diff --git a/src/bin/jbc2mpl b/src/bin/jbc2mpl index 6ba9c094211183da74f8a61a66d4e0e87937f0e8..bcf4d096870b98b4e98e1afd7e939fb6527e7d63 100755 Binary files a/src/bin/jbc2mpl and b/src/bin/jbc2mpl differ diff --git a/src/bin/maple b/src/bin/maple index c6b08459199c178852628a5635089727a7f6c194..ae98f86e8e5ef3a5180e96aad1ca9ddab3c8e3a3 100755 Binary files a/src/bin/maple and b/src/bin/maple differ diff --git a/src/deplibs/libmplphase.a b/src/deplibs/libmplphase.a index e5f0124d6995c74958e8190f9ec29c6b19e805d8..1baa57c362ae927ee8a4343c64e990a8b3206f3c 100644 Binary files a/src/deplibs/libmplphase.a and b/src/deplibs/libmplphase.a differ diff --git a/src/deplibs/libmplutil.a b/src/deplibs/libmplutil.a index 7a57b6d9fd92f490ff3ec63d3f4ae26a9891cfa2..1f51965b115af3d8be38ecb093e6d15f55306c86 100644 Binary files a/src/deplibs/libmplutil.a and b/src/deplibs/libmplutil.a differ diff --git a/src/maple_be/include/cg/aarch64/aarch64_color_ra.h b/src/maple_be/include/cg/aarch64/aarch64_color_ra.h index 0cd91ff6c86d10f4aff5b098b5381e0a9b6d2d61..d7bcd4291ee65449d4c1994cc23d48c51f4b8d56 100644 --- a/src/maple_be/include/cg/aarch64/aarch64_color_ra.h +++ b/src/maple_be/include/cg/aarch64/aarch64_color_ra.h @@ -1103,7 +1103,7 @@ class GraphColorRegAllocator : public AArch64RegAllocator { private: struct SetLiveRangeCmpFunc { bool operator()(const LiveRange *lhs, const LiveRange *rhs) const { - if (lhs->GetPriority() == rhs->GetPriority()) { + if (fabs(lhs->GetPriority() - rhs->GetPriority()) <= 1e-6) { /* * This is to ensure the ordering is consistent as the reg# * differs going through VtableImpl.mpl file. diff --git a/src/maple_be/include/cg/cgfunc.h b/src/maple_be/include/cg/cgfunc.h index b8586311f48ecb5b4c86f08f78b2ff0df6d85129..55e7e655a0d1a239e89b57a2e7dbc18cea277b6d 100644 --- a/src/maple_be/include/cg/cgfunc.h +++ b/src/maple_be/include/cg/cgfunc.h @@ -243,7 +243,9 @@ class CGFunc { virtual Operand *GetTrueOpnd() { return nullptr; } - virtual void ClearUnreachableGotInfos(BB &bb) {}; + virtual void ClearUnreachableGotInfos(BB &bb) { + (void)bb; + }; LabelIdx CreateLabel(); virtual Operand &CreateFPImmZero(PrimType primType) = 0; diff --git a/src/maple_be/src/cg/cg_cfg.cpp b/src/maple_be/src/cg/cg_cfg.cpp index 01f7ed515ed595ae5984fd4a8471364240fedc22..440d7e82e32fa9b0818330e8d9f338ae4687fccb 100644 --- a/src/maple_be/src/cg/cg_cfg.cpp +++ b/src/maple_be/src/cg/cg_cfg.cpp @@ -54,6 +54,7 @@ void CGCFG::BuildCFG() { break; } /* else fall through */ + [[clang::fallthrough]]; case BB::kBBIf: { BB *fallthruBB = curBB->GetNext(); curBB->PushBackSuccs(*fallthruBB); diff --git a/src/maple_ipa/src/callgraph.cpp b/src/maple_ipa/src/callgraph.cpp index d191d61d42bb4d2b9e0cb9fdddbfcff24c9f5dfa..fa1933fc5c58dcd84a47761ada9340553c02adeb 100644 --- a/src/maple_ipa/src/callgraph.cpp +++ b/src/maple_ipa/src/callgraph.cpp @@ -1136,6 +1136,7 @@ void DoDevirtual(const Klass *klass, const KlassHierarchy *klassh) { } } } + [[clang::fallthrough]]; case OP_call: case OP_callassigned: { CallNode *cnode = static_cast(stmt); @@ -1267,7 +1268,7 @@ void CallGraph::GenCallGraph() { // don't optimize this loop to iterator or range-base loop // because AddCallGraphNode(mirFunc) will change GlobalTables::GetFunctionTable().GetFuncTable() // see: https://gitlab.huawei.com/Maple/ArkKit/issues/122 - for (size_t index = 0; index < funcTable.size(); index++) { + for (size_t index = 0; index < funcTable.size(); ++index) { MIRFunction *mirFunc = funcTable.at(index); if (mirFunc == nullptr || mirFunc->GetBody() == nullptr) { continue; diff --git a/src/maple_ir/include/mir_const.h b/src/maple_ir/include/mir_const.h index d6979654b0f6666a1e3be6002bd773a2d5ab2251..0aefd957bfea9ddfd0381bcdb6fd9cfa5e63456b 100644 --- a/src/maple_ir/include/mir_const.h +++ b/src/maple_ir/include/mir_const.h @@ -50,9 +50,8 @@ class MIRConst { return fieldID; } - virtual void SetFieldID(uint32 fieldIdx) { - CHECK_FATAL(kind != kConstInt, "must be"); - fieldID = fieldIdx; + void SetFieldID(uint32 fieldIdx) { + DoSetFieldID(fieldIdx); } virtual bool IsZero() const { @@ -91,6 +90,11 @@ class MIRConst { private: MIRType &type; MIRConstKind kind; + virtual void DoSetFieldID(uint32 fieldIdx) { + CHECK_FATAL(kind != kConstInt, "must be"); + fieldID = fieldIdx; + } + protected: uint32 fieldID; }; @@ -136,14 +140,9 @@ class MIRIntConst : public MIRConst { return value; } - void SetValue(int64 val) { - CHECK_FATAL(false, "Can't Use This Interface in This Object"); + void SetValue(int64 val) const { (void)val; - } - - void SetFieldID(uint32 fieldIdx) override { CHECK_FATAL(false, "Can't Use This Interface in This Object"); - (void)fieldIdx; } bool operator==(const MIRConst &rhs) const override; @@ -156,6 +155,10 @@ class MIRIntConst : public MIRConst { private: int64 value; + void DoSetFieldID(uint32 fieldIdx) override { + CHECK_FATAL(false, "Can't Use This Interface in This Object"); + (void)fieldIdx; + } }; class MIRAddrofConst : public MIRConst { @@ -319,10 +322,10 @@ class MIRFloatConst : public MIRConst { } bool IsOne() const override { - return value.floatValue == 1; + return fabs(value.floatValue - 1) <= 1e-6; }; bool IsAllBitsOne() const { - return value.floatValue == -1; + return fabs(value.floatValue + 1) <= 1e-6; }; void Neg() override { value.floatValue = -value.floatValue; @@ -379,10 +382,10 @@ class MIRDoubleConst : public MIRConst { } bool IsOne() const override { - return value.dValue == 1; + return fabs(value.dValue - 1) <= 1e-15; }; bool IsAllBitsOne() const { - return value.dValue == -1; + return fabs(value.dValue + 1) <= 1e-15; }; void Neg() override { value.dValue = -value.dValue; diff --git a/src/maple_ir/src/lexer.cpp b/src/maple_ir/src/lexer.cpp index 0a6daf77b316e9517f495c3ea42c38e73358fd9d..5536ee915774fb57f92ce00db27d3ad4d78b5bc2 100644 --- a/src/maple_ir/src/lexer.cpp +++ b/src/maple_ir/src/lexer.cpp @@ -283,7 +283,7 @@ TokenKind MIRLexer::GetFloatConst(uint32 valStart, uint32 startIdx, bool negativ } theIntVal = static_cast(theFloatVal); theDoubleVal = static_cast(theDoubleVal); - if (theFloatVal == -0) { + if (negative && fabs(theFloatVal) <= 1e-6) { theDoubleVal = -theDoubleVal; } name = line.substr(valStart, curIdx - valStart); @@ -297,7 +297,7 @@ TokenKind MIRLexer::GetFloatConst(uint32 valStart, uint32 startIdx, bool negativ } theIntVal = static_cast(theDoubleVal); theFloatVal = static_cast(theDoubleVal); - if (theDoubleVal == -0) { + if (negative && fabs(theDoubleVal) <= 1e-15) { theFloatVal = -theFloatVal; } name = line.substr(valStart, curIdx - valStart); @@ -574,6 +574,7 @@ TokenKind MIRLexer::LexToken() { return TK_dotdotdot; } // fall thru for .9100 == 0.9100 + [[clang::fallthrough]]; case '0': case '1': case '2': diff --git a/src/maple_me/include/ssa_epre.h b/src/maple_me/include/ssa_epre.h index 0de035869a8d0efaedaee6a757e77e119825baee..6cc848c2f003f7e9aeb79da5b242fd3ed3d050f6 100644 --- a/src/maple_me/include/ssa_epre.h +++ b/src/maple_me/include/ssa_epre.h @@ -40,6 +40,7 @@ class SSAEPre : public SSAPre { return v != nullptr && v->IsVolatile(irMap->GetSSATab()); } virtual bool IsThreadObjField(const IvarMeExpr &expr) const { + (void)expr; return false; } diff --git a/src/maple_me/src/alias_class.cpp b/src/maple_me/src/alias_class.cpp index 227ed66af90b37bffaa5fbf10a84b1c31ef61791..6106a6fdbae73568a7e4b8ae312f1e1ca7df3e82 100644 --- a/src/maple_me/src/alias_class.cpp +++ b/src/maple_me/src/alias_class.cpp @@ -150,6 +150,7 @@ AliasElem *AliasClass::CreateAliasElemsExpr(BaseNode &expr) { } // fall-through } + [[clang::fallthrough]]; default: for (size_t i = 0; i < expr.NumOpnds(); ++i) { CreateAliasElemsExpr(*expr.Opnd(i)); @@ -265,6 +266,7 @@ void AliasClass::ApplyUnionForCopies(StmtNode &stmt) { } // fallthrough; } + [[clang::fallthrough]]; default: for (size_t i = 0; i < stmt.NumOpnds(); ++i) { CreateAliasElemsExpr(*stmt.Opnd(i)); diff --git a/src/maple_me/src/irmap.cpp b/src/maple_me/src/irmap.cpp index bef42a220a5d9f9f268af97fac9439412a8a5b58..c85e5e1a9ca6fb449a0ac7a8430041de61e995f7 100644 --- a/src/maple_me/src/irmap.cpp +++ b/src/maple_me/src/irmap.cpp @@ -272,6 +272,7 @@ RegMeExpr *IRMap::CreateRegRefMeExpr(const MeExpr &meExpr) { break; } // fall thru + [[clang::fallthrough]]; default: return CreateRegMeExpr(PTY_ptr); } diff --git a/src/maple_me/src/me_function.cpp b/src/maple_me/src/me_function.cpp index 6d9b4c95426cae6c1aaa7e105d3cca0cafa069cb..a7344d654ac8818a789efb951687a0f1614d2206 100644 --- a/src/maple_me/src/me_function.cpp +++ b/src/maple_me/src/me_function.cpp @@ -171,6 +171,7 @@ void MeFunction::CreateBasicBlocks() { break; } // fall thru to handle as return + [[clang::fallthrough]]; case OP_gosub: case OP_retsub: case OP_return: { diff --git a/src/maple_me/src/me_profile_use.cpp b/src/maple_me/src/me_profile_use.cpp index d7e9064b433c69b8c226b3502443532ec403476e..ab84d409ec4d42ca11a3b3181822b8ef02c28271 100644 --- a/src/maple_me/src/me_profile_use.cpp +++ b/src/maple_me/src/me_profile_use.cpp @@ -288,7 +288,7 @@ bool MeProfUse::Run() { return true; } -AnalysisResult *MeDoProfUse::Run(MeFunction *func, MeFuncResultMgr *m, ModuleResultMgr*) { +AnalysisResult *MeDoProfUse::Run(MeFunction *func, MeFuncResultMgr *, ModuleResultMgr*) { MemPool *tempMp = NewMemPool(); MeProfUse profUse(*func, *tempMp, DEBUGFUNC(func)); profUse.Run(); diff --git a/src/maple_me/src/ssa_devirtual.cpp b/src/maple_me/src/ssa_devirtual.cpp index 0b55c55c0806b1bdc5311340e3854411d5e45e80..d8bd4fb20f540e8f63a14fd5b3441fe39375995d 100644 --- a/src/maple_me/src/ssa_devirtual.cpp +++ b/src/maple_me/src/ssa_devirtual.cpp @@ -137,6 +137,7 @@ bool SSADevirtual::DevirtualizeCall(CallMeStmt &callStmt) { case OP_interfacecallassigned: case OP_interfaceicallassigned: totalInterfaceCalls++; // FALLTHROUGH + [[clang::fallthrough]]; case OP_virtualcall: case OP_virtualicall: case OP_virtualcallassigned: diff --git a/src/maple_me/src/ssa_pre.cpp b/src/maple_me/src/ssa_pre.cpp index ece34ed20a8b6ea1b3459e51db63a44422b63f72..555d65671e28a620fed27354614eebc06be446a7 100644 --- a/src/maple_me/src/ssa_pre.cpp +++ b/src/maple_me/src/ssa_pre.cpp @@ -1553,6 +1553,7 @@ void SSAPre::BuildWorkListStmt(MeStmt &stmt, uint32 seqStmt, bool isRebuilt, MeE } // fall thru } + [[clang::fallthrough]]; case OP_xintrinsiccall: case OP_intrinsiccallwithtype: case OP_intrinsiccallassigned: diff --git a/src/maple_util/include/mpl_scheduler.h b/src/maple_util/include/mpl_scheduler.h index c0994403c2c5fe6170db87a9af9066ea83d29b02..27c3141a76e2d6e76da48997118f62972d0d7dcc 100644 --- a/src/maple_util/include/mpl_scheduler.h +++ b/src/maple_util/include/mpl_scheduler.h @@ -62,10 +62,12 @@ class MplTask { protected: virtual int RunImpl(MplTaskParam *param) { + (void)param; return 0; } virtual int FinishImpl(MplTaskParam *param) { + (void)param; return 0; } diff --git a/src/mpl2mpl/src/constantfold.cpp b/src/mpl2mpl/src/constantfold.cpp index e0ad8af745f463a763d849816f68fe2b4fcd9eb7..528335a0c3c7b68a09a480c94ea77d4a05303d0a 100644 --- a/src/mpl2mpl/src/constantfold.cpp +++ b/src/mpl2mpl/src/constantfold.cpp @@ -666,9 +666,9 @@ MIRIntConst *ConstantFold::FoldFPConstComparisonMIRConst(Opcode opcode, PrimType switch (opcode) { case OP_eq: { if (useDouble) { - constValue = (doubleConst0->GetValue() == doubleConst1->GetValue()) ? 1 : 0; + constValue = fabs(doubleConst0->GetValue() - doubleConst1->GetValue()) <= 1e-15 ? 1 : 0; } else { - constValue = (floatConst0->GetValue() == floatConst1->GetValue()) ? 1 : 0; + constValue = fabs(floatConst0->GetValue() - floatConst1->GetValue()) <= 1e-6 ? 1 : 0; } break; } @@ -706,9 +706,9 @@ MIRIntConst *ConstantFold::FoldFPConstComparisonMIRConst(Opcode opcode, PrimType } case OP_ne: { if (useDouble) { - constValue = (doubleConst0->GetValue() != doubleConst1->GetValue()) ? 1 : 0; + constValue = fabs(doubleConst0->GetValue() - doubleConst1->GetValue()) > 1e-15 ? 1 : 0; } else { - constValue = (floatConst0->GetValue() != floatConst1->GetValue()) ? 1 : 0; + constValue = fabs(floatConst0->GetValue() - floatConst1->GetValue()) > 1e-6 ? 1 : 0; } break; } @@ -721,7 +721,7 @@ MIRIntConst *ConstantFold::FoldFPConstComparisonMIRConst(Opcode opcode, PrimType if (doubleConst0->GetValue() > doubleConst1->GetValue() || (opcode == OP_cmpg && (std::isnan(doubleConst0->GetValue()) || std::isnan(doubleConst1->GetValue())))) { constValue = 1; - } else if (doubleConst0->GetValue() == doubleConst1->GetValue()) { + } else if (fabs(doubleConst0->GetValue() - doubleConst1->GetValue()) <= 1e-15) { constValue = 0; } else if (doubleConst0->GetValue() < doubleConst1->GetValue() || (opcode == OP_cmpl && (std::isnan(doubleConst0->GetValue()) || @@ -732,7 +732,7 @@ MIRIntConst *ConstantFold::FoldFPConstComparisonMIRConst(Opcode opcode, PrimType if (floatConst0->GetValue() > floatConst1->GetValue() || (opcode == OP_cmpg && (std::isnan(floatConst0->GetValue()) || std::isnan(floatConst1->GetValue())))) { constValue = 1; - } else if (floatConst0->GetValue() == floatConst1->GetValue()) { + } else if (fabs(floatConst0->GetValue() - floatConst1->GetValue()) > 1e-6) { constValue = 0; } else if (floatConst0->GetValue() < floatConst1->GetValue() || (opcode == OP_cmpl && (std::isnan(floatConst0->GetValue()) || diff --git a/src/mpl2mpl/src/java_eh_lower.cpp b/src/mpl2mpl/src/java_eh_lower.cpp index c2ebca05af2bb077214a13251fdbca1e6b65d74b..71b775c641f8762a85c4d55d05eba346992f1778 100644 --- a/src/mpl2mpl/src/java_eh_lower.cpp +++ b/src/mpl2mpl/src/java_eh_lower.cpp @@ -213,6 +213,7 @@ BlockNode *JavaEHLowerer::DoLowerBlock(BlockNode &block) { } // fallthrough; } + [[clang::fallthrough]]; default: { for (size_t i = 0; i < stmt->NumOpnds(); ++i) { stmt->SetOpnd(DoLowerExpr(*(stmt->Opnd(i)), *newBlock), i); diff --git a/src/mpl2mpl/src/reflection_analysis.cpp b/src/mpl2mpl/src/reflection_analysis.cpp index f597107e293b8047cbeb4ad26f99e9a695ce9c78..468155bfe5b250dddf148326f2d720fd16d16468 100644 --- a/src/mpl2mpl/src/reflection_analysis.cpp +++ b/src/mpl2mpl/src/reflection_analysis.cpp @@ -86,7 +86,7 @@ constexpr char kObjsizeStr[] = "objsize"; constexpr char kPaddingStr[] = "padding"; #else constexpr char kInstanceOfCacheFalseStr[] = "instanceOfCacheFalse"; -#endif +#endif // ~USE_32BIT_REF constexpr char kTypeNameStr[] = "typeName"; constexpr char kClassNameStr[] = "classname"; constexpr char kFieldNameStr[] = "fieldname"; diff --git a/src/mpl2mpl/src/vtable_impl.cpp b/src/mpl2mpl/src/vtable_impl.cpp index 88cb649a26c1ca0659215849ee96f558faf5b906..f870542a286f49eee8b7b57d60a8fe3334e7421a 100644 --- a/src/mpl2mpl/src/vtable_impl.cpp +++ b/src/mpl2mpl/src/vtable_impl.cpp @@ -129,6 +129,7 @@ void VtableImpl::ProcessFunc(MIRFunction *func) { stmt = icallNode; // Fall-through } + [[clang::fallthrough]]; case OP_icallassigned: { auto *icall = static_cast(stmt); BaseNode *firstParm = icall->GetNopndAt(0); diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/CRC32.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/MainClass.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..e61b88f96f940622d9d33fc1f54b73adedcdadad --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/MainClass.java @@ -0,0 +1,348 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3331378896 + +//import java.util.zip.CRC32; + +class MainClass +{ + static int var_0 = (-294712552); + static short var_3 = (short)(20662); + final static byte var_4 = (byte)(-69); + static int var_5 = (1931856895); + static long [][][] var_16 = {{{(-4083409322881095391L),(6328844550635922242L),(-3416679272311937346L),(5663662665406140196L),(7436826343793257253L),(9054590670240937315L),(-2540198872794034711L)}},{{(-5665045464805169427L),(-7215159074662842141L),(8641618268882941000L),(9081822668297766253L),(3601841294442920591L),(2696042469774349840L),(4454848116478942730L)}},{{(597143846796045665L),(-1472984459915757756L),(430577398305101347L),(2603694565850236604L),(-7205873517288699579L),(4667223886154274577L),(6874130884142991676L)}},{{(-64556985787972755L),(6596374370356080595L),(3658028671193650669L),(-5926073394889158121L),(7278971195910372289L),(-8513723923395229938L),(41896184896530180L)}},{{(-2977244552178520492L),(-2349466482102781720L),(5509502056342069283L),(-8045731545521512749L),(2990451732122260300L),(6009821968026047361L),(-1381004056629633554L)}},{{(-7592024398104749947L),(7546483105193831836L),(67485959388557150L),(4940853554796890341L),(-2614131444455057226L),(1668129779000695058L),(-724245939440923691L)}},{{(-3324438451557574520L),(7641744535957465851L),(12229977417941051L),(-2092728928813218344L),(-383909484361812196L),(-2005609977610022942L),(-632842390821104218L)}}}; + static byte var_21 = (byte)(12); + static cl_20 var_23 = new cl_20(); + static byte var_31 = (byte)(26); + static cl_38 var_32 = new cl_38(); + static boolean var_35 = true; + static boolean [][] var_43 = {{true,true},{false,true},{false,true}}; + final long var_51 = (-1168576565941185822L); + static boolean var_52 = true; + boolean var_53 = false; + static cl_22 var_54 = new cl_22(); + static cl_59 var_55 = new cl_59(); + static cl_82 var_57 = new cl_82(); + final static boolean [] var_66 = {false,false,true,true}; + static cl_66 var_69 = new cl_66(); + static int var_72 = (1688578927); + static int var_73 = (-617950649); + double var_78 = (-2.0519e+219D); + boolean var_80 = true; + static int [] var_85 = {(1995403673),(-1016304839),(604426049),(-749923107),(-2083115843),(-379003263),(1551264340)}; + long var_99 = (-2362807278631551459L); + static float var_104 = (-2.86915e-28F); + final static double [][] var_116 = {{(8.58624e+132D),(5.86604e-93D),(-2.16693e-264D),(7.96859e-94D),(-7.48244e-158D),(5.06793e-239D)},{(-2.73753e-275D),(3.83217e-29D),(1.04119e-237D),(5.11444e+227D),(-1.28235e-108D),(-1.05804e+43D)},{(-1.41267e-226D),(1.3433e-196D),(5.152e-142D),(1.15731e-194D),(-3.64899e+82D),(-3.01092e-87D)}}; + static byte var_121 = (byte)(-50); + final static int [] var_137 = {(-1938735922),(-1281248405),(1256171703),(1825250153)}; + long [][][] var_141 = {{{(-742859087612043592L),(3641167902990781504L),(-4901859622565467210L),(-1479762463534703775L),(-4718942903067202400L)},{(6715341179984397613L),(-1009595057164727141L),(6695808075495487919L),(306098359603424271L),(7566916446407049506L)},{(-867076873029613553L),(-5280555965976437524L),(-2055509188122778677L),(6122682877665208631L),(-6965677796012999484L)},{(4246906588767010112L),(5328067930737066450L),(-5531805201729752749L),(2846754181579620131L),(2543348623451037487L)}}}; + float var_148 = (2.73354e-26F); + int var_149 = (-1761057237); + short var_152 = (short)(23878); +/*********************************/ +public strictfp void run() +{ + for( var_0 = 328 ;(var_0>286);var_0 = (var_0-14) ) + { + long var_7 = (-76899250950704159L); + try + { + double [] var_2 = {(1.17158e-96D),(-4.88918e-251D),(-3.35482e+220D),(0.522255D),(-8.36919e+239D),(-5.27275e+79D),(-6.40695e-204D)}; + int var_6 = (625666293); + var_2[(((var_3++)&var_4)&6)] = (--var_5) ; + for( var_6 = 355 ;(var_6>265);var_6 = (var_6-18) ) + { + if( ((var_7--)<=func_8())) + { + // if stmt begin,id=1 + var_23.var_81 = (1431398077) ; + // if stmt end,id=1 + } + else + { + // else stmt begin,id=1 + var_2[((var_152++)&6)] = ((++var_31)|var_31) ; + // else stmt end,id=1 + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_153 ) + { + var_55.var_74 = var_32.var_59.var_76 ; + System.out.println("hello exception 0 !"); + } + } + return ; +} +public strictfp short func_8() +{ + byte var_9 = (byte)(47); + if( ((++var_9)>=var_4)) + { + // if stmt begin,id=2 + final cl_20 var_145 = new cl_20(); + var_3 = func_10(var_141 ,var_54.var_143 ,var_145 ,var_32.var_59.var_64) ; + // if stmt end,id=2 + } + else + { + // else stmt begin,id=2 + for( var_149 = 778 ;(var_149<816);var_149 = (var_149+19) ) + { + boolean var_150 = true; + } + // else stmt end,id=2 + } + return var_55.var_151; +} +public static strictfp short func_10(long[][][] var_11, long[][][] var_12, cl_20 var_13, cl_22 var_14) +{ + short var_19 = (short)(30553); + short var_17 = (short)(-24074); + int var_18 = (-1173902243); + var_16[((var_18--)&6)][((~(--var_17))&0)][6] = (var_19++) ; + try + { + int var_20 = (-1184059677); + for( var_20 = 963 ;(var_20>943);var_20 = (var_20-10) ) + { + byte var_22 = (byte)(6); + if( (!(!((++var_21)>var_0)))) + { + // if stmt begin,id=3 + float [] var_138 = {(-2.21194e-32F),(-2.69692e-25F),(0.588517F),(273.529F),(6.62736e+13F)}; + if( ((var_22--)!=( ( short )(-(var_5++)) ))) + { + // if stmt begin,id=4 + var_19 = (var_17--) ; + var_23 = func_24(var_137 ,var_104 ,var_138[((var_21++)&4)] ,(var_19++)) ; + // if stmt end,id=4 + } + else + { + // else stmt begin,id=3 + var_17 = (var_22++) ; + // else stmt end,id=3 + } + // if stmt end,id=3 + } + } + } + catch( java.lang.ArithmeticException myExp_139 ) + { + int var_140 = (1930013509); + System.out.println("hello exception 1 !"); + } + return (var_3++); +} +public static strictfp cl_20 func_24(int[] var_25, float var_26, float var_27, int var_28) +{ + final byte var_135 = (byte)(-27); + var_16[((var_21--)&6)][0][((var_28++)&6)] = func_29((((--var_121)|var_135)|var_55.var_34)) ; + return var_32.var_59.var_58; +} +public static strictfp long func_29(int var_30) +{ + if( ((++var_31)>=var_32.var_33.var_34)) + { + // if stmt begin,id=5 + float var_118 = (1.11565e+36F); + byte var_124 = (byte)(12); + if( var_35) + { + // if stmt begin,id=6 + var_30 = func_36(var_116 ,(var_118--) ,var_55 ,(var_121++) ,func_36(var_116 ,((var_124++)-var_118) ,var_55 ,var_55.var_106 ,(var_5++) ,var_43) ,func_44(((++var_124)!=(-9.35898e+19F)) ,var_69 ,(+(--var_124)))) ; + // if stmt end,id=6 + } + // if stmt end,id=5 + } + return (var_30++); +} +public static strictfp int func_36(double[][] var_37, float var_38, cl_59 var_39, int var_40, int var_41, boolean[][] var_42) +{ + cl_66 var_113 = new cl_66(); + var_42 = func_44(var_42[((-(var_21++))&2)][((--var_40)&1)] ,var_113 ,(var_21--)) ; + return var_72; +} +public static strictfp boolean[][] func_44(boolean var_45, cl_66 var_46, long var_47) +{ + int var_48 = (-813511760); + boolean [] var_50 = {true,false,true,true}; + int var_87 = (1403413899); + for( var_48 = 1005 ;(var_48<1026);var_48 = (var_48+7) ) + { + cl_38 var_93 = new cl_38(); + short var_67 = (short)(-14756); + cl_59 var_101 = new cl_59(); + byte var_107 = (byte)(32); + int var_49 = (-1096228729); + for( var_49 = 155 ;(var_49<225);var_49 = (var_49+14) ) + { + if( var_50[3]) + { + // if stmt begin,id=7 + byte var_60 = (byte)(-31); + int var_90 = (-1155049412); + try + { + var_54 = var_55.var_56.var_33 ; + var_57.var_58 = var_32.var_59.var_58 ; + var_47 = ((--var_60)&var_32.var_61.var_62) ; + float var_79 = (-4.11429e-15F); + var_50 = var_66 ; + var_52 = (((--var_67)!=var_32.var_33.var_68)&&var_69.var_70) ; + var_50[(((((var_31--)-var_55.var_33.var_34)+var_23.var_71)|(byte)(116))&3)] = ((--var_31)>=( ( float )(var_72--) )) ; + var_50[((var_73--)&3)] = var_50[((+(var_5--))&3)] ; + var_50[((((var_60++)|var_73)&( ( byte )(((var_60++)|var_23.var_75)*var_0) ))&3)] = ((--var_60)<=var_57.var_76.var_77) ; + var_55.var_61.var_81 = (var_67++) ; + var_50[(((var_31--)|var_55.var_56.var_82.var_83)&3)] = (!(!(!(!(!(!true)))))) ; + var_50[(((var_67++)-var_69.var_84)&3)] = true ; + var_67 = (short)(25287) ; + cl_20 [][][] var_86 = {{{new cl_20(),new cl_20(),new cl_20(),new cl_20(),new cl_20()},{new cl_20(),new cl_20(),new cl_20(),new cl_20(),new cl_20()},{new cl_20(),new cl_20(),new cl_20(),new cl_20(),new cl_20()}}}; + var_50[(((var_60--)&( ( int )(byte)(41) ))&3)] = (!((var_60--)==(2.2752e+25F))) ; + var_50[((var_60--)&3)] = (!(!((var_60--)<( ( short )(--var_21) )))) ; + var_50[((var_87++)&3)] = true ; + var_87 = (+(var_60--)) ; + } + catch( java.lang.ArithmeticException myExp_88 ) + { + cl_20 var_89 = new cl_20(); + System.out.println("hello exception 2 !"); + } + int var_96 = (-1902264381); + for( var_90 = 365 ;(var_90<397);var_90 = (var_90+16) ) + { + double var_92 = (1.04657e-306D); + var_47 = ( ( long )((var_21++)-var_57.var_81) ) ; + final cl_20 var_91 = new cl_20(); + double var_95 = (-4.56456e-266D); + var_73 = (+(var_60++)) ; + var_50[(((--var_60)-( ( short )(var_87++) ))&3)] = (!((+(var_3++))>( ( int )var_23.var_62 ))) ; + var_50 = var_66 ; + var_57.var_76 = var_32.var_59.var_76 ; + var_32 = var_93 ; + var_85[(((var_87--)+var_3)&6)] = (--var_87) ; + var_85[(((var_21++)*var_4)&6)] = (--var_3) ; + } + for( var_96 = 770 ;(var_96>705);var_96 = (var_96-13) ) + { + long var_98 = (356923351145741346L); + long [][] var_97 = {{(-8156035840794431740L)},{(-4589611227191878281L)}}; + var_23.var_100 = ((!((++var_67)!=var_3))&&var_69.var_70) ; + var_87 = (-(--var_60)) ; + var_55 = var_101 ; + int var_103 = (-35793487); + var_50[(var_96&3)] = (!(!(!(!((var_87--)<=var_54.var_102))))) ; + var_46 = var_69 ; + var_50[((+(var_60--))&3)] = true ; + var_60 = (var_60++) ; + var_50[(((var_60--)-var_72)&3)] = (((++var_31)-var_69.var_105)=var_69.var_83) ; + } + // else stmt end,id=4 + } + } + } + return var_23.var_111; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(862); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + CrcCheck.ToByteArray(this.var_3,b,"var_3"); + CrcCheck.ToByteArray(this.var_4,b,"var_4"); + CrcCheck.ToByteArray(this.var_5,b,"var_5"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_16[a0][a1][a2],b,"var_16" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_21,b,"var_21"); + CrcCheck.ToByteArray(this.var_23.GetChecksum(),b,"var_23.GetChecksum()"); + CrcCheck.ToByteArray(this.var_31,b,"var_31"); + CrcCheck.ToByteArray(this.var_32.GetChecksum(),b,"var_32.GetChecksum()"); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_43[a0][a1],b,"var_43" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_51,b,"var_51"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_53,b,"var_53"); + CrcCheck.ToByteArray(this.var_54.GetChecksum(),b,"var_54.GetChecksum()"); + CrcCheck.ToByteArray(this.var_55.GetChecksum(),b,"var_55.GetChecksum()"); + CrcCheck.ToByteArray(this.var_57.GetChecksum(),b,"var_57.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_66[a0],b,"var_66" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_69.GetChecksum(),b,"var_69.GetChecksum()"); + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_85[a0],b,"var_85" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_99,b,"var_99"); + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_116[a0][a1],b,"var_116" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_137[a0],b,"var_137" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_141[a0][a1][a2],b,"var_141" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_148,b,"var_148"); + CrcCheck.ToByteArray(this.var_149,b,"var_149"); + CrcCheck.ToByteArray(this.var_152,b,"var_152"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/Start.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..3a55bc128f5c3f2639de3b856be9ae501b5f2cc4 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_22.java CRC32.java cl_59.java cl_38.java CrcCheck.java cl_20.java cl_66.java cl_82.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_20.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_20.java new file mode 100644 index 0000000000000000000000000000000000000000..b39ecf63f078ed38f8b42146a633bceecec7341e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_20.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3331378896 + +//import java.util.zip.CRC32; + +class cl_20 +{ + long var_62 = (1440659960753226582L); + final boolean [] var_63 = {true,false,false,false}; + byte var_71 = (byte)(-72); + short var_75 = (short)(7623); + int var_81 = (2139880156); + boolean var_100 = false; + float var_108 = (-2.65501e+35F); + boolean [][] var_111 = {{true,false},{true,true},{true,true}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(30); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_63[a0],b,"var_63" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_71,b,"var_71"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_111[a0][a1],b,"var_111" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_22.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_22.java new file mode 100644 index 0000000000000000000000000000000000000000..6bac0f38a589cb921fa484169345cf46ab3f2337 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_22.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3331378896 + +//import java.util.zip.CRC32; + +class cl_22 +{ + byte var_34 = (byte)(5); + boolean [] var_65 = {true,true,false,true}; + double var_68 = (2.61938e+124D); + float var_102 = (5.25118e-14F); + long [][][] var_143 = {{{(6818561910474570816L),(-2268544989331263953L),(1876262145694664506L),(5936841423166530955L),(-1854793657304945363L),(-7855559623805160175L),(3090104646090451195L)},{(5347279537935428976L),(-2395145234137370369L),(-6467712917620127062L),(4778044594999589544L),(-464944344527622668L),(-1946081550162896627L),(7839360502841479978L)},{(4171969079966434025L),(-6633704713005845882L),(2998454555231213419L),(-8265738543351964038L),(-1081033549585149802L),(7245273692736843365L),(-2706580725846293509L)},{(-4840461440045887150L),(7670931756876343954L),(-6034363688770029349L),(-5605391777158778776L),(258465916233369570L),(-805719781658623164L),(4879735932686132923L)},{(4055799602381193495L),(-444393098062117978L),(1114645069557447388L),(7064934603633601346L),(2941682113952940290L),(6340930240128790835L),(264861305607210436L)},{(-585431841567471290L),(-9071681729921776033L),(-3142620668695235260L),(-6357444688757484318L),(-6444624640013436335L),(4135120520514062708L),(4363201053978634490L)},{(-4681710572265272827L),(-814726173494297051L),(1603859219492760236L),(-5643438487313808774L),(-6096559316857749632L),(8749478019864402227L),(7307955412845237764L)}},{{(-1237117709719368212L),(2717999333891712542L),(-5564328929313716107L),(-5186912425038025188L),(-8926102765260083685L),(-3991682587688831924L),(-301150319304855731L)},{(207855180699937L),(-2862968261774100321L),(2252844105881642846L),(4838453377445193047L),(5164377603167788879L),(5083027002906076115L),(5581373417727330708L)},{(-218426239043073501L),(-5753179810066102016L),(3672893172803432490L),(-3119568474350570190L),(8738517486338828629L),(-2771140756899771546L),(-9205836915750907590L)},{(8626010258860437577L),(5355119074201645064L),(3372609801459591074L),(2052544184787033132L),(943221207500057224L),(-4228416267748333835L),(4326035758112003306L)},{(-4225136951818312919L),(2057860527232997834L),(-7237501330565611016L),(-3417091489080389094L),(-4702525639036958868L),(-3522579520708416363L),(5819032637417150044L)},{(-8367581438366461414L),(955467554779804175L),(-559461474297286842L),(1602407697545278984L),(814792989385399249L),(-7091664970335197594L),(7238006247780377843L)},{(6643420718505824002L),(4489632923406380538L),(-8602959525332214847L),(-2834588856244337717L),(6011659683562117033L),(4895348851225905875L),(-1260425200414147503L)}},{{(4310617953039481104L),(-1531514459355240505L),(-3935912351768061126L),(9204804497853522327L),(-5476671431413594939L),(-1585371934911954511L),(5161402616951091997L)},{(-1401292020522465071L),(-1866966870237253916L),(-340497885569097381L),(7809136684645066613L),(831247407203324898L),(2529410617443889238L),(4864581251625937399L)},{(7971789351352853625L),(-1439111700379118973L),(3168880320206388466L),(-1814539802508816088L),(-4347032024704125796L),(-5294193373563040627L),(-6169110647774261727L)},{(-9014618801241153213L),(-1308680438919630519L),(7860102059101662193L),(4536378615674089941L),(4658798210744292078L),(-3725769809721736749L),(6190652891442859020L)},{(-7418673696856486884L),(1685629870697658323L),(5511340576862749541L),(-2104338583432528245L),(-6816260990129074911L),(8619249626539705799L),(7304653125831245181L)},{(-3080370387573654773L),(-5492305957497584106L),(5547714199877366366L),(4187674279200423329L),(9109034326416095638L),(-7246646896978074892L),(874401113090244502L)},{(3056251466806267446L),(-4522437899186886291L),(9074361263845738745L),(-7474029269199131589L),(1083557302275260644L),(8492765940563857393L),(-8470650468809448200L)}},{{(4046422638973468719L),(4407910439937110130L),(5208921456310269062L),(-2692628156939151125L),(-5656513651880092609L),(-2109222425350393291L),(-4567948830243772389L)},{(2782868631812043993L),(4342255679330845771L),(578039182858947057L),(-3276333947472862365L),(-2928008465799185030L),(8082400473554202L),(5653040207425407863L)},{(-5978626225069478553L),(6302988127225160535L),(-4025581094163661417L),(-3374619558848756482L),(-3429347353621984192L),(3872614139004728136L),(-6274698374268422080L)},{(-3303321797176200888L),(9153792779668154188L),(1939853844867309740L),(-8353541602198078479L),(-3480004770408588030L),(-6945654231448451976L),(-2956437201140341613L)},{(-1790020748150481095L),(-2772573791476275880L),(-7008234643337570944L),(5972522462938386324L),(5845989119965553044L),(-8197407253590668365L),(-8841397664876736324L)},{(8981551423055925132L),(5393304847441138218L),(7789114908274449848L),(-1806985266634802780L),(1007417425187157490L),(-8705994024190257266L),(-4610322372002980090L)},{(912938567727862469L),(52353661510192866L),(265110573626765744L),(-676639811297466860L),(-235648186725467924L),(-473620751277044054L),(4401696124240715910L)}},{{(8488037798138481138L),(-4114008375221380279L),(-5665595004159900083L),(2075937603520359937L),(1812340084152931045L),(-1069640403163298346L),(-5150409828900267777L)},{(7421929873394035937L),(129139279393166068L),(-1610483267580333841L),(2346516787690286946L),(-7391036830282710685L),(1279182458125830368L),(-7431929532790650824L)},{(3801649738621693930L),(5161839085519051760L),(-7780952200622430108L),(7790117927007770674L),(-156511197484644875L),(-2175551455146433639L),(-552352783266325037L)},{(-6335430756533119865L),(9093347766549286750L),(8173741178670732826L),(6900189298278724984L),(746808947117648953L),(-8397430332058091876L),(2209731719702734898L)},{(2071496447233236579L),(-6679143272586144243L),(-2396978191294372532L),(8365526117306613053L),(-5083681099765062551L),(5578406187408923635L),(-1410671263578599867L)},{(-41659687642748126L),(35387423188423121L),(2661479425282964297L),(-4101871009249049053L),(-8064046470140719099L),(9092396471050212692L),(-5993373669947579659L)},{(8919752394055990137L),(4928487609901345855L),(129636961880136909L),(-4896360804190557691L),(-6168571998379756245L),(4268042942182031609L),(7829244681049612724L)}},{{(-3332457159354067197L),(7295483890898558081L),(-8709054040057316820L),(3220782506162836974L),(6572905777965583323L),(-5746132662092988636L),(-6467040411250580567L)},{(-1586542258774988466L),(4473625848025586111L),(-84885744137885766L),(6444854831873659208L),(-7942132991334703966L),(-6816833561312281865L),(2595195903508585338L)},{(4663785993547807596L),(1825552852567352511L),(-3539732254427039066L),(-4345067178389132665L),(8569168270574899506L),(-2122532050743687581L),(2487736315162968266L)},{(67388191308951694L),(631738886360536034L),(44132753301260644L),(-6011117265867511866L),(-1436533783425025738L),(-5626012022989622155L),(3563592826260679755L)},{(-5920914533670568621L),(-6151121108857051486L),(-6429988133068218836L),(462846519575050777L),(1736541023964220753L),(6313920340719504038L),(1022067437838159278L)},{(-3888432203381398485L),(979612863743563759L),(-9055701891955670061L),(8803576252037652706L),(-325830363712765162L),(243241846305258643L),(236449501806050472L)},{(1709192492837851567L),(9214300356727824202L),(2153342229751587822L),(3957356025493691805L),(-6909596497592673617L),(6828943934517248567L),(1182867831403064212L)}},{{(5507153776521523078L),(8959405024781199623L),(-579429289608063797L),(9094904624705037749L),(-1644018081527884436L),(823696086118177149L),(-5036658469168723586L)},{(-2636698438817732435L),(-4100218216508423933L),(-7389088059016461074L),(6994082079264681443L),(-2721343810407139516L),(235160236734486495L),(-1210939438045140124L)},{(-3265977404643474475L),(7516907300896048557L),(8069729139896637107L),(-7266920262473278270L),(-4769778946714697415L),(8610658746663951374L),(7839714589370367206L)},{(-255721601715730765L),(10369441660322840L),(1078965741513622602L),(-6743809850999346164L),(-4372914011712094652L),(1021321219694977759L),(3150937638979941444L)},{(-5168438787249089741L),(-9218185735427671811L),(4271475002193498994L),(-995388058793533928L),(-8549175805788979506L),(8654035508011288962L),(-3711429497789982269L)},{(8537288252217159552L),(4478677386400690293L),(-1539311659143495790L),(-7315270728827507401L),(-7776532358074554357L),(-6397667388721535102L),(2169631554657891492L)},{(3079090312714534706L),(5267499294766215798L),(-1295315079943347642L),(-7953609652864419900L),(2811589324330820548L),(3075718228946871389L),(3789392184392608081L)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2761); + CrcCheck.ToByteArray(this.var_34,b,"var_34"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_65[a0],b,"var_65" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_102,b,"var_102"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_143[a0][a1][a2],b,"var_143" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_38.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_38.java new file mode 100644 index 0000000000000000000000000000000000000000..c4697c38538a2f91cab5047e1d7fdf9050320c4d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_38.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3331378896 + +//import java.util.zip.CRC32; + +class cl_38 extends cl_22 +{ + cl_22 var_33 = new cl_22(); + final cl_82 var_59 = new cl_82(); + cl_20 var_61 = new cl_20(); + cl_66 var_82 = new cl_66(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2793); + CrcCheck.ToByteArray(this.var_33.GetChecksum(),b,"var_33.GetChecksum()"); + CrcCheck.ToByteArray(this.var_34,b,"var_34"); + CrcCheck.ToByteArray(this.var_59.GetChecksum(),b,"var_59.GetChecksum()"); + CrcCheck.ToByteArray(this.var_61.GetChecksum(),b,"var_61.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_65[a0],b,"var_65" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_82.GetChecksum(),b,"var_82.GetChecksum()"); + CrcCheck.ToByteArray(this.var_102,b,"var_102"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_143[a0][a1][a2],b,"var_143" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_59.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_59.java new file mode 100644 index 0000000000000000000000000000000000000000..f169254c3078a8cac66262a774581797031692c6 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_59.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3331378896 + +//import java.util.zip.CRC32; + +class cl_59 extends cl_38 +{ + cl_38 var_56 = new cl_38(); + cl_66 var_74 = new cl_66(); + int var_106 = (1514370190); + short var_151 = (short)(-14383); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2815); + CrcCheck.ToByteArray(this.var_33.GetChecksum(),b,"var_33.GetChecksum()"); + CrcCheck.ToByteArray(this.var_34,b,"var_34"); + CrcCheck.ToByteArray(this.var_56.GetChecksum(),b,"var_56.GetChecksum()"); + CrcCheck.ToByteArray(this.var_59.GetChecksum(),b,"var_59.GetChecksum()"); + CrcCheck.ToByteArray(this.var_61.GetChecksum(),b,"var_61.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_65[a0],b,"var_65" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_74.GetChecksum(),b,"var_74.GetChecksum()"); + CrcCheck.ToByteArray(this.var_82.GetChecksum(),b,"var_82.GetChecksum()"); + CrcCheck.ToByteArray(this.var_102,b,"var_102"); + CrcCheck.ToByteArray(this.var_106,b,"var_106"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_143[a0][a1][a2],b,"var_143" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_151,b,"var_151"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_66.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_66.java new file mode 100644 index 0000000000000000000000000000000000000000..f5ea9c6f8edf1e416418c99f5decc1d9525fd06d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_66.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3331378896 + +//import java.util.zip.CRC32; + +class cl_66 +{ + boolean var_70 = true; + short var_77 = (short)(2672); + byte var_83 = (byte)(-83); + int var_84 = (724027069); + float [][][] var_94 = {{{(-2.57321e-23F),(8.99001e-14F),(-5.6575e+06F),(-0.000189227F),(-1.27617e+29F)}},{{(2.92318e-06F),(-7.6509e+31F),(4.87687e+12F),(3.30772e-09F),(4.40802e-09F)}},{{(-1049.37F),(4.24468e+08F),(-1.62298e-12F),(6.52782e+27F),(0.000153332F)}},{{(1.9766e+34F),(5.83881e-38F),(3.98911e-17F),(7.11056e+20F),(1.06594e-26F)}},{{(-0.00685871F),(2.02767e+28F),(5.9937e+18F),(-1.78378e-36F),(3.03863F)}}}; + double var_105 = (8.40271e-303D); + boolean [] var_109 = {false,false,false,true}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(120); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_94[a0][a1][a2],b,"var_94" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_109[a0],b,"var_109" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_82.java b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_82.java new file mode 100644 index 0000000000000000000000000000000000000000..7385b5f136c185725e29869d56e3abd7e7f93de4 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/134_2019010202011/cl_82.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3331378896 + +//import java.util.zip.CRC32; + +class cl_82 extends cl_20 +{ + cl_20 var_58 = new cl_20(); + cl_22 var_64 = new cl_22(); + cl_66 var_76 = new cl_66(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(54); + CrcCheck.ToByteArray(this.var_58.GetChecksum(),b,"var_58.GetChecksum()"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_63[a0],b,"var_63" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_64.GetChecksum(),b,"var_64.GetChecksum()"); + CrcCheck.ToByteArray(this.var_71,b,"var_71"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_76.GetChecksum(),b,"var_76.GetChecksum()"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_111[a0][a1],b,"var_111" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/CRC32.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/MainClass.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..56be77d05e3baaf937394d1bb63e7e9667054ca2 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/MainClass.java @@ -0,0 +1,754 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1157171100 + +//import java.util.zip.CRC32; + +class MainClass +{ + static byte var_0 = (byte)(23); + static float var_3 = (-2.85e-35F); + static int var_6 = (880711515); + static boolean var_8 = true; + static int var_19 = (1771887948); + static cl_24 var_22 = new cl_24(); + static byte var_32 = (byte)(-90); + static cl_39 var_35 = new cl_39(); + static int var_43 = (-1405878835); + static byte var_46 = (byte)(36); + static cl_81 var_53 = new cl_81(); + static short var_60 = (short)(6971); + final static float var_61 = (0.0404511F); + static byte var_64 = (byte)(16); + static cl_106 var_66 = new cl_106(); + static cl_89 var_71 = new cl_89(); + final static double [][][] var_82 = {{{(-7.90484e-234D),(-2.78177e+151D),(-9.46795e+27D),(-2.14381e+39D),(6.78962e+58D),(1.60205e-185D),(6.28742e+82D)},{(1.33058e-285D),(2.5412e-96D),(5.68626e+10D),(8.40502e+303D),(-7.29013e-89D),(-2.13214e-153D),(3.92235e-49D)},{(2.44418e-167D),(1.44052e-43D),(4.31418e+173D),(-3.49629e+138D),(4.38058e+267D),(1.13225e-129D),(5.57961e+70D)},{(6.70474e-31D),(-1.75078e+159D),(1.24145e-49D),(-4.68591e-102D),(-1.28939e-85D),(-7.30887e-06D),(-4.47661e+117D)}},{{(3.12824e+185D),(-1.22187e-225D),(-9.2498e-204D),(-1.39369e-66D),(-9.73321e-265D),(7.32338e-252D),(-3.42582e-294D)},{(-2.00159e+150D),(-6.05689e+257D),(1.66043e+63D),(-3.21557e-266D),(-6.22807e-307D),(5.69686e+26D),(-6.46809e+272D)},{(2.39684e+113D),(-1.33526e+143D),(2.29624e+143D),(4.95592e-125D),(1.86833e-35D),(-2.47154e+238D),(6.26671e-161D)},{(-2.6919e+200D),(3.09196e+238D),(4.39138e-188D),(5.66792e+110D),(1.17575e+151D),(5.01445e+304D),(-3.87679e+125D)}},{{(1.26137e+37D),(-6.05975e-104D),(1.15427e-207D),(-1.22024e-296D),(2.66319e+186D),(-1.75786e+62D),(-7.14259e-224D)},{(3.12643e+67D),(2.13412e+33D),(3.02386e-159D),(9.26543e+234D),(1.22953e+90D),(2.1805e-80D),(1.30121e-126D)},{(-7.75872e+14D),(7.64559e-60D),(8.14839e+299D),(-6.80475e-162D),(2.63488e+198D),(-4.7526e+235D),(8.64016e-102D)},{(2.66728e+276D),(2.28488e-153D),(6.28617e+125D),(-5.72044e+205D),(2.24497e+195D),(8.94571e-42D),(5.33021e+35D)}},{{(-2.25041e+23D),(-8.3373e+252D),(5.8494e-42D),(-2.02603e+25D),(-6.48562e-162D),(-1.20075e-88D),(7.01488e+147D)},{(3.02983e+59D),(-4.89863e+120D),(6.11086e+236D),(-4.06994e+276D),(-1.74154e+307D),(5.773e-92D),(-1.07421e+55D)},{(4.25884e-72D),(-4.92437e+113D),(2.52296e+220D),(-3.71232e+146D),(3.77176e-290D),(-5.42295e+299D),(-1.45187e+12D)},{(-5.09353e+134D),(-9.11655e+12D),(4.88713e-269D),(6.4056e+248D),(1.3451e-285D),(-8.78933e-268D),(-2.23234e+300D)}},{{(1.30721e+140D),(2.0777e+301D),(4.05846e+297D),(-2.46521e-25D),(-3.6762e-103D),(8.689e+104D),(1.15253e+32D)},{(1.64535e-30D),(-6.7491e+289D),(1.36954e+85D),(-2.63978e+275D),(-2.59871e-200D),(4.58251e+186D),(-2.14239e+21D)},{(1.53589e+13D),(6.71462e+262D),(2.85866e-163D),(-2.70083e-209D),(-1.34808e+112D),(3.95527e+49D),(9.38217e-301D)},{(1.31649e-192D),(-1.09851e-45D),(2.15839e-20D),(-1.96432e+14D),(-7.65802e-162D),(1.24909e-88D),(-4.70854e+29D)}},{{(2.51091e-146D),(6.62813e+71D),(5.30766e-06D),(-4.75969e+48D),(-5.70183e+146D),(-1.70247e-81D),(-1.82484e-28D)},{(-3.83906e-11D),(-1.15115e-88D),(-8.82304e+15D),(-7.16652e-161D),(-4.78609e+131D),(1.85067e+83D),(1.2636e-134D)},{(2.21322e-294D),(1.15687e+185D),(9.63771e+216D),(1.96871e+157D),(1.13671e-184D),(9.50244e+14D),(-5.28915e-115D)},{(3.41397e+223D),(2.38486e-97D),(-2.65382e-275D),(1.86844e-81D),(1.32413e+19D),(-7.56157e+156D),(3.57615e-235D)}}}; + static cl_46 var_84 = new cl_46(); + static cl_24 var_85 = new cl_24(); + static float var_89 = (-0.12138F); + static double var_94 = (3.8861e-201D); + boolean var_98 = false; + static byte var_108 = (byte)(-33); + static int var_113 = (-160460337); + static cl_81 [][][] var_115 = {{{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()}},{{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()}},{{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()}},{{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()}}}; + final static int var_116 = (-705617567); + static double [] var_118 = {(1.01491e-155D)}; + static float [][][] var_119 = {{{(-9007.03F),(4.85941e+09F),(-2.08905e+23F),(3.45086e-07F),(-5.35844e-13F),(-2459.35F)},{(-0.177956F),(1.99552e+27F),(-3.23854e-12F),(-1.03724e-26F),(1.85264e+09F),(1.25417e+34F)},{(4.68051e-18F),(-1.66244e+33F),(-2.47618e+18F),(-358.561F),(-1.14779e+24F),(4.47216e+29F)},{(1.41395e+17F),(5.91396e+35F),(-2.0995e+27F),(0.000115086F),(-3.39072e-32F),(1.04586e+11F)},{(1.94817e-22F),(-4.22766e+11F),(-7.15114e-31F),(3.89172e+23F),(2.89039e-10F),(-5.46584e+26F)},{(1.6639e-07F),(-7.35942e-27F),(-2.26207e+10F),(1.52024e-37F),(-2.53489e+20F),(2.03238e-19F)}},{{(1.27103e+17F),(3.64996e+12F),(1.62886e-21F),(-1.25515e-36F),(32736.6F),(1.31552e+13F)},{(7.98568e-19F),(3.1879e-34F),(5.67971e+35F),(1.5245e-13F),(1.69959e+30F),(1.47141e+34F)},{(-8.49652e-28F),(5.80828e+31F),(-6.69355e-32F),(9.32526e-12F),(-3.00287e-28F),(-3.64849e+23F)},{(-2.209e-06F),(1.68347e-11F),(-2.64081e-38F),(4.88675e-27F),(7.80155e+06F),(5.85602e-30F)},{(5.30089e+22F),(-6.96633e-06F),(7.98377e-29F),(-1.13971e-11F),(-2.71382e-22F),(1.56519e-05F)},{(-3.7329e-29F),(2.9069e-19F),(2.46565e-17F),(-1.80329e-31F),(7.36326e-17F),(-1.07283e-20F)}}}; + static int var_120 = (1430164013); + static long [] var_138 = {(-599457522193370427L),(7188472984799153477L),(-3909820755404746518L)}; + static boolean [][][] var_144 = {{{false,true,true,false,true,false,false},{true,true,false,true,true,false,true},{true,false,false,true,true,true,false},{true,false,false,true,true,true,false},{true,false,false,true,true,false,true},{true,true,true,false,false,false,false},{false,true,true,false,true,false,false}},{{true,true,false,true,true,false,true},{false,false,false,false,false,false,true},{true,true,true,true,false,false,true},{false,true,true,true,true,false,true},{true,true,true,false,false,false,true},{true,true,true,true,false,false,true},{false,true,true,true,false,true,true}},{{false,true,false,false,false,false,true},{true,false,false,false,false,false,true},{false,false,false,false,false,true,true},{true,true,true,false,true,true,true},{false,true,true,false,true,false,false},{true,true,false,false,false,true,false},{true,true,false,true,true,true,false}},{{true,true,false,true,false,true,false},{false,true,true,false,true,true,true},{true,true,true,false,false,true,true},{false,false,false,false,true,true,true},{true,false,false,false,true,false,true},{true,true,true,true,true,true,true},{true,false,true,false,true,true,false}},{{false,true,true,false,false,false,true},{true,false,false,true,false,true,false},{true,false,true,true,true,true,false},{false,false,true,true,false,false,true},{false,false,false,false,true,true,true},{false,true,false,true,true,false,false},{false,true,true,false,false,false,true}},{{false,false,false,false,false,false,true},{true,false,true,false,false,true,true},{true,true,false,false,true,false,false},{true,false,false,false,false,false,false},{true,false,true,true,false,false,true},{true,false,false,false,false,true,true},{true,true,true,false,true,true,false}}}; + static byte var_147 = (byte)(14); + static cl_81 [][] var_156 = {{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()}}; + static int var_160 = (1535501302); + static long [] var_162 = {(-7508534397240638075L),(-7264057363231451048L),(9162969285192346177L),(8605606415224300891L),(-6389377789182098496L),(9188467792257415367L)}; + final static long var_163 = (-1397167326471809338L); + static boolean [] var_183 = {false,true}; + static short var_186 = (short)(31491); + static byte var_203 = (byte)(122); + static int var_213 = (1999669982); + static int var_214 = (748950130); + static int var_216 = (1587277066); + static int var_217 = (-362043935); + static boolean [] var_219 = {true,false,true,false,false}; + byte var_224 = (byte)(-82); + short var_246 = (short)(19826); + short var_249 = (short)(-6707); + int var_250 = (753714923); + int var_252 = (651178698); + final int var_255 = (-434761258); + boolean [][][] var_260 = {{{false,true,true,false,true,true,true},{false,true,false,false,false,false,false},{false,false,true,true,true,true,true},{true,false,false,false,true,false,true},{true,true,true,true,true,true,false},{false,false,false,false,false,true,false},{true,false,true,false,true,false,true}},{{true,false,false,false,true,true,false},{false,true,true,false,false,true,false},{false,false,true,true,false,true,false},{true,false,false,true,false,true,false},{false,false,false,false,true,false,false},{false,true,false,true,false,false,true},{false,false,true,false,false,true,false}},{{true,true,true,false,false,true,true},{true,false,false,true,true,true,false},{true,true,true,false,true,true,true},{false,true,false,true,false,false,false},{false,true,true,true,true,false,false},{false,true,true,true,false,false,false},{false,false,false,true,true,false,false}},{{true,true,false,false,false,true,false},{false,true,true,false,true,false,false},{false,false,true,true,false,true,true},{true,true,false,true,true,true,false},{false,true,false,false,false,false,false},{false,true,true,true,true,false,true},{true,true,true,false,true,true,true}},{{false,false,false,true,false,true,false},{false,true,true,true,true,false,true},{false,false,false,true,false,false,false},{true,false,false,true,false,false,false},{false,true,false,true,false,false,true},{false,false,true,true,false,false,false},{true,true,true,true,true,false,false}},{{false,false,true,true,true,false,true},{true,true,false,true,true,true,true},{false,false,false,false,false,false,false},{true,false,false,false,true,true,false},{false,true,false,false,false,false,false},{true,false,false,false,true,true,false},{false,true,true,false,false,false,true}}}; +/*********************************/ +public strictfp void run() +{ + float [][] var_222 = {{(-7.5416e+08F),(-1.05556e-28F),(-7.39018e-26F),(-4.86751e-18F),(-2.25358e+20F)},{(2.78496e-15F),(1.66329e-26F),(2.42432e-11F),(3.76198e-34F),(2.41018e-24F)},{(-1.04638e+27F),(-1.69081e-34F),(-4.72666e-07F),(-11.7767F),(-0.00160312F)},{(-2.83489e+24F),(-0.00902134F),(-1.51245e+29F),(-2.99308e+28F),(-4.60526e+23F)}}; + byte var_242 = (byte)(-79); + short var_245 = (short)(8291); + short var_223 = (short)(15062); + byte var_238 = (byte)(-13); + float var_225 = (2.15934e-09F); + byte var_231 = (byte)(62); + if( (!(!(!(!(!(((-var_0)*func_1(var_222[((var_249--)&3)][(((++var_223)+func_11(( ( boolean )((var_224--)<=func_40((var_225++) ,(-83566528))) ) ,(!(!((--var_64)<=func_40(( ( float )((var_186--)*( ( short )func_26((-2.48175e-233D) ,var_35 ,((++var_231)-var_84.var_232) ,var_85.var_234 ,var_66.var_97.var_55) )) ) ,(var_238--))))) ,(-(++var_186)) ,((++var_242)+var_186) ,var_66.var_97.var_93 ,(!(!((--var_245)>=( ( float )(+(var_246++)) )))) ,(971875098)))&4)]))>=var_22.var_123))))))) + { + System.out.println(" if stmt begin,id=1 "); + long [][] var_259 = {{(8329838264253535878L),(7578300912300785755L),(7411051936173525182L)},{(4763828099971277589L),(-3234487205815065736L),(-3124889639633025650L)},{(4698963221051650195L),(379407628999730071L),(7746545714131632172L)},{(1455480562392215010L),(5338077126630049752L),(-8317475470711592444L)}}; + int var_256 = (-670271505); + if( (!(((var_250++)+func_21())!=func_21()))) + { + System.out.println(" if stmt begin,id=2 "); + int var_251 = (-46299599); + for( var_251 = 745 ;(var_251<795);var_251 = (var_251+10) ) + { + for( var_252 = 819 ;(var_252>791);var_252 = (var_252-7) ) + { + int var_253 = (-538747502); + for( var_253 = 723 ;(var_253>721);var_253 = (var_253-2) ) + { + int var_254 = (1020047243); + final boolean [][][] var_262 = {{{false,true,false,false,false,true,true},{false,true,true,false,false,true,false},{false,true,false,true,true,false,false},{true,true,false,false,false,false,true},{true,false,true,false,true,false,true},{true,false,true,false,false,true,true},{true,true,false,false,true,true,true}},{{false,true,true,false,true,false,false},{true,false,true,false,false,false,false},{true,true,true,false,true,false,false},{true,false,false,false,false,false,false},{true,true,false,false,true,false,true},{false,true,true,false,true,false,true},{true,false,false,true,false,true,false}},{{false,false,false,true,true,true,false},{false,false,false,false,false,true,true},{false,true,false,false,false,false,false},{true,false,false,false,true,false,false},{true,false,false,true,false,false,true},{false,false,true,true,false,false,true},{true,false,false,true,true,true,true}},{{false,false,true,true,false,false,false},{true,false,true,false,true,false,false},{false,true,true,false,true,false,false},{true,true,true,false,false,true,false},{true,false,true,false,true,true,false},{false,true,false,true,false,false,false},{false,false,true,false,false,false,true}},{{false,true,false,true,true,true,false},{true,true,true,false,false,false,true},{true,true,true,true,false,true,false},{true,true,true,false,false,false,true},{false,false,false,false,false,true,false},{true,true,false,false,false,true,true},{false,true,true,true,false,false,true}},{{false,false,false,false,false,true,true},{false,false,true,true,false,false,true},{false,true,true,false,false,true,true},{false,true,false,false,true,true,true},{false,true,false,true,false,false,true},{false,true,false,false,true,true,true},{true,true,false,true,true,false,true}}}; + for( var_254 = 688 ;(var_254<748);var_254 = (var_254+15) ) + { + var_222[(((++var_242)*func_26((~(var_256--)) ,var_35 ,var_259[(((var_223++)+func_26(((--var_223)&func_21()) ,var_35 ,(7123567560789355459L) ,var_260 ,var_66.var_97.var_55))&3)][((--var_213)&2)] ,var_262 ,var_84))&3)][((var_256++)&4)] = (var_223++) ; + } + } + } + } + System.out.println(" if stmt end,id=2 "); + } + System.out.println(" if stmt end,id=1 "); + } + return ; +} +public static strictfp double func_1(float var_2) +{ + if( false) + { + System.out.println(" if stmt begin,id=3 "); + int var_4 = (-1321275282); + var_2 = ((--var_0)+var_3) ; + for( var_4 = 699 ;(var_4>679);var_4 = (var_4-4) ) + { + short var_187 = (short)(21410); + boolean [][][] var_200 = {{{true,true,true,false},{true,false,false,true},{false,false,true,true},{true,false,true,false}},{{true,true,true,false},{true,false,true,true},{false,true,true,true},{false,false,true,false}},{{false,false,false,true},{true,false,true,false},{true,true,true,true},{true,false,true,true}}}; + try + { + int var_5 = (1724790518); + if( ((var_5--)>=var_6)) + { + System.out.println(" if stmt begin,id=4 "); + int var_7 = (503950073); + int [][] var_10 = {{(-2121110934),(-535659610),(-1363800764),(1865341880),(-1849971892),(-1919888216)},{(-270546499),(723394153),(1769802847),(-51026920),(241729208),(-502035150)}}; + for( var_7 = 704 ;(var_7<774);var_7 = (var_7+14) ) + { + if( var_8) + { + System.out.println(" if stmt begin,id=5 "); + var_10[((var_203++)&1)][(((++var_0)*func_11((((-((--var_187)+var_84.var_109))*( ( float )((~(var_32++))&func_26((~(~((--var_187)*var_116))) ,var_35 ,var_71.var_190 ,var_53.var_192 ,var_66.var_97.var_55)) ))!=var_0) ,(!(!(!((var_147++)!=(-8.66205e+206D))))) ,((var_60++)*var_160) ,(-309707475) ,var_66.var_97.var_93 ,var_200[((var_187++)&2)][((var_186--)&3)][((var_46++)&3)] ,((var_64--)*(514013240))))&5)] = func_26(var_82[(((++var_187)&func_21())&5)][((var_187--)&3)][((var_186--)&6)] ,var_35 ,((var_203++)&var_163) ,var_53.var_192 ,var_84) ; + System.out.println(" if stmt end,id=5 "); + } + } + System.out.println(" if stmt end,id=4 "); + } + } + catch( java.lang.IllegalArgumentException myExp_204 ) + { + var_66.var_77.var_56 = var_66.var_97.var_93 ; + System.out.println("hello exception 0 !"); + } + } + System.out.println(" if stmt end,id=3 "); + } + else + { + System.out.println(" else stmt begin,id=1 "); + byte var_209 = (byte)(-74); + try + { + float [] var_205 = {(-0.00130511F),(1.35107e-17F),(-6.71617e-27F),(869401F),(1.91549e+28F),(-9.31866e-34F),(-2.52121e+26F)}; + short var_206 = (short)(-31415); + var_53.var_184 = (var_2--) ; + } + catch( java.lang.ArithmeticException myExp_207 ) + { + short var_220 = (short)(31768); + try + { + short var_208 = (short)(20805); + if( (!(!((var_208++)488);var_214 = (var_214-14) ) + { + var_208 = (var_60--) ; + } + System.out.println(" else stmt end,id=2 "); + } + System.out.println(" if stmt end,id=6 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_215 ) + { + for( var_216 = 781 ;(var_216>729);var_216 = (var_216-13) ) + { + for( var_217 = 771 ;(var_217<798);var_217 = (var_217+9) ) + { + var_219[((var_209++)&4)] = (!(((var_220++)-var_66.var_221.var_58)<=var_53.var_73)) ; + } + } + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 1 !"); + } + System.out.println(" else stmt end,id=1 "); + } + return (--var_213); +} +public static strictfp short func_11(boolean var_12, boolean var_13, int var_14, int var_15, cl_24 var_16, boolean var_17, int var_18) +{ + for( var_19 = 104 ;(var_19>59);var_19 = (var_19-15) ) + { + byte var_20 = (byte)(-31); + final int [][][] var_168 = {{{(1245313966),(-727833734),(-2107194277),(750149402),(-235283133),(134391631)},{(-1689700135),(1215696421),(-353019885),(1942790706),(-1832221630),(444387251)},{(-1810030438),(-446249764),(-1786151577),(136934074),(-1710992579),(1116053796)},{(1350496011),(1762245217),(-1005441837),(-1055561012),(-1481838970),(1581110603)},{(-565207363),(403570721),(871306455),(-668146126),(-605575877),(1362029546)},{(1831156631),(1379410754),(-1983906478),(1900709218),(1337028997),(548380382)}},{{(-2066089254),(305031700),(2058188809),(-84419325),(-1341012055),(544969651)},{(1402256588),(608200020),(-2127462857),(1806969153),(-2136066023),(-1684124077)},{(-349417259),(-773119145),(-684895619),(1876191069),(-1676901816),(-908290519)},{(1055533386),(-1376758273),(-135444798),(101781016),(-211669096),(1553966223)},{(1257427485),(-1842192735),(793993082),(-924345366),(-1785931096),(1964945432)},{(1380273840),(-1876303548),(1476108291),(1481481299),(-1895721998),(-1294336978)}},{{(-1056546847),(-1497962769),(-398512125),(1771683593),(250483044),(1995248820)},{(-795813394),(-2003796598),(-1926073710),(1011235346),(1158380409),(351664976)},{(1499531332),(1268660701),(-1560366746),(1124126984),(-1442711017),(-567235878)},{(1173127742),(172081438),(-507010964),(1503934901),(1081969864),(2104351067)},{(-760570113),(623358752),(-2102274189),(2048617295),(17020982),(97984731)},{(-718920839),(-1983540465),(-1356351779),(-1484636014),(-1466601692),(-1931543872)}},{{(1708852065),(-264859044),(-1115683958),(-2036496296),(1007137690),(1571351580)},{(1887577455),(-1944264067),(556207904),(2061750747),(921352464),(1466384265)},{(875588709),(-1255214795),(963005889),(1990105921),(-567439965),(1780807582)},{(4599448),(1403602188),(916540743),(-598088141),(914450966),(-1841680172)},{(-339211522),(853489908),(-460836058),(-166618551),(81980405),(1313276501)},{(1633459747),(497156577),(-1788859528),(-1248279799),(1297484481),(946888949)}}}; + try + { + float var_159 = (-3.67925e-24F); + if( (((var_20--)+func_21())!=var_53.var_74)) + { + System.out.println(" if stmt begin,id=9 "); + short var_164 = (short)(8310); + if( ((var_14--)>=( ( float )func_26((var_60--) ,var_35 ,(var_14--) ,var_144 ,var_84) ))) + { + System.out.println(" if stmt begin,id=10 "); + cl_89 var_153 = new cl_89(); + if( func_37()) + { + System.out.println(" if stmt begin,id=11 "); + try + { + var_71 = var_66.var_77.var_154 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_155 ) + { + cl_81 [][] var_157 = {{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()}}; + var_156 = var_66.var_97.var_158 ; + System.out.println("hello exception 3 !"); + } + System.out.println(" if stmt end,id=11 "); + } + System.out.println(" if stmt end,id=10 "); + } + else + { + System.out.println(" else stmt begin,id=3 "); + if( ((~(var_20++))==var_159)) + { + System.out.println(" if stmt begin,id=12 "); + for( var_160 = 271 ;(var_160<298);var_160 = (var_160+9) ) + { + var_162[((var_15++)&5)] = ((var_164--)*var_84.var_122) ; + } + System.out.println(" if stmt end,id=12 "); + } + else + { + System.out.println(" else stmt begin,id=4 "); + final int var_165 = (-1749835058); + System.out.println(" else stmt end,id=4 "); + } + System.out.println(" else stmt end,id=3 "); + } + System.out.println(" if stmt end,id=9 "); + } + } + catch( java.lang.IllegalArgumentException myExp_166 ) + { + int var_167 = (-1608187237); + short var_173 = (short)(-19793); + double var_170 = (1.08424e-208D); + for( var_167 = 597 ;(var_167>517);var_167 = (var_167-16) ) + { + short var_169 = (short)(-24266); + if( (!((+(var_0++))!=( ( double )var_168[((var_147++)&3)][(((++var_169)-func_26((++var_170) ,var_35 ,(++var_173) ,var_144 ,var_66.var_97.var_55))&5)][((-(+(var_108++)))&5)] )))) + { + System.out.println(" if stmt begin,id=13 "); + int var_177 = (1121863789); + for( var_177 = 660 ;(var_177>652);var_177 = (var_177-8) ) + { + if( (((--var_108)-var_53.var_76)var_35.var_180)) + { + System.out.println(" if stmt begin,id=15 "); + int var_181 = (770131061); + for( var_181 = 338 ;(var_181>336);var_181 = (var_181-2) ) + { + var_183[((var_15--)&1)] = ((var_20++)!=var_53.var_184) ; + } + System.out.println(" if stmt end,id=15 "); + } + System.out.println(" else stmt end,id=6 "); + } + } + System.out.println("hello exception 4 !"); + } + } + short [][] var_185 = {{(short)(13102),(short)(-29448),(short)(28108),(short)(-6253)},{(short)(27862),(short)(3907),(short)(8061),(short)(-15419)}}; + return var_185[((++var_186)&1)][((var_15++)&3)]; +} +public static strictfp short func_21() +{ + short var_25 = (short)(-17385); + byte var_142 = (byte)(29); + double [][] var_24 = {{(3.67807e-175D),(-9.87473e-40D),(-1.68289e-273D),(-2.60821e-301D)},{(-4.05521e-101D),(315802D),(1.0845e+186D),(-2.27354e-116D)},{(3.85808e+107D),(-2.30571e+16D),(-2.28594e+272D),(-4.81594e-303D)},{(1.16162e+256D),(-2.28191e-205D),(6.49402e+162D),(-1.42785e-177D)}}; + var_22.var_23 = ((--var_147)|var_84.var_58) ; + return (var_60--); +} +public static strictfp int func_26(double var_27, cl_39 var_28, long var_29, boolean[][][] var_30, cl_46 var_31) +{ + final cl_81 [][][] var_128 = {{{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()}},{{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()}},{{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()}},{{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()},{new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81(),new cl_81()}}}; + byte var_34 = (byte)(48); + short var_33 = (short)(-7073); + if( ( ( boolean )var_30[(((var_32--)-var_35.var_36)&5)][((~(var_34--))&6)][(((--var_32)+var_33)&6)] )) + { + System.out.println(" if stmt begin,id=16 "); + int var_133 = (1856205064); + if( (((var_33++)<=var_3)&func_37())) + { + System.out.println(" if stmt begin,id=17 "); + if( (((var_34--)&var_35.var_55.var_56.var_109)>var_60)) + { + System.out.println(" if stmt begin,id=18 "); + if( (!(!((var_34++)>=var_22.var_23)))) + { + System.out.println(" if stmt begin,id=19 "); + if( ((-(var_34--))==var_89)) + { + System.out.println(" if stmt begin,id=20 "); + var_30[((var_33++)&5)][((~(var_46++))&6)][(((var_34--)|var_116)&6)] = ((((var_46--)&var_85.var_109)&var_35.var_36)var_120))) + { + System.out.println(" if stmt begin,id=23 "); + if( ((++var_34)==var_35.var_93.var_122)) + { + System.out.println(" if stmt begin,id=24 "); + var_66.var_77.var_56.var_123 = ((var_34++)+var_89) ; + System.out.println(" if stmt end,id=24 "); + } + else + { + System.out.println(" else stmt begin,id=9 "); + var_29 = (var_34++) ; + System.out.println(" else stmt end,id=9 "); + } + System.out.println(" if stmt end,id=23 "); + } + System.out.println(" if stmt end,id=22 "); + } + else + { + System.out.println(" else stmt begin,id=10 "); + int var_124 = (777548439); + for( var_124 = 298 ;(var_124<318);var_124 = (var_124+10) ) + { + try + { + var_66.var_77.var_75.var_74 = ((--var_33)|var_84.var_56.var_58) ; + } + catch( java.lang.IllegalArgumentException myExp_125 ) + { + long var_126 = (6116104832079267996L); + System.out.println("hello exception 5 !"); + } + } + System.out.println(" else stmt end,id=10 "); + } + System.out.println(" if stmt end,id=21 "); + } + else + { + System.out.println(" else stmt begin,id=11 "); + try + { + if( ((var_33++)==var_64)) + { + System.out.println(" if stmt begin,id=25 "); + var_35.var_55.var_75.var_127 = (-2136422765306020818L) ; + System.out.println(" if stmt end,id=25 "); + } + else + { + System.out.println(" else stmt begin,id=12 "); + try + { + var_115 = var_128 ; + } + catch( java.lang.ArithmeticException myExp_129 ) + { + final float var_130 = (-4.2724e-36F); + System.out.println("hello exception 6 !"); + } + System.out.println(" else stmt end,id=12 "); + } + } + catch( java.lang.ArithmeticException myExp_131 ) + { + if( ((var_34--)>=func_40(((var_132--)*var_85.var_109) ,(var_133--)))) + { + System.out.println(" if stmt begin,id=26 "); + final double var_134 = (-2.38286e-34D); + System.out.println(" if stmt end,id=26 "); + } + else + { + System.out.println(" else stmt begin,id=13 "); + try + { + var_133 = ((--var_46)+var_19) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_135 ) + { + boolean var_136 = true; + System.out.println("hello exception 8 !"); + } + System.out.println(" else stmt end,id=13 "); + } + System.out.println("hello exception 7 !"); + } + System.out.println(" else stmt end,id=11 "); + } + System.out.println(" else stmt end,id=8 "); + } + System.out.println(" if stmt end,id=16 "); + } + else + { + System.out.println(" else stmt begin,id=14 "); + var_30[((+((++var_34)|var_71.var_114))&5)][(((--var_34)&(short)(14316))&6)][6] = ((var_32--)>=var_61) ; + System.out.println(" else stmt end,id=14 "); + } + return (~((var_64--)+func_40((2.47609e-07F) ,( ( int )var_138[((var_60++)&2)] )))); +} +public static strictfp boolean func_37() +{ + int var_38 = (-332662187); + short var_110 = (short)(-26271); + for( var_38 = 403 ;(var_38>401);var_38 = (var_38-2) ) + { + float var_39 = (-2.22488e-12F); + if( (((++var_32)>=func_40(((+(var_108++))*(-404284210)) ,(-1362517961)))==var_8)) + { + System.out.println(" if stmt begin,id=27 "); + var_35.var_93.var_109 = (-(var_110++)) ; + System.out.println(" if stmt end,id=27 "); + } + else + { + System.out.println(" else stmt begin,id=15 "); + int var_111 = (55605289); + for( var_111 = 222 ;(var_111<257);var_111 = (var_111+7) ) + { + int var_112 = (-1540846200); + for( var_112 = 104 ;(var_112>97);var_112 = (var_112-7) ) + { + for( var_113 = 294 ;(var_113<296);var_113 = (var_113+2) ) + { + if( (!(!(!(!(!(!((--var_6)360);var_45 = (var_45-8) ) + { + cl_81 [][] var_49 = {{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()}}; + short var_51 = (short)(-10247); + try + { + final boolean [] var_63 = {true,false,false,false,true}; + final cl_89 var_92 = new cl_89(); + if( ((var_46++)!=var_46)) + { + System.out.println(" if stmt begin,id=29 "); + double var_100 = (2.23552e-276D); + int var_78 = (-1940161567); + int var_95 = (-146763635); + int var_88 = (1424090676); + int var_47 = (-1436878403); + for( var_47 = 299 ;(var_47<349);var_47 = (var_47+10) ) + { + boolean var_54 = false; + double var_57 = (-1.07143e-183D); + byte var_50 = (byte)(109); + var_49[((-(var_51++))&6)][((var_50++)&1)] = var_52 ; + var_22 = var_35.var_55.var_56 ; + var_49[((var_42++)&6)][(((var_51++)&var_22.var_58)&1)] = var_53 ; + var_51 = (++var_51) ; + var_59[(var_47&4)] = var_59[((var_60++)&4)] ; + var_62[(var_47&3)] = var_63[((~(var_64++))&4)] ; + var_41 = (var_65--) ; + var_66.var_67 = (var_42--) ; + var_59 = var_68 ; + var_35.var_55.var_56.var_69 = var_71.var_72 ; + var_8 = (!((++var_65)>=var_32)) ; + var_49[6][((-(--var_65))&1)] = var_52 ; + var_46 = (var_64++) ; + var_49[6][(((++var_32)&var_19)&1)] = var_53 ; + var_52 = var_53 ; + var_49[(((--var_32)|var_35.var_55.var_75.var_76)&6)][((var_65--)&1)] = var_66.var_77.var_75 ; + break; + + } + for( var_78 = 985 ;(var_78<1012);var_78 = (var_78+9) ) + { + int var_86 = (725712878); + long var_83 = (1790004159004655468L); + float var_81 = (4.20627e+16F); + var_80[((var_6++)&0)][((var_51--)&0)][(((--var_65)&(-364445148))&0)] = (((++var_65)|var_66.var_67)|( ( int )(++var_65) )) ; + var_49[6][(((var_65++)+var_6)&1)] = var_53 ; + var_84.var_56 = var_66.var_77.var_56 ; + continue; + + } + var_66.var_77.var_75 = var_66.var_77.var_75 ; + var_85 = var_87 ; + for( var_88 = 379 ;(var_88<385);var_88 = (var_88+3) ) + { + var_0 = (--var_65) ; + var_85 = var_66.var_77.var_56 ; + var_90[(var_88&2)] = (var_91--) ; + var_71 = var_92 ; + var_35.var_55.var_56 = var_66.var_77.var_56 ; + var_59[((var_65--)&4)] = ((++var_51)*var_35.var_93.var_58) ; + var_90[(var_88&2)] = (var_42++) ; + } + for( var_95 = 646 ;(var_95<648);var_95 = (var_95+2) ) + { + final boolean var_99 = true; + double var_96 = (2.34869e-56D); + var_35.var_93 = var_66.var_97.var_93 ; + var_94 = (2.92834e-183D) ; + } + if( (((var_100++)*var_3)<=(2.32777e-164D))) + { + System.out.println(" if stmt begin,id=30 "); + long var_101 = (5427989351194781665L); + System.out.println(" if stmt end,id=30 "); + } + else + { + System.out.println(" else stmt begin,id=16 "); + var_84.var_56 = var_66.var_97.var_93 ; + System.out.println(" else stmt end,id=16 "); + } + System.out.println(" if stmt end,id=29 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_102 ) + { + try + { + try + { + var_42 = (--var_46) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_103 ) + { + var_22 = var_66.var_97.var_93 ; + System.out.println("hello exception 10 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_104 ) + { + int var_105 = (687142381); + for( var_105 = 655 ;(var_105<750);var_105 = (var_105+19) ) + { + boolean var_106 = false; + } + System.out.println("hello exception 11 !"); + } + System.out.println("hello exception 9 !"); + } + } + } + } + return (var_107++); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(3121); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + CrcCheck.ToByteArray(this.var_3,b,"var_3"); + CrcCheck.ToByteArray(this.var_6,b,"var_6"); + CrcCheck.ToByteArray(this.var_8,b,"var_8"); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + CrcCheck.ToByteArray(this.var_22.GetChecksum(),b,"var_22.GetChecksum()"); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + CrcCheck.ToByteArray(this.var_35.GetChecksum(),b,"var_35.GetChecksum()"); + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_53.GetChecksum(),b,"var_53.GetChecksum()"); + CrcCheck.ToByteArray(this.var_60,b,"var_60"); + CrcCheck.ToByteArray(this.var_61,b,"var_61"); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_66.GetChecksum(),b,"var_66.GetChecksum()"); + CrcCheck.ToByteArray(this.var_71.GetChecksum(),b,"var_71.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_82[a0][a1][a2],b,"var_82" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_84.GetChecksum(),b,"var_84.GetChecksum()"); + CrcCheck.ToByteArray(this.var_85.GetChecksum(),b,"var_85.GetChecksum()"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_115[a0][a1][a2].GetChecksum(),b,"var_115" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_118[a0],b,"var_118" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_119[a0][a1][a2],b,"var_119" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_120,b,"var_120"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_138[a0],b,"var_138" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_144[a0][a1][a2],b,"var_144" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_147,b,"var_147"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_156[a0][a1].GetChecksum(),b,"var_156" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_160,b,"var_160"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_162[a0],b,"var_162" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_163,b,"var_163"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_183[a0],b,"var_183" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_186,b,"var_186"); + CrcCheck.ToByteArray(this.var_203,b,"var_203"); + CrcCheck.ToByteArray(this.var_213,b,"var_213"); + CrcCheck.ToByteArray(this.var_214,b,"var_214"); + CrcCheck.ToByteArray(this.var_216,b,"var_216"); + CrcCheck.ToByteArray(this.var_217,b,"var_217"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_219[a0],b,"var_219" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_224,b,"var_224"); + CrcCheck.ToByteArray(this.var_246,b,"var_246"); + CrcCheck.ToByteArray(this.var_249,b,"var_249"); + CrcCheck.ToByteArray(this.var_250,b,"var_250"); + CrcCheck.ToByteArray(this.var_252,b,"var_252"); + CrcCheck.ToByteArray(this.var_255,b,"var_255"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_260[a0][a1][a2],b,"var_260" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/Start.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..0a0bf37131da5bc87e95f1341a375c8e6d542348 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_46.java cl_39.java cl_106.java cl_24.java CRC32.java cl_81.java cl_89.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_106.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_106.java new file mode 100644 index 0000000000000000000000000000000000000000..fe84af009f5a325d0add3478f65ca0612bbf8683 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_106.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1157171100 + +//import java.util.zip.CRC32; + +class cl_106 +{ + int var_67 = (-2066283302); + cl_46 var_77 = new cl_46(); + cl_39 var_97 = new cl_39(); + cl_24 var_221 = new cl_24(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(28); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_77.GetChecksum(),b,"var_77.GetChecksum()"); + CrcCheck.ToByteArray(this.var_97.GetChecksum(),b,"var_97.GetChecksum()"); + CrcCheck.ToByteArray(this.var_221.GetChecksum(),b,"var_221.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_24.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_24.java new file mode 100644 index 0000000000000000000000000000000000000000..3db660e2219dd1eac780876ef4f7fcf2907994f3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_24.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1157171100 + +//import java.util.zip.CRC32; + +class cl_24 +{ + double var_23 = (-4.8081e+27D); + short var_58 = (short)(31410); + float [][][] var_69 = {{{(-1.01641e+16F),(4.74462e+33F),(-184160F),(-1.12141e-13F),(1.45964e+29F)},{(1.30558e+08F),(9.2737e-07F),(-1.97102e-20F),(9.72139e-27F),(3.71266e-33F)},{(-7.22072e-27F),(7.03026e-32F),(1.07234e-35F),(3.36238e-26F),(-1.34828e+16F)},{(-1.71536e-06F),(1.402e-36F),(-1.28387e-37F),(-2.0977e+31F),(-1.54607e-22F)},{(-8.65851e+15F),(-1.60956e+19F),(1.21752e+10F),(1.10663e+22F),(-1.84697e-19F)}},{{(-7.74933e+14F),(167192F),(-2.32312e+28F),(-2.34593e-36F),(2.48559e+33F)},{(0.0940007F),(5.7378e-38F),(-3.61502e-14F),(6.33505e-26F),(-5.44983e+20F)},{(-4.97601e-14F),(-3.17273e+10F),(7.13999e-17F),(1.32273e-39F),(-169.542F)},{(-0.249679F),(-1.57294e+13F),(2.62441e-17F),(-4.76363e-06F),(-1.3352e-12F)},{(8.46637e-38F),(-0.000889981F),(5.74302e+26F),(3.96511e+07F),(1.5938e+08F)}},{{(-1.31899e-35F),(-6.87014e+06F),(5.96425e-27F),(-5.32237e-27F),(-1.05479e-18F)},{(-3.40675e-05F),(-1.05976e-18F),(2.87118F),(-292101F),(-1.04585e+20F)},{(-1.08788F),(-3.89923e-30F),(6.06387e-15F),(-1.0092e-16F),(-2.76918e+10F)},{(6.35615e-18F),(-1.52014e+25F),(-623.529F),(9.33616e-10F),(28500.7F)},{(1.31432e+36F),(1.035e+27F),(-8.31763e+36F),(-55400F),(1.3751e+06F)}},{{(-8.53826e-28F),(1.0667e-35F),(5.80768e-20F),(-2.5933e+33F),(3.32962e-12F)},{(-5.27396e-23F),(2.8635e+11F),(3.65366e+29F),(-3.79147e+30F),(1.61e+34F)},{(-2.22105e-07F),(-7.62765e+34F),(-1.16184e-18F),(-4.07976e-17F),(6.92859e+18F)},{(8.43451e+32F),(-2.49584e-30F),(-1.00381e-20F),(-5.62545e+28F),(-2.48891e+36F)},{(1.726e-10F),(5.40144e+22F),(8.61396e+35F),(2.10514e+15F),(-2.19209e-30F)}}}; + int var_109 = (-1696644156); + double [] var_117 = {(1.01381e+261D)}; + final byte var_122 = (byte)(61); + float var_123 = (-1.993e+10F); + boolean [][][] var_234 = {{{true,true,true,false,true,true,false},{true,false,false,false,false,true,false},{true,false,true,false,true,true,false},{true,false,false,true,true,false,true},{true,true,true,true,false,false,false},{true,false,false,false,true,false,true},{false,true,true,true,false,false,false}},{{false,false,false,true,true,false,false},{false,true,false,true,false,false,false},{false,false,true,true,false,true,true},{true,false,false,true,false,false,true},{false,true,false,true,true,true,true},{false,true,false,false,true,true,true},{false,false,false,false,false,false,false}},{{true,true,false,true,true,false,true},{false,false,true,true,true,false,true},{true,true,true,false,false,true,false},{true,false,true,true,false,false,false},{false,true,true,true,true,false,true},{false,true,true,false,false,true,false},{false,true,true,false,false,true,true}},{{true,true,true,false,false,false,true},{true,true,false,true,false,false,false},{false,true,true,false,true,false,false},{false,true,true,true,false,true,true},{true,false,true,true,false,true,false},{true,false,true,true,true,true,true},{false,false,false,false,true,true,true}},{{true,true,false,true,false,true,false},{true,true,false,true,false,false,true},{true,true,true,false,true,true,false},{true,false,true,true,true,true,true},{false,false,false,true,false,false,true},{false,true,true,true,false,true,true},{false,true,false,false,false,false,false}},{{false,true,false,true,false,true,true},{false,true,false,false,true,true,false},{true,true,true,false,false,true,true},{true,false,true,false,true,true,false},{false,false,false,false,true,false,false},{false,false,true,false,true,true,true},{false,false,true,true,false,false,false}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(721); + CrcCheck.ToByteArray(this.var_23,b,"var_23"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_69[a0][a1][a2],b,"var_69" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_117[a0],b,"var_117" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_122,b,"var_122"); + CrcCheck.ToByteArray(this.var_123,b,"var_123"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_234[a0][a1][a2],b,"var_234" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_39.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_39.java new file mode 100644 index 0000000000000000000000000000000000000000..307a496a1b9c7956538c185f93ef4c595276c685 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_39.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1157171100 + +//import java.util.zip.CRC32; + +class cl_39 +{ + int var_36 = (-505733947); + cl_46 var_55 = new cl_46(); + cl_24 var_93 = new cl_24(); + cl_81 [][] var_158 = {{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()},{new cl_81(),new cl_81()}}; + final short var_180 = (short)(2681); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(102); + CrcCheck.ToByteArray(this.var_36,b,"var_36"); + CrcCheck.ToByteArray(this.var_55.GetChecksum(),b,"var_55.GetChecksum()"); + CrcCheck.ToByteArray(this.var_93.GetChecksum(),b,"var_93.GetChecksum()"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_158[a0][a1].GetChecksum(),b,"var_158" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_180,b,"var_180"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_46.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_46.java new file mode 100644 index 0000000000000000000000000000000000000000..5c2a676f48bd5f819988d8a7854742e49233436c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_46.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1157171100 + +//import java.util.zip.CRC32; + +class cl_46 extends cl_24 +{ + cl_24 var_56 = new cl_24(); + cl_81 var_75 = new cl_81(); + cl_89 var_154 = new cl_89(); + long var_232 = (5261615551694280407L); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(753); + CrcCheck.ToByteArray(this.var_23,b,"var_23"); + CrcCheck.ToByteArray(this.var_56.GetChecksum(),b,"var_56.GetChecksum()"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_69[a0][a1][a2],b,"var_69" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_75.GetChecksum(),b,"var_75.GetChecksum()"); + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_117[a0],b,"var_117" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_122,b,"var_122"); + CrcCheck.ToByteArray(this.var_123,b,"var_123"); + CrcCheck.ToByteArray(this.var_154.GetChecksum(),b,"var_154.GetChecksum()"); + CrcCheck.ToByteArray(this.var_232,b,"var_232"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_234[a0][a1][a2],b,"var_234" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_81.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_81.java new file mode 100644 index 0000000000000000000000000000000000000000..88c35477bc07acc673b6840168992f1f82ad51e3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_81.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1157171100 + +//import java.util.zip.CRC32; + +class cl_81 +{ + double var_73 = (-4.79764e+154D); + int var_74 = (1767925968); + byte var_76 = (byte)(107); + long var_127 = (8475768886516257579L); + float var_184 = (-6.91734e-38F); + final boolean [][][] var_192 = {{{true,true,false,false,true,false,false},{false,false,false,true,false,false,true},{false,false,false,true,false,true,false},{false,false,true,false,false,false,true},{false,false,true,false,true,false,false},{false,false,true,true,true,false,false},{false,true,true,false,true,false,true}},{{true,true,true,false,false,true,true},{false,true,false,false,true,true,false},{false,false,false,true,false,false,false},{true,false,true,false,false,false,false},{true,false,true,true,true,true,true},{false,true,true,false,false,true,true},{false,false,false,true,true,false,false}},{{false,false,false,true,false,true,false},{false,true,false,false,true,true,false},{false,true,true,true,true,true,false},{true,false,false,true,true,false,true},{false,false,false,true,false,true,false},{false,false,true,true,true,true,true},{false,true,true,true,true,false,false}},{{true,true,false,true,false,false,false},{false,false,false,false,false,true,false},{true,true,true,false,false,true,false},{false,true,false,false,true,false,false},{false,true,true,false,false,true,true},{false,true,false,true,true,true,false},{false,true,false,false,true,true,false}},{{true,true,false,false,true,false,false},{false,false,true,false,false,false,false},{false,false,false,false,false,false,false},{true,true,true,true,false,false,false},{false,false,true,false,false,false,true},{false,false,true,false,true,false,false},{false,true,false,true,true,true,true}},{{true,false,false,false,true,true,true},{true,false,true,true,false,true,false},{true,false,false,false,false,false,true},{true,false,false,false,false,true,true},{true,true,true,true,false,true,true},{false,true,true,true,true,true,false},{false,false,true,false,true,true,false}}}; + short var_212 = (short)(-1367); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(321); + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + CrcCheck.ToByteArray(this.var_127,b,"var_127"); + CrcCheck.ToByteArray(this.var_184,b,"var_184"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_192[a0][a1][a2],b,"var_192" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_212,b,"var_212"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_89.java b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_89.java new file mode 100644 index 0000000000000000000000000000000000000000..0a6fcc6a0cb9fdc107151932f7f204a3528943a1 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/13500_2018122103678/cl_89.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1157171100 + +//import java.util.zip.CRC32; + +class cl_89 +{ + float [][][] var_72 = {{{(-1.21131e+21F),(-1.1053e-16F),(-8.33178e+34F),(2.72419e-39F),(6.11681e+33F)},{(-4.34248e-29F),(4.79482e+17F),(0.657722F),(2.0259e-17F),(1.08924e-23F)},{(-5.64365e-19F),(97.6529F),(-3.95685e+08F),(2.0632e+37F),(-1.72918e+16F)},{(8.84151e+16F),(-2.21704e+17F),(2.20868e-09F),(-1.08082e+28F),(-6.08663e-25F)},{(0.000106128F),(7.47109e+06F),(2.04534e+27F),(-8.6202e-17F),(6.95345e-12F)}},{{(-2.67362e-24F),(-3.48102e+15F),(-2.41147e+33F),(2.2237e+20F),(-1.4197e-30F)},{(-273.208F),(-2.21018e+35F),(-1.07757e+11F),(441.145F),(-3.62731e-05F)},{(-9.64094e-29F),(-2.3644e-23F),(5.3079e+25F),(3.80908e-37F),(-4.44177e-10F)},{(5.82482e-10F),(5.22059e-14F),(1.07939e-19F),(3.60888e+24F),(5.37293e+09F)},{(-2.78678e+26F),(-1.51145e+18F),(9.59852e+07F),(-6.74729e+25F),(1.90681e-07F)}},{{(-3.90686e-31F),(-4.0583e+21F),(-1.42941e-08F),(1.71939e+15F),(6.90912e-36F)},{(-5.07541e-21F),(2.94065e-28F),(-1.66963e+11F),(1.04079e-35F),(-2.27091e+24F)},{(-4.77289e-30F),(2.49279e+38F),(2.18304e-08F),(-7.62711e-35F),(-3.89035e-19F)},{(-2.61011e-08F),(1.62993e+24F),(-9.6026e-30F),(6.84713e-33F),(-4.04752e-06F)},{(1.90869e+18F),(1.68712e-34F),(-0.235529F),(-3.82783F),(1.58274e-18F)}},{{(4.26107e+28F),(-4.21541e-09F),(-1.61221e+06F),(-1.95432e-12F),(-6.29242e+35F)},{(523.095F),(-1.11551e+08F),(-2.74423e-18F),(5.05849e-29F),(6.60128e-14F)},{(-8.68724e+35F),(2.94132e-10F),(2.42557e+13F),(4.40372e+12F),(4.96645e-28F)},{(-0.00049327F),(1.01005e-06F),(-2.12555e+13F),(-2.24657F),(5.18279e-36F)},{(-1.93714e+18F),(0.257501F),(3.8376e+16F),(2846.32F),(-1.57451e+38F)}}}; + final int var_114 = (1873857947); + short var_121 = (short)(553); + final long var_190 = (986337916653058172L); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(414); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_72[a0][a1][a2],b,"var_72" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + CrcCheck.ToByteArray(this.var_190,b,"var_190"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1433_2018101901169/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/1433_2018101901169/MainClass.java b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..b2d85fc33bda179559aeaa115ff370776fd1ffe2 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/MainClass.java @@ -0,0 +1,253 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3798900212 + +import java.util.zip.CRC32; + +class MainClass +{ + final static cl_6 var_2 = new cl_6(); + static cl_6 var_3 = new cl_6(); + static cl_12 var_9 = new cl_12(); + static byte var_24 = (byte)(-37); + final static byte var_25 = (byte)(121); + static int var_35 = (-1717571889); + static boolean [] var_36 = {false}; + static int var_46 = (-1207869073); + double var_47 = (5.08727e+188D); + static byte var_50 = (byte)(-103); + static float [][][] var_51 = {{{(-1.06678e-06F),(1.38763e+35F),(227.247F),(-1.42302e-15F),(2.2153e-05F),(2.21186e-32F),(9.27424e-11F)},{(2.08657e-19F),(-1.45653e+27F),(3.86673e+10F),(-3.84833e-20F),(-4.85914e-32F),(9.08211e-27F),(-2.02706F)},{(-3.85502e+12F),(1.88205e+17F),(-1.20431e-32F),(3.31719e-10F),(9.46891e+31F),(-2.03298e+20F),(-7.36137e+36F)},{(-3.87542e+22F),(6.308e+10F),(2.66598e-10F),(-8.88015e+13F),(0.00955052F),(-0.000456214F),(-4.2275e+07F)},{(-9.2642e-29F),(-5724.98F),(-7.99928e+18F),(-2.18073e+15F),(8.96943e-27F),(-1.71376e-12F),(-3.51337e+37F)},{(-1.10779e-19F),(2.51917e-29F),(-0.00374927F),(-7.35413e+34F),(-7.8498e-22F),(2.89673e+15F),(-534.633F)},{(0.0010679F),(-11834F),(3.9041e+29F),(3.62786e+36F),(2.50764e-11F),(-2.39871e-20F),(1.20278e-20F)}},{{(5.37164e-15F),(-4.57348e-09F),(-3.03644e-37F),(2.37261e+17F),(-92282.9F),(3.75268e+21F),(2.91376e+30F)},{(-108446F),(-2.2236e-10F),(1.8593e-28F),(2.31449F),(-8.50776e+33F),(-1.08244e+26F),(-1.18964e+14F)},{(3.19862e-21F),(-1.33498e-19F),(-1.09646e-23F),(-1.16523e-26F),(8.4556e+11F),(-3.45369e-34F),(-5.89823e+06F)},{(4.42787e-15F),(-1.63836e+31F),(-9.96475e+24F),(-0.0433826F),(8.00225e-30F),(-4.30999e+12F),(-7.92349e+27F)},{(-0.00171125F),(-4.54196e+19F),(1.45339e-25F),(9.77189e+11F),(3.45285e-36F),(-1.71917e-23F),(-1.35222e+24F)},{(-3.09371e+12F),(2.63368e-17F),(-1.17026e+25F),(5.97715e+15F),(9.60143e+24F),(-1.57026e+21F),(2.98191e+23F)},{(-3.56343e-09F),(7.61662F),(840139F),(-6.24624e+16F),(-0.015985F),(-3.5913e+35F),(2.33659e-21F)}},{{(9.46058e-05F),(-890.489F),(-2.41778e-19F),(-8.94331e-23F),(1.81041e-27F),(-2.28524F),(7.22953e-22F)},{(0.871118F),(1.04557e-07F),(-2.07809e-08F),(-1.06906e+11F),(3.676e+07F),(-3.54474e+22F),(-3.98202e+07F)},{(5.7002e-10F),(5.14305e+17F),(-4.67731e+10F),(-1.14907e+34F),(-1.11805e-13F),(-7.71962e-11F),(-70.4809F)},{(-5.61817e+27F),(-2.48024e+20F),(-2.11287e+24F),(-1.87635e+34F),(1.53765e+29F),(-1.47776e+38F),(-1.98871e+24F)},{(2.07961e-24F),(1.68881e-33F),(-7.87842e-19F),(-6.49563e+15F),(-7.63583e-26F),(-6.60064e-10F),(-0.00742081F)},{(-2.61915e+23F),(3.18749e-12F),(-4.31801e-28F),(-1.07252e-10F),(-0.149113F),(-3.15607e-21F),(3.92382e+30F)},{(-2.08259e-38F),(-7.27439e-38F),(-1.07831e-05F),(1.85628e+34F),(1.77329e-23F),(2.1743e-06F),(-3.00768e+21F)}},{{(4.24073e+20F),(-4.06129e+12F),(8.24235e+20F),(-3.17688e-23F),(-130668F),(-7.2289e-27F),(-7.39855e-38F)},{(2.3542e-15F),(6.48835e-12F),(1.98966e+31F),(-2.85553e+28F),(1.06383e+25F),(9.48664e+12F),(-2.81379e-32F)},{(18340.4F),(-6.85172e+09F),(-9.30841e+24F),(-416.094F),(6.83238e-29F),(1.91703e-36F),(939.073F)},{(1.17452e+14F),(-8.03171e+34F),(-1.15518e-34F),(2.19478e-32F),(-3.82709e-25F),(-6.72072e-07F),(-1.91439e-26F)},{(-7.09161e+08F),(5.59208e-14F),(-1.20367e+22F),(-277849F),(-2.9902e+06F),(-7.60269e+09F),(7.77232e+30F)},{(1.04546e-05F),(-2.75024e-30F),(-1.26456e+07F),(6.69105F),(1.23347e-15F),(-777.485F),(15233.1F)},{(2.08915e-28F),(1.86698e+07F),(-1.25569e-09F),(3.65312e+36F),(4.98744e+32F),(-1.12721e-23F),(-1.58488e-06F)}},{{(1.18971e+07F),(4.00405e+20F),(-1.57164e+18F),(1.06011e-27F),(7.79265e-17F),(1.26492e-19F),(-2.8452e+29F)},{(5.83457e-34F),(1.1482e+35F),(-7469.2F),(3.19529e-22F),(1.6171e-06F),(-53738.3F),(2.9577e-22F)},{(5.83193e-39F),(3.06115e+29F),(-2.18221e-12F),(-2.69816e-18F),(0.0376036F),(-9.15188e-15F),(-3.47262e+08F)},{(-1.80942e+38F),(-0.0319564F),(-1.30207e+15F),(2.67319e-21F),(1.87461e+12F),(-1.14308e-08F),(-3.92858e+36F)},{(1.96433e+10F),(-1.52062e+06F),(1.96778e+36F),(-8.72511e-36F),(6.74325e+22F),(-5.44432e+14F),(-8.47681e+09F)},{(-5.71807e-08F),(-1.28489e+13F),(2.90839e+29F),(2.02351e+13F),(-4.9792e+30F),(-3.76719e+28F),(-4.92693e+07F)},{(-3.10484e-38F),(9.85802e-22F),(2.25565e+34F),(-0.00706959F),(-9.29492e+24F),(-195.555F),(2.78822e-35F)}},{{(-3.38707e+22F),(-6.11825e+11F),(8.81996e+24F),(7.98013e-22F),(-3.07295e-39F),(1.77058e-17F),(-1.74044e+11F)},{(3.46012e+24F),(2.81622e-25F),(3.73608e-27F),(-11078.7F),(1.85336e-38F),(-1520.79F),(2.90248e+18F)},{(2.44664e+19F),(-1.00714e-14F),(1.84842e+15F),(-2.68231e+29F),(-1.054e+21F),(-7.32016e-20F),(-3.59568e-06F)},{(-8.97708e+15F),(4.64513e-17F),(8.37812e+28F),(1.48403e-18F),(-3.20179e+07F),(6.59565e+35F),(-7.48617e-14F)},{(3.52347e-16F),(-4.72548e+33F),(-2.3183e-20F),(7.42875e-16F),(5.07272e+35F),(-36.9055F),(-5.04683e+12F)},{(1.05646e-07F),(4.04356e+27F),(7.66314e-07F),(-2.92243e+28F),(-1.58516e+29F),(-2.14329e+07F),(-1.35245e-27F)},{(-3.91893e+07F),(-3.04076e+08F),(2.46784e+21F),(-3.00495e-10F),(1.37957F),(1.86384e+36F),(2.01587e+38F)}}}; + static byte var_55 = (byte)(-97); + static int var_56 = (-1020676575); + byte var_59 = (byte)(107); + byte var_62 = (byte)(-42); + short var_72 = (short)(16929); + cl_12 var_79 = new cl_12(); + int var_88 = (-1532609251); + float var_89 = (-1.24851e-09F); + short var_93 = (short)(25042); + long var_98 = (5169903097905253256L); +/*********************************/ +public strictfp void run() +{ + int var_0 = (-1194430962); + cl_6 [] var_1 = {new cl_6(),new cl_6(),new cl_6(),new cl_6(),new cl_6(),new cl_6()}; + for( var_0 = 478 ;(var_0<505);var_0 = (var_0+9) ) + { + short var_97 = (short)(32544); + var_1[(var_0&5)] = func_4(((var_97++)&var_98) ,var_9 ,var_9.var_101 ,func_10()) ; + } + return ; +} +public strictfp cl_6 func_4(long var_5, cl_12 var_6, int[][] var_7, cl_12 var_8) +{ + short var_86 = (short)(29905); + byte var_94 = (byte)(37); + cl_6 var_95 = new cl_6(); + try + { + var_8 = func_10() ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_85 ) + { + byte var_87 = (byte)(122); + var_7[((var_87--)&0)][(((var_86--)&var_2.var_43)&2)] = ((var_88--)&var_88) ; + System.out.println("hello exception 0 !"); + } + return func_13((var_89--) ,var_79 ,(var_72++) ,func_13((var_93++) ,var_79 ,(~(var_94--)) ,var_95)); +} +public strictfp cl_12 func_10() +{ + float var_82 = (5.95904e-16F); + int var_11 = (143130509); + for( var_11 = 555 ;(var_11>460);var_11 = (var_11-19) ) + { + final boolean var_12 = true; + try + { + var_3 = func_13(((var_72++)&var_3.var_78) ,var_79 ,(+(var_56--)) ,var_3) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_80 ) + { + try + { + var_2.var_81 = (var_82++) ; + } + catch( java.lang.IllegalArgumentException myExp_83 ) + { + int [][] var_84 = {{(279906333),(-1328656641)},{(1874700458),(2112067771)},{(1280901849),(-2100562391)}}; + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 1 !"); + } + } + return var_79; +} +public strictfp cl_6 func_13(float var_14, cl_12 var_15, long var_16, cl_6 var_17) +{ + float var_61 = (-8.26975e-23F); + short var_71 = (short)(-15010); + boolean [][] var_57 = {{true,true,false,false,true,true,false},{false,true,true,false,true,true,false},{false,false,true,true,false,false,true},{false,false,true,false,true,false,false},{true,true,false,false,true,true,false}}; + byte var_18 = (byte)(-29); + if( (!((var_18--)>func_19(var_57[((var_59--)&4)][(((((var_55--)|( ( int )(var_50--) ))*var_9.var_58)-var_46)&6)] ,((+(++var_61))<=( ( short )(var_62++) )) ,var_36)))) + { + short var_67 = (short)(12192); + try + { + try + { + short var_65 = (short)(11932); + var_56 = (--var_65) ; + } + catch( java.lang.ArithmeticException myExp_66 ) + { + var_51[((var_67++)&5)][((--var_18)&6)][((~(++var_18))&6)] = var_51[5][(((--var_24)+var_9.var_68)&6)][((+(++var_67))&6)] ; + System.out.println("hello exception 3 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_69 ) + { + int var_70 = (1498923209); + for( var_70 = 1014 ;(var_70<1044);var_70 = (var_70+10) ) + { + var_9.var_58 = ((--var_67)-var_9.var_28) ; + } + System.out.println("hello exception 4 !"); + } + } + else + { + try + { + try + { + var_57[(((var_71--)*(short)(27810))&4)][((var_18++)&6)] = (!((++var_62)>=var_72)) ; + } + catch( java.lang.ArithmeticException myExp_73 ) + { + var_57[((+(var_24--))&4)][((--var_18)&6)] = (!((var_18--)<=var_9.var_58)) ; + System.out.println("hello exception 5 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_74 ) + { + if( ( ( boolean )((+((var_35--)|( ( byte )(--var_72) )))==func_19((!((++var_18)<=var_72)) ,((++var_50)=( ( byte )(-(var_24--)) )) ; + } + } + } + catch( java.lang.ArithmeticException myExp_45 ) + { + for( var_46 = 476 ;(var_46<491);var_46 = (var_46+3) ) + { + try + { + final boolean var_48 = true; + } + catch( java.lang.ArithmeticException myExp_49 ) + { + var_22[((+(++var_50))&0)] = var_22[((--var_24)&0)] ; + System.out.println("hello exception 8 !"); + } + } + System.out.println("hello exception 7 !"); + } + return (~(((-(--var_50))-( ( long )var_51[((((++var_55)-var_56)&var_35)&5)][(((--var_54)&var_9.var_28)&6)][(((++var_52)+( ( int )(var_53--) ))&6)] ))*var_2.var_26)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1255); + CrcCheck.ToByteArray(this.var_2.GetChecksum(),b,"var_2.GetChecksum()"); + CrcCheck.ToByteArray(this.var_3.GetChecksum(),b,"var_3.GetChecksum()"); + CrcCheck.ToByteArray(this.var_9.GetChecksum(),b,"var_9.GetChecksum()"); + CrcCheck.ToByteArray(this.var_24,b,"var_24"); + CrcCheck.ToByteArray(this.var_25,b,"var_25"); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_36[a0],b,"var_36" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_51[a0][a1][a2],b,"var_51" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + CrcCheck.ToByteArray(this.var_79.GetChecksum(),b,"var_79.GetChecksum()"); + CrcCheck.ToByteArray(this.var_88,b,"var_88"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + CrcCheck.ToByteArray(this.var_93,b,"var_93"); + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1433_2018101901169/Start.java b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..f676c33b56059f958d780d958b585ddc08c84d09 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_12.java cl_6.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/1433_2018101901169/cl_12.java b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/cl_12.java new file mode 100644 index 0000000000000000000000000000000000000000..a2bd7d56b4e707383828c50bec27cc0a55dd2b35 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/cl_12.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3798900212 + +import java.util.zip.CRC32; + +class cl_12 +{ + short var_28 = (short)(28055); + float var_40 = (10.7531F); + int var_58 = (1598268895); + final byte var_68 = (byte)(-74); + int [][] var_101 = {{(-533542133),(-1360744183),(-267446977)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(23); + CrcCheck.ToByteArray(this.var_28,b,"var_28"); + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_101[a0][a1],b,"var_101" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1433_2018101901169/cl_6.java b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/cl_6.java new file mode 100644 index 0000000000000000000000000000000000000000..742f11d7b968fb33900b3ea01c866a14102d9ebe --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1433_2018101901169/cl_6.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3798900212 + +import java.util.zip.CRC32; + +class cl_6 +{ + long var_26 = (-1629736733382040440L); + boolean var_29 = true; + int [][][] var_37 = {{{(1947132671),(541607880),(943431201),(-1066935381),(-1360057386),(-1265980655)}},{{(758153815),(-641316439),(-1639850109),(-986272874),(-1774835498),(-261727412)}},{{(-651070408),(832375677),(1562998272),(1014336062),(-608694958),(1465221741)}}}; + int var_43 = (614933668); + short var_78 = (short)(6654); + float var_81 = (0.000348065F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(91); + CrcCheck.ToByteArray(this.var_26,b,"var_26"); + CrcCheck.ToByteArray(this.var_29,b,"var_29"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_37[a0][a1][a2],b,"var_37" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1530_2018110810324/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/1530_2018110810324/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1530_2018110810324/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/1530_2018110810324/MainClass.java b/test/testsuite/fuzz_test/fuzz/1530_2018110810324/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..c735297132ccf311122be81af1c92dbafa7143ab --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1530_2018110810324/MainClass.java @@ -0,0 +1,391 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1354424452 + +import java.util.zip.CRC32; + +class MainClass +{ + boolean var_6 = false; + static int var_8 = (-651982272); + static cl_9 var_9 = new cl_9(); + static cl_13 var_13 = new cl_13(); + static byte var_18 = (byte)(70); + static boolean [] var_42 = {false,true,false,false,true,false,true}; + long var_47 = (7507193327288782936L); + static boolean [] var_53 = {true,false,true}; + final long [][][] var_60 = {{{(-696345492676179133L),(967108080453720293L),(831408510128469550L),(7145322662169137071L)},{(6254196916068126259L),(7405466389794836860L),(-8794712907813719946L),(1693156517830809893L)}}}; + byte var_63 = (byte)(47); + byte var_67 = (byte)(-88); + final long [][][] var_73 = {{{(5448330321484841276L),(5982724672558791568L),(7968004272673526402L),(-413894910683812658L)},{(6215500639538485121L),(-7923599535106154863L),(1316607273156821396L),(2596947367809539738L)}}}; + boolean [][] var_75 = {{true,false,false,false,true,true,false},{false,true,false,false,true,false,true},{false,false,true,true,false,false,true},{true,false,false,true,false,true,true},{true,false,false,true,true,false,false},{false,false,false,false,true,true,false},{false,true,false,true,true,false,false}}; + short var_79 = (short)(-19009); + long [] var_85 = {(-3868053580841909857L)}; + long [][][] var_97 = {{{(-5996941125628188605L),(4032257714853566386L),(8494699652577196453L)},{(-6771143898925760199L),(3596187154931457940L),(4015774347492832596L)}},{{(-1956632955523895147L),(2309553791693447615L),(9156362583517826341L)},{(-6813044675141500280L),(-107052197492249034L),(7962631912272539347L)}},{{(-8414374158368623519L),(6699289763536038465L),(873282064257175535L)},{(3573051736863663692L),(-4054047666711114586L),(-3947368578714746919L)}},{{(6512137049410216579L),(-6296780927661357544L),(99492625708143914L)},{(-5527143690428790426L),(5276288992172372564L),(5470942431866253885L)}}}; + float var_106 = (4.28032e-13F); + int var_108 = (1956341953); + int var_110 = (1702042053); + boolean [][][] var_114 = {{{false,false,true,true},{true,false,false,true},{true,true,false,false},{false,false,false,true}}}; + cl_13 var_135 = new cl_13(); + int var_146 = (-341680539); + final int var_154 = (1067045712); + byte var_156 = (byte)(56); + long var_157 = (-2503730861345456701L); + long var_165 = (3276395669326191092L); + int var_178 = (832211398); +/*********************************/ +public strictfp void run() +{ + int var_170 = (-1274373760); + short var_132 = (short)(-31540); + long [][][] var_151 = {{{(866293982969129171L),(5726834352284194457L),(-7745972941438267703L),(437011959514420168L)},{(2509192857210995140L),(-8267273083154492322L),(4844207353307278107L),(8789385756844543554L)}}}; + cl_13 var_140 = new cl_13(); + final long [] var_138 = {(838518350471755068L),(-4520399754347276199L),(1821970866350997166L),(6843634187768847741L),(8119974861868891713L)}; + try + { + double [][][] var_143 = {{{(4.78375e+22D),(2.62445e+100D)}},{{(4.55495e-187D),(-8.0649e-221D)}},{{(2.48557e-172D),(2.12564e-131D)}},{{(7.38591e-77D),(-2.82295e+168D)}}}; + long var_147 = (6965112705412706681L); + byte var_0 = (byte)(48); + long var_148 = (-3247384783153598227L); + long [] var_130 = {(-7623160047600295875L),(-5752998686176722411L),(2392176641214525136L),(-7388911848135814001L),(255481662054426333L)}; + long [] var_137 = {(-5379325828170983438L),(-3896173983436314685L),(2428713408859577860L),(7461473037294450485L),(-8875116681041470026L)}; + byte var_153 = (byte)(66); + byte var_131 = (byte)(84); + if( ((-((var_0++)+func_1(var_130 ,(!(!(!(!(!(((--var_131)-(-576225165))==( ( double )(var_110--) ))))))) ,(-(var_132++)) ,(((--var_18)+func_29(((var_79++)|var_13.var_133) ,func_15(var_135 ,((var_132--)( ( float )func_19(var_138[((var_132++)&4)] ,var_140 ,var_9 ,var_143[(((var_132--)+var_108)&3)][0][((var_108++)&1)]) ))) ,(var_63++) ,(~(var_47++))))*func_1(var_135.var_145 ,(!((var_146--)>var_79)) ,((++var_147)-var_9.var_25) ,(var_148--))) ,var_47 ,var_151 ,(!((((var_18--)|( ( int )var_60[((var_79--)&0)][((var_132--)&1)][((((+(~(+(var_153++))))|var_135.var_56)*var_154)&3)] ))+func_1(var_138 ,(!(!(!((++var_156)!=func_29(((--var_157)+var_47) ,func_15(var_135 ,(!((var_132++)>=var_110))) ,(--var_67) ,(var_146++) ,var_151 ,(!(!(!(!(!(var_63>=var_79))))))))))) ,(var_165--) ,var_138[((var_132--)&4)]))<=var_9.var_168))))-var_79))))802);var_177 = (var_177-16) ) + { + var_140 = var_13 ; + } + } + else + { + for( var_178 = 220 ;(var_178>169);var_178 = (var_178-17) ) + { + var_130[((var_132++)&4)] = (var_147++) ; + } + } + } + catch( java.lang.IllegalArgumentException myExp_179 ) + { + byte var_181 = (byte)(72); + try + { + try + { + var_13 = func_15(var_13 ,((--var_181)!=var_106)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_183 ) + { + cl_9 [][][] var_184 = {{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}},{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}}}; + System.out.println("hello exception 1 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_185 ) + { + long var_186 = (-2005004278102431550L); + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 0 !"); + } + return ; +} +public strictfp short func_1(long[] var_2, boolean var_3, float var_4, long var_5) +{ + cl_13 var_127 = new cl_13(); + byte var_7 = (byte)(124); + try + { + try + { + short var_12 = (short)(-9959); + int var_115 = (1195271201); + if( ((var_7++)>var_8)) + { + cl_13 [] var_11 = {new cl_13(),new cl_13(),new cl_13()}; + cl_13 var_14 = new cl_13(); + var_9 = var_9 ; + long [][][] var_112 = {{{(-1009738580163766289L),(-748936708011542290L),(-3860771447836740502L),(8487884960174630374L)},{(4257645823690221121L),(-8556382073889547866L),(4249936534402347439L),(5437525463194624027L)}}}; + var_11[((+(++var_12))&2)] = func_15(func_15(var_13 ,(!(!((--var_4)<( ( int )func_29(var_47 ,func_15(var_13 ,((var_106--)<=( ( float )(((--var_67)|( ( int )(--var_79) ))&(243881222)) ))) ,(-(--var_108)) ,((var_110++)*var_13.var_44) ,var_112 ,var_114[((var_115--)&0)][((var_115--)&3)][((~(~(var_67--)))&3)]) ))))) ,true) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_119 ) + { + short var_120 = (short)(16042); + try + { + var_2[((~(var_120--))&4)] = ((+(var_7--))-var_9.var_25) ; + } + catch( java.lang.ArithmeticException myExp_121 ) + { + var_7 = (var_7++) ; + System.out.println("hello exception 4 !"); + } + System.out.println("hello exception 3 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_123 ) + { + int var_125 = (1824871349); + try + { + int var_124 = (1179489590); + for( var_124 = 597 ;(var_124>591);var_124 = (var_124-6) ) + { + var_2[((((var_7++)|var_108)|( ( short )((var_18--)|var_110) ))&4)] = (var_125--) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_126 ) + { + try + { + var_13 = var_13 ; + } + catch( java.lang.ArithmeticException myExp_128 ) + { + var_2[(((+(--var_7))&var_108)&4)] = (var_79++) ; + System.out.println("hello exception 7 !"); + } + System.out.println("hello exception 6 !"); + } + System.out.println("hello exception 5 !"); + } + byte var_129 = (byte)(119); + return (--var_129); +} +public strictfp cl_13 func_15(cl_13 var_16, boolean var_17) +{ + byte var_90 = (byte)(94); + int var_102 = (-554907714); + byte var_86 = (byte)(-103); + if( (!((++var_18)=func_29((var_79++) ,var_13 ,(-1129124868346872733L) ,((--var_86)*var_92) ,var_9.var_94 ,((var_79--)257);var_99 = (var_99-6) ) + { + cl_9 var_103 = new cl_9(); + try + { + var_101[((--var_102)&1)] = var_103 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_104 ) + { + var_86 = (var_90++) ; + System.out.println("hello exception 9 !"); + } + } + } + return var_13; +} +public strictfp double func_19(long var_20, cl_13 var_21, cl_9 var_22, double var_23) +{ + float var_84 = (2.94744e+06F); + int var_24 = (-1939091650); + short var_57 = (short)(-203); + for( var_24 = 137 ;(var_24<149);var_24 = (var_24+6) ) + { + long [][] var_59 = {{(-5406104700856116886L),(-5506867589769822127L),(5571875367047591085L),(7522585915440925419L),(2225891006102698702L),(251738307193112727L)},{(-5295211585157922996L),(-457313886339960232L),(-3194989098073609990L),(3040516328693108251L),(5548487631204459627L),(-7367973555240246716L)}}; + short var_76 = (short)(-4591); + short var_78 = (short)(-6766); + try + { + var_20 = (var_20--) ; + int var_66 = (187015165); + cl_9 [][][] var_28 = {{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}},{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}},{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}},{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}},{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}},{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}},{{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()},{new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9(),new cl_9()}}}; + byte var_69 = (byte)(125); + try + { + byte var_61 = (byte)(-21); + short var_26 = (short)(19741); + var_9.var_25 = (var_26++) ; + var_28[((var_57--)&6)][((var_57++)&6)][(((++var_18)&func_29(((var_57++)+var_9.var_58) ,var_13 ,var_9.var_25 ,var_59[((var_18++)&1)][((var_57++)&5)] ,var_60 ,((++var_61)>=(-1.70291e-303D))))&5)] = var_22 ; + } + catch( java.lang.ArithmeticException myExp_62 ) + { + byte var_68 = (byte)(74); + var_28[(((+(var_67--))&var_79)&6)][((~(var_78++))&6)][(((var_63++)-func_29(var_9.var_25 ,var_13 ,var_60[((((var_68++)+var_66)&func_29((++var_66) ,var_13 ,(-((--var_69)|var_63)) ,(var_57++) ,var_13.var_70 ,((var_69++)>var_13.var_55)))&0)][((var_67--)&1)][((var_66++)&3)] ,(((var_67--)+var_9.var_45)|var_63) ,var_73 ,var_75[((~(++var_69))&6)][((--var_76)&6)]))&5)] = var_22 ; + System.out.println("hello exception 10 !"); + } + } + catch( java.lang.ArithmeticException myExp_80 ) + { + try + { + int var_81 = (-1110090378); + } + catch( java.lang.IllegalArgumentException myExp_82 ) + { + boolean [] var_83 = {true,true,false,true,false,true}; + System.out.println("hello exception 12 !"); + } + System.out.println("hello exception 11 !"); + } + } + return (--var_84); +} +public static strictfp byte func_29(long var_30, cl_13 var_31, long var_32, long var_33, long[][][] var_34, boolean var_35) +{ + byte var_43 = (byte)(74); + int var_40 = (1130849766); + short var_41 = (short)(24310); + try + { + cl_9 var_36 = new cl_9(); + try + { + try + { + float [][][] var_38 = {{{(5.96628e-09F),(-2.36103e-15F)},{(10.6889F),(4.14264e-19F)},{(9.48742e-26F),(-8.08532e+32F)},{(-5.11241e-26F),(-2.53405e+15F)}},{{(-8.96028e-22F),(-3.13647e-28F)},{(-1.23087e-38F),(4.57346e-12F)},{(7.59545e+37F),(6.1989e+19F)},{(1.1251e-06F),(-1.65989F)}},{{(-1.17721e-34F),(-1.632e+24F)},{(9.19235e-05F),(-3.0856e-33F)},{(3.69437e+31F),(1.32023e-21F)},{(1.7121e+09F),(-6.4199e+18F)}},{{(9.94122e-08F),(2.63193e+17F)},{(4.57163e+36F),(1.95091e+25F)},{(4.65643e-28F),(-1.29312e+36F)},{(-8.21251e+35F),(-8.49144e+19F)}},{{(1.06285e-20F),(-1.37057e-26F)},{(7.72166e+06F),(-3.13101e+06F)},{(8.2458e+30F),(3.33006e+06F)},{(-6.62216e-05F),(-6.3114e-36F)}}}; + int var_37 = (541776120); + var_9 = var_36 ; + var_9 = var_9 ; + var_9.var_39 = (-2.8689e-25D) ; + var_34[(((var_41++)|var_8)&0)][((--var_40)&1)][((var_18++)&3)] = (var_18--) ; + var_40 = (1357466704) ; + var_42[((var_8--)&6)] = ((--var_43)>=(short)(-2336)) ; + var_42[((~(-(var_41++)))&6)] = (!(!(!((--var_43)>=( ( byte )var_9.var_45 ))))) ; + var_34[((var_43++)&0)][1][(((var_41--)+var_8)&3)] = (var_40++) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_46 ) + { + long var_48 = (7489273184474270436L); + var_13.var_44 = (var_18--) ; + long [][][] var_49 = {{{(-2510569289780576709L),(-3285283264800407594L),(-516625572983761225L),(6544926211114583000L)},{(-3333184921234656510L),(1988813624042143555L),(6113554034399423477L),(7946340449885060501L)}}}; + var_13 = var_13 ; + var_34[((var_41++)&0)][((~(--var_18))&1)][((~(++var_43))&3)] = (var_43--) ; + var_34[0][((+(var_43++))&1)][3] = (++var_33) ; + var_34 = var_49 ; + System.out.println("hello exception 13 !"); + } + } + catch( java.lang.ArithmeticException myExp_50 ) + { + int var_51 = (-591690648); + for( var_51 = 841 ;(var_51>821);var_51 = (var_51-5) ) + { + var_13 = var_13 ; + } + System.out.println("hello exception 14 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_52 ) + { + if( var_53[(((var_43--)+var_43)&2)]) + { + final short var_54 = (short)(-13834); + if( (!((--var_43)>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/1755_2018122012259/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/1755_2018122012259/MainClass.java b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..858069623cd81d47f926eb1893b97df869a8d80e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/MainClass.java @@ -0,0 +1,425 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=432072564 + +//import java.util.zip.CRC32; + +class MainClass +{ + cl_14 var_14 = new cl_14(); + final cl_21 var_87 = new cl_21(); + byte var_88 = (byte)(118); + final cl_12 var_90 = new cl_12(); + cl_18 var_95 = new cl_18(); + cl_26 var_99 = new cl_26(); + final boolean [] var_105 = {false}; + cl_59 var_108 = new cl_59(); + cl_26 [] var_117 = {new cl_26()}; + boolean var_119 = false; + byte var_130 = (byte)(71); + int var_133 = (-359939762); + cl_12 [][][] var_135 = {{{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()}}}; + byte var_137 = (byte)(118); + double var_139 = (8.42417e-147D); + cl_12 var_144 = new cl_12(); + short var_150 = (short)(13559); + int var_163 = (-925268441); + final int var_174 = (1164631921); + byte var_176 = (byte)(-20); +/*********************************/ +public strictfp void run() +{ + short var_168 = (short)(-23737); + if( false) + { + System.out.println(" if stmt begin,id=1 "); + int var_173 = (-758875296); + byte var_180 = (byte)(103); + if( func_0(((var_168--)-( ( long )((var_168--)*var_90.var_128) )) ,(!(!(!(!((--var_150)943);var_182 = (var_182-2) ) + { + var_108 = var_108 ; + } + System.out.println(" if stmt end,id=4 "); + } + System.out.println(" else stmt end,id=1 "); + } + System.out.println(" if stmt end,id=1 "); + } + return ; +} +public strictfp boolean func_0(float var_1, boolean var_2, long var_3, boolean var_4) +{ + int var_5 = (376712924); + int var_166 = (859271439); + short var_159 = (short)(23652); + short var_167 = (short)(-15634); + for( var_5 = 971 ;(var_5<1001);var_5 = (var_5+10) ) + { + cl_14 [][] var_165 = {{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()}}; + byte var_157 = (byte)(-8); + if( func_6((-1465793137) ,var_135 ,func_15(var_87 ,((var_157++)==(-8.45105e+228D))) ,(var_159++))) + { + System.out.println(" if stmt begin,id=5 "); + if( (!((--var_88)<=var_137))) + { + System.out.println(" if stmt begin,id=6 "); + if( false) + { + System.out.println(" if stmt begin,id=7 "); + int var_161 = (-1471970004); + for( var_161 = 705 ;(var_161>667);var_161 = (var_161-19) ) + { + var_14 = var_14 ; + } + System.out.println(" if stmt end,id=7 "); + } + else + { + System.out.println(" else stmt begin,id=2 "); + int var_162 = (49075604); + for( var_162 = 747 ;(var_162<797);var_162 = (var_162+10) ) + { + for( var_163 = 461 ;(var_163<488);var_163 = (var_163+9) ) + { + var_165[((var_157++)&4)][((--var_166)&6)] = func_15(var_87 ,var_87.var_42) ; + } + } + System.out.println(" else stmt end,id=2 "); + } + System.out.println(" if stmt end,id=6 "); + } + System.out.println(" if stmt end,id=5 "); + } + } + return ((-(++var_167))!=var_87.var_51.var_68); +} +public strictfp boolean func_6(int var_7, cl_12[][][] var_8, cl_14 var_9, long var_10) +{ + short var_11 = (short)(-29182); + int var_138 = (-2072778902); + byte var_153 = (byte)(123); + if( (!(!(!(((var_11++)var_87.var_67)))))) + { + System.out.println(" if stmt begin,id=9 "); + int var_134 = (-1383590192); + for( var_134 = 301 ;(var_134<356);var_134 = (var_134+11) ) + { + var_8 = var_135 ; + } + System.out.println(" if stmt end,id=9 "); + } + } + System.out.println(" if stmt end,id=8 "); + } + else + { + System.out.println(" else stmt begin,id=3 "); + final int [] var_142 = {(816744787),(931832911)}; + int var_136 = (944181329); + short var_143 = (short)(-29152); + final cl_12 var_145 = new cl_12(); + for( var_136 = 784 ;(var_136>736);var_136 = (var_136-16) ) + { + if( ((++var_88)!=( ( float )(-(var_137--)) ))) + { + System.out.println(" if stmt begin,id=10 "); + byte var_140 = (byte)(95); + short var_148 = (short)(20148); + try + { + if( ((-(var_138++))>var_139)) + { + System.out.println(" if stmt begin,id=11 "); + if( (!((++var_140)>=( ( double )((+(var_140--))&var_133) )))) + { + System.out.println(" if stmt begin,id=12 "); + var_8 = var_135 ; + System.out.println(" if stmt end,id=12 "); + } + else + { + System.out.println(" else stmt begin,id=4 "); + var_99 = var_99 ; + System.out.println(" else stmt end,id=4 "); + } + System.out.println(" if stmt end,id=11 "); + } + else + { + System.out.println(" else stmt begin,id=5 "); + int var_141 = (-290754793); + for( var_141 = 316 ;(var_141<346);var_141 = (var_141+6) ) + { + var_8[((--var_11)&0)][((~((var_140++)*( ( byte )var_142[((var_88++)&1)] )))&0)][(((++var_11)&( ( short )var_142[((var_143--)&1)] ))&5)] = var_90 ; + } + System.out.println(" else stmt end,id=5 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_146 ) + { + int var_147 = (-1503566565); + try + { + if( (!(!((var_140++)==var_144.var_29)))) + { + System.out.println(" if stmt begin,id=13 "); + var_8[((--var_148)&0)][(((--var_147)*var_133)&0)][((-(++var_140))&5)] = var_144 ; + System.out.println(" if stmt end,id=13 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_149 ) + { + if( ((var_137--)!=var_148)) + { + System.out.println(" if stmt begin,id=14 "); + var_11 = (var_150++) ; + System.out.println(" if stmt end,id=14 "); + } + else + { + System.out.println(" else stmt begin,id=6 "); + var_140 = (byte)(-125) ; + System.out.println(" else stmt end,id=6 "); + } + System.out.println("hello exception 1 !"); + } + System.out.println("hello exception 0 !"); + } + System.out.println(" if stmt end,id=10 "); + } + else + { + System.out.println(" else stmt begin,id=7 "); + var_14 = func_15(var_87 ,(!((--var_138)==( ( float )var_133 )))) ; + System.out.println(" else stmt end,id=7 "); + } + } + System.out.println(" else stmt end,id=3 "); + } + return ((var_153++)<=var_90.var_154); +} +public strictfp float func_12(int var_13) +{ + var_14 = func_15(var_87 ,var_108.var_126) ; + short var_127 = (short)(-9283); + return ((((var_127--)|var_90.var_128)&var_108.var_129)-var_88); +} +public strictfp cl_14 func_15(cl_21 var_16, boolean var_17) +{ + long var_18 = (1723353954118307517L); + boolean [][] var_102 = {{true},{false},{true},{true}}; + float var_93 = (-1.25785e+37F); + byte var_89 = (byte)(-89); + cl_14 var_125 = new cl_14(); + short var_97 = (short)(-15600); + short var_94 = (short)(2832); + int var_113 = (-836430006); + cl_26 [] var_92 = {new cl_26()}; + if( (!((var_18++)>=var_87.func_19((+(((~(++var_88))*var_89)|var_90.var_91)) ,var_92 ,(--var_93) ,(var_94++) ,var_95.var_96 ,((~(--var_97))<(short)(-10355)))))) + { + System.out.println(" if stmt begin,id=15 "); + try + { + try + { + final cl_26 var_100 = new cl_26(); + try + { + var_16 = var_87 ; + if( false) + { + System.out.println(" if stmt begin,id=16 "); + int var_98 = (111089577); + for( var_98 = 1008 ;(var_98>1006);var_98 = (var_98-1) ) + { + var_87.var_51 = var_99 ; + } + System.out.println(" if stmt end,id=16 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_101 ) + { + boolean [] var_104 = {false}; + if( var_102[((var_89++)&3)][((var_88++)&0)]) + { + System.out.println(" if stmt begin,id=17 "); + try + { + var_95.var_103 = var_105 ; + } + catch( java.lang.IllegalArgumentException myExp_106 ) + { + var_16 = var_87 ; + System.out.println("hello exception 3 !"); + } + System.out.println(" if stmt end,id=17 "); + } + else + { + System.out.println(" else stmt begin,id=8 "); + int var_107 = (1685998907); + for( var_107 = 864 ;(var_107>794);var_107 = (var_107-14) ) + { + var_108.var_109 = (+(var_89++)) ; + } + System.out.println(" else stmt end,id=8 "); + } + System.out.println("hello exception 2 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_110 ) + { + cl_18 var_111 = new cl_18(); + var_95 = var_111 ; + System.out.println("hello exception 4 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_112 ) + { + short var_114 = (short)(-1122); + cl_26 var_120 = new cl_26(); + if( var_102[((-(++var_94))&3)][((var_113++)&0)]) + { + System.out.println(" if stmt begin,id=18 "); + try + { + if( ((!(!((~(var_114--))!=var_108.var_115)))!=var_87.var_42)) + { + System.out.println(" if stmt begin,id=19 "); + if( var_87.var_42) + { + System.out.println(" if stmt begin,id=20 "); + boolean var_116 = false; + System.out.println(" if stmt end,id=20 "); + } + else + { + System.out.println(" else stmt begin,id=9 "); + var_92 = var_117 ; + System.out.println(" else stmt end,id=9 "); + } + System.out.println(" if stmt end,id=19 "); + } + else + { + System.out.println(" else stmt begin,id=10 "); + int var_118 = (-2132729787); + for( var_118 = 556 ;(var_118>542);var_118 = (var_118-7) ) + { + var_92[(var_118&0)] = var_99 ; + } + System.out.println(" else stmt end,id=10 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_121 ) + { + var_92 = var_117 ; + System.out.println("hello exception 6 !"); + } + System.out.println(" if stmt end,id=18 "); + } + else + { + System.out.println(" else stmt begin,id=11 "); + int var_122 = (-317399210); + for( var_122 = 401 ;(var_122>347);var_122 = (var_122-18) ) + { + try + { + int var_123 = (1157136466); + for( var_123 = 735 ;(var_123<810);var_123 = (var_123+15) ) + { + var_92[((var_89++)&0)] = var_99 ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_124 ) + { + var_14.var_59 = (var_97--) ; + System.out.println("hello exception 7 !"); + } + } + System.out.println(" else stmt end,id=11 "); + } + System.out.println("hello exception 5 !"); + } + System.out.println(" if stmt end,id=15 "); + } + return var_125; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(140); + CrcCheck.ToByteArray(this.var_14.GetChecksum(),b,"var_14.GetChecksum()"); + CrcCheck.ToByteArray(this.var_87.GetChecksum(),b,"var_87.GetChecksum()"); + CrcCheck.ToByteArray(this.var_88,b,"var_88"); + CrcCheck.ToByteArray(this.var_90.GetChecksum(),b,"var_90.GetChecksum()"); + CrcCheck.ToByteArray(this.var_95.GetChecksum(),b,"var_95.GetChecksum()"); + CrcCheck.ToByteArray(this.var_99.GetChecksum(),b,"var_99.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_105[a0],b,"var_105" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_108.GetChecksum(),b,"var_108.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_117[a0].GetChecksum(),b,"var_117" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_119,b,"var_119"); + CrcCheck.ToByteArray(this.var_130,b,"var_130"); + CrcCheck.ToByteArray(this.var_133,b,"var_133"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_135[a0][a1][a2].GetChecksum(),b,"var_135" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_137,b,"var_137"); + CrcCheck.ToByteArray(this.var_139,b,"var_139"); + CrcCheck.ToByteArray(this.var_144.GetChecksum(),b,"var_144.GetChecksum()"); + CrcCheck.ToByteArray(this.var_150,b,"var_150"); + CrcCheck.ToByteArray(this.var_163,b,"var_163"); + CrcCheck.ToByteArray(this.var_174,b,"var_174"); + CrcCheck.ToByteArray(this.var_176,b,"var_176"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1755_2018122012259/Start.java b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..f31a41a3294a5f341ed66f28caf10dc69d4e4940 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_12.java cl_14.java CRC32.java cl_59.java cl_18.java cl_26.java CrcCheck.java cl_21.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_12.java b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_12.java new file mode 100644 index 0000000000000000000000000000000000000000..4dc98b035e54e7962128fbb6f03073352b71f86d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_12.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=432072564 + +//import java.util.zip.CRC32; + +class cl_12 +{ + double var_29 = (2.33386e-87D); + long var_91 = (-4311034324853907443L); + int var_128 = (1833873813); + float var_154 = (-1.85331e+34F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(24); + CrcCheck.ToByteArray(this.var_29,b,"var_29"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + CrcCheck.ToByteArray(this.var_128,b,"var_128"); + CrcCheck.ToByteArray(this.var_154,b,"var_154"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_14.java b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_14.java new file mode 100644 index 0000000000000000000000000000000000000000..0545932944e79611ec07943b9f31a87c5d94d698 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_14.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=432072564 + +//import java.util.zip.CRC32; + +class cl_14 +{ + long var_59 = (2859749004757642607L); + byte var_78 = (byte)(114); + int var_83 = (1792225659); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(13); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_18.java b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_18.java new file mode 100644 index 0000000000000000000000000000000000000000..2ab2ea8a6992100dcaaaba57f2ebedeca8295c6b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_18.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=432072564 + +//import java.util.zip.CRC32; + +class cl_18 +{ + double var_45 = (6.55696e-178D); + int var_49 = (588681790); + long var_96 = (7077514783226818085L); + boolean [] var_103 = {true}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(21); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_103[a0],b,"var_103" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_21.java b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_21.java new file mode 100644 index 0000000000000000000000000000000000000000..3806422ba89b83650c3c047b8bb2a9a48410b8b2 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1755_2018122012259/cl_21.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=432072564 + +//import java.util.zip.CRC32; + +class cl_21 +{ + static cl_12 var_28 = new cl_12(); + cl_12 var_40 = new cl_12(); + static boolean var_42 = true; + static short var_43 = (short)(-24088); + static cl_18 var_44 = new cl_18(); + static float [] var_47 = {(-1.97785e+25F)}; + static cl_26 var_51 = new cl_26(); + static cl_18 [][][] var_54 = {{{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()}},{{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()}},{{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()}},{{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()},{new cl_18(),new cl_18()}}}; + static cl_18 var_55 = new cl_18(); + final static cl_14 var_58 = new cl_14(); + final static byte var_60 = (byte)(5); + static byte var_64 = (byte)(110); + static int var_67 = (-560898058); + static cl_59 var_70 = new cl_59(); + static double var_79 = (5.00289e+08D); +/*********************************/ +public static strictfp short func_19(double var_20, cl_26[] var_21, float var_22, int var_23, long var_24, boolean var_25) +{ + int var_26 = (-47521808); + float var_27 = (-9.59024e-16F); + for( var_26 = 435 ;(var_26<438);var_26 = (var_26+1) ) + { + short var_82 = (short)(20215); + var_27 = (var_22--) ; + if( ((--var_23)=var_67))) ,(-86626816))) + { + System.out.println(" if stmt begin,id=22 "); + var_51 = var_51 ; + System.out.println(" if stmt end,id=22 "); + } + else + { + System.out.println(" else stmt begin,id=12 "); + final boolean var_86 = true; + System.out.println(" else stmt end,id=12 "); + } + System.out.println(" if stmt end,id=21 "); + } + } + return var_43; +} +public static strictfp boolean func_30(boolean var_31, boolean var_32, int var_33, boolean var_34, int var_35) +{ + int var_36 = (1820414016); + cl_18 var_72 = new cl_18(); + for( var_36 = 705 ;(var_36>630);var_36 = (var_36-15) ) + { + short var_66 = (short)(-9042); + byte var_48 = (byte)(64); + boolean [][][] var_69 = {{{false,true,false,true,false,false}},{{false,true,true,true,true,true}},{{true,true,true,true,true,true}}}; + try + { + float [] var_62 = {(6.35446e-38F),(1.20418e-10F)}; + try + { + int var_37 = (-1126790686); + for( var_37 = 796 ;(var_37<800);var_37 = (var_37+2) ) + { + int var_38 = (-393683137); + for( var_38 = 438 ;(var_38<474);var_38 = (var_38+12) ) + { + cl_12 var_52 = new cl_12(); + int var_39 = (857483913); + final cl_18 var_57 = new cl_18(); + for( var_39 = 176 ;(var_39<214);var_39 = (var_39+19) ) + { + final cl_12 var_41 = new cl_12(); + cl_18 var_56 = new cl_18(); + final int [] var_50 = {(1159667867),(478278544),(-2061929828),(1291732527),(1162239653)}; + var_28 = var_28 ; + var_31 = (!(!((++var_43)<=var_44.var_45))) ; + var_47[((var_43++)&0)] = ((~(var_48--))-var_44.var_49) ; + final cl_18 var_53 = new cl_18(); + var_28 = var_52 ; + var_54[(var_37&3)][(var_38&5)][(var_39&1)] = var_44 ; + var_58.var_59 = ((var_48--)|var_60) ; + var_62[((var_48--)&1)] = (-(++var_64)) ; + } + } + } + } + catch( java.lang.IllegalArgumentException myExp_65 ) + { + if( (!(!(((var_66--)&( ( long )(((var_48++)+var_67)-var_51.var_68) ))==(1677977800))))) + { + System.out.println(" if stmt begin,id=23 "); + if( var_69[((--var_33)&2)][(((-(--var_48))+(short)(-30416))&0)][((var_66--)&5)]) + { + System.out.println(" if stmt begin,id=24 "); + if( ((--var_64)>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/MainClass.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..2cf959d9bb029e9d7a9a0a20ad38946d5006f2c2 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/MainClass.java @@ -0,0 +1,1124 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1973468952 + +//import java.util.zip.CRC32; + +class MainClass +{ + static short var_3 = (short)(24045); + static float var_4 = (1.47074e-10F); + static double var_5 = (2.40031e-36D); + static int var_6 = (1423488151); + static boolean [][][] var_9 = {{{true,true,false,false,true},{true,false,false,true,false}},{{false,false,true,true,true},{true,true,true,false,false}},{{true,true,false,false,true},{true,false,true,false,true}},{{true,false,true,false,true},{true,false,true,true,true}},{{false,true,true,true,false},{false,true,true,false,false}},{{true,true,true,false,true},{false,false,false,false,true}}}; + int var_18 = (195629663); + static int var_19 = (2052211216); + static byte var_28 = (byte)(-74); + static int var_47 = (-1957790492); + static cl_52 var_57 = new cl_52(); + static cl_44 var_62 = new cl_44(); + static cl_86 var_64 = new cl_86(); + static byte var_67 = (byte)(-34); + static float [] var_70 = {(-3.60165e+26F)}; + static cl_90 var_71 = new cl_90(); + static boolean [][] var_75 = {{true,true,false,true,true}}; + static long var_78 = (7054180737562127253L); + static byte var_79 = (byte)(112); + final static cl_21 var_82 = new cl_21(); + static cl_60 var_95 = new cl_60(); + static int var_100 = (-717735157); + static cl_21 var_103 = new cl_21(); + static float var_108 = (7.94955e-38F); + final static boolean var_110 = false; + static cl_86 var_123 = new cl_86(); + static double var_128 = (2.85558e+177D); + static int var_135 = (-551480618); + float [] var_152 = {(-2.53401e-20F)}; + long var_167 = (2338669023822526278L); + float [] var_170 = {(0.000223461F)}; + int [][] var_206 = {{(1116244365),(597558811),(-2097247358),(-2115700618),(-106563984),(558694845)},{(-1252271879),(-1064809239),(569063434),(-942349908),(-523532506),(-1104460234)},{(-270162785),(-1705183986),(1680638072),(1168430870),(1342614225),(389800236)},{(-965280543),(-2138125842),(-2137107671),(-1341175926),(1288631839),(1527019991)},{(538834591),(1642186773),(-1620188253),(-225582009),(-643681924),(124847714)},{(-1323991411),(-1809523472),(-1728026546),(243771385),(-166947664),(1912485270)}}; + short var_222 = (short)(30525); + byte var_226 = (byte)(108); + int var_228 = (-1606023540); + byte var_235 = (byte)(-92); + short var_237 = (short)(-4675); + byte var_238 = (byte)(-115); + int var_251 = (1844322740); + byte var_256 = (byte)(62); + cl_21 var_270 = new cl_21(); + int var_272 = (438375027); + final boolean var_277 = false; + short var_289 = (short)(-15008); + byte var_291 = (byte)(12); + short var_299 = (short)(-32262); + short var_304 = (short)(-13120); + short var_306 = (short)(26209); + long var_326 = (-3379501815843794963L); + float [] var_330 = {(9.40917e+14F)}; + int [][][] var_348 = {{{(-926403576),(-426472226),(476158049),(-314998542),(1035688850),(-655448612)},{(746896441),(637309437),(433270682),(432196959),(-1684500444),(137259530)},{(1280953627),(580480353),(171956327),(711289646),(1533124158),(429464808)},{(-1135394161),(-1808641012),(1014581935),(-97240346),(378486856),(-455761244)},{(-1329468706),(1146668504),(253559229),(1610053226),(-756260798),(427200200)},{(249421174),(1707582380),(-465349387),(673169812),(648208228),(371201451)}},{{(668524083),(-1186023020),(665640251),(-1747636662),(-1780951692),(-38041708)},{(-1038322868),(356607701),(-336526969),(962815616),(-33777067),(726058883)},{(-1830785444),(-1895963989),(1950836341),(1220968110),(-1007003765),(-96945335)},{(-1072489878),(-1952749044),(-720492539),(-711651843),(-1236716098),(1897990082)},{(895692132),(-1262689925),(-527079593),(271744696),(-1958112483),(539104691)},{(658730483),(-1057995320),(-771075983),(415264484),(-1084894006),(-1413113358)}}}; + int var_361 = (-225619404); + final int [][][] var_371 = {{{(831945918),(596766226),(1947139000),(-52954513),(1865848185),(2027226478)},{(-2129943413),(-1218975963),(-1043236338),(1379535348),(-616355624),(-42363523)},{(1553505644),(1972365746),(-1006477644),(1443361758),(-2099037998),(99102743)},{(-774032274),(166566109),(-240876817),(85863441),(-919895969),(-1018527979)},{(1801209620),(-993122587),(-57644264),(1675552027),(1024990426),(2145449579)},{(139235737),(-50657380),(571557417),(454405247),(-831309833),(1532510460)}},{{(-1076146946),(404781998),(-1299453562),(1108628217),(691978867),(-1704593503)},{(-163905742),(-957540825),(1996999306),(1064156445),(-925231743),(763838896)},{(528951402),(-1911748655),(-134775444),(29303469),(437672722),(1470826715)},{(2075360115),(1388590586),(-981560894),(-717873694),(1351255016),(-14231280)},{(-1865804624),(-1426878141),(273517141),(-1691501664),(-571492165),(-497047217)},{(1451769018),(-1610449327),(1734012539),(-765494897),(190776475),(1692604241)}}}; + double var_413 = (-2.57956e-26D); + boolean [][][] var_431 = {{{false,true,false,false,true,true,false},{false,false,false,true,true,false,false}},{{false,false,true,false,false,false,true},{true,true,true,false,true,false,false}},{{true,false,false,true,true,false,false},{false,true,true,false,true,false,false}},{{true,false,false,false,true,false,false},{false,true,true,false,true,true,true}},{{false,true,false,true,false,false,true},{false,true,false,true,false,true,true}},{{false,true,false,true,false,true,true},{true,false,false,false,false,true,true}}}; + byte var_436 = (byte)(34); + int [] var_441 = {(2124625739),(1718215587),(-1144295179),(-271614988),(2104819716)}; + cl_44 var_443 = new cl_44(); + int var_447 = (533477902); + byte var_451 = (byte)(123); + short var_452 = (short)(-3653); + float [] var_456 = {(-3.05234e+08F)}; + int var_461 = (-814975512); + double [][][] var_464 = {{{(-2.86261e+43D),(2.29027e+61D),(8.16839e+71D),(-6.71494e+124D),(-1.80938e+280D),(-2.29853e+294D),(-3.09876e+285D)},{(7.12043e-234D),(6.03516e+68D),(4.51249e-53D),(-7.93684e+135D),(-4.72369e+139D),(1.28507e+305D),(-6.17159e+29D)},{(6.96284e+213D),(-1.60675e-21D),(-8.29906e-102D),(1.08777e+216D),(1.05247e+16D),(-5.8056e-97D),(2.84247e+44D)},{(1.00783e-242D),(-1.17766e-214D),(-1.48984e+123D),(2.75184e+119D),(1.6684e-211D),(3.4342e-98D),(5.16966e+242D)},{(-1.98439e-161D),(5.21205e-135D),(-1.20447e-139D),(-2.56457e+90D),(-6.9979e-279D),(3.42898e+281D),(1.12522e+222D)},{(-3.99494e+257D),(-8.06238e+82D),(-3.92365e+118D),(-8.77962e+195D),(-1.08518e+184D),(-2.60914e+263D),(9.9853e-124D)},{(-1.06317e+27D),(-4.30114e-77D),(-9.29151e+13D),(-8.36022e+14D),(1.04937e-113D),(3.13895e-206D),(1.65579e+184D)}},{{(-1.22179e+107D),(1.41757e-282D),(2.62144e+303D),(-2.66778e-29D),(-3.28913e+103D),(-1.58807e-240D),(-8.44485e-255D)},{(-1.54916e-139D),(1.3911e+241D),(5.14248e+47D),(1.11983e-264D),(-2.7417e-214D),(1.02235e-72D),(-1.22053e-273D)},{(1.82911e-280D),(3.50478e+194D),(-1.28327e-271D),(-1.02916e+65D),(-6.33132e+102D),(-1.38337e+195D),(1.10755e+244D)},{(6.78062e+283D),(-2.53811e+53D),(2.66465e+45D),(2.21141e-62D),(0.000428934D),(4.02726e+40D),(1.25684e-285D)},{(5.55734e+199D),(1.07205e-184D),(2.45952e-220D),(-1.70339e+22D),(-9.51065e-160D),(-7.60174e-273D),(-5.30377e-84D)},{(2.83054e-208D),(-8.21133e-51D),(-7.03945e+143D),(2.85085e+277D),(-9.89827e+172D),(3.34637e-177D),(-1.18276e+20D)},{(-4.36334e-247D),(1.96919e-82D),(-5.94943e-186D),(5.37024e-174D),(-7.99928e+35D),(1.25056e+247D),(-1.57974e-83D)}},{{(-3.04543e-199D),(9.81253e-284D),(8.78641e-145D),(-1.1074e-45D),(5.73152e+124D),(-7.81211e-271D),(-1.5896e+190D)},{(-4.729e+13D),(4.99743e+223D),(2.4264e+61D),(8.83623e+160D),(-3.12519e-245D),(2.26958e+171D),(2.38082e-62D)},{(-5.19634e-171D),(3.38195e+29D),(-1.90071e-274D),(6.74551e-20D),(6.70499e-224D),(-3.92594e+286D),(-9.31906e+64D)},{(5.41825e+172D),(8.00121e-249D),(-1.23259e+123D),(-5.30704e-45D),(1.34187e-128D),(-60341.1D),(4.10114e-258D)},{(3.07878e-261D),(1.28884e-73D),(2.48825e+252D),(-6.01859e+194D),(1.07952e+62D),(2.11776e-262D),(2.46359e+268D)},{(3.92297e+52D),(3.50485e+263D),(2.33953e+297D),(1.9564e+265D),(1.22396e+256D),(-1.25966e+156D),(6.19109e+209D)},{(4.5864e+140D),(4.28672e+130D),(1.01994e+08D),(-1.01746e+41D),(-2.86495e+82D),(-1.03658e-10D),(-1.1191e+78D)}},{{(1.0424e-74D),(1.45822e-71D),(-2.37017e+244D),(-7.91362e+169D),(-7.69138e+230D),(6.50523e+211D),(-8.35009e+98D)},{(3.39389e-67D),(1.76961e+123D),(-7.8247e-125D),(4.86127e-198D),(-5.11087e+156D),(4.15064e+89D),(-6.01725e+17D)},{(-8.02392e-53D),(-2.45008e+302D),(4.39132e+99D),(3.75651e+142D),(7.30294e+47D),(-6.19451e+224D),(-2.71745e+129D)},{(-5.31787e-22D),(-1.11957e+124D),(9.93759e+224D),(-16.0506D),(2.02726e+119D),(2.88891e-231D),(-7.92241e+272D)},{(5.57966e+196D),(-1.10164e-82D),(-6.52913e+31D),(3.64647e+172D),(-5.19824e+248D),(1.31134e+57D),(1.18882e-11D)},{(-6.20964e-65D),(2.70194e-299D),(6.85703e+196D),(1.02652e+68D),(4.32092e+269D),(-6.0185e-191D),(-1.60528e-220D)},{(-6.99784e-183D),(-8.1918e+61D),(2.56505e-98D),(1.83999e-221D),(-1.08655e-235D),(1.07556e+108D),(1.80557e-239D)}},{{(-1.03518e+110D),(-2.46795e+69D),(-2.0389e-39D),(1.20313e-215D),(-5.13818e+79D),(-9.52713e-142D),(-1.00288e-15D)},{(6.71536e+150D),(-1.31934e+221D),(1.86445e-21D),(-5.25443e+204D),(-9.83599e+14D),(7.34333e-15D),(-2.10868e-291D)},{(5.8578e+72D),(-9.73422e-150D),(3.60241e-204D),(3.78961e+266D),(-3.84113e+177D),(-1.89826e-214D),(-7.02238e-219D)},{(2.4311e+222D),(-3.00927e+220D),(7.42126e+283D),(-2.79436e+169D),(-7.50999e-227D),(1.65302e+162D),(1.52848e-155D)},{(5.33655e+60D),(4.59388e-246D),(-5.68927e+173D),(-1.08394e+52D),(-2.42202e-276D),(4.97943e-260D),(6.22499e+77D)},{(-1.13019e+57D),(-5.3753e+54D),(-8.62392e-73D),(-1.86916e+114D),(6.52197e+108D),(-5.07944e-13D),(5.09095e-174D)},{(-3.68851e-77D),(-6.73079e+24D),(-3.63416e+297D),(1.63066e-156D),(-1.22883e-254D),(-4.3537e+245D),(-1.41225e+146D)}}}; + boolean var_466 = false; + short var_469 = (short)(-19281); + cl_60 var_476 = new cl_60(); + byte [][][] var_491 = {{{(byte)(27)},{(byte)(69)},{(byte)(109)},{(byte)(57)},{(byte)(111)}},{{(byte)(5)},{(byte)(-27)},{(byte)(-78)},{(byte)(-99)},{(byte)(-61)}},{{(byte)(92)},{(byte)(-38)},{(byte)(86)},{(byte)(-115)},{(byte)(-80)}},{{(byte)(-79)},{(byte)(101)},{(byte)(-78)},{(byte)(27)},{(byte)(127)}},{{(byte)(22)},{(byte)(-39)},{(byte)(112)},{(byte)(-51)},{(byte)(102)}},{{(byte)(7)},{(byte)(0)},{(byte)(91)},{(byte)(62)},{(byte)(75)}},{{(byte)(-50)},{(byte)(-24)},{(byte)(-9)},{(byte)(-30)},{(byte)(12)}}}; + final int [] var_497 = {(564686164),(-245584685),(-1241088423),(1126814150),(-1959236296),(-642488434),(-573820288)}; + long var_513 = (-8723112491682663936L); + byte var_522 = (byte)(-65); + cl_52 var_539 = new cl_52(); + int var_580 = (1031013951); + double [][] var_587 = {{(-3.5617e-66D),(-3.55134e-11D),(2.25059e-206D),(-5.56713e+47D),(3.57908e+118D)},{(-6.1902e+141D),(-2.96763e+158D),(4.94394e-116D),(-4.44156e+11D),(-4.52447e-197D)},{(-1.31405e+43D),(2.70526e+122D),(3.17467e+256D),(-1.75356e+81D),(4.10074e+154D)},{(1.33504e-76D),(-2.12837e-244D),(-3.40691e+170D),(-1.14658e+182D),(-2.00757e-122D)},{(1.57182e+130D),(-2.35536e-117D),(1.0628e-18D),(-3.08961e-244D),(-3.70498e-180D)},{(2.46904e-286D),(-5.00625e-244D),(2.17026e-25D),(2.30294e-05D),(1.21371e+216D)}}; + int var_592 = (-2099905593); + short var_593 = (short)(-15417); + int var_596 = (1044698049); +/*********************************/ +public strictfp void run() +{ + double [][] var_574 = {{(5.97425e-133D),(-1.54638e-197D),(1.1473e+138D),(-2.28835e-144D),(1.17062e-94D)},{(-6.74681e-84D),(-1.5765e-17D),(2.65394e+61D),(9.74907e-113D),(-8.93896e+122D)},{(1.73016e+84D),(-2.98001e+28D),(2.21527e+142D),(-2.24748e-265D),(4.89928e+52D)},{(-5.6676e+202D),(8.36629e+31D),(7.77032e-305D),(7.88006e+115D),(2.05144e+241D)},{(3.36177e-06D),(3.84221e+239D),(7.1179e-88D),(-4.9328e-39D),(-3.17626e+38D)},{(-1.21503e+94D),(-8.97738e+289D),(5.11823e-129D),(3.06401e+286D),(-8.44579e+10D)}}; + try + { + int var_0 = (-98262463); + cl_21 var_523 = new cl_21(); + long var_570 = (6847284157772119009L); + short var_546 = (short)(-6420); + float [] var_558 = {(2.06487e-33F),(1.47145e+38F),(4.09936e+30F),(-0.000139721F),(5.12943e+33F),(-2.67636e-20F),(-4.82564e+23F)}; + for( var_0 = 850 ;(var_0<878);var_0 = (var_0+7) ) + { + float var_543 = (-2.46075e-13F); + byte var_566 = (byte)(-27); + int [][][] var_567 = {{{(-2036382084),(139012750),(-1601703262),(1069511848),(-1323146484)},{(1812438859),(1687095775),(-482772015),(1237773567),(-876780216)},{(-306833106),(-1371995616),(1980485335),(362181749),(-121619298)},{(-986030799),(55823191),(-604868040),(1511332775),(-274938352)},{(-96742734),(-864106043),(-1862063),(-1795960567),(310038420)},{(-1279137568),(-820556474),(-2096175893),(-1926703484),(2002797320)},{(315114374),(-1217321672),(-1039467232),(1031494185),(1793341700)}},{{(-1317743592),(-1379759315),(1811350263),(-1852900657),(1807169493)},{(-154486135),(-351594880),(-1541068077),(281899727),(-1666030588)},{(-1760958052),(-563269682),(964796526),(-848580951),(1803285310)},{(1629709186),(985099617),(-184759926),(-1215338794),(-693255504)},{(-301762604),(908704194),(640099872),(1692604779),(1170037577)},{(-1353003222),(1331866165),(-776998628),(-540546615),(-1656490044)},{(917380534),(-3433078),(-445283331),(-389132212),(-653938204)}},{{(1125920275),(-198031366),(26423064),(-1400065427),(-974114602)},{(-1229553006),(268456305),(-2044527415),(1916279140),(1161996689)},{(-1700387577),(1059068422),(754026796),(-284739838),(-1960859712)},{(1487840690),(1854936729),(1268623326),(46180453),(-1828755647)},{(-2050300794),(445345216),(-948112812),(314723793),(1117163002)},{(1553289733),(-555196293),(164185775),(1962052836),(-846812814)},{(-150998493),(-1714926745),(-1964666396),(-1980240416),(715660778)}}}; + try + { + double var_553 = (1.15655e-269D); + long var_2 = (5205914042998175611L); + int var_1 = (-288509350); + for( var_1 = 155 ;(var_1>103);var_1 = (var_1-13) ) + { + byte var_10 = (byte)(-116); + int var_531 = (-876368943); + cl_44 var_563 = new cl_44(); + try + { + if( (!(((var_2++)+var_3)<(byte)(123)))) + { + int var_7 = (-1988025450); + var_5 = (var_2--) ; + short var_545 = (short)(20101); + var_2 = (var_2--) ; + var_9[((var_531++)&5)][(((~(--var_545))*var_64.var_86.var_164)&1)][((((var_10++)-func_11(var_523 ,((var_306--)-func_29((var_10++) ,(--var_10) ,(var_2++) ,var_71.var_105.var_63 ,(--var_2) ,var_371 ,(++var_531))) ,((((--var_222)&var_289)-( ( short )(--var_10) ))*var_361) ,(-3.33147e+29F)))+func_29((var_451++) ,((--var_238)*( ( short )(var_10--) )) ,(var_413++) ,var_539 ,(var_10++) ,var_348 ,(var_543++)))&4)] = (((--var_546)*( ( long )(var_2++) ))>=func_29((-197269467) ,((++var_543)-var_82.var_89) ,((--var_10)|var_95.var_164) ,var_71.var_105.var_63 ,(var_546++) ,var_371 ,((var_10++)+var_553))) ; + } + } + catch( java.lang.IllegalArgumentException myExp_555 ) + { + try + { + var_10 = (++var_10) ; + } + catch( java.lang.ArithmeticException myExp_556 ) + { + var_558[((+(var_10++))&6)] = ((var_10++)|func_21((!(!((~(--var_10))<=var_4))) ,var_431 ,(var_546--) ,var_441 ,var_563)) ; + System.out.println("hello exception 1 !"); + } + System.out.println("hello exception 0 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_565 ) + { + try + { + if( (((var_566++)+( ( double )var_567[(((++var_566)|func_11(var_71.var_105.var_73 ,(-(-(var_566++))) ,(++var_570) ,(++var_67)))&2)][(((var_546--)&var_447)&6)][((var_546--)&4)] ))!=var_361)) + { + if( func_37((-(++var_566)) ,var_574)) + { + var_291 = (var_436--) ; + } + } + else + { + try + { + long var_576 = (7167085621504279969L); + } + catch( java.lang.ArithmeticException myExp_577 ) + { + int var_578 = (-1203710495); + System.out.println("hello exception 3 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_579 ) + { + for( var_580 = 834 ;(var_580>822);var_580 = (var_580-6) ) + { + try + { + var_558[((++var_546)&6)] = (-1.91107e-06F) ; + } + catch( java.lang.ArithmeticException myExp_581 ) + { + int var_582 = (141868267); + var_574[((var_582++)&5)][((~(var_566--))&4)] = (var_566--) ; + System.out.println("hello exception 5 !"); + } + } + System.out.println("hello exception 4 !"); + } + System.out.println("hello exception 2 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_583 ) + { + try + { + boolean var_584 = true; + } + catch( java.lang.IllegalArgumentException myExp_585 ) + { + int var_586 = (1330172524); + for( var_586 = 354 ;(var_586>310);var_586 = (var_586-11) ) + { + try + { + try + { + try + { + var_574 = var_587 ; + } + catch( java.lang.ArithmeticException myExp_589 ) + { + final boolean var_590 = true; + System.out.println("hello exception 8 !"); + } + } + catch( java.lang.ArithmeticException myExp_591 ) + { + for( var_592 = 440 ;(var_592<508);var_592 = (var_592+17) ) + { + var_128 = ((var_593--)+var_64.var_86.var_87) ; + } + System.out.println("hello exception 9 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_594 ) + { + byte var_595 = (byte)(-63); + if( (!((--var_595)>=var_5))) + { + for( var_596 = 207 ;(var_596<263);var_596 = (var_596+14) ) + { + var_574 = var_587 ; + } + } + System.out.println("hello exception 10 !"); + } + } + System.out.println("hello exception 7 !"); + } + System.out.println("hello exception 6 !"); + } + return ; +} +public strictfp int func_11(cl_21 var_12, int var_13, long var_14, float var_15) +{ + boolean [][][] var_511 = {{{true,false,true,true,true,true,true},{false,false,false,false,false,false,true}},{{true,false,true,true,true,true,true},{true,false,false,false,true,false,true}},{{true,false,true,false,false,false,false},{true,true,true,true,false,true,false}},{{false,false,true,false,true,true,false},{true,true,false,false,true,true,true}},{{false,false,true,false,false,true,true},{true,false,false,true,false,true,false}},{{false,false,true,true,true,false,false},{false,true,true,true,true,false,false}}}; + try + { + int var_16 = (-1960694346); + int [] var_449 = {(-1536016182)}; + for( var_16 = 1012 ;(var_16>942);var_16 = (var_16-14) ) + { + boolean var_17 = false; + byte var_20 = (byte)(45); + for( var_18 = 480 ;(var_18>430);var_18 = (var_18-10) ) + { + for( var_19 = 255 ;(var_19<330);var_19 = (var_19+15) ) + { + short var_437 = (short)(-23717); + try + { + if( ((++var_20)==func_21((!(((--var_437)|( ( int )(var_306--) ))==var_13)) ,var_431 ,(((var_20++)+( ( int )(var_20--) ))-var_123.var_65.var_91) ,var_441 ,var_443))) + { + final int var_445 = (-1239185626); + } + } + catch( java.lang.IllegalArgumentException myExp_446 ) + { + for( var_447 = 734 ;(var_447<742);var_447 = (var_447+2) ) + { + var_449[((~(++var_20))&0)] = (var_20++) ; + } + System.out.println("hello exception 11 !"); + } + } + } + } + } + catch( java.lang.ArithmeticException myExp_450 ) + { + byte var_458 = (byte)(71); + double var_453 = (-1.23355e+08D); + try + { + if( ((var_451--)>=var_6)) + { + if( ((++var_452)==func_48((var_453++) ,var_277 ,var_456 ,(var_458++) ,(~(-(var_458--)))))) + { + for( var_461 = 214 ;(var_461<270);var_461 = (var_461+14) ) + { + int var_462 = (1205127622); + for( var_462 = 860 ;(var_462>858);var_462 = (var_462-2) ) + { + var_464[4][(((--var_451)*var_100)&6)][(((var_458++)*( ( int )(++var_67) ))&6)] = ((++var_79)-var_413) ; + } + } + } + } + } + catch( java.lang.ArithmeticException myExp_465 ) + { + if( (!(!((var_458--)==var_237)))) + { + short var_481 = (short)(16981); + cl_60 var_507 = new cl_60(); + try + { + long var_493 = (-2493503349634254409L); + try + { + if( var_466) + { + float var_467 = (-7.44954e+26F); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_468 ) + { + float [] var_479 = {(-2.98727e-06F)}; + if( (!((++var_458)>var_451))) + { + var_103.var_136 = ((var_291--)+func_21(((--var_469)!=func_29((++var_299) ,(((var_458++)*var_3)+var_71.var_168.var_273) ,(var_15--) ,var_71.var_105.var_63 ,(-((((var_13--)&func_48(var_71.var_106.var_136 ,(!(!(!(!(!((!func_40((((var_78--)+var_272)-var_326) ,var_476))==var_443.var_63.var_80.var_65.var_107)))))) ,var_479 ,((var_481--)&func_48(((++var_291)&var_289) ,(!(!((--var_481)!=var_62.var_165))) ,var_152 ,(-(--var_67)) ,(var_13++))) ,(var_3--)))+var_222)*( ( short )(--var_28) ))) ,var_348 ,((var_458--)*( ( short )var_491[((-(var_481--))&6)][((var_13--)&4)][(((var_481++)&func_48(var_128 ,(!((-(var_493--))!=var_135)) ,var_476.var_69 ,((var_238--)|(byte)(-103)) ,var_497[((var_304++)&6)]))&0)] )))) ,var_57.var_433 ,(+((var_493++)*var_272)) ,var_62.var_503 ,var_443)) ; + } + else + { + var_479[((--var_481)&0)] = ((--var_458)*var_57.var_112) ; + } + System.out.println("hello exception 14 !"); + } + } + catch( java.lang.ArithmeticException myExp_506 ) + { + try + { + var_95 = var_71.var_105.var_111 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_508 ) + { + int var_509 = (821118950); + for( var_509 = 423 ;(var_509<425);var_509 = (var_509+1) ) + { + var_464[((var_226++)&4)][6][((var_458++)&6)] = ((-(++var_306))/func_21(((--var_458)<=var_128) ,var_511 ,(var_513--) ,var_57.var_68.var_515 ,var_62)) ; + } + System.out.println("hello exception 16 !"); + } + System.out.println("hello exception 15 !"); + } + } + else + { + if( (((var_304--)-var_4)>=var_64.var_86.var_96)) + { + try + { + try + { + cl_60 var_518 = new cl_60(); + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_519 ) + { + var_12 = var_82 ; + System.out.println("hello exception 17 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_520 ) + { + int var_521 = (-971695199); + for( var_521 = 474 ;(var_521>384);var_521 = (var_521-18) ) + { + var_511[(((~(var_458--))+var_443.var_98.var_112)&5)][(((var_458++)&var_521)&1)][((var_6--)&6)] = ((++var_436)<=var_3) ; + } + System.out.println("hello exception 18 !"); + } + } + } + System.out.println("hello exception 13 !"); + } + System.out.println("hello exception 12 !"); + } + return (var_522++); +} +public strictfp byte func_21(boolean var_22, boolean[][][] var_23, float var_24, int[] var_25, cl_44 var_26) +{ + byte var_418 = (byte)(-66); + short var_377 = (short)(-18975); + int var_307 = (-1382178014); + final cl_52 var_297 = new cl_52(); + try + { + final cl_60 var_334 = new cl_60(); + try + { + short var_316 = (short)(-17464); + byte var_293 = (byte)(-41); + double var_27 = (-3.02183e-268D); + float [] var_345 = {(-3.4842e+28F)}; + if( false) + { + double [][] var_303 = {{(-8.413e+222D),(-2.90378e+155D),(-1.28885e+175D),(1.12771e+157D)}}; + if( (!((var_28++)!=func_29(func_48((+(-(--var_291))) ,((var_67++)==func_29((((var_293--)+var_222)|var_100) ,(var_27++) ,(-2.27787e-234D) ,var_297 ,((++var_299)&( ( long )((var_293--)&var_82.var_112) )) ,var_95.var_301 ,var_303[((+((((var_293++)*func_48(((++var_47)-(short)(-5388)) ,(!((++var_306)!=func_29((var_307--) ,(var_167++) ,(var_307--) ,var_297 ,((((+(--var_293))|func_48(((++var_238)&var_64.var_81) ,var_71.var_105.var_111.var_313 ,var_170 ,var_25[((-(++var_316))&4)] ,(1259812827)))&var_123.var_112)|var_78) ,var_62.var_320 ,(((var_293++)*var_57.var_58.var_136)+( ( int )var_82.var_81 ))))) ,var_70 ,(+(++var_291)) ,(((--var_316)+func_48((+(var_326--)) ,(!(!((var_24--)var_71.var_116)&&func_40((var_4--) ,var_334)) ,var_330 ,var_25[((+(-(var_3--)))&4)] ,(var_6++))) ,(++var_316))))+var_237)))|var_103.var_81)-var_95.var_96))&0)][((+(++var_304))&3)])) ,var_345 ,(var_307--) ,((--var_316)+func_29(var_307 ,((var_307--)-var_62.var_63.var_109) ,(1.9346e-78D) ,var_57 ,(++var_293) ,var_348 ,(-2.51746e+97D)))) ,(--var_27) ,((++var_293)%var_237) ,var_297 ,((++var_293)+var_57.var_59) ,var_348 ,var_128)))) + { + int var_357 = (-297641084); + for( var_357 = 764 ;(var_357>744);var_357 = (var_357-10) ) + { + try + { + float var_358 = (-1.28644e+16F); + } + catch( java.lang.IllegalArgumentException myExp_359 ) + { + float var_360 = (8.12302e+30F); + System.out.println("hello exception 19 !"); + } + } + } + else + { + for( var_361 = 640 ;(var_361>636);var_361 = (var_361-1) ) + { + int [][] var_362 = {{(-187739720),(1892015887),(-1658478882),(1207608431),(2090938088)}}; + } + } + } + } + catch( java.lang.IllegalArgumentException myExp_363 ) + { + double var_392 = (1.57363e+278D); + try + { + byte var_364 = (byte)(-86); + try + { + long var_373 = (734010173392408273L); + var_23[(((++var_226)+func_48((var_100--) ,((var_289++)>func_29((var_307--) ,(-(var_364++)) ,(-6.18648e+275D) ,var_57 ,((++var_364)*var_62.var_385) ,var_371 ,(var_364++))) ,var_170 ,(--var_299) ,((var_364++)-func_29(func_48((var_392++) ,(!(!(!((((--var_364)-var_28)*var_167)!=var_5)))) ,var_152 ,(++var_377) ,((var_256--)*var_6)) ,(var_392--) ,((var_377--)-var_128) ,var_71.var_105.var_63 ,(var_238++) ,var_371 ,( ( double )((--var_377)|func_48((-(var_364++)) ,var_103.var_107 ,var_62.var_117.var_74 ,((var_364++)*(-973820967)) ,((-(var_364--))-var_57.var_68.var_96))) )))))&5)][(((var_364++)|func_48(var_123.var_86.var_273 ,(!(((-(++var_67))+func_29(((var_307--)|var_28) ,(-5.1457e+11D) ,(8.2066e-169D) ,var_71.var_105.var_63 ,(-(--var_304)) ,var_371 ,(var_373++)))>( ( short )var_238 ))) ,var_152 ,(--var_377) ,(var_377--)))&1)][(((++var_307)&var_304)&6)] = ((var_364--)>var_5) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_411 ) + { + if( ((var_364++)>=var_128)) + { + var_62.var_98 = var_71.var_105.var_73 ; + } + System.out.println("hello exception 21 !"); + } + } + catch( java.lang.ArithmeticException myExp_412 ) + { + long var_421 = (-4551158996841042485L); + try + { + try + { + try + { + var_22 = ((var_222--)!=var_123.var_91) ; + } + catch( java.lang.ArithmeticException myExp_414 ) + { + int [][][] var_415 = {{{(-1351434447),(-593801810),(721684043),(-1026820502),(-1124132762),(-1413487048),(585181695)}}}; + System.out.println("hello exception 23 !"); + } + } + catch( java.lang.ArithmeticException myExp_416 ) + { + var_270 = var_71.var_105.var_73 ; + System.out.println("hello exception 24 !"); + } + } + catch( java.lang.ArithmeticException myExp_417 ) + { + if( (((var_418--)+( ( double )(+(++var_377)) ))<=var_71.var_419)) + { + if( (((var_418--)*func_48((~(++var_377)) ,(!((var_421--)<=var_64.var_91)) ,var_103.var_74 ,var_62.var_73.var_91 ,var_25[(((++var_79)*var_270.var_91)&4)]))<=var_392)) + { + var_123.var_65.var_89 = ((var_418--)-var_62.var_328) ; + } + else + { + var_170[((var_307--)&0)] = ((++var_28)+var_57.var_58.var_89) ; + } + } + System.out.println("hello exception 25 !"); + } + System.out.println("hello exception 22 !"); + } + System.out.println("hello exception 20 !"); + } + } + catch( java.lang.ArithmeticException myExp_426 ) + { + int var_427 = (3398419); + final double [][] var_428 = {{(9.21634e+24D),(-3.2515e-25D),(-4.5483D),(1.27073e+117D),(-1.52628e-19D),(-2.34031e+180D),(8.6332e-265D)},{(5.09022e-206D),(1.42e-69D),(-4.95133e-132D),(-1.51703e-220D),(-3.88846e+77D),(-2.03546e+157D),(3.18514e-27D)},{(2.35e+272D),(-1.16805e-65D),(-7.58956e-261D),(-2.25364e+43D),(7.21731e-285D),(-9.19283e+48D),(1.3585e-183D)},{(-1.27613e+215D),(4.01007e+89D),(6.29391e-288D),(3.60136e+270D),(-1.34159e-128D),(2.01771e-181D),(4.52738e-253D)}}; + for( var_427 = 570 ;(var_427>540);var_427 = (var_427-10) ) + { + try + { + var_57.var_58.var_136 = (--var_24) ; + } + catch( java.lang.IllegalArgumentException myExp_429 ) + { + if( (!((var_167--)>=( ( double )(2654170) )))) + { + if( (!(!(!((--var_306)==( ( int )(++var_28) )))))) + { + try + { + var_71.var_168 = var_71.var_105.var_111 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_430 ) + { + var_23 = var_431 ; + System.out.println("hello exception 28 !"); + } + } + else + { + try + { + var_307 = (var_418++) ; + } + catch( java.lang.ArithmeticException myExp_434 ) + { + var_23[((++var_3)&5)][(((--var_235)+var_62.var_435)&1)][((var_307++)&6)] = (!((-(++var_291))==var_251)) ; + System.out.println("hello exception 29 !"); + } + } + } + System.out.println("hello exception 27 !"); + } + } + System.out.println("hello exception 26 !"); + } + return (++var_436); +} +public strictfp byte func_29(int var_30, double var_31, double var_32, cl_52 var_33, long var_34, int[][][] var_35, double var_36) +{ + byte var_286 = (byte)(-3); + try + { + if( func_37((366283036) ,var_82.var_268)) + { + var_103 = var_71.var_105.var_98 ; + } + } + catch( java.lang.IllegalArgumentException myExp_271 ) + { + short var_290 = (short)(-31254); + try + { + cl_60 var_282 = new cl_60(); + try + { + for( var_272 = 870 ;(var_272>868);var_272 = (var_272-2) ) + { + try + { + try + { + var_71.var_163.var_68.var_273 = (var_31++) ; + } + catch( java.lang.ArithmeticException myExp_274 ) + { + var_32 = (var_5--) ; + System.out.println("hello exception 31 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_275 ) + { + int var_276 = (908386624); + for( var_276 = 588 ;(var_276>578);var_276 = (var_276-10) ) + { + var_70[(var_276&0)] = (var_34++) ; + } + System.out.println("hello exception 32 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_278 ) + { + try + { + int var_279 = (851185336); + for( var_279 = 282 ;(var_279<287);var_279 = (var_279+1) ) + { + try + { + boolean var_280 = true; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_281 ) + { + var_95 = var_71.var_105.var_111 ; + System.out.println("hello exception 34 !"); + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_283 ) + { + try + { + if( ((var_235--)!=var_123.var_81)) + { + var_95.var_114 = (var_251++) ; + } + } + catch( java.lang.ArithmeticException myExp_284 ) + { + try + { + var_33 = var_57 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_285 ) + { + var_35[((+(var_3++))&1)][(((var_286--)*( ( byte )var_71.var_287 ))&5)][5] = (var_235++) ; + System.out.println("hello exception 37 !"); + } + System.out.println("hello exception 36 !"); + } + System.out.println("hello exception 35 !"); + } + System.out.println("hello exception 33 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_288 ) + { + if( (((var_289++)-var_237)>=var_71.var_168.var_164)) + { + var_35[(((var_290++)-var_47)&1)][5][((+(--var_237))&5)] = ((var_286++)*var_71.var_168.var_164) ; + } + System.out.println("hello exception 38 !"); + } + System.out.println("hello exception 30 !"); + } + return ( ( byte )(--var_235) ); +} +public strictfp boolean func_37(int var_38, double[][] var_39) +{ + if( func_40((-((var_67--)&var_64.var_112)) ,var_71.var_105.var_111)) + { + byte var_241 = (byte)(-97); + try + { + int var_225 = (-1842701617); + for( var_225 = 488 ;(var_225<527);var_225 = (var_225+13) ) + { + try + { + try + { + var_39[5][((+(var_226++))&4)] = (5.03746e+178D) ; + } + catch( java.lang.IllegalArgumentException myExp_227 ) + { + for( var_228 = 123 ;(var_228<218);var_228 = (var_228+19) ) + { + long var_229 = (7437254764343429973L); + } + System.out.println("hello exception 39 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_230 ) + { + byte var_231 = (byte)(-120); + try + { + try + { + var_70[0] = (var_231--) ; + } + catch( java.lang.IllegalArgumentException myExp_232 ) + { + var_38 = ((var_3++)-var_123.var_112) ; + System.out.println("hello exception 41 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_233 ) + { + var_95 = var_71.var_105.var_111 ; + System.out.println("hello exception 42 !"); + } + System.out.println("hello exception 40 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_234 ) + { + short var_243 = (short)(9097); + if( ((var_235++)!=func_48((1.22384e+86D) ,(!((--var_237)>=( ( float )((--var_238)|var_71.var_116) ))) ,var_170 ,(++var_241) ,(((++var_243)*func_48((9.1644e+261D) ,(!(((+(var_79++))+var_3)=var_71.var_168.var_87) ; + } + catch( java.lang.ArithmeticException myExp_252 ) + { + try + { + var_62.var_63.var_61 = var_71.var_105.var_73 ; + } + catch( java.lang.ArithmeticException myExp_253 ) + { + long var_254 = (-2352399010408356713L); + System.out.println("hello exception 45 !"); + } + System.out.println("hello exception 44 !"); + } + } + } + System.out.println("hello exception 43 !"); + } + } + final boolean [][][] var_255 = {{{false,true,false,false,true},{true,true,true,true,false},{true,false,false,false,true},{true,true,false,false,false},{false,false,false,true,false}},{{false,true,true,false,false},{true,false,true,true,false},{false,false,true,false,false},{true,false,false,true,false},{true,true,false,false,false}},{{false,true,false,false,false},{true,false,false,false,true},{true,false,true,false,true},{false,true,true,true,true},{false,false,false,false,false}},{{true,false,false,false,false},{false,true,true,true,false},{true,true,false,false,true},{true,true,true,false,false},{false,false,true,true,true}},{{false,true,true,false,true},{true,false,true,false,false},{false,true,true,false,true},{false,false,true,false,true},{true,true,true,true,true}},{{false,true,true,true,false},{false,false,true,true,false},{true,false,true,true,true},{true,false,false,true,false},{false,false,false,false,true}},{{false,true,false,true,false},{false,true,true,true,false},{true,true,false,true,false},{true,true,true,false,true},{true,true,false,false,false}}}; + byte var_257 = (byte)(-17); + byte var_264 = (byte)(-70); + byte var_261 = (byte)(-74); + short var_259 = (short)(-5549); + final float var_260 = (1.20536e-24F); + return var_255[((--var_237)&6)][(((var_256++)|( ( short )((--var_226)-func_48((-(-(var_257++))) ,func_40((+((((++var_259)+var_260)+var_261)+var_108)) ,var_71.var_105.var_111) ,var_152 ,((++var_264)-var_47) ,(580555395))) ))&4)][((var_256--)&4)]; +} +public strictfp boolean func_40(float var_41, cl_60 var_42) +{ + short var_139 = (short)(-16693); + long var_194 = (3540617829919819066L); + int var_178 = (-1574060786); + byte var_43 = (byte)(33); + if( (!((--var_3)>=( ( double )(var_43--) )))) + { + boolean [][] var_45 = {{false,true},{true,false},{true,true},{true,true},{true,false},{true,true},{false,true}}; + int [] var_218 = {(-252984035),(789935651),(-231552226),(1952952636)}; + try + { + double var_149 = (-3.64348e-231D); + short var_46 = (short)(-32164); + final double [] var_140 = {(6.26752e-161D),(-3.1044e-305D)}; + var_45[(((var_47--)-func_48(var_5 ,(!(!((++var_43)!=var_95.var_90))) ,var_70 ,((((--var_43)*var_71.var_106.var_81)|var_47)+var_43) ,(-(var_43++))))&6)][((--var_46)&1)] = ((var_79--)>func_48(((var_3--)*( ( short )(var_28--) )) ,(!((--var_67)==var_3)) ,var_70 ,(var_43--) ,((--var_139)*func_48(var_140[((((--var_79)*func_48((++var_139) ,(!(!(!((!(!(!(((var_3++)+func_48((-9.00195e-296D) ,var_45[(((++var_43)-func_48((((var_28++)+var_28)*var_149) ,true ,var_152 ,((--var_28)+func_48(((var_139++)*var_103.var_136) ,(!(!(!(!((var_139--)>var_3))))) ,var_152 ,((var_43++)*var_28) ,(~(++var_67)))) ,(++var_79)))&6)][(((++var_67)-func_48((var_28++) ,(!(!(((--var_43)&var_103.var_81)=var_128))))) ; + } + } + catch( java.lang.ArithmeticException myExp_183 ) + { + int var_184 = (-142249952); + for( var_184 = 805 ;(var_184<875);var_184 = (var_184+14) ) + { + try + { + var_45[((var_3++)&6)][((+((++var_67)*func_48((~(+((-(var_43++))-var_57.var_61.var_81))) ,var_123.var_107 ,var_152 ,(--var_43) ,(~(var_43--)))))&1)] = ((var_43--)<=var_28) ; + } + catch( java.lang.IllegalArgumentException myExp_190 ) + { + float var_191 = (1.38318e-33F); + System.out.println("hello exception 48 !"); + } + } + System.out.println("hello exception 47 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_192 ) + { + int var_193 = (1357976369); + for( var_193 = 678 ;(var_193>633);var_193 = (var_193-15) ) + { + if( ((var_194--)==( ( float )((++var_43)-var_135) ))) + { + float [] var_210 = {(-3.34205e-23F)}; + try + { + var_9[((--var_178)&5)][(((--var_139)|func_48(var_128 ,true ,var_123.var_74 ,(var_178++) ,func_48((-(++var_139)) ,(!(!((!(!(!(!(!(!var_62.var_200))))))|( ( boolean )var_103.var_107 )))) ,var_62.var_145 ,(~(+(var_67--))) ,(++var_178))))&1)][((var_139--)&4)] = ((!((var_28--)>( ( double )var_206[(((var_3--)-func_48((-((-(--var_3))&(short)(7560))) ,((var_3--)>=var_64.var_136) ,var_64.var_74 ,func_48((var_78++) ,((var_3--)>func_48(((--var_43)-var_3) ,(((--var_3)-var_4)=var_79))) ,var_210 ,(+(((var_43++)*var_95.var_164)*var_95.var_164)) ,var_218[3])) ))+var_103.var_112)>var_4)) ; + System.out.println("hello exception 50 !"); + } + } + else + { + try + { + var_70 = var_170 ; + } + catch( java.lang.ArithmeticException myExp_220 ) + { + double var_221 = (7.40174e-165D); + System.out.println("hello exception 51 !"); + } + } + } + System.out.println("hello exception 49 !"); + } + System.out.println("hello exception 46 !"); + } + } + return ((--var_222)>=var_123.var_136); +} +public static strictfp int func_48(double var_49, boolean var_50, float[] var_51, int var_52, int var_53) +{ + cl_60 var_137 = new cl_60(); + byte var_124 = (byte)(15); + boolean [][] var_133 = {{true,false,false,false},{true,true,false,false}}; + int var_54 = (303355241); + cl_90 var_102 = new cl_90(); + cl_21 var_104 = new cl_21(); + for( var_54 = 743 ;(var_54>713);var_54 = (var_54-10) ) + { + long var_122 = (6592171762148805580L); + if( var_50) + { + final long [][][] var_115 = {{{(673525892635950916L),(-5289932996482590467L),(4162528345413615580L),(-6204263691323176230L),(7826681877846077955L),(-4765591326469558975L),(-7980719188842812897L)},{(-7938766019977446785L),(-2186768931568560886L),(-6687942810944947000L),(1196331327380318795L),(7148371728619973480L),(-7340320989248220513L),(-527109039981741486L)},{(-2582788661127643415L),(2498304163504828290L),(4978834122477731665L),(-8268672310505631084L),(4580051720246347267L),(-6909369312437511509L),(5252283084995075374L)},{(-3985989035136638842L),(-6177171206141513940L),(7613757723494848228L),(-6308304029382343541L),(-1865610667461081233L),(-1715339229345254357L),(5488275027851390286L)},{(792152108117584890L),(-6169563348188017750L),(-1966452673514614274L),(-8720187889910459819L),(4771422381539361816L),(-4054221150565492386L),(2481994626836546046L)},{(1204368191688985367L),(-6009265906041983854L),(-7252863022037417738L),(5705264778941448558L),(-7773261777113528657L),(-3900127291400642734L),(-7424784982854535035L)}},{{(-5131108966214225519L),(2960464891921937710L),(2800365732661958314L),(77635454080925402L),(4968809401480498982L),(-904367587766315948L),(8847067959837694550L)},{(-7918801106867381594L),(-7754007394090803189L),(-4029161306244328402L),(6885303959578857826L),(-5949594963761330097L),(-4445959361331451310L),(-8345443024365604312L)},{(3410315390205460645L),(2586479893752135507L),(981653763278796497L),(-1451349775071260037L),(1706567022372499672L),(1154000849546784829L),(1337120696057231343L)},{(-746891875763936485L),(2107068160835397879L),(127211234448774574L),(-1092163658085913217L),(-8464303199311623032L),(3574334106607501887L),(-6098486733263609432L)},{(6236171613842699831L),(-2266106841327689157L),(8093042483446028517L),(8229388558624823945L),(3561991086835864043L),(-6687798778291772190L),(1512275140405025762L)},{(6335348816023460034L),(8470956428823492793L),(8836361839087771611L),(5229552306975980472L),(-6202570239588702781L),(-6919605053973681797L),(-7468573588970911244L)}},{{(-4696512726255358238L),(-2401866751748503681L),(-1281776994161234532L),(-2294233390879339729L),(3438284621264289833L),(-4529969725690202800L),(7464162928819504660L)},{(-6488825755933902440L),(842390393771987443L),(5634212027441950375L),(4022390715578191603L),(-6699630991895096050L),(-3485359049016117965L),(6770357066918115545L)},{(6798303867460873221L),(-7635196007881637140L),(650759011576700173L),(6127156684619457003L),(106751678730833633L),(-4968063856611572299L),(5029546398821046455L)},{(6795352320987672153L),(5475600803028918627L),(-8692883327091585494L),(6230234046964864074L),(1990692976092917662L),(-5568690268671394306L),(-1202592342233930838L)},{(3704313496568714792L),(-3150548896819074000L),(-1865317532227934654L),(-420618716482061005L),(3427774938199743061L),(-3592944479109740179L),(1656657899106414168L)},{(-779945941067304174L),(-1827044862987597935L),(-3968805411833171282L),(-8914600554204068600L),(2255696241862340782L),(-7615636087468380236L),(-3092087934250806574L)}},{{(5977554891939970299L),(-3033059356892588007L),(-2606540430698238189L),(-8605063756075815763L),(-1496006911672991932L),(-1274789355607225070L),(-1907369740107064015L)},{(-300769413049493827L),(5102085062403844896L),(4726608968842701802L),(-5779738226198692144L),(53731111448107953L),(-9187352328476864292L),(8491491075040952195L)},{(-4108676539237297249L),(-3083063591575261701L),(1597316702717537850L),(7463640545674350625L),(-4028008653796762731L),(-2216504746637884288L),(6486582023262902004L)},{(8714436969200269916L),(-4673558878567656870L),(1083191997790028107L),(-5929150441377457538L),(-4208329462418205899L),(1682854059463599242L),(2040969715212421262L)},{(7502305841291191219L),(310277168466789585L),(-162279019944179268L),(647895681840413188L),(-3651183237701624849L),(-4827082902489184207L),(-2861102305433973235L)},{(-4896510275246190000L),(6290159689439490615L),(4902217286028203550L),(-1830876618932339179L),(4431443924469784530L),(-4233894668344874590L),(-5092000052899709308L)}}}; + try + { + try + { + short var_85 = (short)(20257); + try + { + byte var_84 = (byte)(-48); + boolean [][][] var_99 = {{{true,false,true},{true,false,false},{false,false,false},{true,false,false}},{{true,true,true},{false,true,true},{true,false,false},{true,false,false}}}; + int var_119 = (2060550388); + try + { + final double var_60 = (2.36134e-78D); + boolean var_76 = false; + short var_55 = (short)(-32466); + float var_56 = (1.79353e-12F); + var_50 = (((var_55--)+var_3)<=var_28) ; + var_51[(((var_6--)&(short)(-31101))&0)] = (var_56++) ; + var_57.var_58.var_59 = (var_53--) ; + var_57.var_61 = var_62.var_63.var_58 ; + final double var_83 = (1.14212e-119D); + byte var_66 = (byte)(113); + var_49 = (var_53++) ; + var_51[((-(++var_28))&0)] = (var_47--) ; + final int [][][] var_92 = {{{(306090607)},{(138379694)}},{{(1899896764)},{(1657131707)}},{{(1624691106)},{(-1329062569)}},{{(-400257752)},{(1049782605)}},{{(179775853)},{(-472237747)}},{{(904577974)},{(759170318)}},{{(472851722)},{(-1900422924)}}}; + int var_77 = (-1170125593); + var_9[((-(++var_66))&5)][((~(var_28--))&1)][((var_53--)&4)] = (!((++var_67)==(short)(21159))) ; + var_51 = var_70 ; + var_51[((var_53++)&0)] = (var_6--) ; + var_71 = var_71 ; + var_53 = (var_3--) ; + var_70[((var_6++)&0)] = (((var_79--)-var_57.var_80.var_65.var_81)+var_82.var_81) ; + var_9[((var_85++)&5)][((++var_3)&1)][((var_84--)&4)] = (!(!((var_67--)>var_64.var_86.var_87))) ; + var_62.var_63.var_80.var_65.var_91 = ((var_53--)&var_67) ; + } + catch( java.lang.IllegalArgumentException myExp_93 ) + { + final float var_94 = (-1.18055e+25F); + var_53 = (++var_53) ; + cl_90 var_97 = new cl_90(); + var_57.var_58.var_59 = ((--var_84)*( ( long )var_4 )) ; + var_95.var_96 = (+(var_28++)) ; + var_9[((-(--var_79))&5)][((-(var_84--))&1)][((++var_3)&4)] = var_99[((var_79--)&1)][(((--var_85)|var_3)&3)][((var_53--)&2)] ; + var_84 = (++var_79) ; + var_49 = (+(++var_79)) ; + var_47 = (var_84++) ; + var_50 = false ; + var_71 = var_71 ; + var_99[((var_85--)&1)][((var_84--)&3)][((-(var_84++))&2)] = ((-(var_53--))>=var_4) ; + System.out.println("hello exception 52 !"); + } + try + { + var_51[((-(--var_84))&0)] = (var_6--) ; + var_103 = var_71.var_105.var_73 ; + var_51 = var_70 ; + var_99[(((++var_84)&var_67)&1)][((var_3--)&3)][((~(var_79--))&2)] = (!(((--var_28)==var_100)&&var_71.var_106.var_107)) ; + var_102 = var_71 ; + var_49 = (((var_108--)+var_57.var_109)*var_78) ; + var_51[((var_53++)&0)] = ((var_85++)+var_95.var_90) ; + var_75[((-(-(++var_84)))&0)][((~(--var_85))&4)] = ((--var_3)var_5))) ; + var_51[((+(var_79--))&0)] = ((var_85--)|var_62.var_111.var_87) ; + var_99[(((var_84--)-var_82.var_112)&1)][3][((var_85--)&2)] = ((var_84--)<=( ( float )var_5 )) ; + } + catch( java.lang.IllegalArgumentException myExp_113 ) + { + cl_60 var_118 = new cl_60(); + var_51[(((var_84++)&var_84)&0)] = (+(var_84++)) ; + var_57.var_80.var_86.var_114 = (((--var_84)&( ( long )var_62.var_73.var_89 ))*var_71.var_106.var_91) ; + var_50 = ((-(--var_3))486);var_135 = (var_135-4) ) + { + if( (((+(++var_124))+var_82.var_136)>var_5)) + { + var_95 = var_71.var_105.var_111 ; + } + else + { + short var_138 = (short)(31376); + var_9[((+(--var_67))&5)][((-(var_124--))&1)][((var_124--)&4)] = ((var_138++)<=var_128) ; + } + } + } + } + } + } + return (~(var_3++)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(3426); + CrcCheck.ToByteArray(this.var_3,b,"var_3"); + CrcCheck.ToByteArray(this.var_4,b,"var_4"); + CrcCheck.ToByteArray(this.var_5,b,"var_5"); + CrcCheck.ToByteArray(this.var_6,b,"var_6"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_9[a0][a1][a2],b,"var_9" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + CrcCheck.ToByteArray(this.var_28,b,"var_28"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_57.GetChecksum(),b,"var_57.GetChecksum()"); + CrcCheck.ToByteArray(this.var_62.GetChecksum(),b,"var_62.GetChecksum()"); + CrcCheck.ToByteArray(this.var_64.GetChecksum(),b,"var_64.GetChecksum()"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_70[a0],b,"var_70" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_71.GetChecksum(),b,"var_71.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_75[a0][a1],b,"var_75" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_82.GetChecksum(),b,"var_82.GetChecksum()"); + CrcCheck.ToByteArray(this.var_95.GetChecksum(),b,"var_95.GetChecksum()"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + CrcCheck.ToByteArray(this.var_103.GetChecksum(),b,"var_103.GetChecksum()"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_110,b,"var_110"); + CrcCheck.ToByteArray(this.var_123.GetChecksum(),b,"var_123.GetChecksum()"); + CrcCheck.ToByteArray(this.var_128,b,"var_128"); + CrcCheck.ToByteArray(this.var_135,b,"var_135"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_152[a0],b,"var_152" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_167,b,"var_167"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_170[a0],b,"var_170" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_206[a0][a1],b,"var_206" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_222,b,"var_222"); + CrcCheck.ToByteArray(this.var_226,b,"var_226"); + CrcCheck.ToByteArray(this.var_228,b,"var_228"); + CrcCheck.ToByteArray(this.var_235,b,"var_235"); + CrcCheck.ToByteArray(this.var_237,b,"var_237"); + CrcCheck.ToByteArray(this.var_238,b,"var_238"); + CrcCheck.ToByteArray(this.var_251,b,"var_251"); + CrcCheck.ToByteArray(this.var_256,b,"var_256"); + CrcCheck.ToByteArray(this.var_270.GetChecksum(),b,"var_270.GetChecksum()"); + CrcCheck.ToByteArray(this.var_272,b,"var_272"); + CrcCheck.ToByteArray(this.var_277,b,"var_277"); + CrcCheck.ToByteArray(this.var_289,b,"var_289"); + CrcCheck.ToByteArray(this.var_291,b,"var_291"); + CrcCheck.ToByteArray(this.var_299,b,"var_299"); + CrcCheck.ToByteArray(this.var_304,b,"var_304"); + CrcCheck.ToByteArray(this.var_306,b,"var_306"); + CrcCheck.ToByteArray(this.var_326,b,"var_326"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_330[a0],b,"var_330" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_348[a0][a1][a2],b,"var_348" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_361,b,"var_361"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_371[a0][a1][a2],b,"var_371" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_413,b,"var_413"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_431[a0][a1][a2],b,"var_431" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_436,b,"var_436"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_441[a0],b,"var_441" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_443.GetChecksum(),b,"var_443.GetChecksum()"); + CrcCheck.ToByteArray(this.var_447,b,"var_447"); + CrcCheck.ToByteArray(this.var_451,b,"var_451"); + CrcCheck.ToByteArray(this.var_452,b,"var_452"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_456[a0],b,"var_456" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_461,b,"var_461"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_464[a0][a1][a2],b,"var_464" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_466,b,"var_466"); + CrcCheck.ToByteArray(this.var_469,b,"var_469"); + CrcCheck.ToByteArray(this.var_476.GetChecksum(),b,"var_476.GetChecksum()"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_491[a0][a1][a2],b,"var_491" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_497[a0],b,"var_497" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_513,b,"var_513"); + CrcCheck.ToByteArray(this.var_522,b,"var_522"); + CrcCheck.ToByteArray(this.var_539.GetChecksum(),b,"var_539.GetChecksum()"); + CrcCheck.ToByteArray(this.var_580,b,"var_580"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_587[a0][a1],b,"var_587" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_592,b,"var_592"); + CrcCheck.ToByteArray(this.var_593,b,"var_593"); + CrcCheck.ToByteArray(this.var_596,b,"var_596"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/Start.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..0f19d4614d8a15bb4d9ccb082e2150702f244c36 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_90.java cl_86.java cl_60.java CRC32.java cl_44.java cl_52.java CrcCheck.java cl_21.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_21.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_21.java new file mode 100644 index 0000000000000000000000000000000000000000..c0b16a685c1aaad3625f113dd97f47c3f14ec481 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_21.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1973468952 + +//import java.util.zip.CRC32; + +class cl_21 +{ + long var_59 = (-4374578691142925598L); + float [] var_74 = {(3.03071F)}; + byte var_81 = (byte)(73); + float var_89 = (-2.20499e-28F); + int var_91 = (-1799223085); + boolean var_107 = false; + short var_112 = (short)(30566); + double var_136 = (5.82351e-177D); + double [][] var_268 = {{(-7.6995e-199D),(-2.12644e+98D),(3.02904e+291D),(-4.23408e-228D),(8.82205e+222D)},{(3.64424e-53D),(-6.50544e-136D),(2.01314e-248D),(3.537e-22D),(3.01442e-197D)},{(8.41748e-101D),(-1.45849e+56D),(-6.24464e+53D),(1.68355e-96D),(-3.31663e+181D)},{(2.89114e+254D),(-7.36419e-289D),(2.94578e+82D),(3.98234e+155D),(-7.23607e-07D)},{(-5.07803e+258D),(-5.16966e+23D),(3.33021e-28D),(-6.504e-85D),(-2.36267e+52D)},{(1.9861e+153D),(-3.0644e-234D),(-1.09915e+291D),(-8.06519e-112D),(8.08994e-286D)}}; + boolean [][][] var_433 = {{{true,false,true,false,false,true,false},{true,true,true,false,true,false,false}},{{false,false,false,false,false,true,false},{true,false,false,true,false,true,false}},{{true,false,false,false,true,false,false},{false,true,true,false,false,false,false}},{{false,false,false,true,false,true,false},{false,true,true,true,false,false,false}},{{true,false,false,true,false,false,false},{true,true,true,true,false,false,true}},{{false,false,true,false,false,true,true},{false,true,false,false,true,true,false}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(356); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_74[a0],b,"var_74" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CrcCheck.ToByteArray(this.var_136,b,"var_136"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_268[a0][a1],b,"var_268" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_433[a0][a1][a2],b,"var_433" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_44.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_44.java new file mode 100644 index 0000000000000000000000000000000000000000..db1163a4aecab5fccf17de9283f790b442293d58 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_44.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1973468952 + +//import java.util.zip.CRC32; + +class cl_44 +{ + cl_52 var_63 = new cl_52(); + final cl_21 var_73 = new cl_21(); + cl_21 var_98 = new cl_21(); + cl_60 var_111 = new cl_60(); + cl_86 var_117 = new cl_86(); + int var_125 = (-1112642460); + float [] var_145 = {(3.45477e+06F)}; + final short var_165 = (short)(26053); + double var_182 = (1.41043e-59D); + boolean var_200 = false; + int [][][] var_320 = {{{(1146951524),(970851104),(-2111283883),(1032009598),(2057681400),(1310720765)},{(764632549),(-1660577925),(1362421412),(1186228066),(-641787049),(-1266206838)},{(-600530385),(-1229532068),(962003583),(-104509574),(1126667755),(-1937964920)},{(-63369023),(-927947397),(1173088196),(541590792),(2024416125),(1620059296)},{(470967908),(-50168398),(-957753714),(-2068692506),(-1196445834),(-570835853)},{(-374756653),(-887462527),(2012955650),(-460625746),(-2079780426),(1099660514)}},{{(-1401462383),(1904461099),(880088088),(1284337836),(-1072706926),(1313769092)},{(-1945212599),(1574962677),(-99076334),(-1431619933),(-347789169),(-372713451)},{(-51166255),(-1733551348),(1332191179),(1794676000),(1691704038),(-1074448574)},{(-1581743446),(465988753),(1005502678),(-483862968),(-1005847943),(273711518)},{(-452945154),(704156311),(1625347591),(1822451342),(-1784440228),(698645447)},{(531429766),(-1031286715),(279688992),(975268347),(-232579281),(-248232906)}}}; + float var_328 = (-3.7848e-31F); + long var_385 = (-1575274938517647051L); + byte var_435 = (byte)(-107); + int [] var_503 = {(-1503118831),(1344694380),(874375032),(-8055848),(772488644)}; + double [][] var_597 = {{(7.30901e-225D),(4.4331e+95D),(4.7355e+71D),(1.01778e+14D),(-8.25712e+252D)},{(1.47761e-217D),(-3.75773e+36D),(5.19922e+151D),(-4.38629e+264D),(8.73584e-57D)},{(-5.79118e+78D),(1.08474e-168D),(-3.86659e-168D),(-8.84309e-225D),(-1.88691e+129D)},{(3.86369e-50D),(7.68236e-201D),(-2.21119e-281D),(5.10392e+73D),(1.49227e+23D)},{(-1.37751e-79D),(-5.12027e-191D),(9.0578e+23D),(-3.69272e-207D),(1.17809e-08D)},{(3.11083e+14D),(1.7864e-16D),(9.22581e-250D),(6.87716e+257D),(1.80527e+27D)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(620); + CrcCheck.ToByteArray(this.var_63.GetChecksum(),b,"var_63.GetChecksum()"); + CrcCheck.ToByteArray(this.var_73.GetChecksum(),b,"var_73.GetChecksum()"); + CrcCheck.ToByteArray(this.var_98.GetChecksum(),b,"var_98.GetChecksum()"); + CrcCheck.ToByteArray(this.var_111.GetChecksum(),b,"var_111.GetChecksum()"); + CrcCheck.ToByteArray(this.var_117.GetChecksum(),b,"var_117.GetChecksum()"); + CrcCheck.ToByteArray(this.var_125,b,"var_125"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_145[a0],b,"var_145" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_165,b,"var_165"); + CrcCheck.ToByteArray(this.var_182,b,"var_182"); + CrcCheck.ToByteArray(this.var_200,b,"var_200"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_320[a0][a1][a2],b,"var_320" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_328,b,"var_328"); + CrcCheck.ToByteArray(this.var_385,b,"var_385"); + CrcCheck.ToByteArray(this.var_435,b,"var_435"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_503[a0],b,"var_503" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_597[a0][a1],b,"var_597" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_52.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_52.java new file mode 100644 index 0000000000000000000000000000000000000000..f9dcd3710990457c7ab1f1a55b4ae797e0790847 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_52.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1973468952 + +//import java.util.zip.CRC32; + +class cl_52 extends cl_21 +{ + final cl_21 var_58 = new cl_21(); + cl_21 var_61 = new cl_21(); + cl_60 var_68 = new cl_60(); + final cl_86 var_80 = new cl_86(); + final double var_109 = (1.72489e+90D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(396); + CrcCheck.ToByteArray(this.var_58.GetChecksum(),b,"var_58.GetChecksum()"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_61.GetChecksum(),b,"var_61.GetChecksum()"); + CrcCheck.ToByteArray(this.var_68.GetChecksum(),b,"var_68.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_74[a0],b,"var_74" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_80.GetChecksum(),b,"var_80.GetChecksum()"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CrcCheck.ToByteArray(this.var_136,b,"var_136"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_268[a0][a1],b,"var_268" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_433[a0][a1][a2],b,"var_433" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_60.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_60.java new file mode 100644 index 0000000000000000000000000000000000000000..7b8dcd7f28d1b14fc462df7a368ba536c3c7cd51 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_60.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1973468952 + +//import java.util.zip.CRC32; + +class cl_60 +{ + final float [] var_69 = {(6.56556e+13F)}; + short var_87 = (short)(29287); + float var_90 = (4.63924e-14F); + int var_96 = (-175396577); + long var_114 = (787996843223091650L); + byte var_164 = (byte)(-38); + double var_273 = (-7.74087e-75D); + int [][][] var_301 = {{{(-840445731),(-165470277),(-593426325),(2118097335),(-1598953506),(-1120619405)},{(163986892),(-1063722499),(-764328478),(-1989941752),(-1620456981),(-1086448432)},{(-72182520),(1398987908),(-1022508140),(-608135506),(-1179100053),(-290355648)},{(-1462470160),(-291153072),(813579666),(-1629988806),(326192116),(1346721248)},{(-1563509581),(-1654095042),(449593981),(1202355805),(713757549),(1506339646)},{(2040214782),(-609562667),(1339385452),(-324048011),(484450714),(95253296)}},{{(1638161260),(-1838814505),(2119056541),(-1888128048),(1614820163),(775871585)},{(897483322),(1085225290),(1403284868),(-154392639),(2067106833),(1194484854)},{(43829522),(2069875297),(-454899654),(-655509466),(-1449504974),(834716584)},{(-1145938461),(-1862280854),(1802172254),(988279365),(-1066823240),(-2132723628)},{(-507834619),(1338364225),(-707934237),(-811411868),(1260787998),(-1881039537)},{(-1246947765),(1964478395),(1363639832),(597364033),(-1029337323),(77161101)}}}; + boolean var_313 = true; + int [] var_515 = {(-391756383),(1238678474),(-2104454405),(-473766630),(-366932802)}; + final double [][] var_588 = {{(7.17365e+278D),(-3.66681e-182D),(-4.44883e+243D),(7.12164e+27D),(-2.26454e-132D)},{(-1.82667e-100D),(-2.00706e-156D),(-2.5101e-07D),(-7.73188e+263D),(4.37003e+28D)},{(-1.39556e-294D),(-5.48576e+103D),(-3.02874e+279D),(-1.51551e-269D),(1.0691e+257D)},{(-3.35192e-141D),(-3.71682e+116D),(-4.1723e+284D),(-6.48017e-152D),(-2.27408e-93D)},{(-9.21781e-262D),(-5.45543e-168D),(-1.55648e+91D),(1.85798e-301D),(-7.04485e+224D)},{(-1.22453e-246D),(-1.10773e-237D),(-2.70859e+94D),(-1.63832e+234D),(3.88839e+297D)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(580); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_69[a0],b,"var_69" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + CrcCheck.ToByteArray(this.var_90,b,"var_90"); + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CrcCheck.ToByteArray(this.var_164,b,"var_164"); + CrcCheck.ToByteArray(this.var_273,b,"var_273"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_301[a0][a1][a2],b,"var_301" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_313,b,"var_313"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_515[a0],b,"var_515" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_588[a0][a1],b,"var_588" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_86.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_86.java new file mode 100644 index 0000000000000000000000000000000000000000..41af21dda1a95fa86939f4cee521ce8de0401c39 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_86.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1973468952 + +//import java.util.zip.CRC32; + +class cl_86 extends cl_21 +{ + cl_21 var_65 = new cl_21(); + cl_60 var_86 = new cl_60(); + boolean [][][] var_432 = {{{false,false,true,true,false,false,true},{false,true,true,false,true,true,true}},{{true,false,true,false,false,false,false},{false,false,true,false,false,true,true}},{{true,true,true,true,false,true,true},{true,false,true,false,false,true,true}},{{true,true,true,false,true,true,true},{true,true,false,true,false,true,false}},{{false,true,true,true,false,false,true},{true,true,false,false,false,false,true}},{{true,false,true,false,true,true,false},{true,true,false,true,true,false,false}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(456); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_65.GetChecksum(),b,"var_65.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_74[a0],b,"var_74" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_86.GetChecksum(),b,"var_86.GetChecksum()"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CrcCheck.ToByteArray(this.var_136,b,"var_136"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_268[a0][a1],b,"var_268" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_432[a0][a1][a2],b,"var_432" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_433[a0][a1][a2],b,"var_433" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_90.java b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_90.java new file mode 100644 index 0000000000000000000000000000000000000000..d826dd033985ded8a17383701b5d48ad9096dd02 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1818_2018120416115/cl_90.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1973468952 + +//import java.util.zip.CRC32; + +class cl_90 +{ + float [] var_72 = {(0.0300555F)}; + boolean var_88 = false; + double var_101 = (-1.86153e+243D); + cl_44 var_105 = new cl_44(); + cl_21 var_106 = new cl_21(); + final short var_116 = (short)(12378); + cl_52 var_163 = new cl_52(); + cl_60 var_168 = new cl_60(); + int var_287 = (1310183778); + final byte var_419 = (byte)(55); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(52); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_72[a0],b,"var_72" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_88,b,"var_88"); + CrcCheck.ToByteArray(this.var_101,b,"var_101"); + CrcCheck.ToByteArray(this.var_105.GetChecksum(),b,"var_105.GetChecksum()"); + CrcCheck.ToByteArray(this.var_106.GetChecksum(),b,"var_106.GetChecksum()"); + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + CrcCheck.ToByteArray(this.var_163.GetChecksum(),b,"var_163.GetChecksum()"); + CrcCheck.ToByteArray(this.var_168.GetChecksum(),b,"var_168.GetChecksum()"); + CrcCheck.ToByteArray(this.var_287,b,"var_287"); + CrcCheck.ToByteArray(this.var_419,b,"var_419"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1888_2018122011951/CRC32.java b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..aefbb1eda4a3a2c6c910c187f8e63f6ee26494d8 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/CRC32.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + } + private int getCrcByLookupTable() { + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + public int getCrcByCalculation() { + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1888_2018122011951/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..b990aa0377cac4ac3ed69cc13af7bb72e06d1f6e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/CrcCheck.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + +} diff --git a/test/testsuite/fuzz_test/fuzz/1888_2018122011951/MainClass.java b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..e9a66cfcb97c13314d73265dbda1b7953d211363 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/MainClass.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1925474860 +//import java.util.zip.CRC32; +class MainClass +{ + final static float var_6 = (2.5367e+27F); + final static boolean [] var_10 = {false,true,false,false,true,true}; + final long var_22 = (1012611220370082784L); + static float [][][] var_31 = {{{(1.62427e+07F),(6.35645e-25F),(6.99256e-11F),(2.48448e-13F),(-6.15252e-27F),(-1.29425e+24F),(-7.32e-07F)},{(-4.495e+30F),(1.10025e-29F),(1.63596e-08F),(-7.89483e+06F),(-1.80485e-12F),(-1.39264e+24F),(3.02761e-25F)},{(-6.40164e+18F),(-0.00151572F),(-1.79265e-31F),(8.53271e+09F),(4.69127e-08F),(2.31831e+18F),(-1.87447e-28F)},{(-1.50292e+38F),(4.94129e+21F),(8700.33F),(7995.76F),(6.95455e+13F),(-3.73369e-10F),(-4.35374e+32F)},{(1.85029e-36F),(1.6326F),(-5.85116e-21F),(-0.000712358F),(9.82595e+25F),(-0.00298436F),(-1.08659e-16F)},{(-2.68117e-13F),(-3.78597e-32F),(-6.32703e-19F),(1.24339e-20F),(2.34053e-05F),(-3.43505e-38F),(-0.000330687F)}},{{(-9.61096e+12F),(-1.17381e+32F),(6.15862e+07F),(-5.02787e-11F),(9.0435e-26F),(2.82434e+20F),(2.6241e+35F)},{(72.1152F),(6.9146e+14F),(5.16817e-15F),(-6.18514e+20F),(-8.94485e-05F),(-1.89303e+09F),(-5.32361e+10F)},{(-1.11853e+19F),(-1.10491e-37F),(-1.9491e+12F),(-26.8091F),(-9.85732e-15F),(-3.01214e+32F),(-1.04591e+19F)},{(-3.60373e+28F),(5.5892e+12F),(0.051311F),(-5.94988e+15F),(2.5191e+11F),(-0.00478722F),(2.78452e+35F)},{(3.21115e+08F),(-4.67735e+24F),(-3.26124e+21F),(4.81564e-18F),(7.52748e-09F),(7.26904e+37F),(9.89825e+33F)},{(1.04479e-07F),(-1.6377e+23F),(-5.5914e+14F),(21.7393F),(7.30426e-29F),(3.81414e-16F),(7.38719e-29F)}},{{(-1.23145e+17F),(6.05103e+33F),(1.73953e-14F),(-2.59492e-06F),(-5.89452e+27F),(-1.15173e+09F),(-1.19835e+23F)},{(8.22344e-08F),(-2.14873e-33F),(0.328485F),(7.9058e+07F),(-4.90948e+18F),(9.97536e+30F),(2.95974e-33F)},{(7.22176e+36F),(8.10192e-29F),(227.029F),(-5.6305e-11F),(-1.56078e-34F),(2.1394e-17F),(8.40658e-10F)},{(-2.57922e+07F),(-4.02681e-37F),(1.994e+34F),(0.0620787F),(1.25845e-32F),(0.00921665F),(-5.65844e-09F)},{(6.20487e-37F),(6.22692e-28F),(7.97428e-38F),(1.02671e-16F),(1.89435e+09F),(-1.74022e+36F),(-1.88538e+26F)},{(-1.69092e+34F),(-1.35624e+21F),(4.24542e-09F),(383.647F),(-1.14676e-33F),(2.1982e-11F),(-1.51397e+29F)}},{{(-29.3565F),(8.35293e-35F),(5.8172e+09F),(2.05282e+29F),(-8.27544e-37F),(3.08868e+09F),(-85316.6F)},{(-1.3423e+11F),(-0.00178527F),(-1.02908e-16F),(2.43295e-26F),(-0.00133567F),(-0.231081F),(-6.5192e-37F)},{(-2.86938e+33F),(-7.67746e+06F),(-7.11177e+16F),(-2.25033e-26F),(14797F),(-1.34711e-14F),(4.8956e+31F)},{(-1.21589e+38F),(-1.34692e+09F),(4.15701e+06F),(4.69559e-32F),(-2.85931e+08F),(-8.82243e+31F),(-7.40889e+36F)},{(-2.01503e-26F),(-49.6619F),(-5.17262e+08F),(-6.09846e+31F),(5.6192e+18F),(-1.92145e-28F),(-0.00640101F)},{(-7.388e+28F),(9.11198e-29F),(-3.93602e-24F),(-1.07402e+27F),(0.0786557F),(4.88335e+30F),(-5.0723e-16F)}},{{(1.42586e-20F),(-5.99139e+25F),(4.22567e-12F),(-1.15004e+18F),(-2.42117e-19F),(-8.78637e-27F),(-2.56649e+34F)},{(1.15226e-27F),(1.00885e+30F),(42866.5F),(0.0724541F),(3.48506e+33F),(-2.27464e-35F),(3.88824e-28F)},{(3.09021e+07F),(3.02526e-07F),(-1.4945e+17F),(5.80766e-33F),(-2.82488e-22F),(0.105227F),(1.18603e+34F)},{(2.11164e+12F),(2.01992e+24F),(-1.20029e+36F),(-2.49446e-15F),(-0.000109573F),(-6.24017e-09F),(1.97507e+13F)},{(-6.15519e-12F),(7.81295e+21F),(2.68574e-26F),(-7.96569e-08F),(3.43809e+22F),(-4.60739e-38F),(4.40948e-13F)},{(1.99703e-37F),(6851.34F),(2.01886e-31F),(5.12373e+27F),(-19.3475F),(-9.90335e+37F),(1.28766e+14F)}}}; + static cl_26 var_33 = new cl_26(); + static byte var_35 = (byte)(73); + static long var_36 = (-3795955194745945992L); + static long var_37 = (-1649178432347680365L); + static boolean [][][] var_38 = {{{false,true,true,false},{true,true,true,true}}}; + static int var_49 = (994583430); + static cl_3 var_128 = new cl_3(); + final static cl_95 var_129 = new cl_95(); + static cl_5 var_131 = new cl_5(); + static int var_133 = (-1412280985); + static cl_29 var_135 = new cl_29(); + static byte var_143 = (byte)(20); + static int var_145 = (1511052544); + final static cl_108 var_148 = new cl_108(); + static short var_151 = (short)(-10639); + static long var_158 = (-1459345746000245487L); + byte var_160 = (byte)(-128); + int var_168 = (-1984254659); + int var_172 = (1798974569); + cl_95 var_173 = new cl_95(); + short var_183 = (short)(27572); + short var_185 = (short)(-2029); + short var_186 = (short)(-17462); + int var_187 = (-1679856495); + short var_198 = (short)(19008); + int var_201 = (-243247371); + boolean var_206 = false; + cl_26 [][] var_207 = {{new cl_26(),new cl_26(),new cl_26()},{new cl_26(),new cl_26(),new cl_26()},{new cl_26(),new cl_26(),new cl_26()},{new cl_26(),new cl_26(),new cl_26()},{new cl_26(),new cl_26(),new cl_26()},{new cl_26(),new cl_26(),new cl_26()}}; + long var_215 = (-3210757676290494909L); + boolean [][] var_219 = {{true,true,false,false,false,true,false},{true,false,true,true,false,true,true},{false,true,true,false,true,false,false},{true,false,true,true,true,true,false}}; + byte var_220 = (byte)(87); + int var_221 = (1698249812); +/*********************************/ +public strictfp void run() + +{ var_49 =var_128.func_53(var_129 ,false ,false); + //var_38[0][1][var_49] = (!(!(((--var_35)-(short)(29028))==var_135.var_136))) ; + +} + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1173); + CrcCheck.ToByteArray(this.var_6,b,"var_6"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_10[a0],b,"var_10" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_22,b,"var_22"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_31[a0][a1][a2],b,"var_31" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_33.GetChecksum(),b,"var_33.GetChecksum()"); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + CrcCheck.ToByteArray(this.var_36,b,"var_36"); + CrcCheck.ToByteArray(this.var_37,b,"var_37"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_38[a0][a1][a2],b,"var_38" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + CrcCheck.ToByteArray(this.var_128.GetChecksum(),b,"var_128.GetChecksum()"); + CrcCheck.ToByteArray(this.var_129.GetChecksum(),b,"var_129.GetChecksum()"); + CrcCheck.ToByteArray(this.var_131.GetChecksum(),b,"var_131.GetChecksum()"); + CrcCheck.ToByteArray(this.var_133,b,"var_133"); + CrcCheck.ToByteArray(this.var_135.GetChecksum(),b,"var_135.GetChecksum()"); + CrcCheck.ToByteArray(this.var_143,b,"var_143"); + CrcCheck.ToByteArray(this.var_145,b,"var_145"); + CrcCheck.ToByteArray(this.var_148.GetChecksum(),b,"var_148.GetChecksum()"); + CrcCheck.ToByteArray(this.var_151,b,"var_151"); + CrcCheck.ToByteArray(this.var_158,b,"var_158"); + CrcCheck.ToByteArray(this.var_160,b,"var_160"); + CrcCheck.ToByteArray(this.var_168,b,"var_168"); + CrcCheck.ToByteArray(this.var_172,b,"var_172"); + CrcCheck.ToByteArray(this.var_173.GetChecksum(),b,"var_173.GetChecksum()"); + CrcCheck.ToByteArray(this.var_183,b,"var_183"); + CrcCheck.ToByteArray(this.var_185,b,"var_185"); + CrcCheck.ToByteArray(this.var_186,b,"var_186"); + CrcCheck.ToByteArray(this.var_187,b,"var_187"); + CrcCheck.ToByteArray(this.var_198,b,"var_198"); + CrcCheck.ToByteArray(this.var_201,b,"var_201"); + CrcCheck.ToByteArray(this.var_206,b,"var_206"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_207[a0][a1].GetChecksum(),b,"var_207" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_215,b,"var_215"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_219[a0][a1],b,"var_219" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_220,b,"var_220"); + CrcCheck.ToByteArray(this.var_221,b,"var_221"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1888_2018122011951/Start.java b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..c4cb88b346b39028d0c01ebec4c5a1fe7c910f5b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/Start.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} +// DEPENDENCE: MainClass.java cl_95.java cl_108.java cl_3.java CRC32.java cl_26.java CrcCheck.java cl_29.java cl_5.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_108.java b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_108.java new file mode 100644 index 0000000000000000000000000000000000000000..ec4820e7755361eb4120a45cb2130beda1a19d41 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_108.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1925474860 +//import java.util.zip.CRC32; +class cl_108 +{ + long var_76 = (-4472109714255938465L); + boolean var_102 = true; + int var_117 = (513694508); + short var_149 = (short)(19494); + byte var_193 = (byte)(-42); + boolean [] var_196 = {true,true,false}; +/*********************************/ + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(19); + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + CrcCheck.ToByteArray(this.var_102,b,"var_102"); + CrcCheck.ToByteArray(this.var_117,b,"var_117"); + CrcCheck.ToByteArray(this.var_149,b,"var_149"); + CrcCheck.ToByteArray(this.var_193,b,"var_193"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_196[a0],b,"var_196" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_26.java b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_26.java new file mode 100644 index 0000000000000000000000000000000000000000..77a0156f5ea5acfc365c7c2d0396ba0044fb357e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_26.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1925474860 +//import java.util.zip.CRC32; +class cl_26 +{ + short var_34 = (short)(-17369); + double var_103 = (3.02197e+113D); + long var_105 = (1769044878848318895L); + boolean [] var_118 = {false,false,true,true,false,true,true}; + boolean var_218 = false; +/*********************************/ + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(26); + CrcCheck.ToByteArray(this.var_34,b,"var_34"); + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_118[a0],b,"var_118" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_218,b,"var_218"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_29.java b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_29.java new file mode 100644 index 0000000000000000000000000000000000000000..1fcd0c00e8b2ca1b6b540b16958ce2ed423cdf07 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_29.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1925474860 +//import java.util.zip.CRC32; +class cl_29 +{ + double var_82 = (-4.21015e-135D); + short var_98 = (short)(-23460); + int var_104 = (1712617002); + long var_116 = (-5815869228292543848L); + byte var_136 = (byte)(-35); +/*********************************/ + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(23); + CrcCheck.ToByteArray(this.var_82,b,"var_82"); + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + CrcCheck.ToByteArray(this.var_136,b,"var_136"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_3.java b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_3.java new file mode 100644 index 0000000000000000000000000000000000000000..3103714664eb19fad151119eff31b54ebb4f168a --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/1888_2018122011951/cl_3.java @@ -0,0 +1,166 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1925474860 +//import java.util.zip.CRC32; +class cl_3 +{ + static short var_57 = (short)(-10519); + static long var_58 = (3373874143346354831L); + final static cl_5 var_59 = new cl_5(); + static cl_108 var_62 = new cl_108(); + static double [][][] var_63 = {{{(-1.54946e-133D)}},{{(-8.15586e-186D)}}}; + final boolean var_66 = true; + static cl_95 var_67 = new cl_95(); + static byte var_72 = (byte)(-25); + static float [][][] var_73 = {{{(-4.19853e-38F),(-3.0596e+35F)}},{{(5.71273e-33F),(-2.60261e-25F)}},{{(3.8335e-35F),(2.17597e+35F)}},{{(-7.65908F),(-0.00363006F)}}}; + static short var_74 = (short)(-13200); + static cl_29 var_81 = new cl_29(); + static int var_88 = (-667295099); + static cl_26 var_89 = new cl_26(); + double var_90 = (-3.29149e+275D); + static boolean [] var_91 = {false,false}; + static float var_93 = (-1.63771e+30F); + static cl_95 var_94 = new cl_95(); + int var_99 = (1763305824); + static int [][] var_101 = {{(-589677875)},{(1672390737)},{(1815586227)},{(1239094769)},{(439766529)}}; + static int var_106 = (423772638); + final static boolean [] var_108 = {false,false,false,false,true,true,false}; + long var_110 = (7837269181999904073L); +/*********************************/ +public static strictfp short func_53(cl_95 var_54, boolean var_55, boolean var_56) +{ + byte var_125 = (byte)(114); + byte var_127 = (byte)(-127); + short [][] var_126 = {{(short)(18516),(short)(28964),(short)(-23748),(short)(-26153)},{(short)(2428),(short)(219),(short)(-5552),(short)(24767)},{(short)(23288),(short)(30612),(short)(22345),(short)(7428)},{(short)(2815),(short)(-15356),(short)(-28950),(short)(-9623)},{(short)(-21357),(short)(10837),(short)(-3566),(short)(-29117)},{(short)(684),(short)(-31508),(short)(11556),(short)(27545)}}; + //if( ( ( boolean )((var_57++)>(byte)(-98)) )) + var_57++; + + int [][] var_83 = {{(-1349322725)},{(-1914028806)},{(1642491635)},{(-235244590)},{(485070675)}}; + int var_75 = (-1059667735); + if( true) + { + float [][][] var_70 = {{{(-8.59155e+37F),(3.81428e-10F),(3.53823e-07F),(-7.01214e+29F),(6.60018e+16F),(3.50873e-22F)},{(1.18489e-15F),(-7.44609e-33F),(-1.00091e-21F),(9.59043e+18F),(1.94509e+08F),(-8.42453e+28F)}},{{(-7.66844e-05F),(-6.53284e-09F),(9.9684e-33F),(9.34879F),(2.67566e-05F),(1.12172e-23F)},{(-1.24625e+37F),(-4.32595e-16F),(-6.78644e+06F),(1.68984F),(-2.18409e-26F),(5.48692e+37F)}},{{(-0.0125907F),(2.023e-38F),(-1.82682e+28F),(-53262.9F),(-3.41548e+33F),(-1.67821e-34F)},{(5.09275e-37F),(-9.14686e+23F),(1.08282e+12F),(-5.87249e-36F),(-2.78577e-05F),(100833F)}},{{(-0.120857F),(-3.11142e+17F),(3.00698e+33F),(-115617F),(3.80013e-26F),(8.17033e-33F)},{(-6.37824e+07F),(0.0913528F),(-6.26767e+16F),(5.85459e-32F),(-1.19863e+13F),(-1.0027e-05F)}},{{(7.41534e+22F),(-8.89105e-33F),(-3.34962e-06F),(-1.99955e+23F),(-1.31964e+34F),(-5.0756e-23F)},{(-5.92924e-05F),(6.94824e-22F),(1.34343e-11F),(2.98842e-31F),(-1.3233e-15F),(-1.68576e+28F)}},{{(-1.81101e-38F),(6.66886e+25F),(2.34644e-08F),(-8.78945e-06F),(-2.56396e+33F),(-2.16684e-20F)},{(63563F),(-1.2051e+18F),(-1.15337e+26F),(-1.67881e-28F),(-4.60454e-17F),(2.47304e+30F)}}}; + boolean [] var_84 = {false,false,false,true,false,false,true}; + byte var_97 = (byte)(-60); + try + { + final float [][][] var_112 = {{{(-1.28772e+33F),(2.11344e-33F)}},{{(3.23685e-23F),(-2.42086e-07F)}},{{(0.0393653F),(4.77176e-06F)}},{{(4.87165e-39F),(0.010111F)}}}; + try + { + int var_61 = (1915400208); + byte var_80 = (byte)(-15); + int var_87 = (826654917); + short var_77 = (short)(15391); + int var_68 = (-430637410); + for( var_61 = 726 ;(var_61<736);var_61 = (var_61+5) ) + { + double var_65 = (-1.17101e+216D); + int var_64 = (-540552655); + var_54 = var_67 ; + } + for( var_68 = 293 ;(var_68<300);var_68 = (var_68+7) ) + { + byte var_71 = (byte)(51); + var_70[((++var_72)&5)][((var_72++)&1)][((var_71++)&5)] = var_73[((++var_75)&3)][0][((+(var_74++))&1)] ; + int var_79 = (761558395); + var_62.var_76 = (((-(var_77--))&var_59.var_78)*var_62.var_76) ; + var_63[((~(var_57--))&1)][((~(++var_77))&0)][0] = ((var_80--)*var_81.var_82) ; + var_73[3][((var_77++)&0)][((var_80--)&1)] = ((var_80--)*( ( byte )var_83[((var_72++)&4)][0] )) ; + var_84[(var_68&6)] = var_84[((var_72++)&6)] ; + var_73[((((var_77++)-var_74)+( ( short )(var_80--) ))&3)][(((-(++var_80))-( ( short )(1684153618) ))&0)][((var_77++)&1)] = (var_75++) ; + var_73[(((var_80--)+( ( short )(var_75++) ))&3)][((var_77--)&0)][((++var_77)&1)] = (var_77++) ; + var_84[(var_68&6)] = ((++var_77)<(2125622126)) ; + } + var_62.var_76 = ((--var_74)|var_57) ; + for( var_87 = 910 ;(var_87>896);var_87 = (var_87-7) ) + { + var_84[(((--var_72)-var_88)&6)] = (((++var_72)+( ( int )(var_80--) ))>(-1274302381)) ; + var_63[(((++var_80)&var_74)&1)][((-(var_72++))&0)][((~(var_57--))&0)] = (var_77++) ; + var_89 = var_89 ; + cl_5 var_96 = new cl_5(); + var_91[(var_87&1)] = false ; + final float var_95 = (-2.04116e-26F); + var_84[(var_87&6)] = (!(((var_75++)+var_93)>=var_59.var_86)) ; + } + if( ( ( boolean )(!(!((var_97--)>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/MainClass.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..b95e39d89b537159f21802621b4508169c89fc97 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/MainClass.java @@ -0,0 +1,602 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=189333068 + +//import java.util.zip.CRC32; + +class MainClass +{ + static byte var_9 = (byte)(95); + static cl_3 var_10 = new cl_3(); + static int var_17 = (494625015); + static cl_99 var_233 = new cl_99(); + static byte var_240 = (byte)(56); + static cl_71 var_241 = new cl_71(); + static cl_110 var_244 = new cl_110(); + static cl_116 var_247 = new cl_116(); + final static cl_153 var_251 = new cl_153(); + static int var_255 = (848840678); + static int var_274 = (1861274845); + static double var_275 = (5.74051e-58D); + static int var_279 = (-1664728896); + final cl_116 var_286 = new cl_116(); + static cl_153 [] var_287 = {new cl_153(),new cl_153(),new cl_153(),new cl_153(),new cl_153(),new cl_153(),new cl_153()}; + double var_289 = (-1.47579e-133D); + static cl_153 var_290 = new cl_153(); + static int var_302 = (2029521543); + final static boolean var_304 = true; + cl_110 var_305 = new cl_110(); + static byte var_310 = (byte)(-14); + float var_312 = (-3.0045e+06F); + int var_324 = (-1358748577); + final boolean var_327 = false; + int var_334 = (1252650532); + long [] var_338 = {(7547187098814043780L),(-8687764293463973210L),(2248183428189175470L),(-1999410945622645095L),(-5514264718384500107L)}; + long var_343 = (7700948331262035155L); + long var_351 = (-1749809777831621759L); + short var_362 = (short)(3125); + final boolean var_365 = true; + long var_366 = (-1340211431491587387L); + int var_379 = (1629169281); + int var_381 = (1036619536); +/*********************************/ +public strictfp void run() +{ + try + { + if( func_0((var_302--) ,var_10 ,var_244.var_225 ,false)) + { + int var_373 = (1748333836); + double [] var_375 = {(7.1248e+169D),(-7.46971e-73D),(2.48057e-304D),(1.59777e-119D),(-9.35537e+147D)}; + for( var_373 = 110 ;(var_373<195);var_373 = (var_373+17) ) + { + int var_376 = (-1763933768); + byte var_377 = (byte)(-51); + var_375[((var_376--)&4)] = ((-(~((var_9++)+( ( int )(var_377++) ))))*var_305.var_84) ; + } + } + } + catch( java.lang.IllegalArgumentException myExp_378 ) + { + for( var_379 = 201 ;(var_379<286);var_379 = (var_379+17) ) + { + int var_380 = (-106052723); + for( var_380 = 408 ;(var_380>407);var_380 = (var_380-1) ) + { + cl_153 var_385 = new cl_153(); + for( var_381 = 963 ;(var_381>928);var_381 = (var_381-7) ) + { + try + { + int var_382 = (478271197); + for( var_382 = 881 ;(var_382>806);var_382 = (var_382-15) ) + { + long var_383 = (-7056357273654054087L); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_384 ) + { + var_290 = var_251 ; + System.out.println("hello exception 1 !"); + } + } + } + } + System.out.println("hello exception 0 !"); + } + return ; +} +public strictfp boolean func_0(float var_1, cl_3 var_2, boolean var_3, boolean var_4) +{ + short var_316 = (short)(12596); + int var_329 = (-415109478); + cl_153 var_318 = new cl_153(); + try + { + byte var_311 = (byte)(-20); + try + { + int var_6 = (-1657115431); + final long var_5 = (-7144845775323238115L); + for( var_6 = 100 ;(var_6<106);var_6 = (var_6+6) ) + { + short var_8 = (short)(-17565); + boolean [][] var_7 = {{false,true,false,false,true,false},{false,false,true,true,false,true},{true,false,false,true,true,true},{true,true,false,true,false,false}}; + if( var_7[((+((--var_9)&var_10.var_11))&3)][((++var_8)&5)]) + { + try + { + if( func_12((!((((var_311++)-(-252654410))-var_289)641);var_324 = (var_324-10) ) + { + var_290.var_325 = (var_1++) ; + } + System.out.println("hello exception 4 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_326 ) + { + long [] var_339 = {(-1080806668882168984L),(3863274350766167935L),(2259175222988680126L),(-8735715527201208950L),(973000648113352651L)}; + byte var_328 = (byte)(96); + try + { + if( (((~(var_328--))+( ( int )(++var_328) ))==var_329)) + { + int var_330 = (6260449); + for( var_330 = 332 ;(var_330>300);var_330 = (var_330-16) ) + { + try + { + var_328 = (var_310--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_331 ) + { + try + { + var_10.var_63.var_137 = (-(var_328--)) ; + } + catch( java.lang.IllegalArgumentException myExp_332 ) + { + int var_333 = (1200296404); + System.out.println("hello exception 7 !"); + } + System.out.println("hello exception 6 !"); + } + } + } + else + { + try + { + for( var_334 = 1023 ;(var_334<1026);var_334 = (var_334+1) ) + { + if( ((+(~(var_302++)))>=var_274)) + { + var_290 = var_251 ; + } + else + { + var_329 = (~(var_316--)) ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_335 ) + { + long [] var_337 = {(574059727508961373L),(-8540787358979063530L),(5065445176226310969L),(7566873261202745652L),(2684175995452436395L)}; + var_241.var_336 = var_338 ; + System.out.println("hello exception 8 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_340 ) + { + long var_354 = (-7459330353442262260L); + try + { + try + { + int var_341 = (696853546); + for( var_341 = 123 ;(var_341<129);var_341 = (var_341+6) ) + { + if( func_12((!(!((++var_328)<=func_20((+(++var_328)) ,(--var_343) ,var_255 ,var_343)))) ,var_289 ,(((var_316--)|var_255)+( ( int )(++var_328) )) ,( ( long )((var_9++)+( ( int )(var_329++) )) ))) + { + var_290.var_325 = (--var_351) ; + } + } + } + catch( java.lang.IllegalArgumentException myExp_352 ) + { + if( (!(((--var_328)-var_9)=var_244.var_84)) ; + System.out.println("hello exception 13 !"); + } + System.out.println("hello exception 12 !"); + } + } + System.out.println("hello exception 11 !"); + } + System.out.println("hello exception 9 !"); + } + System.out.println("hello exception 5 !"); + } + return ((var_1++)680);var_17 = (var_17-15) ) + { + int var_260 = (1642261175); + cl_71 var_269 = new cl_71(); + byte var_19 = (byte)(107); + float var_18 = (2.04749e+16F); + var_16 = (++var_19) ; + try + { + try + { + if( ((var_19++)==func_20((var_15--) ,(var_260++) ,(636478928) ,((var_240--)+var_10.var_70)))) + { + try + { + var_233.var_157 = var_233.var_157 ; + } + catch( java.lang.IllegalArgumentException myExp_264 ) + { + var_247.var_265 = var_10.var_50.var_266 ; + System.out.println("hello exception 14 !"); + } + } + else + { + boolean var_267 = true; + } + } + catch( java.lang.ArithmeticException myExp_268 ) + { + try + { + try + { + var_241 = var_241 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_270 ) + { + boolean [][][] var_271 = {{{false,false,false,true,true,false,true},{true,false,true,false,false,false,true},{false,false,true,false,true,true,false},{true,true,true,false,true,true,true},{false,true,false,true,false,true,true},{false,false,true,false,true,true,false}},{{true,true,false,true,true,false,true},{false,true,true,false,false,true,true},{true,false,false,false,false,true,true},{true,true,true,false,true,false,false},{true,false,true,true,false,true,true},{true,false,true,true,true,false,false}}}; + System.out.println("hello exception 16 !"); + } + } + catch( java.lang.ArithmeticException myExp_272 ) + { + var_241 = var_241 ; + System.out.println("hello exception 17 !"); + } + System.out.println("hello exception 15 !"); + } + } + catch( java.lang.ArithmeticException myExp_273 ) + { + for( var_274 = 859 ;(var_274>844);var_274 = (var_274-3) ) + { + try + { + int var_276 = (-393780400); + for( var_276 = 784 ;(var_276>770);var_276 = (var_276-14) ) + { + double var_277 = (-2.0958e-35D); + } + } + catch( java.lang.ArithmeticException myExp_278 ) + { + for( var_279 = 772 ;(var_279>682);var_279 = (var_279-18) ) + { + var_275 = (var_19--) ; + } + System.out.println("hello exception 19 !"); + } + } + System.out.println("hello exception 18 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_280 ) + { + int [][] var_282 = {{(-937852105),(-608127065),(847977158),(2061948417),(415280947),(-240085740)},{(-1265643856),(-1428536538),(1718498641),(-48358533),(-574291065),(1012292441)},{(2043118319),(895256925),(1661643118),(-2071554307),(-1334405892),(-824575541)},{(1944763381),(1447598968),(-231413729),(-1540151930),(-1553281969),(-1961403799)}}; + int var_293 = (490345866); + try + { + var_282[(((--var_9)*var_9)&3)][((~(++var_283))&5)] = ((var_283--)*var_15) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_284 ) + { + float var_294 = (-4.48842e-14F); + short var_307 = (short)(6633); + try + { + cl_153 var_300 = new cl_153(); + try + { + final cl_153 var_291 = new cl_153(); + try + { + var_241.var_212 = (--var_283) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_285 ) + { + try + { + var_287 = var_287 ; + } + catch( java.lang.IllegalArgumentException myExp_288 ) + { + var_287[6] = var_291 ; + System.out.println("hello exception 23 !"); + } + System.out.println("hello exception 22 !"); + } + } + catch( java.lang.ArithmeticException myExp_292 ) + { + double [][][] var_297 = {{{(4.08652e+184D),(-2.27675e-223D),(-8.63861e+193D),(-2.87178e+252D),(9.10227e+165D),(52717.4D)},{(-1.07001e-97D),(2.75126e+41D),(-2.95707e+254D),(-1.43309e+60D),(-3.7602e+187D),(3.72617e-102D)},{(-1.54837e+148D),(-3.84141e+270D),(4.14892e-13D),(3.16258e+91D),(1.09955e-290D),(1.29909e+105D)},{(3.69278e-81D),(-3.4411e+205D),(-8.61864e-122D),(-8.86826e+186D),(-1.7278e-305D),(1.28589e-153D)}},{{(-4.66156e+148D),(-2.4111e+168D),(-1.41082e+130D),(3.2787e+244D),(3.26113e+280D),(2.73793e-261D)},{(2.03888e+238D),(3.61052e-207D),(5.69996e+32D),(-1.51257e+260D),(9.31799e+273D),(2.10456e+30D)},{(4.1719e+224D),(2.31759e+237D),(1.19199e+240D),(-2.63784e-53D),(-1.36008e+73D),(1.62711e-99D)},{(1.76098e+258D),(1.38826e-257D),(2.40782e+306D),(-3.67372e-192D),(-2.83817e+180D),(3.32677e-180D)}}}; + try + { + if( (((--var_283)*( ( byte )(var_293++) ))var_233.var_137); +} +public static strictfp short func_20(double var_21, long var_22, int var_23, long var_24) +{ + short var_27 = (short)(30126); + float var_242 = (2.62023e+28F); + int var_25 = (1827678052); + for( var_25 = 865 ;(var_25>859);var_25 = (var_25-6) ) + { + int var_26 = (-520815252); + short var_246 = (short)(-25030); + float [] var_253 = {(1.5327e-08F),(-3.25332e+07F),(7.37096e-24F),(-1.65103e+10F),(3.81701e+34F),(3.7102e+25F)}; + float [] var_239 = {(-3.20517e-15F),(-1.3557e+33F),(-2.00701e+32F),(-3.54107e-22F)}; + for( var_26 = 177 ;(var_26<253);var_26 = (var_26+19) ) + { + byte var_254 = (byte)(-27); + if( ((var_27--)!=var_10.func_28())) + { + cl_99 var_235 = new cl_99(); + try + { + try + { + try + { + var_10.var_63.var_64 = ((var_9--)+var_233.var_157) ; + } + catch( java.lang.IllegalArgumentException myExp_234 ) + { + var_233 = var_235 ; + System.out.println("hello exception 30 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_236 ) + { + int var_237 = (290465276); + for( var_237 = 605 ;(var_237>545);var_237 = (var_237-12) ) + { + var_239[(((--var_240)|var_241.var_67)&3)] = (var_242++) ; + } + System.out.println("hello exception 31 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_243 ) + { + try + { + try + { + var_244 = var_244 ; + } + catch( java.lang.IllegalArgumentException myExp_245 ) + { + var_239[((var_23--)&3)] = var_239[(((--var_246)&var_247.var_248)&3)] ; + System.out.println("hello exception 33 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_249 ) + { + int var_250 = (1072512301); + for( var_250 = 1009 ;(var_250<1017);var_250 = (var_250+4) ) + { + var_239[(((--var_240)-var_251.var_252)&3)] = var_253[(((~(var_254++))*var_240)&5)] ; + } + System.out.println("hello exception 34 !"); + } + System.out.println("hello exception 32 !"); + } + } + else + { + for( var_255 = 770 ;(var_255<783);var_255 = (var_255+13) ) + { + int var_256 = (850449443); + for( var_256 = 156 ;(var_256<207);var_256 = (var_256+17) ) + { + try + { + boolean var_257 = false; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_258 ) + { + var_241 = var_241 ; + System.out.println("hello exception 35 !"); + } + } + } + } + } + } + return (--var_240); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(256); + CrcCheck.ToByteArray(this.var_9,b,"var_9"); + CrcCheck.ToByteArray(this.var_10.GetChecksum(),b,"var_10.GetChecksum()"); + CrcCheck.ToByteArray(this.var_17,b,"var_17"); + CrcCheck.ToByteArray(this.var_233.GetChecksum(),b,"var_233.GetChecksum()"); + CrcCheck.ToByteArray(this.var_240,b,"var_240"); + CrcCheck.ToByteArray(this.var_241.GetChecksum(),b,"var_241.GetChecksum()"); + CrcCheck.ToByteArray(this.var_244.GetChecksum(),b,"var_244.GetChecksum()"); + CrcCheck.ToByteArray(this.var_247.GetChecksum(),b,"var_247.GetChecksum()"); + CrcCheck.ToByteArray(this.var_251.GetChecksum(),b,"var_251.GetChecksum()"); + CrcCheck.ToByteArray(this.var_255,b,"var_255"); + CrcCheck.ToByteArray(this.var_274,b,"var_274"); + CrcCheck.ToByteArray(this.var_275,b,"var_275"); + CrcCheck.ToByteArray(this.var_279,b,"var_279"); + CrcCheck.ToByteArray(this.var_286.GetChecksum(),b,"var_286.GetChecksum()"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_287[a0].GetChecksum(),b,"var_287" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_289,b,"var_289"); + CrcCheck.ToByteArray(this.var_290.GetChecksum(),b,"var_290.GetChecksum()"); + CrcCheck.ToByteArray(this.var_302,b,"var_302"); + CrcCheck.ToByteArray(this.var_304,b,"var_304"); + CrcCheck.ToByteArray(this.var_305.GetChecksum(),b,"var_305.GetChecksum()"); + CrcCheck.ToByteArray(this.var_310,b,"var_310"); + CrcCheck.ToByteArray(this.var_312,b,"var_312"); + CrcCheck.ToByteArray(this.var_324,b,"var_324"); + CrcCheck.ToByteArray(this.var_327,b,"var_327"); + CrcCheck.ToByteArray(this.var_334,b,"var_334"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_338[a0],b,"var_338" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_343,b,"var_343"); + CrcCheck.ToByteArray(this.var_351,b,"var_351"); + CrcCheck.ToByteArray(this.var_362,b,"var_362"); + CrcCheck.ToByteArray(this.var_365,b,"var_365"); + CrcCheck.ToByteArray(this.var_366,b,"var_366"); + CrcCheck.ToByteArray(this.var_379,b,"var_379"); + CrcCheck.ToByteArray(this.var_381,b,"var_381"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/Start.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..9c434f5a69e82c612b3c0067ebeff4fbb62031f4 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_71.java cl_153.java cl_116.java cl_3.java CRC32.java CrcCheck.java cl_99.java cl_110.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_110.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_110.java new file mode 100644 index 0000000000000000000000000000000000000000..8c54c199d8012af30faa254e19c3222559220022 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_110.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=189333068 + +//import java.util.zip.CRC32; + +class cl_110 +{ + long [][][] var_81 = {{{(3988525376025794243L),(-2160193992002041829L),(4752361816372011982L),(-1227521046318077240L),(-3735097075897154721L),(901754842588991297L)},{(4564898282710507590L),(-7864586852142175814L),(4796243669042444695L),(-4291590382081565606L),(-3204448864407643842L),(3573367987536346584L)},{(5574240896664886692L),(-1684733787390438425L),(-5596235915937279742L),(-8128662532317405867L),(-7645246632866678281L),(7997579495874544163L)},{(-5142402972520795096L),(7022876950027708920L),(6812092262136861298L),(-8217966976334989237L),(7157153259600143991L),(4258334747062715205L)},{(529139901076304707L),(1348089273792915119L),(-3122917150238508162L),(9075519688988550242L),(5139965031134297578L),(-974956891590850859L)},{(-7581822581476486625L),(8928662568298914323L),(2806455465333008183L),(-1454798323263806875L),(189011922595232802L),(-5969494293522182981L)},{(4285240719575183428L),(-8037546046551124456L),(2138858135805177196L),(2898187129077444650L),(6393213399631550326L),(-2770002865234190424L)}},{{(6248641774379675339L),(8079392863189233131L),(-1954178995038948537L),(8422061308720382688L),(7084858156757826052L),(-2572758946824956648L)},{(-176181371517619805L),(6669569854482606262L),(3689561813569453320L),(-504411427916923662L),(-142625640694506399L),(8333815733648434885L)},{(2209149302666094666L),(8000380905474727618L),(-261537815901506362L),(1791036770652958207L),(-2308040825206625163L),(528629231533326528L)},{(-5300970921115963157L),(-6193773709399418380L),(2722799837248124700L),(1047720675725911047L),(-5999047172045922481L),(-5716467048598779038L)},{(196788078592793425L),(-6599488824703204483L),(-2285283835678004669L),(6530466068103601870L),(716388289882123374L),(-7063191311613617896L)},{(4676903161383643290L),(-4176354957916230501L),(-2095257724361652950L),(323385956391175625L),(-7093883014506665062L),(-6699928224170533904L)},{(-4644295230010620345L),(3409222172927281125L),(3810031463953915151L),(453998585598664737L),(3568641177299443325L),(549906490287248400L)}},{{(-7171053009733713043L),(8164451041832089811L),(-6111359666923416643L),(-5403344318775125913L),(785616651036597854L),(-3269039638800753704L)},{(1496865131753073665L),(2432639567765421812L),(-3733626593468673963L),(-4099157261620590988L),(1253824728090742499L),(-7506207723432978860L)},{(1655836135739014091L),(4249754098631216655L),(-8860802673617602902L),(3260449834928345891L),(4097091537766962445L),(906885869902177061L)},{(5993257939070991708L),(2643057753749754719L),(8377607167178230377L),(3474419815936890518L),(-2807705369216054457L),(1095859086300511456L)},{(4750325875029118935L),(1618257522620674146L),(-297447318843995210L),(-7499408556300962258L),(5787424579699384153L),(3235418281512240029L)},{(-3486925625097705909L),(7729420437202419309L),(6668819967848916362L),(-680286432571195289L),(91958498701996070L),(-227098737226319345L)},{(4947381040147298287L),(-2536695525297643485L),(-6902628018116251591L),(-8701348525183254883L),(8971775105371885779L),(-4209310956473859808L)}},{{(7469861186963949986L),(3731370369713428155L),(7086967268596884808L),(-5498994113837379637L),(-7796979863600454111L),(-1264992890264755703L)},{(1144561658728057302L),(-5670599922639303761L),(-978359949026347776L),(-6536953119963902436L),(-5623671726287372261L),(7749326892768624641L)},{(910760137561128633L),(6310421049353694576L),(855896772808874745L),(-2189092279580480430L),(-736142116142055840L),(-6317277970621155382L)},{(4047782873653099825L),(-3566432891120539124L),(-3523545838457268877L),(-1796665995787212398L),(-700503223716388531L),(3727852455449743940L)},{(-975394824193692518L),(-3315787514767676584L),(8060133671041460965L),(-608160491338962859L),(5623532413273620456L),(-723583955758521539L)},{(7623231889407353249L),(-9149187341512297662L),(-4628995267250837786L),(4316210071533494661L),(4776116703580954041L),(2684952773022593014L)},{(-5545749454001104858L),(8203704918534695224L),(1588608398391029653L),(-8199488983210518208L),(7714499100163160751L),(6306543087983492156L)}}}; + double var_84 = (-1.07772e-282D); + byte var_177 = (byte)(80); + int var_192 = (2082362380); + short var_224 = (short)(12725); + boolean var_225 = false; + final boolean [] var_230 = {true}; + double [][][] var_298 = {{{(-8.30007e+177D),(1.11159e-230D),(1.64166e+25D),(-4.61268e+294D),(4.50499e-142D),(-8.00122e+185D)},{(1.79647e+121D),(-4.07921e-67D),(-4.2613e-235D),(-4.26328e+62D),(-1.09798e+90D),(-4.04141e+47D)},{(4.71783e-255D),(-1.1402e-119D),(-1.10236e+89D),(5.44905e-72D),(3.94321e-93D),(3.69235e+212D)},{(-2.74252e+197D),(-7.46692e+271D),(3.73914e+106D),(-4.94002e+146D),(-2.15415e+130D),(6.89942e+62D)}},{{(1.37975e+07D),(-1.70487e+89D),(1.7751e+224D),(-4.23963e+245D),(-2.88217e+282D),(1.53202e+187D)},{(4.50137e+71D),(3.06368e+194D),(-2.28952e-210D),(1.85484e+186D),(7.06664e-241D),(-1.43411e-13D)},{(-7.37342e-125D),(9.68133e-185D),(-5.10707e-08D),(5.24401e+290D),(1.41202e-279D),(-9.32802e+84D)},{(2.6678e-101D),(3.10361e-89D),(1.12912e-306D),(2.18915e-220D),(1.54735e+192D),(-7.40214e-09D)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1745); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_81[a0][a1][a2],b,"var_81" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + CrcCheck.ToByteArray(this.var_177,b,"var_177"); + CrcCheck.ToByteArray(this.var_192,b,"var_192"); + CrcCheck.ToByteArray(this.var_224,b,"var_224"); + CrcCheck.ToByteArray(this.var_225,b,"var_225"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_230[a0],b,"var_230" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_298[a0][a1][a2],b,"var_298" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_116.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_116.java new file mode 100644 index 0000000000000000000000000000000000000000..693e8f21dc3312ff7f50c8a26fe755b0a7db98eb --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_116.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=189333068 + +//import java.util.zip.CRC32; + +class cl_116 +{ + long var_76 = (6516039371946602934L); + byte var_102 = (byte)(-65); + int var_160 = (1617940582); + boolean var_191 = true; + boolean [] var_231 = {true}; + short var_248 = (short)(-26828); + int [][] var_265 = {{(-510737135),(-805316677)},{(1033001152),(1546727080)}}; + double [][][] var_296 = {{{(5.727e-103D),(-7.21109e+129D),(7.0347e-155D),(1.96148e-112D),(8.01109e-256D),(-17.3913D)},{(-4.63116e+288D),(2.71494e-33D),(1.08853e+108D),(1.09558e+221D),(3.57704e+160D),(-85.1344D)},{(-4.92159e+277D),(-9.26299e+167D),(1.06257e-113D),(1.03768e+147D),(1.17023e-174D),(-2.53888e+280D)},{(8.88937e-284D),(-4.3982e+269D),(4.35407e-193D),(-2.57654e-87D),(1.31214e+65D),(5.10544e+110D)}},{{(-1.64032e-136D),(-1.33718e+22D),(-1.71117e+40D),(5.13393e+245D),(4.32362e+133D),(4.03698e+227D)},{(-1.75494e+216D),(2.73917e-222D),(-3.73846e-167D),(-4.73034e-280D),(-1.71744e-262D),(-3.91886e-25D)},{(9.96782e+210D),(-1.33657e-247D),(3.25711e-296D),(2.11132e-143D),(5.05234e-240D),(-5.37438e-100D)},{(-4.34666e-155D),(2.17398e+91D),(3.03837e-22D),(-29.2164D),(-1.45791e+178D),(2.23593e+280D)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(417); + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + CrcCheck.ToByteArray(this.var_102,b,"var_102"); + CrcCheck.ToByteArray(this.var_160,b,"var_160"); + CrcCheck.ToByteArray(this.var_191,b,"var_191"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_231[a0],b,"var_231" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_248,b,"var_248"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_265[a0][a1],b,"var_265" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_296[a0][a1][a2],b,"var_296" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_153.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_153.java new file mode 100644 index 0000000000000000000000000000000000000000..0c8dc07acb57e11ef06b6e95d66883f7489ff3e7 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_153.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=189333068 + +//import java.util.zip.CRC32; + +class cl_153 +{ + boolean [] var_131 = {true}; + int var_252 = (2072773388); + final short var_309 = (short)(28292); + double var_325 = (-7.29179e+223D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(15); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_131[a0],b,"var_131" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_252,b,"var_252"); + CrcCheck.ToByteArray(this.var_309,b,"var_309"); + CrcCheck.ToByteArray(this.var_325,b,"var_325"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_3.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_3.java new file mode 100644 index 0000000000000000000000000000000000000000..911398e652cfcc1c9030e4d3b815d8e75e7daa09 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_3.java @@ -0,0 +1,488 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=189333068 + +//import java.util.zip.CRC32; + +class cl_3 +{ + static int var_11 = (-1228416745); + static float var_30 = (-1.67828e-17F); + static boolean [] var_38 = {false,false,false}; + static int var_39 = (-1287693996); + static int var_40 = (-763480108); + static cl_71 var_50 = new cl_71(); + static double [][][] var_58 = {{{(-2.8949e-143D),(-1.32093e-247D),(-9.71838e+238D)}},{{(1.42543e+308D),(1.69306e-228D),(4.31014e-175D)}}}; + static byte var_61 = (byte)(-107); + static short var_62 = (short)(668); + static cl_99 var_63 = new cl_99(); + static boolean var_69 = true; + static long var_70 = (-7406438721051114051L); + static cl_116 [] var_71 = {new cl_116(),new cl_116()}; + static cl_116 var_73 = new cl_116(); + static cl_116 var_74 = new cl_116(); + static cl_110 var_80 = new cl_110(); + static long [][][] var_82 = {{{(-4871069600466917428L),(4621541792357344763L),(-1495327835483878323L),(5114532641930125133L),(-1165787477610727430L),(7433204419656045491L)},{(2495271545819995441L),(1011977388048874548L),(7308062974443634387L),(6350256785025363820L),(-7435982231886028241L),(-522814567794773242L)},{(3148465568760651185L),(3844112384717116076L),(6857345950431957050L),(4550078120301887778L),(-8202401694269384483L),(-5785953926545409529L)},{(1943426884296543686L),(6368104527536188808L),(-1274166347844035791L),(2544127820623709645L),(1102664175746425883L),(2192521573586867364L)},{(-1682254423914856625L),(5172824123624834127L),(-151946104177594771L),(-6634556480646486731L),(1928076087514505637L),(9132209706190594679L)},{(-3727791630292376608L),(-4450251155869066468L),(-7705201481666407121L),(4993552969986844522L),(5444985772179339206L),(6529143835452445962L)},{(-3252650297075171971L),(-4656161477409430376L),(965721463903360781L),(-7017630634639344778L),(1144363333399729223L),(6733778402406899719L)}},{{(-8010787947282025557L),(4228908856320666767L),(-825831044098275444L),(-468453349735803470L),(3868597297987859890L),(-4860396795883331431L)},{(6609413578937874381L),(7264721158379867884L),(-3169014385065875752L),(1836432761190081867L),(-1730661119407540064L),(-599509189648361319L)},{(6284978606435409804L),(-6338182548801198285L),(8973774470428416748L),(-6559418127780198001L),(3877959405309752993L),(5069778665085625835L)},{(582474403821087241L),(-5220182558340282390L),(9219701185149939054L),(-9033651115093198703L),(4026437588605546121L),(2314634560364779581L)},{(-3196185500984870166L),(-2405404335375607870L),(-1124028680178092558L),(5098380692531044640L),(-1274661183778074288L),(6963124402074292308L)},{(1852191873306165891L),(-3985075022450351245L),(5988579759142429590L),(-4551589564962154354L),(923622067524794196L),(3132056163977138774L)},{(-5226874550555749098L),(6272523534300304943L),(2776041628507127210L),(-7418526009784876513L),(58132488314497649L),(4769414863080223775L)}},{{(-560142056922282146L),(299399764530619102L),(-7478379608806698267L),(-6110124935611508095L),(3742930572480282659L),(-3470131489408464246L)},{(5762874150448932907L),(-2250491490422268839L),(-3650318073205263377L),(1541530305983737279L),(7922053007968894804L),(8189476532115340390L)},{(4081855037955443948L),(-9024594605845733600L),(5029964682535353751L),(3048429414956150711L),(9035652581301809206L),(4242041402823726592L)},{(2655676573225508097L),(8779582263691333933L),(7045033393905762654L),(-5561464673650135466L),(3181604565515455156L),(5498023518144672877L)},{(-4817153788371598371L),(7152803309579733848L),(-8265723047203168442L),(-8138261321788369078L),(-626612324385650335L),(8622095818742472764L)},{(2761468843064111532L),(-2502312143360739259L),(-1790746371302531980L),(-40807890161026989L),(501898540147519772L),(-102825549408459525L)},{(-8067542242029952489L),(3978715037491910125L),(-3653945936794062339L),(-3949224603407475257L),(5193580812348904713L),(-8899029491441034315L)}},{{(389610788397932945L),(-8974968419314646549L),(2511095129707364867L),(1712814974768735995L),(-2574605792969790522L),(-3579133167090352297L)},{(-9093234845606548895L),(-3154942215749424065L),(8773944419182018823L),(-2880346701514425766L),(-1123253745733474087L),(1346876700981433310L)},{(2593807511213804101L),(-6054684108081715855L),(-4683859212619753132L),(4838152608526936964L),(-7105388276707196819L),(-3621823011613367703L)},{(128083656987766813L),(5544766557792304199L),(-8626700094876401040L),(-1061087857372382090L),(-9090243418083144732L),(-5615630391995378151L)},{(-7044009968901683661L),(3907713911979915511L),(2233200499438992069L),(7427856490753191143L),(-4941578761220221117L),(3654634442291086246L)},{(-1814935623049161582L),(8938752884449395201L),(-4575480442490437045L),(-3929167133684122449L),(-1192484093598458797L),(-7879742439990875421L)},{(7962621588005716411L),(8598573965301880105L),(-5564368654637487742L),(-5213049046014474600L),(9200059403597070238L),(292770662613426542L)}}}; + static int [][][] var_93 = {{{(-671525306),(542090802),(-696652532),(627101396),(-408361053),(-142344638)}},{{(-1876980402),(1892985960),(-1377717271),(1105129711),(2021833761),(-1808251382)}},{{(-469335111),(1168362640),(1956860023),(-857030153),(-1312252609),(-1845541378)}},{{(1926602713),(-678005631),(789629239),(-805045988),(-791919543),(2095230999)}},{{(-481082362),(-1521013476),(1175745310),(-2121390789),(-896671160),(672542086)}},{{(283916143),(-813153737),(1432917375),(-74617751),(312934207),(-1410067571)}}}; + static short var_94 = (short)(-4166); + static short var_96 = (short)(-1365); + static float [][] var_99 = {{(-3.84787e+14F),(-4.55421e+12F)},{(2.47765e-24F),(-5.21764e-05F)},{(144436F),(5.61273e-29F)},{(1.38195e-37F),(3.96348e-09F)}}; + static byte var_100 = (byte)(-5); + static boolean [] var_119 = {false}; + static cl_153 var_130 = new cl_153(); + static short var_138 = (short)(-19508); + static long var_139 = (7237977489566877109L); + static byte var_145 = (byte)(-122); + static byte var_147 = (byte)(6); + static short var_158 = (short)(2173); + static cl_153 [][] var_162 = {{new cl_153(),new cl_153(),new cl_153(),new cl_153()},{new cl_153(),new cl_153(),new cl_153(),new cl_153()},{new cl_153(),new cl_153(),new cl_153(),new cl_153()},{new cl_153(),new cl_153(),new cl_153(),new cl_153()}}; + static cl_153 [][] var_163 = {{new cl_153(),new cl_153(),new cl_153(),new cl_153()},{new cl_153(),new cl_153(),new cl_153(),new cl_153()},{new cl_153(),new cl_153(),new cl_153(),new cl_153()},{new cl_153(),new cl_153(),new cl_153(),new cl_153()}}; + static short var_166 = (short)(-6487); + static double [][][] var_183 = {{{(8.6586e-10D),(1.77068e-304D)},{(-7.79036e-265D),(2.82632e+85D)},{(-4.23855e+239D),(1.64768e+139D)},{(1.58448e+175D),(1.35934e+70D)},{(-4.48684e+232D),(-6.31659e+261D)}},{{(3.46458e+259D),(-1.45479e+107D)},{(2.68378e+225D),(4.70324e+80D)},{(9.95501D),(-6.44584e-71D)},{(1.41506e-196D),(9.84083e+288D)},{(-8.79271e-246D),(-9.0807e-212D)}},{{(-5.05156e+93D),(2.07805e-249D)},{(6.74774e-293D),(-8.85457e+88D)},{(-3.77965e-225D),(4.61708e-274D)},{(-5.83022e-157D),(3.91008e+65D)},{(-1.17856e+305D),(-1.95413e+35D)}},{{(4.63278e+237D),(7.41301e-302D)},{(8.42449e-136D),(4.40424e-219D)},{(-8.06039e-196D),(4.01373e+134D)},{(-1.75927e-300D),(-3.88321e+258D)},{(-1.45935e+128D),(2.06022e+180D)}},{{(-2.08245e+102D),(-5.11577e-96D)},{(2.15227e+218D),(-3.9518e+46D)},{(-2.90829e-273D),(-1.39815e-120D)},{(-1.46209e+153D),(-1.5401e-164D)},{(-1.36873e+203D),(-1.10763e+44D)}}}; + static double var_188 = (-4.12614e+209D); + final static boolean [] var_199 = {true}; + static int var_206 = (1456628009); + static int var_214 = (-1063851976); +/*********************************/ +public static strictfp float func_28() +{ + long var_196 = (-661751946625838042L); + cl_116 var_227 = new cl_116(); + cl_153 var_204 = new cl_153(); + boolean [][] var_215 = {{false,false,false,false,false,false},{true,true,false,true,true,false},{false,false,true,false,true,false},{true,false,true,false,true,false}}; + try + { + float [][][] var_165 = {{{(-6.37892e-27F),(5.70532e+22F),(7.28729e+29F)},{(-1.52705e+28F),(-4.03605e+29F),(1.80855e+10F)},{(-1.0739e-27F),(3.53378e-09F),(-1.7849e-32F)},{(1.90855e-11F),(-2.86153e-26F),(2.70074e-30F)},{(2.01338e+21F),(-1.16331e+21F),(8.27514e-38F)}},{{(-9.90728e+13F),(-0.18694F),(-0.831342F)},{(1.98983e+35F),(3.99981e+11F),(-3.2618e+34F)},{(1.39549e-33F),(-1.9304e+26F),(-2.04866e+35F)},{(3.67469e+16F),(3.35794e-31F),(2.16763e-27F)},{(-3.2327e+08F),(-4.29125e-08F),(-5.4536e-12F)}},{{(-2.46772e-08F),(-619945F),(-1.12341e+22F)},{(1.27771e-37F),(-9.45534e-06F),(2.79717e-38F)},{(-8.9723e-22F),(-1.80867e+22F),(-963164F)},{(-2.22058e-39F),(-2.71296e-39F),(-4.98663e-27F)},{(-470956F),(4.83794e+23F),(-2.43186e+22F)}},{{(7.52675e+06F),(6.54731e+23F),(-1.18041e+35F)},{(2.77316e-15F),(-5.00804e-09F),(9.64949e+25F)},{(9.97949e-22F),(4.72925e-15F),(3.04845e-18F)},{(-6.44839e+06F),(-0.0288148F),(-2.66806e+30F)},{(4.90923e-30F),(5.27994e+20F),(1.88719e-25F)}}}; + double [][][] var_143 = {{{(-1.24698e+289D),(-1.49236e-212D)},{(1.63705e+78D),(1.29661e-187D)},{(6.33148e+266D),(4.66233e+239D)},{(1.9273e-116D),(-3.16974e-150D)},{(-3.78989e-255D),(4.67454e+287D)}},{{(-9.76833e-150D),(1.96943e+152D)},{(7.48799e-96D),(1.728e-301D)},{(-1.68662e-208D),(-4.24269e+179D)},{(4.29466e+163D),(3.90857e+189D)},{(-2.98121e-148D),(-3.3064e-108D)}},{{(4.98035e-210D),(-6.8659e+50D)},{(-2.27176e+116D),(-1.49896e+103D)},{(7.14515e+172D),(-1.87035e+58D)},{(2.51259e-59D),(-2.38445e+276D)},{(1.72481e-40D),(-4.53352e-302D)}},{{(-4.64857e+152D),(-6.12179e-25D)},{(9.00725e-234D),(-1.59936e-07D)},{(5.25705e+188D),(-3.97514e-89D)},{(2.19796e+92D),(-2.57091e-298D)},{(1.42159e-85D),(7.61261e-128D)}},{{(2.90954e-33D),(6.80666e-304D)},{(3.25535e+196D),(-2.84136e+83D)},{(-4.97807e+188D),(-9.38665e+273D)},{(1.41239e+158D),(-9.11464e+221D)},{(3.44425e-255D),(2.1346e-08D)}}}; + try + { + int var_141 = (1246131731); + byte var_29 = (byte)(92); + short var_193 = (short)(-21464); + cl_71 var_151 = new cl_71(); + int var_149 = (-469313387); + if( (!(((var_29++)-var_30)>=func_31((var_139++) ,(var_141++) ,var_143 ,((++var_145)>=func_43((-1328366) ,(++var_147) ,(~(++var_149)) ,var_151 ,var_130.var_131 ,(1124243939))) ,(7656139481785571025L))))) + { + try + { + try + { + if( var_69) + { + var_63.var_157 = ((var_158--)|var_11) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_159 ) + { + try + { + var_73.var_160 = ((--var_29)|var_11) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_161 ) + { + var_162 = var_163 ; + System.out.println("hello exception 37 !"); + } + System.out.println("hello exception 36 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_164 ) + { + short var_171 = (short)(11746); + int [][] var_176 = {{(-1118059328),(1847695832),(739616235),(1841132125),(1112892015),(1927492050),(1848615251)},{(-269860232),(1408090413),(-872053844),(-1021853335),(448605754),(-840590041),(-701988626)},{(-545569080),(803528221),(1643685424),(581343049),(220424836),(-2083660613),(-732971109)},{(1868226818),(1891299041),(-891650474),(-679203880),(1663730011),(-1179337518),(1839810270)},{(1387848061),(-1945225789),(-219098912),(-483411581),(1826670852),(408708910),(758127152)},{(-365753947),(190876910),(-276077066),(449802333),(-700867314),(-1103332192),(694892561)},{(1456147445),(-1325013419),(-407315704),(1570540284),(-126999831),(-1053119554),(755626968)}}; + try + { + if( (!(((++var_147)*var_158)==func_31(var_165[((++var_166)&3)][((var_29--)&4)][((-(--var_29))&2)] ,(var_147--) ,var_143 ,(((++var_145)>var_94)!=( ( boolean )((var_29++)>func_43((var_138++) ,((var_171--)-var_39) ,((++var_29)+var_147) ,var_151 ,var_119 ,var_176[(((++var_145)|var_80.var_177)&6)][((--var_141)&6)])) )) ,((--var_100)*( ( long )(4.50843F) )))))) + { + double var_181 = (3.29586e-257D); + } + } + catch( java.lang.IllegalArgumentException myExp_182 ) + { + var_143 = var_183 ; + System.out.println("hello exception 39 !"); + } + System.out.println("hello exception 38 !"); + } + } + else + { + int var_184 = (-641450312); + for( var_184 = 699 ;(var_184>623);var_184 = (var_184-19) ) + { + if( (!(!(!(((var_29--)=var_50.var_51)))) ; + System.out.println("hello exception 40 !"); + } + } + } + } + } + catch( java.lang.ArithmeticException myExp_203 ) + { + final float var_211 = (4.26175e-13F); + byte var_208 = (byte)(-68); + try + { + var_130 = var_130 ; + } + catch( java.lang.ArithmeticException myExp_205 ) + { + for( var_206 = 433 ;(var_206>379);var_206 = (var_206-18) ) + { + try + { + try + { + var_50.var_207 = (var_208--) ; + } + catch( java.lang.IllegalArgumentException myExp_209 ) + { + var_204 = var_130 ; + System.out.println("hello exception 43 !"); + } + } + catch( java.lang.ArithmeticException myExp_210 ) + { + var_63.var_64 = var_50.var_212 ; + System.out.println("hello exception 44 !"); + } + } + System.out.println("hello exception 42 !"); + } + System.out.println("hello exception 41 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_213 ) + { + short var_218 = (short)(15592); + byte var_216 = (byte)(37); + for( var_214 = 596 ;(var_214>580);var_214 = (var_214-16) ) + { + if( var_215[((-(var_216++))&3)][((((var_216++)&var_206)|var_50.var_67)&5)]) + { + if( (!((var_94--)==func_31((++var_30) ,(++var_218) ,var_183 ,var_63.var_68 ,(var_11--))))) + { + boolean [] var_232 = {false}; + try + { + int var_223 = (-123238569); + for( var_223 = 193 ;(var_223<215);var_223 = (var_223+11) ) + { + var_215[(((++var_61)*var_80.var_224)&3)][(((++var_216)-( ( byte )(((var_100++)+var_145)&var_61) ))&5)] = (!(!(((++var_196)293);var_37 = (var_37-4) ) + { + for( var_39 = 347 ;(var_39<362);var_39 = (var_39+3) ) + { + long var_116 = (-8758819806280626019L); + cl_71 var_123 = new cl_71(); + if( true) + { + int [] var_101 = {(972396391)}; + short var_42 = (short)(10088); + try + { + final boolean [] var_107 = {false}; + for( var_40 = 181 ;(var_40>126);var_40 = (var_40-11) ) + { + try + { + var_34[((var_41--)&4)][((var_42++)&4)][((var_41--)&1)] = ((--var_32)-func_43((var_42--) ,var_101[(((--var_100)+func_43(func_43(((+(++var_41))|var_73.var_102) ,( ( int )(+(++var_41)) ) ,(var_41++) ,var_50 ,var_107 ,var_101[(((++var_41)+var_94)&0)]) ,func_43(var_101[((+(++var_11))&0)] ,(~(var_41++)) ,var_113[(((var_100--)-var_100)&2)][(((var_41++)+func_43((~(var_41--)) ,(-(++var_33)) ,(var_116++) ,var_50 ,var_119 ,var_39))&1)][((var_42++)&4)] ,var_123 ,var_119 ,(var_33++)) ,(++var_11) ,var_50 ,var_130.var_131 ,((--var_61)-var_40)))&0)] ,(var_116--) ,var_123 ,var_107 ,var_40)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_134 ) + { + var_41 = (var_41++) ; + System.out.println("hello exception 48 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_135 ) + { + if( ((++var_136)<( ( double )var_39 ))) + { + var_63.var_137 = ((var_33--)+( ( int )(var_61--) )) ; + } + System.out.println("hello exception 49 !"); + } + } + } + } + return (~((var_138--)|var_70)); +} +public static strictfp int func_43(int var_44, int var_45, float var_46, cl_71 var_47, boolean[] var_48, int var_49) +{ + byte var_55 = (byte)(-15); + try + { + cl_116 var_75 = new cl_116(); + try + { + if( (((var_30--)-var_50.var_51)!=var_50.var_52)) + { + try + { + try + { + int var_53 = (-1903364231); + short var_59 = (short)(-29255); + boolean [] var_54 = {true,true,true}; + for( var_53 = 484 ;(var_53>424);var_53 = (var_53-15) ) + { + var_54[(var_53&2)] = (((~(--var_55))-var_50.var_56)<=var_40) ; + var_50.var_57 = var_58 ; + byte var_60 = (byte)(-95); + var_58[((((var_55--)|( ( short )(++var_55) ))-var_61)&1)][(((var_59++)-( ( int )(--var_60) ))&0)][2] = (var_61--) ; + var_54[(var_53&2)] = (!((var_55--)!=var_30)) ; + var_54[((-(+(var_59++)))&2)] = (!(!(!((var_55--)<=var_40)))) ; + } + if( ((+((var_62--)/var_62))==var_50.var_51)) + { + var_38[((var_61--)&2)] = ((++var_55)<( ( double )(var_61++) )) ; + var_46 = (~((++var_61)*( ( byte )(-159196030) ))) ; + var_50 = var_50 ; + var_54[((var_61++)&2)] = ((++var_59)==var_63.var_64) ; + final cl_116 var_72 = new cl_116(); + var_54[(((var_55--)&var_63.var_65)&2)] = (!(((--var_59)|var_59)!=( ( int )(var_55--) ))) ; + var_49 = (++var_55) ; + var_58[((~(++var_62))&1)][((var_59++)&0)][((((++var_61)&var_63.var_66)&var_50.var_51)&2)] = (var_62++) ; + var_50.var_67 = (~(--var_55)) ; + var_54[((var_62--)&2)] = (!(!(!(!(!(!(( ( short )((var_61--)+var_50.var_51) )609);var_90 = (var_90-9) ) + { + if( (!((++var_55)<( ( float )(var_62++) )))) + { + try + { + float var_91 = (1.52045e-33F); + } + catch( java.lang.ArithmeticException myExp_92 ) + { + var_44 = (var_94--) ; + System.out.println("hello exception 56 !"); + } + } + else + { + try + { + var_74 = var_73 ; + } + catch( java.lang.IllegalArgumentException myExp_95 ) + { + var_93[((var_96++)&5)][((var_55--)&0)][(((++var_61)+var_61)&5)] = ((++var_55)&var_44) ; + System.out.println("hello exception 57 !"); + } + } + } + } + System.out.println("hello exception 55 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_97 ) + { + var_99[((var_94++)&3)][(((--var_55)*var_49)&1)] = (--var_30) ; + System.out.println("hello exception 58 !"); + } + return (-((var_44++)+( ( int )(++var_100) ))); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2358); + CrcCheck.ToByteArray(this.var_11,b,"var_11"); + CrcCheck.ToByteArray(this.var_30,b,"var_30"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_38[a0],b,"var_38" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_39,b,"var_39"); + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + CrcCheck.ToByteArray(this.var_50.GetChecksum(),b,"var_50.GetChecksum()"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_58[a0][a1][a2],b,"var_58" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_61,b,"var_61"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_63.GetChecksum(),b,"var_63.GetChecksum()"); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_71[a0].GetChecksum(),b,"var_71" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_73.GetChecksum(),b,"var_73.GetChecksum()"); + CrcCheck.ToByteArray(this.var_74.GetChecksum(),b,"var_74.GetChecksum()"); + CrcCheck.ToByteArray(this.var_80.GetChecksum(),b,"var_80.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_82[a0][a1][a2],b,"var_82" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_93[a0][a1][a2],b,"var_93" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_99[a0][a1],b,"var_99" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_119[a0],b,"var_119" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_130.GetChecksum(),b,"var_130.GetChecksum()"); + CrcCheck.ToByteArray(this.var_138,b,"var_138"); + CrcCheck.ToByteArray(this.var_139,b,"var_139"); + CrcCheck.ToByteArray(this.var_145,b,"var_145"); + CrcCheck.ToByteArray(this.var_147,b,"var_147"); + CrcCheck.ToByteArray(this.var_158,b,"var_158"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_162[a0][a1].GetChecksum(),b,"var_162" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_163[a0][a1].GetChecksum(),b,"var_163" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_166,b,"var_166"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_183[a0][a1][a2],b,"var_183" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_188,b,"var_188"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_199[a0],b,"var_199" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_206,b,"var_206"); + CrcCheck.ToByteArray(this.var_214,b,"var_214"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_71.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_71.java new file mode 100644 index 0000000000000000000000000000000000000000..b1e39c6f83757a6e086a969317e84be6834d88f3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_71.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=189333068 + +//import java.util.zip.CRC32; + +class cl_71 +{ + short var_51 = (short)(-8172); + byte var_52 = (byte)(111); + double var_56 = (-2.52811e+73D); + double [][][] var_57 = {{{(7.44062e+122D),(-1.48833e+98D),(-4.68551e+226D)}},{{(-3.08708e+68D),(-3.8553e+214D),(-5.47338e+24D)}}}; + int var_67 = (-1407847278); + long var_207 = (-4216181795972826303L); + float var_212 = (-1.38623e-25F); + boolean [] var_229 = {true}; + int [][] var_266 = {{(1303579896),(-821997073)},{(861969958),(-1395133466)}}; + long [] var_336 = {(5941580355835384699L),(-7660351526588789941L),(-174322992065073533L),(-7618971873478779797L),(-6234703578627310592L)}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(132); + CrcCheck.ToByteArray(this.var_51,b,"var_51"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_57[a0][a1][a2],b,"var_57" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_207,b,"var_207"); + CrcCheck.ToByteArray(this.var_212,b,"var_212"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_229[a0],b,"var_229" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_266[a0][a1],b,"var_266" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_336[a0],b,"var_336" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_99.java b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_99.java new file mode 100644 index 0000000000000000000000000000000000000000..bcc50085a62ca9cb5fdd3b141d4614deddd1ef9f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/190_2018112402698/cl_99.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=189333068 + +//import java.util.zip.CRC32; + +class cl_99 +{ + float var_64 = (1.19187e-05F); + byte var_65 = (byte)(-42); + int var_66 = (861282567); + final boolean var_68 = false; + double var_137 = (-6.27547e+227D); + long var_157 = (1975717745457226122L); + boolean var_368 = true; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(27); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_137,b,"var_137"); + CrcCheck.ToByteArray(this.var_157,b,"var_157"); + CrcCheck.ToByteArray(this.var_368,b,"var_368"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/CRC32.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..ef6737ec32b5eee3362ad6583b8f2f8da47c3801 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/MainClass.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..2d4280d4341aa75431053c52b88c18a8d552cedd --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/MainClass.java @@ -0,0 +1,301 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2025510452 + +//import java.util.zip.CRC32; + +class MainClass +{ + final boolean var_0 = true; + static int var_12 = (1599745616); + static float var_20 = (-1.33934e-33F); + static cl_30 var_197 = new cl_30(); + static cl_66 var_199 = new cl_66(); + static double [][] var_203 = {{(-2.72869e+208D),(-2.52816e+181D)},{(8.12802e+126D),(2.78376e+131D)}}; + static cl_40 var_204 = new cl_40(); + static cl_83 var_209 = new cl_83(); + static byte var_211 = (byte)(-59); + final static cl_28 var_213 = new cl_28(); + long var_215 = (4050671382561700978L); + final short var_217 = (short)(-4000); + short var_219 = (short)(-355); + short var_221 = (short)(-13128); + byte var_225 = (byte)(87); + double var_229 = (2.56217e+12D); + boolean [][] var_232 = {{true,false,true,true,true},{true,true,true,true,false}}; + cl_28 var_239 = new cl_28(); + float [][][] var_248 = {{{(2.80868e-36F),(4.10789e-18F)},{(-8.98751e+08F),(-6.56195e-31F)},{(-6.69639e-33F),(8.09365e-17F)}},{{(1.32879e-27F),(3.5869e+28F)},{(2.8923e-37F),(-2.08063e-06F)},{(-8.40655e-09F),(-2.54031e-12F)}}}; + int var_258 = (488024426); + short var_260 = (short)(-8695); + cl_83 var_268 = new cl_83(); + long var_269 = (-5075066570987392849L); + cl_110 var_270 = new cl_110(); + float var_271 = (-1.24079e+36F); + boolean var_272 = false; +/*********************************/ +public strictfp void run() +{ + int var_233 = (-1101492559); + double [][] var_235 = {{(5.0321e+306D),(-1.44293e+10D)},{(1.19841e+57D),(9.2598e-18D)}}; + byte var_244 = (byte)(-9); + if( var_0) + { + // if stmt begin,id=1 + double var_249 = (4.13914e-65D); + long var_223 = (4707509031916089264L); + short var_1 = (short)(14944); + if( ((var_1++)!=func_2((((var_211++)+var_217)==var_209.var_109) ,((var_219++)-var_217) ,(-((var_221++)-var_12)) ,(var_223--) ,(-(var_225--))))) + { + // if stmt begin,id=2 + final cl_40 var_236 = new cl_40(); + byte var_234 = (byte)(-123); + if( (!(!(!((var_219--)>=func_15(var_197.var_30.var_31 ,var_197 ,var_229 ,(var_223--))))))) + { + // if stmt begin,id=3 + if( (!(!(!(!(((var_211++)*var_225)831);var_258 = (var_258-12) ) + { + var_233 = (var_221--) ; + } + // if stmt end,id=5 + } + // else stmt end,id=2 + } + // if stmt end,id=1 + } + else + { + // else stmt begin,id=3 + short var_261 = (short)(17214); + if( ((--var_211)643);var_9 = (var_9-8) ) + { + int var_10 = (1364739870); + for( var_10 = 371 ;(var_10>356);var_10 = (var_10-15) ) + { + int var_11 = (-330917745); + for( var_11 = 550 ;(var_11<577);var_11 = (var_11+9) ) + { + var_12 = (++var_13) ; + var_3 = ((~(var_14++))<=func_15(var_197.var_30.var_31 ,var_197 ,(var_6--) ,(+(((++var_12)+var_12)|var_215)))) ; + } + } + } + } + return (var_211++); +} +public static strictfp float func_15(cl_28 var_16, cl_30 var_17, double var_18, long var_19) +{ + byte var_201 = (byte)(27); + byte var_202 = (byte)(-88); + int var_200 = (1231340068); + float var_198 = (1.3542e+35F); + byte var_205 = (byte)(5); + byte var_206 = (byte)(101); + byte var_216 = (byte)(100); + if( (!((++var_20)==var_197.func_21((!((var_198--)=var_197.var_30.func_48((var_201--) ,((++var_201)+var_204.var_74.var_90.var_122) ,((var_207++)|var_12) ,(var_208++)))) + { + // if stmt begin,id=12 + try + { + var_209.var_122 = (-(++var_202)) ; + } + catch( java.lang.ArithmeticException myExp_210 ) + { + var_203[((var_207--)&1)][((+(--var_211))&1)] = var_212[(((var_202++)-var_211)&3)][(((var_205++)&var_213.var_72.var_113)&1)][((var_200--)&1)] ; + System.out.println("hello exception 1 !"); + } + // if stmt end,id=12 + } + // if stmt end,id=11 + } + else + { + // else stmt begin,id=7 + short var_214 = (short)(13153); + if( (!((-(-((~(var_214--))-var_197.var_34.var_121)))>=var_197.var_30.var_100))) + { + // if stmt begin,id=13 + if( ((++var_214)>=( ( int )(byte)(-80) ))) + { + // if stmt begin,id=14 + if( ((var_200--)>var_211)) + { + // if stmt begin,id=15 + var_204.var_54.var_94 = ( ( long )((--var_206)&var_197.var_156) ) ; + // if stmt end,id=15 + } + else + { + // else stmt begin,id=8 + var_204.var_54 = var_204.var_31.var_67 ; + // else stmt end,id=8 + } + // if stmt end,id=14 + } + // if stmt end,id=13 + } + // else stmt end,id=7 + } + return ((--var_216)+var_20); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(206); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + CrcCheck.ToByteArray(this.var_12,b,"var_12"); + CrcCheck.ToByteArray(this.var_20,b,"var_20"); + CrcCheck.ToByteArray(this.var_197.GetChecksum(),b,"var_197.GetChecksum()"); + CrcCheck.ToByteArray(this.var_199.GetChecksum(),b,"var_199.GetChecksum()"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_203[a0][a1],b,"var_203" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_204.GetChecksum(),b,"var_204.GetChecksum()"); + CrcCheck.ToByteArray(this.var_209.GetChecksum(),b,"var_209.GetChecksum()"); + CrcCheck.ToByteArray(this.var_211,b,"var_211"); + CrcCheck.ToByteArray(this.var_213.GetChecksum(),b,"var_213.GetChecksum()"); + CrcCheck.ToByteArray(this.var_215,b,"var_215"); + CrcCheck.ToByteArray(this.var_217,b,"var_217"); + CrcCheck.ToByteArray(this.var_219,b,"var_219"); + CrcCheck.ToByteArray(this.var_221,b,"var_221"); + CrcCheck.ToByteArray(this.var_225,b,"var_225"); + CrcCheck.ToByteArray(this.var_229,b,"var_229"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_232[a0][a1],b,"var_232" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_239.GetChecksum(),b,"var_239.GetChecksum()"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_248[a0][a1][a2],b,"var_248" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_258,b,"var_258"); + CrcCheck.ToByteArray(this.var_260,b,"var_260"); + CrcCheck.ToByteArray(this.var_268.GetChecksum(),b,"var_268.GetChecksum()"); + CrcCheck.ToByteArray(this.var_269,b,"var_269"); + CrcCheck.ToByteArray(this.var_270.GetChecksum(),b,"var_270.GetChecksum()"); + CrcCheck.ToByteArray(this.var_271,b,"var_271"); + CrcCheck.ToByteArray(this.var_272,b,"var_272"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/Start.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..60349668a2558a5b742cf528297a07c22726d07c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_40.java cl_30.java CRC32.java cl_83.java cl_28.java CrcCheck.java cl_110.java cl_66.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_110.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_110.java new file mode 100644 index 0000000000000000000000000000000000000000..67c5f480505489cdbf1d83e08486898e591d1320 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_110.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2025510452 + +//import java.util.zip.CRC32; + +class cl_110 extends cl_66 +{ + cl_66 var_75 = new cl_66(); + long [] var_86 = {(-8093398084363872279L),(387715887705026735L),(7163302013071940138L),(3788770558072433940L),(7837099675896899906L),(-7738173715611188085L),(4089399776532554486L)}; + final cl_83 var_90 = new cl_83(); + cl_83 var_154 = new cl_83(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(170); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_75.GetChecksum(),b,"var_75.GetChecksum()"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_86[a0],b,"var_86" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_89[a0],b,"var_89" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_90.GetChecksum(),b,"var_90.GetChecksum()"); + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_102,b,"var_102"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_107[a0][a1][a2],b,"var_107" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + CrcCheck.ToByteArray(this.var_154.GetChecksum(),b,"var_154.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_28.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_28.java new file mode 100644 index 0000000000000000000000000000000000000000..2f09025e1f512837390897f5fcd3243558311ef7 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_28.java @@ -0,0 +1,182 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2025510452 + +//import java.util.zip.CRC32; + +class cl_28 +{ + static boolean var_32 = false; + final static short var_35 = (short)(5005); + static int var_64 = (1088341687); + static cl_66 var_67 = new cl_66(); + static cl_83 var_72 = new cl_83(); + static cl_110 var_74 = new cl_110(); + static byte var_79 = (byte)(-123); + static short var_82 = (short)(-28567); + static int var_84 = (-891495121); + static long [] var_87 = {(-8422608070494299634L),(-1484686316436487291L),(-5711399025429580217L),(-2986169567444046218L),(8964703854074604454L),(-158701054622455083L),(2085645134216191220L)}; + static boolean var_98 = true; + static int var_100 = (-1705290133); + final cl_110 [][] var_115 = {{new cl_110(),new cl_110(),new cl_110(),new cl_110()}}; + float var_120 = (-4.1749e-05F); + static long var_121 = (5830977240121996357L); +/*********************************/ +public static strictfp short func_57(int var_58, long[] var_59, cl_83 var_60, long var_61, long var_62) +{ + int var_63 = (1864337604); + final cl_110 var_112 = new cl_110(); + byte [][][] var_99 = {{{(byte)(-91),(byte)(-37),(byte)(-7),(byte)(46)},{(byte)(111),(byte)(-108),(byte)(-1),(byte)(-112)},{(byte)(67),(byte)(1),(byte)(-81),(byte)(103)},{(byte)(-8),(byte)(-50),(byte)(-44),(byte)(-81)}}}; + for( var_63 = 699 ;(var_63<704);var_63 = (var_63+5) ) + { + int var_69 = (-620711278); + byte var_71 = (byte)(-82); + int var_95 = (1470449179); + short var_66 = (short)(-18642); + try + { + cl_66 var_93 = new cl_66(); + int [][] var_76 = {{(-938639480)},{(2139907807)},{(-451383603)},{(1505543220)},{(-2022648755)},{(-8363911)},{(605089619)}}; + byte [][][] var_108 = {{{(byte)(100),(byte)(20),(byte)(78),(byte)(-5)},{(byte)(-39),(byte)(123),(byte)(84),(byte)(58)},{(byte)(-123),(byte)(-71),(byte)(84),(byte)(-4)},{(byte)(-29),(byte)(-4),(byte)(106),(byte)(39)}}}; + byte var_68 = (byte)(75); + for( var_64 = 597 ;(var_64<657);var_64 = (var_64+12) ) + { + int var_65 = (-546474962); + float [] var_78 = {(-2.3219e+14F),(1.43257e-12F),(-7.58939e-16F),(-0.00277621F),(-2.57161e+34F)}; + short var_70 = (short)(13469); + for( var_65 = 230 ;(var_65>174);var_65 = (var_65-14) ) + { + var_62 = (+(((--var_66)-var_67.var_55)+( ( long )((-(var_68--))*var_64) ))) ; + var_59[((--var_69)&6)] = var_59[((++var_70)&6)] ; + long var_83 = (-8224942242849024033L); + var_59[((++var_71)&6)] = ((--var_62)&var_35) ; + var_72.var_73 = (-(--var_68)) ; + var_72 = var_72 ; + var_76[(var_64&6)][(var_65&0)] = (var_66--) ; + var_78[((~((var_79++)|var_67.var_55))&4)] = ((var_58--)*var_67.var_81) ; + var_78[((+(-(var_71--)))&4)] = (((var_82++)-( ( long )(--var_69) ))+var_79) ; + var_59[((var_66--)&6)] = (var_61++) ; + break; + + } + for( var_84 = 930 ;(var_84>902);var_84 = (var_84-14) ) + { + long var_85 = (8253348234060099791L); + var_59 = var_87 ; + cl_110 var_92 = new cl_110(); + int var_91 = (429267075); + var_61 = (var_71++) ; + var_78[((~(++var_58))&4)] = (+(++var_66)) ; + var_67 = var_67 ; + } + float var_96 = (5.36179e+19F); + try + { + var_67.var_94 = (-(--var_79)) ; + var_76[((--var_95)&6)][((var_69--)&0)] = (var_82--) ; + var_95 = ((var_68++)&(1253450359)) ; + cl_83 var_97 = new cl_83(); + var_78[(((var_58++)&( ( int )(--var_79) ))&4)] = (--var_96) ; + var_79 = (var_79--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_101 ) + { + cl_83 var_105 = new cl_83(); + var_76[((var_58++)&6)][(((var_100--)&( ( int )(+(--var_70)) ))&0)] = (++var_68) ; + var_59[((+(var_70++))&6)] = (var_79++) ; + var_87 = var_59 ; + var_87[(((var_79++)|var_65)&6)] = (var_70++) ; + final cl_83 var_104 = new cl_83(); + var_67.var_102 = ((+(--var_79))-var_74.var_94) ; + int [][] var_106 = {{(-1198910039),(1815725337),(-1084410129),(-681653748),(168078813)},{(-1324370059),(296511437),(675883493),(-1232923819),(1808377619)},{(-317959611),(-2061372921),(1306002528),(945019373),(-1056338014)},{(1305400275),(1386311744),(-1423394597),(-1795708350),(1750121148)},{(1023905311),(-1886717087),(-1030004794),(-657383136),(652032644)}}; + var_61 = (-(var_82++)) ; + long var_103 = (-3033433828985955215L); + var_71 = (++var_79) ; + var_87[((++var_71)&6)] = (var_58++) ; + var_72 = var_72 ; + var_32 = ((-(++var_68))>=(short)(10681)) ; + var_99 = var_108 ; + var_70 = (var_66--) ; + System.out.println("hello exception 2 !"); + } + } + boolean var_110 = true; + boolean [][] var_117 = {{true},{true},{false},{false}}; + if( (!(!(((!((var_66++)==var_84))==( ( boolean )(!((--var_71)>=var_72.var_109)) ))!=var_110)))) + { + // if stmt begin,id=16 + int var_111 = (-50026971); + for( var_111 = 734 ;(var_111<810);var_111 = (var_111+19) ) + { + int [][] var_118 = {{(-260988952),(-1183555141),(227836772)},{(911367354),(-1616522641),(1967485893)},{(-880286609),(22886812),(1491884963)},{(-1246808957),(257764923),(-393677028)},{(1039930426),(-1956295354),(-1108264763)},{(-346603741),(1996244382),(-2078344898)},{(1976018281),(-47380065),(2130519859)}}; + var_82 = (++var_79) ; + var_74 = var_112 ; + var_72 = var_72 ; + long var_119 = (-8503520339083865081L); + final cl_83 var_114 = new cl_83(); + var_59[(var_111&6)] = ((var_58--)+var_72.var_113) ; + var_93 = var_67 ; + var_87[(var_111&6)] = (~(++var_66)) ; + var_74.var_75.var_116 = ((!((--var_68)>(byte)(120)))&&var_32) ; + var_108[((+(var_68++))&0)][((~(var_71--))&3)][((--var_82)&3)] = (--var_79) ; + var_76[((var_79++)&6)][((~(var_82++))&0)] = (-731156118) ; + var_87[((++var_66)&6)] = (~((--var_82)*var_35)) ; + var_87[(var_111&6)] = ((var_95++)+var_72.var_109) ; + var_67 = var_93 ; + } + // if stmt end,id=16 + } + } + catch( java.lang.ArithmeticException myExp_123 ) + { + var_59[((var_66--)&6)] = (+(++var_82)) ; + System.out.println("hello exception 3 !"); + } + } + return (var_79--); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(143); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_67.GetChecksum(),b,"var_67.GetChecksum()"); + CrcCheck.ToByteArray(this.var_72.GetChecksum(),b,"var_72.GetChecksum()"); + CrcCheck.ToByteArray(this.var_74.GetChecksum(),b,"var_74.GetChecksum()"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_82,b,"var_82"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_87[a0],b,"var_87" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_115[a0][a1].GetChecksum(),b,"var_115" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_120,b,"var_120"); + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_30.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_30.java new file mode 100644 index 0000000000000000000000000000000000000000..54db7978ba10a1db13d56588a0febf938b9ac0d3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_30.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2025510452 + +//import java.util.zip.CRC32; + +class cl_30 +{ + static cl_40 var_30 = new cl_40(); + static cl_28 var_34 = new cl_28(); + int var_36 = (1068839866); + static int var_46 = (2086117082); + static byte var_156 = (byte)(125); + static long [][] var_157 = {{(-8800986646286354886L),(1476773373347207112L),(-7838209286425808089L),(7591324167234866518L),(-3970744592407602073L),(7025187024644954118L)},{(5051054458447659649L),(3065146237626941178L),(-2648627707575991275L),(9148217939806692662L),(7674078952644780026L),(544454569656934976L)},{(7540094728891791180L),(3430408905338981889L),(7949671155736140537L),(-262403641522389452L),(-6903941225651394495L),(-3065522991539862277L)},{(-4875933345857059878L),(2158127829844082695L),(2969668801698331678L),(2380168524188580336L),(-7320351947911148484L),(-6471675511424438433L)},{(-2769640439218956492L),(3709211732592280690L),(8504495206313256233L),(3432766951087399510L),(1663556610999761042L),(-8493366274347421857L)}}; + static int var_158 = (1702310668); + static cl_83 var_160 = new cl_83(); + static cl_110 var_163 = new cl_110(); + static long var_166 = (-7038575108948331672L); + static double var_169 = (-7.64366e-58D); + static int var_173 = (-1327040777); + final static long [] var_175 = {(-3191585742218020825L),(-2496080627389942099L),(-2406853639901250588L)}; + final double var_188 = (-2.34922e-107D); + boolean var_237 = false; +/*********************************/ +public static strictfp double func_21(boolean var_22, long var_23, boolean var_24, double[][] var_25, cl_40 var_26, float var_27, long var_28) +{ + int var_29 = (194758301); + int var_196 = (261972522); + short var_186 = (short)(-13595); + final int [][][] var_193 = {{{(1280122378),(1349091109),(-618747024)},{(-1964825121),(1309508922),(1732500400)}},{{(1740561905),(1931710941),(1316020252)},{(1233465656),(1723319501),(-1235482975)}},{{(745720155),(-1614776235),(-1934269091)},{(-363483671),(-1396283031),(626249568)}},{{(1628101316),(-1529591695),(-1291144624)},{(-365478685),(544348728),(-1658256716)}},{{(-969923415),(-913704039),(-818829808)},{(113237379),(-1321310428),(1983496682)}},{{(2045671716),(927684349),(-1043569477)},{(174053010),(-344900050),(-1129771726)}}}; + for( var_29 = 840 ;(var_29<884);var_29 = (var_29+11) ) + { + short var_33 = (short)(6364); + short var_192 = (short)(-8273); + var_30.var_31.var_32 = ((var_33++)!=var_34.var_35) ; + if( false) + { + // if stmt begin,id=17 + final long [][] var_183 = {{(1259184651599861290L),(-4286777558856151195L),(4103675355919065360L),(-4901452053771412289L),(-2857407771289157581L),(4443702988923385389L)},{(640081988123263505L),(-5891321033609046986L),(7798902780486800406L),(-8953979500926902389L),(3626238245504848417L),(-8567849317230191203L)},{(-757180334086522636L),(628852764417470230L),(7846977427117396659L),(-7351279106032103058L),(-6267991231740042963L),(8098915090169328308L)},{(-8089925656509310545L),(-4607825257971398335L),(-4266676243949066856L),(5765602829804900850L),(-280022319331734455L),(-1252432494210921934L)},{(-1714925199486753118L),(3182697304865833932L),(-1279368722298815580L),(-3781441009330698378L),(4083884039763856379L),(-5876784131773706481L)}}; + byte var_39 = (byte)(60); + int var_179 = (-171859011); + int var_37 = (-967384663); + for( var_37 = 279 ;(var_37>274);var_37 = (var_37-1) ) + { + long var_38 = (-8617410528585622865L); + if( (!(!(!((var_39--)!=func_40(var_169 ,func_40((var_23++) ,((--var_39)*( ( byte )(++var_33) )) ,(!(!(!((++var_173)<(-6.41705e+12F))))) ,var_175[(((+(var_39++))*( ( short )((var_39--)+(1621099241)) ))&2)] ,var_30.var_31.var_67) ,(!((+(++var_179))!=( ( byte )(var_156++) ))) ,((var_173++)-var_163.var_90.var_113) ,var_30.var_31.var_67)))))) + { + // if stmt begin,id=18 + var_157 = var_183 ; + // if stmt end,id=18 + } + else + { + // else stmt begin,id=9 + final cl_83 var_184 = new cl_83(); + // else stmt end,id=9 + } + } + // if stmt end,id=17 + } + else + { + // else stmt begin,id=10 + byte var_185 = (byte)(-71); + short var_194 = (short)(29687); + try + { + var_30.var_54.var_116 = ((var_185--)!=var_186) ; + } + catch( java.lang.ArithmeticException myExp_187 ) + { + boolean [][][] var_191 = {{{true},{false},{false}},{{true},{false},{true}},{{true},{false},{true}},{{true},{false},{true}},{{true},{false},{true}},{{false},{true},{true}}}; + if( (!(!((var_185++)<=var_163.var_102)))) + { + // if stmt begin,id=19 + cl_110 var_189 = new cl_110(); + // if stmt end,id=19 + } + else + { + // else stmt begin,id=11 + short var_195 = (short)(31863); + var_191[5][((((var_185++)-( ( byte )var_193[((((--var_185)&var_163.var_75.var_55)-var_195)&5)][(((--var_185)|var_160.var_113)&1)][((var_194++)&2)] ))*(byte)(2))&2)][((--var_192)&0)] = ((--var_185)==( ( byte )(var_156++) )) ; + // else stmt end,id=11 + } + System.out.println("hello exception 4 !"); + } + // else stmt end,id=10 + } + } + return (var_196++); +} +public static strictfp int func_40(double var_41, int var_42, boolean var_43, long var_44, cl_66 var_45) +{ + short var_165 = (short)(21245); + short var_168 = (short)(-21674); + for( var_46 = 435 ;(var_46<451);var_46 = (var_46+4) ) + { + short var_161 = (short)(-24190); + short var_162 = (short)(3711); + byte var_159 = (byte)(-126); + short var_164 = (short)(16121); + short var_47 = (short)(-13828); + if( (!(!((var_47--)==var_30.func_48((var_156--) ,var_157[(((var_159--)*var_160.var_134)&4)][((--var_158)&5)] ,((var_161++)-var_34.func_57((-(++var_162)) ,var_163.var_89 ,var_30.var_31.var_72 ,(var_164--) ,(var_165--))) ,(var_166--)))))) + { + // if stmt begin,id=20 + final long var_167 = (3528754484855364727L); + // if stmt end,id=20 + } + } + return (var_168--); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(338); + CrcCheck.ToByteArray(this.var_30.GetChecksum(),b,"var_30.GetChecksum()"); + CrcCheck.ToByteArray(this.var_34.GetChecksum(),b,"var_34.GetChecksum()"); + CrcCheck.ToByteArray(this.var_36,b,"var_36"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_156,b,"var_156"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_157[a0][a1],b,"var_157" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_158,b,"var_158"); + CrcCheck.ToByteArray(this.var_160.GetChecksum(),b,"var_160.GetChecksum()"); + CrcCheck.ToByteArray(this.var_163.GetChecksum(),b,"var_163.GetChecksum()"); + CrcCheck.ToByteArray(this.var_166,b,"var_166"); + CrcCheck.ToByteArray(this.var_169,b,"var_169"); + CrcCheck.ToByteArray(this.var_173,b,"var_173"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_175[a0],b,"var_175" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_188,b,"var_188"); + CrcCheck.ToByteArray(this.var_237,b,"var_237"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_40.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_40.java new file mode 100644 index 0000000000000000000000000000000000000000..44038cdc45ccdd68e47bdd0bf99c17175e46bc66 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_40.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2025510452 + +//import java.util.zip.CRC32; + +class cl_40 extends cl_28 +{ + static cl_28 var_31 = new cl_28(); + static cl_66 var_54 = new cl_66(); + static long [] var_125 = {(-8437715909428743806L),(1704068703665284440L),(942103181968912974L),(-3319333172661715426L),(4081700108140021446L),(-1881307141792421635L),(-3169767242544833958L)}; + static long [] var_129 = {(-3394990152464582524L),(-7257105960547724512L),(4410927226048230744L),(538375188174728617L),(-8047706823583358489L),(540320171568688218L),(4415015125218022728L)}; + static long [] var_138 = {(-5977054628224234935L),(-3641716596942658621L),(-3730303976918105571L),(-275222980827891304L),(3886247847022197404L),(-5789600289226845368L),(2712156116497146946L)}; + static int var_145 = (2064640738); +/*********************************/ +public static strictfp float func_48(float var_49, long var_50, int var_51, long var_52) +{ + int var_155 = (2104312182); + try + { + short var_56 = (short)(6148); + byte var_53 = (byte)(20); + long [] var_147 = {(8538065173471441718L),(6152600630219879840L),(-5725445259328738632L),(-4317430587035552844L),(6836383638446085406L),(6892751555116849136L),(8830134574885197815L)}; + long [][][] var_144 = {{{(-2682836281105515491L),(-5799601180141274980L),(-368704392501462495L),(-7933091453082130396L)},{(5896765209811382004L),(-3333071699564742680L),(-8224302820032981182L),(4251950105998262998L)},{(-1389491620656351023L),(6816506133963730781L),(-9045417463589729593L),(1679405065315470321L)},{(3225938906884763331L),(1862779310259654004L),(-2400818725809608850L),(-3577093178726510937L)},{(-7202181032201116687L),(3716379577260788030L),(9161176119479879912L),(-6686040223149699956L)},{(-6078735414308822052L),(2022088600720202991L),(6049605754707911706L),(-8012100630935687541L)},{(7927075857966022262L),(-3030216431220065432L),(9030283207020658162L),(-4576898624321871040L)}},{{(-9206720812182405330L),(-595194346210811342L),(-8922496806362005002L),(783947589474535940L)},{(6516539990567413992L),(-674570934758290374L),(-81553194704147302L),(-1372292444659521428L)},{(5120787816973220668L),(-4170483535442834359L),(-6183524772653462019L),(-5990822182174140870L)},{(2629421488201012110L),(6324902986226661825L),(-335062808948537688L),(-1571607561551489164L)},{(-1852891336812069690L),(3859654957852931926L),(-5139431061311965011L),(-6416858272983198797L)},{(-8331378050083289885L),(3497598535346974168L),(-7901667189871833920L),(2641238353126864115L)},{(-1919149051408873813L),(7495849222109038050L),(-2904325099265407676L),(-4967922148137879377L)}}}; + if( ((~(var_53--))!=var_54.var_55)) + { + // if stmt begin,id=21 + if( ((((((var_56++)*var_35)&var_31.func_57((((var_53++)&func_57(((var_53--)*var_72.var_109) ,var_125 ,var_31.var_74.var_90 ,(((var_53++)-func_57((var_79++) ,var_129 ,var_31.var_74.var_90 ,(-7841080107775092638L) ,(var_121--)))-var_31.var_72.var_134) ,( ( long )var_72.var_80 )))*func_57(((var_53++)+var_54.var_81) ,var_138 ,var_31.var_74.var_90 ,(-((var_79--)-var_72.var_109)) ,(var_100--))) ,var_74.var_90.var_88 ,var_72 ,(var_50++) ,(~(~(var_79--)))))&var_64)*var_35)>=( ( short )(var_53++) ))) + { + // if stmt begin,id=22 + cl_66 var_143 = new cl_66(); + if( var_98) + { + // if stmt begin,id=23 + var_67 = var_31.var_74.var_75 ; + // if stmt end,id=23 + } + else + { + // else stmt begin,id=12 + var_49 = (-(var_53--)) ; + // else stmt end,id=12 + } + // if stmt end,id=22 + } + else + { + // else stmt begin,id=13 + if( false) + { + // if stmt begin,id=24 + var_138[6] = var_144[((var_56++)&1)][(((--var_82)|var_67.var_55)&6)][((var_79--)&3)] ; + // if stmt end,id=24 + } + else + { + // else stmt begin,id=14 + var_144[((~(--var_53))&1)][((++var_145)&6)][3] = (+((var_53++)-func_57(((++var_79)|var_64) ,var_147 ,var_31.var_74.var_90 ,var_147[((--var_56)&6)] ,(var_56++)))) ; + // else stmt end,id=14 + } + // else stmt end,id=13 + } + // if stmt end,id=21 + } + } + catch( java.lang.IllegalArgumentException myExp_152 ) + { + int var_153 = (733051584); + for( var_153 = 672 ;(var_153<722);var_153 = (var_153+10) ) + { + var_31.var_74.var_154 = var_31.var_74.var_90 ; + } + System.out.println("hello exception 5 !"); + } + return (--var_155); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(331); + CrcCheck.ToByteArray(this.var_31.GetChecksum(),b,"var_31.GetChecksum()"); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + CrcCheck.ToByteArray(this.var_54.GetChecksum(),b,"var_54.GetChecksum()"); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_67.GetChecksum(),b,"var_67.GetChecksum()"); + CrcCheck.ToByteArray(this.var_72.GetChecksum(),b,"var_72.GetChecksum()"); + CrcCheck.ToByteArray(this.var_74.GetChecksum(),b,"var_74.GetChecksum()"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_82,b,"var_82"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_87[a0],b,"var_87" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_115[a0][a1].GetChecksum(),b,"var_115" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_120,b,"var_120"); + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_125[a0],b,"var_125" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_129[a0],b,"var_129" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_138[a0],b,"var_138" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_145,b,"var_145"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_66.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_66.java new file mode 100644 index 0000000000000000000000000000000000000000..b737e2e68e5fda4b429c55eb14d4505a50e8265a --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_66.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2025510452 + +//import java.util.zip.CRC32; + +class cl_66 +{ + final int var_55 = (-1929671413); + byte var_81 = (byte)(-69); + long [] var_89 = {(-5492793535263746725L),(-3974566652130550779L),(1325887239593102764L),(-565464146090203449L),(-838819357738307655L),(1840211928353376327L),(-2739011310632093486L)}; + long var_94 = (5012846206849273930L); + float var_102 = (9.22988e-37F); + byte [][][] var_107 = {{{(byte)(53),(byte)(19),(byte)(-94),(byte)(77)},{(byte)(103),(byte)(-3),(byte)(-119),(byte)(72)},{(byte)(-116),(byte)(33),(byte)(17),(byte)(-113)},{(byte)(54),(byte)(-114),(byte)(43),(byte)(-9)}}}; + boolean var_116 = true; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(90); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_89[a0],b,"var_89" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_102,b,"var_102"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_107[a0][a1][a2],b,"var_107" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_83.java b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_83.java new file mode 100644 index 0000000000000000000000000000000000000000..02a3632c74fa2157720b6dc49ae6e4dcd9f58b84 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/197_2019010201274/cl_83.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2025510452 + +//import java.util.zip.CRC32; + +class cl_83 +{ + double var_73 = (-1.24058e-140D); + final float var_80 = (4.38822e+33F); + long [] var_88 = {(-828744676719971772L),(5054517921124057953L),(-5114583130074993786L),(7004039984413565637L),(-4290014921351186276L),(-1366208666436720736L),(-5402918337827149695L)}; + int var_109 = (1572428694); + short var_113 = (short)(-15349); + long var_122 = (-2214392377184977292L); + byte var_134 = (byte)(-39); + boolean var_242 = false; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(84); + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_88[a0],b,"var_88" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_122,b,"var_122"); + CrcCheck.ToByteArray(this.var_134,b,"var_134"); + CrcCheck.ToByteArray(this.var_242,b,"var_242"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/220_2018110810324/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/220_2018110810324/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/220_2018110810324/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/220_2018110810324/MainClass.java b/test/testsuite/fuzz_test/fuzz/220_2018110810324/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..cbb980c29dc13fc0d154f1033fb2cb9ccfba7c45 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/220_2018110810324/MainClass.java @@ -0,0 +1,361 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=364962514 + +import java.util.zip.CRC32; + +class MainClass +{ + static cl_12 var_14 = new cl_12(); + static short var_18 = (short)(6776); + static cl_3 var_19 = new cl_3(); + static int var_34 = (1304838017); + static byte var_35 = (byte)(-96); + static long var_38 = (-8260563726039416753L); + static long [][] var_40 = {{(4424670335353577512L),(7931129666141239674L),(2097035956926043821L)},{(5867234425808169189L),(-2465635046374471438L),(8624050441206143777L)},{(3772400073010817925L),(6188248431566265190L),(7380530353221769853L)},{(5960570481011013835L),(3487732954937932385L),(5193077261241949284L)},{(6763958535280514214L),(2377508377838641746L),(3961715029224667573L)},{(-8074549132813051129L),(-2664448277394081754L),(-1091006533744104310L)}}; + static cl_3 var_42 = new cl_3(); + static short var_47 = (short)(29394); + cl_3 var_49 = new cl_3(); + cl_3 var_56 = new cl_3(); + static short var_60 = (short)(-29631); + static byte var_66 = (byte)(106); + static long [][][] var_71 = {{{(-3667419076181100142L),(-6169694053404452558L),(-8720772573565420153L),(1027716747982042268L),(8108561980213150222L),(2515888397339129508L),(8612622163061864328L)},{(4336605233310288527L),(-2870757175443621422L),(-6033216396905656275L),(-9131203018434432887L),(4579146551704379258L),(380756353056435174L),(-4677400671349192190L)},{(3968276418426326439L),(834117188235595162L),(-8249723830736444129L),(-3851966286681179315L),(661818657870661210L),(1383837282597475228L),(-1721792460894783266L)}},{{(5283091987483858742L),(1282100938179470698L),(-2995314235261175556L),(7723567378045855392L),(-5237317594898055911L),(-8365794311099790243L),(-6033930031000362324L)},{(-5829927075476286889L),(3249708811347834030L),(-2224093760138199831L),(479534347010012198L),(3774586014477166701L),(-1149802660850596599L),(-2721548067137710095L)},{(-3821295482268518546L),(7604902165783322376L),(4375292681228617115L),(-6932189813416300271L),(7168851554281902269L),(-3362032783943395164L),(-4277101212480988781L)}}}; + float var_79 = (1.03635e-11F); + long var_94 = (-4647968103377318178L); + int var_97 = (-29516901); + byte var_100 = (byte)(91); + final cl_12 [][] var_104 = {{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()}}; + double var_110 = (2.66995e-132D); + cl_3 var_112 = new cl_3(); + double [][][] var_117 = {{{(-2.71828e-27D),(3.83149e+17D),(-5.9846e+179D),(0.0809153D)},{(2.3281e+92D),(-2.11673e+20D),(5.21703e-25D),(1.22969e+150D)},{(5.44371e+10D),(-3.23319e-113D),(8.91856e+42D),(3.68305e-204D)},{(8.62983e-15D),(6.58824e-226D),(5.51879e+300D),(8.37149e-143D)},{(6.66889e+56D),(-7.73025e+92D),(-8.87599e-226D),(-9.46409e+263D)},{(-1.16066e-155D),(8.1025e+187D),(-2.05326e+307D),(-3.08682e+112D)},{(-1.27758e-145D),(1.84477e+93D),(-9.42708e-138D),(1.12947e+86D)}},{{(-5.33431e-26D),(1.53884e+274D),(-1.5011e-151D),(5.79551e-173D)},{(-3.55284e-79D),(-1.32097e+267D),(7.2444e+32D),(-6.45815e-170D)},{(-2.04725e-240D),(-4.42869e+269D),(1.14005e-151D),(3.3561e-267D)},{(-3.17295e-42D),(1.94416e-139D),(-3.1877e-110D),(-1.92913e-102D)},{(2.81247e+34D),(-2.90347e-233D),(2.64152e-236D),(-2.31993e-68D)},{(-2.89503e-285D),(-1.55056e-167D),(-5.28084e-273D),(5.02481e+283D)},{(1.11885e+131D),(0.00101147D),(7.32281e-304D),(2.18839e+220D)}},{{(1.19844e+167D),(1.06236e-38D),(-1.40051e-199D),(4.64466e+16D)},{(-9.89233e+307D),(2.79771e+253D),(1.18845e+97D),(-2.27472e-189D)},{(6.64372e-251D),(5.74388e-283D),(8.19854e+187D),(-10.2049D)},{(5.57656e-09D),(-3.47097e-169D),(-2.55167e+242D),(3.06653e+192D)},{(-1.22819e-152D),(1.06537e+195D),(-5.9398e+176D),(1.3379e-34D)},{(2.2884e+126D),(-1.96582e+275D),(-2.48006e-118D),(-3.39915e+65D)},{(3.44726e+67D),(-3.08983e-264D),(-1.38812e-133D),(1.80756e-139D)}},{{(-9.95753e+85D),(6.69383e-124D),(-1.19187e-282D),(-9.09016e+141D)},{(-8.0434e+57D),(3.58651e-12D),(1.57511e-249D),(1.47803e-259D)},{(-9.97076e+230D),(3.50752e+120D),(-2.4942e+246D),(-5.09145e+248D)},{(-7.33793e-284D),(-1.20048e+33D),(-9.16383e-156D),(2.35755e-152D)},{(-1.69224e-112D),(-6.12961e-266D),(4.79781e+116D),(7.06132e+149D)},{(1.13061e-18D),(-2.78347e-32D),(-5.37952e+240D),(6.02976e-307D)},{(1.19074e+23D),(-3.11612e-153D),(-9.63256e-102D),(-2.0713e-71D)}}}; + short var_119 = (short)(23793); + final long [][][] var_121 = {{{(119696569486299397L),(-9203682964999539043L),(-9152617348628227832L)},{(-7031168272656726267L),(-1840411277653236616L),(-5361391407776246042L)},{(6818097008244763727L),(-3094132737521513390L),(5976452519791018946L)}},{{(-8802302552317994243L),(-3850748243682842488L),(-6644404626160846346L)},{(3208717809697272785L),(-2958949822489288064L),(4434977413914691695L)},{(1314361247044363796L),(-5028165940058176384L),(-3616290680926973313L)}},{{(8198854546792707548L),(-5521802771142786847L),(-7414862965287812859L)},{(-321133141707285499L),(-1607427311259991166L),(-3839991261429858667L)},{(4301398325043837220L),(-7088496461291423906L),(1489226614710535200L)}},{{(4389239134606414012L),(3698218660310990939L),(-7800115763958248891L)},{(-1275742614287434861L),(4050029944319286116L),(-1691034123184545643L)},{(-860221305264452011L),(-2381684306782456492L),(5481669687623300319L)}},{{(5231125228935708168L),(-2952203127945223624L),(4906190505965338807L)},{(1916371125255202643L),(-6865923137753399410L),(-6901239896243607067L)},{(-8094002901835321825L),(-1480518230614001174L),(-1028085562109205213L)}},{{(7058244095601546250L),(2928160443016628057L),(5138513115050527986L)},{(1331993189380074040L),(-2131612314687717042L),(3272451841603861251L)},{(-306812747747266422L),(627693997025795974L),(-9046599966675526037L)}}}; + final cl_3 var_126 = new cl_3(); + cl_3 var_128 = new cl_3(); + final cl_3 var_130 = new cl_3(); + cl_3 var_134 = new cl_3(); + cl_3 var_136 = new cl_3(); + cl_3 var_137 = new cl_3(); + final cl_3 var_142 = new cl_3(); + cl_3 var_145 = new cl_3(); +/*********************************/ +public strictfp void run() +{ + cl_3 var_143 = new cl_3(); + cl_3 var_132 = new cl_3(); + final cl_3 var_129 = new cl_3(); + cl_3 [] var_1 = {new cl_3(),new cl_3(),new cl_3()}; + cl_3 var_133 = new cl_3(); + int var_118 = (-1276853657); + cl_3 var_139 = new cl_3(); + cl_3 var_141 = new cl_3(); + cl_3 var_146 = new cl_3(); + final cl_3 var_127 = new cl_3(); + final cl_3 var_144 = new cl_3(); + byte var_2 = (byte)(-21); + cl_3 var_131 = new cl_3(); + short var_123 = (short)(-13444); + cl_3 var_140 = new cl_3(); + final cl_3 var_138 = new cl_3(); + cl_3 var_135 = new cl_3(); + var_1[(((~(var_2++))&func_3(var_117[((var_34++)&3)][((++var_119)&6)][((var_118--)&3)] ,var_121 ,(!((++var_123)<=var_14.var_39)) ,(var_34--)))&2)] = var_19 ; + return ; +} +public strictfp short func_3(double var_4, long[][][] var_5, boolean var_6, int var_7) +{ + short var_114 = (short)(-23416); + try + { + short var_102 = (short)(29611); + try + { + byte var_103 = (byte)(-12); + try + { + var_6 = func_8(((++var_102)&var_34) ,func_22((7.66585e+30F) ,(!((--var_103)var_110)) ; + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 1 !"); + } + } + catch( java.lang.ArithmeticException myExp_111 ) + { + byte var_116 = (byte)(-23); + try + { + if( (!(!(!(!((-(var_14.var_51+var_100))!=var_79)))))) + { + var_56 = var_19 ; + } + } + catch( java.lang.IllegalArgumentException myExp_113 ) + { + byte var_115 = (byte)(-68); + var_5[((((++var_116)-var_66)|var_14.var_51)&5)][((var_116--)&2)][((-((+(++var_114))*( ( short )(var_115--) )))&2)] = (+(--var_116)) ; + System.out.println("hello exception 4 !"); + } + System.out.println("hello exception 3 !"); + } + return (--var_35); +} +public strictfp boolean func_8(int var_9, cl_12 var_10, cl_12[][] var_11, long var_12, float var_13) +{ + float var_77 = (-1614.94F); + byte var_75 = (byte)(-92); + short var_85 = (short)(-9778); + cl_12 [][] var_82 = {{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12(),new cl_12()}}; + try + { + try + { + int [][][] var_74 = {{{(-1842578081)},{(1485642494)},{(-1817812019)},{(-583964079)}},{{(972973404)},{(1232573710)},{(-843930414)},{(-1841771083)}},{{(471315145)},{(22664445)},{(1048420524)},{(-931214661)}},{{(338035738)},{(260010389)},{(-919968177)},{(-2032944846)}},{{(1811863246)},{(523059464)},{(1230065591)},{(-225666244)}}}; + try + { + byte var_16 = (byte)(56); + short var_21 = (short)(-13340); + final int var_17 = (1754997385); + var_14.var_15 = ((--var_16)+var_13) ; + var_9 = (+(--var_18)) ; + var_18 = (--var_21) ; + var_14 = func_22(((--var_13)+var_34) ,(!((var_13--)>=( ( double )var_74[((var_9--)&4)][((++var_60)&3)][(((var_75--)*( ( byte )((var_75--)*var_9) ))&0)] ))) ,func_22(( ( float )(var_66++) ) ,(!((+(--var_75))>var_66)) ,var_14 ,(var_77--)) ,var_79) ; + } + catch( java.lang.IllegalArgumentException myExp_81 ) + { + var_11 = var_82 ; + System.out.println("hello exception 5 !"); + } + } + catch( java.lang.ArithmeticException myExp_83 ) + { + int var_84 = (-637382433); + for( var_84 = 106 ;(var_84<181);var_84 = (var_84+15) ) + { + var_11[(((--var_75)+var_14.var_39)&4)][(((var_85--)*( ( short )(843024198) ))&5)] = func_22((var_34--) ,(!(!((+((var_75--)|var_34))>=(1.45586e-265D)))) ,func_22((--var_47) ,((+(var_18--))<=var_49.var_89) ,var_14 ,(-(++var_85))) ,(var_94++)) ; + } + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.ArithmeticException myExp_96 ) + { + for( var_97 = 156 ;(var_97>100);var_97 = (var_97-14) ) + { + if( ((var_75--)>=var_14.var_54)) + { + final boolean var_98 = true; + } + else + { + var_9 = ((var_66++)+var_34) ; + } + } + System.out.println("hello exception 7 !"); + } + byte var_99 = (byte)(-126); + return ( ( boolean )(!(((--var_99)>( ( int )var_100 ))!=var_49.var_101)) ); +} +public static strictfp cl_12 func_22(float var_23, boolean var_24, cl_12 var_25, float var_26) +{ + try + { + short var_27 = (short)(-13814); + if( (!((++var_27)>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/229_2018112402538/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/229_2018112402538/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/229_2018112402538/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/229_2018112402538/MainClass.java b/test/testsuite/fuzz_test/fuzz/229_2018112402538/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..36ab45988906551cfce8ff2f5bb8f671c4191d40 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/229_2018112402538/MainClass.java @@ -0,0 +1,1071 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=59004558 + +//import java.util.zip.CRC32; + +class MainClass +{ + int var_0 = (1615473218); + int var_5 = (-1132226258); + cl_21 var_31 = new cl_21(); + int [][] var_34 = {{(669191619),(-1857884533),(-2028222486),(-2038383585),(-1329987469)},{(768291337),(-766244324),(-871582678),(-591975478),(-1611638144)},{(36602525),(-1486121645),(306571065),(1372029190),(-494993683)},{(1522138960),(512574841),(-851432407),(-1675646789),(1192886802)},{(-181264768),(762638029),(1511475637),(-582110131),(-1698655386)},{(95059826),(-102983489),(1402249308),(1589826824),(632407796)}}; + byte var_35 = (byte)(99); + cl_58 var_46 = new cl_58(); + short var_47 = (short)(-12819); + cl_39 var_55 = new cl_39(); + float var_58 = (-4.62756e+06F); + cl_26 var_59 = new cl_26(); + cl_44 var_62 = new cl_44(); + cl_26 [][][] var_74 = {{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}}}; + final double var_91 = (3.10191e+66D); + byte var_93 = (byte)(-87); + cl_23 var_96 = new cl_23(); + byte var_99 = (byte)(78); + final cl_58 var_102 = new cl_58(); + byte var_113 = (byte)(-116); + byte var_114 = (byte)(33); + boolean var_124 = true; + cl_26 var_127 = new cl_26(); + final cl_26 var_128 = new cl_26(); + byte var_135 = (byte)(8); + int var_140 = (170071704); + cl_39 var_143 = new cl_39(); + boolean [][] var_144 = {{true,false,false,true,true,true},{false,true,true,false,false,true},{true,true,true,false,false,false}}; + cl_44 var_149 = new cl_44(); + byte var_192 = (byte)(-53); + int var_215 = (552466370); + boolean var_218 = true; + int var_219 = (610088337); + long var_223 = (-9179379917399491725L); + cl_26 [][] var_234 = {{new cl_26(),new cl_26(),new cl_26(),new cl_26()}}; + int var_246 = (621956387); + int var_276 = (1631395175); + float [][] var_277 = {{(-2.16933e-28F),(1.49483e+10F),(-3.00452e-21F),(-6.59397e-19F)},{(-7.67008e-36F),(-5.04495F),(-1.89824e+34F),(-5.39345e+12F)},{(-2.15979e-32F),(3.68269e+37F),(-1.38838e+24F),(-9.35844e-29F)},{(1.57135F),(8594.5F),(-1.78924e+24F),(6.2054e-31F)}}; + final cl_39 var_290 = new cl_39(); + cl_26 [][] var_296 = {{new cl_26(),new cl_26(),new cl_26(),new cl_26()}}; + cl_26 [][] var_320 = {{new cl_26(),new cl_26(),new cl_26(),new cl_26()}}; + cl_26 [][] var_331 = {{new cl_26(),new cl_26(),new cl_26(),new cl_26()}}; + int var_366 = (-2127441065); + int var_367 = (403672615); + float var_368 = (0.0112177F); + int var_377 = (-2046784906); + cl_58 var_394 = new cl_58(); + short var_398 = (short)(2042); + int var_405 = (-1727585765); + double [][] var_421 = {{(-8.26577e-195D),(-5.18848e+143D)},{(6.36552e-285D),(9.04354e-32D)},{(-2.52568e-222D),(2.05006e-182D)},{(-4.36124e-60D),(1.64738e+121D)}}; + short var_422 = (short)(-6741); + int [][] var_429 = {{(152891914),(-696901179),(1894741518),(1140408621),(-903051448)},{(777696662),(-1552883479),(1960258866),(-174668627),(-1812277326)},{(-165558555),(1160253368),(-365888295),(-868351993),(-1683921626)},{(2144918527),(63479277),(-363038559),(226283647),(559470774)},{(-654907945),(1991680756),(1984907564),(466820846),(-395382305)},{(-853297922),(1764158738),(-61753308),(-1095173266),(872066160)}}; + double var_435 = (1.71297e-10D); + int var_437 = (-142205649); + boolean [][][] var_482 = {{{true,false,false},{true,true,false},{true,true,true},{false,true,true},{false,true,false}},{{true,false,true},{true,true,false},{true,true,true},{false,true,false},{false,false,true}},{{true,false,true},{false,true,true},{false,false,true},{true,true,false},{false,false,true}}}; + cl_23 var_485 = new cl_23(); + byte var_492 = (byte)(1); + int var_495 = (-1344375350); + final double [][] var_502 = {{(2.13303e-233D),(2.5019e+117D)},{(-5.52729e-305D),(-9.53867e-92D)},{(-1.37947e+97D),(-2.62462e+28D)},{(-7.58274e+120D),(-7.23183e+87D)},{(9.59762e-145D),(-6.85494e+295D)},{(-2.31948e-101D),(6.57847e+13D)},{(3.30559e+108D),(1.00246e-91D)}}; + short var_503 = (short)(17000); + short var_509 = (short)(-23077); + int var_523 = (-1537876979); + final boolean var_524 = true; + long var_529 = (7433881574617182645L); + int var_535 = (596961116); + final cl_44 var_536 = new cl_44(); + final byte var_543 = (byte)(103); + cl_58 var_551 = new cl_58(); + boolean [][] var_575 = {{true,false,false,true,false}}; +/*********************************/ +public strictfp void run() +{ + boolean [][] var_1 = {{true,false,true,true,true}}; + byte var_548 = (byte)(-38); + for( var_0 = 615 ;(var_0>535);var_0 = (var_0-16) ) + { + short var_3 = (short)(-22216); + int var_2 = (1443605760); + if( var_1[((-(var_3--))&0)][((--var_2)&4)]) + { + try + { + long var_4 = (-8438076662020614123L); + try + { + var_4 = (-1911570908396594403L) ; + try + { + for( var_5 = 602 ;(var_5<626);var_5 = (var_5+6) ) + { + var_1[((--var_2)&0)][((+(var_3--))&4)] = func_6((var_4++)) ; + } + } + catch( java.lang.IllegalArgumentException myExp_547 ) + { + if( ((++var_548)>=var_394.var_186.var_78)) + { + var_1[((--var_192)&0)][(((var_548++)+var_114)&4)] = func_6((((var_548--)*func_48(var_536 ,((~(var_548++))*var_31.var_78) ,var_551 ,var_218 ,((--var_114)&(byte)(125)) ,var_149.var_63.var_162))*func_48(var_62 ,var_58 ,var_46 ,func_26(false ,((var_548--)>=( ( short )(--var_548) )) ,(-(++var_99)) ,var_536) ,(--var_548) ,var_536.var_63.var_162))) ; + } + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_567 ) + { + try + { + try + { + var_1[((++var_99)&0)][4] = (((+(var_548++))*var_31.var_78)>=var_62.var_230) ; + } + catch( java.lang.ArithmeticException myExp_568 ) + { + var_59.var_569 = (var_2--) ; + System.out.println("hello exception 2 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_570 ) + { + cl_23 var_571 = new cl_23(); + var_96 = var_149.var_63.var_109 ; + System.out.println("hello exception 3 !"); + } + System.out.println("hello exception 1 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_572 ) + { + var_1 = var_575 ; + System.out.println("hello exception 4 !"); + } + } + } + return ; +} +public strictfp boolean func_6(double var_7) +{ + final int var_532 = (1646681225); + byte var_8 = (byte)(54); + long var_490 = (2703549826902372819L); + cl_44 [] var_534 = {new cl_44(),new cl_44()}; + byte var_487 = (byte)(86); + short var_538 = (short)(-21765); + int var_542 = (-1435403255); + if( (!(!(!(!((--var_8)==func_9(var_31 ,var_485 ,( ( long )(--var_487) ) ,var_149.var_63.var_64 ,( ( int )(++var_490) ) ,(-(++var_492)) ,((var_398++)*var_398)))))))) + { + int var_504 = (617405650); + short var_513 = (short)(3782); + try + { + for( var_495 = 434 ;(var_495>433);var_495 = (var_495-1) ) + { + short var_499 = (short)(-16278); + double [][][] var_497 = {{{(-2.00675e-134D),(3.36193e+67D),(-1.55461e-90D)},{(-1.55276e-151D),(5.53447e+49D),(2.89544e+181D)},{(-2.55914e+119D),(8.83358e+33D),(1.23494e+40D)}},{{(1.76715e-52D),(-8.98188e-246D),(-1.44124e+151D)},{(1.66059e-275D),(-5.9882e+08D),(-4.30693e+09D)},{(-8.72969e-229D),(-1.38964e+17D),(3.19978e+242D)}},{{(-6.39878e+84D),(-3.43576e-270D),(-2.45652e+159D)},{(-4.49923e-215D),(1.42179e+295D),(1.72615e-196D)},{(-4.08818e+238D),(-4.02291e+185D),(-1.52677e+65D)}},{{(-1.09373e+201D),(-5.42049e-135D),(4.13711e+213D)},{(-4.06185e-199D),(1.53828e-33D),(-5.22306e-192D)},{(6.96644e-303D),(-1.64598e-59D),(-3.86811e+72D)}}}; + var_497[((--var_499)&3)][((-(++var_487))&2)][(((--var_8)|var_46.var_498)&2)] = ((((var_135++)&var_59.var_500)*var_422)*var_223) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_501 ) + { + try + { + if( func_26((!(!((var_503++)==( ( double )(--var_504) )))) ,(!((var_8--)>=var_492)) ,(~(--var_503)) ,var_149)) + { + int [] var_519 = {(1915081681),(996936401),(1651787794),(-1055887012),(-1696192356),(-251002693)}; + if( (!((var_509--)==func_19((var_487++) ,((++var_487)*var_492) ,((~((--var_8)*var_503))>var_368) ,(!(!((((var_513--)+var_96.var_233)<=var_91)==var_218))) ,((++var_7)+var_128.var_369) ,var_102.var_68.var_63)))) + { + try + { + float var_517 = (-3.30709e-25F); + } + catch( java.lang.ArithmeticException myExp_518 ) + { + var_31.var_116 = (var_398++) ; + System.out.println("hello exception 6 !"); + } + } + } + else + { + boolean var_520 = true; + } + } + catch( java.lang.ArithmeticException myExp_521 ) + { + boolean var_522 = false; + System.out.println("hello exception 7 !"); + } + System.out.println("hello exception 5 !"); + } + } + else + { + cl_23 var_526 = new cl_23(); + cl_44 var_537 = new cl_44(); + for( var_523 = 815 ;(var_523<848);var_523 = (var_523+11) ) + { + try + { + var_8 = (++var_487) ; + } + catch( java.lang.ArithmeticException myExp_525 ) + { + try + { + if( true) + { + var_102.var_275 = var_149.var_63.var_109 ; + } + else + { + double var_527 = (-1.66825e+154D); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_528 ) + { + try + { + short var_530 = (short)(-19385); + if( true) + { + var_144[((~(var_530++))&2)][((++var_487)&5)] = false ; + } + } + catch( java.lang.ArithmeticException myExp_531 ) + { + if( (!((var_114++)var_149.var_256) ,var_536.var_334 ,(+((var_542--)-var_543)) ,var_149); +} +public strictfp int func_9(cl_21 var_10, cl_23 var_11, long var_12, cl_26 var_13, int var_14, float var_15, float var_16) +{ + final int [][] var_388 = {{(613099554),(-279856557),(45975041),(368810813),(-298893270)},{(-555071081),(409415675),(485492122),(501335006),(1035719629)},{(2054221288),(203528825),(-1570815426),(1019987353),(1437836486)}}; + byte [] var_365 = {(byte)(32),(byte)(24),(byte)(88),(byte)(88),(byte)(36),(byte)(-12),(byte)(32)}; + cl_44 var_232 = new cl_44(); + byte var_17 = (byte)(50); + boolean [][][] var_481 = {{{true,true,true},{true,true,true},{true,true,false},{false,false,false},{true,true,true}},{{true,true,false},{true,true,true},{false,true,true},{false,true,false},{true,true,true}},{{false,true,false},{false,false,false},{false,true,true},{true,false,false},{false,false,true}}}; + short var_483 = (short)(-7195); + if( false) + { + short var_18 = (short)(-23434); + cl_58 var_285 = new cl_58(); + if( ((var_17++)!=( ( byte )(-(var_18--)) ))) + { + int [][] var_348 = {{(-653952470),(-253861711),(-207526489),(814779213),(-54043509)},{(-1477337320),(327468319),(-891013068),(-500522781),(-1094233249)},{(-335196458),(-1204498247),(565748752),(1220887796),(-709237658)},{(1680459479),(1980479840),(1075879753),(104263143),(-1714833508)},{(764624940),(1096545931),(830046430),(449401806),(-2097218745)},{(1089817144),(1916973024),(717012958),(-340021735),(-165057917)}}; + cl_39 var_301 = new cl_39(); + if( (!(!((var_17++)>func_19(var_223 ,(+(--var_18)) ,((--var_215)==var_91) ,((++var_17)>=var_47) ,(var_215++) ,var_46.var_68.var_63))))) + { + if( func_26(func_26(func_26((((var_17++)+( ( double )(--var_18) ))<=var_62.var_230) ,(!(((++var_12)+func_48(var_232 ,(--var_215) ,var_46 ,(!(!(!((--var_192)>var_96.var_233)))) ,(-(++var_47)) ,var_234))==( ( short )(254932202) ))) ,(var_18++) ,var_62) ,(((var_99--)*var_127.var_125)!=var_113) ,var_34[((var_14--)&5)][((var_35--)&4)] ,var_149) ,(!(!((++var_93)!=( ( byte )(var_18++) )))) ,(var_17++) ,var_149)) + { + try + { + boolean [][] var_249 = {{false,false,true,false,false,true},{true,false,true,true,false,true},{true,false,true,true,true,true},{true,false,true,false,false,false}}; + for( var_246 = 106 ;(var_246<178);var_246 = (var_246+18) ) + { + boolean [][] var_248 = {{true,false}}; + var_248[(((--var_114)|var_31.var_57)&0)][((var_18++)&1)] = var_249[(((var_18--)-func_37(var_249[3][((++var_14)&5)] ,(+((+(var_18++))|var_96.var_120)) ,(var_15--) ,(!((+(~((var_14++)*func_19((var_18--) ,((var_192--)+( ( int )(var_17++) )) ,((++var_17)!=var_149.var_230) ,((++var_17)!=var_149.var_256) ,(--var_17) ,var_46.var_68.var_63))))<(short)(11118))) ,var_46 ,var_46 ,var_34))&3)][(((var_215++)-( ( short )(var_17++) ))&5)] ; + } + } + catch( java.lang.IllegalArgumentException myExp_264 ) + { + var_102.var_265 = var_149.var_63.var_56 ; + System.out.println("hello exception 11 !"); + } + } + else + { + if( func_26(((!((var_17--)==var_15))==var_31.var_32) ,func_26(((~((var_17--)-var_215))==var_47) ,(!((var_17--)!=var_46.var_68.var_268.var_154)) ,((var_35--)-( ( int )((var_12--)-var_96.var_154) )) ,var_149) ,(var_114++) ,var_62)) + { + if( ((++var_17)<=( ( int )(-(var_192--)) ))) + { + var_31.var_32 = (!(!(((++var_18)&var_127.var_111)==var_143.var_56.var_75))) ; + } + else + { + var_102.var_275 = var_149.var_63.var_109 ; + } + } + } + } + else + { + if( (!(!((++var_12)<=var_219)))) + { + try + { + for( var_276 = 825 ;(var_276<865);var_276 = (var_276+10) ) + { + var_15 = (-(var_47--)) ; + } + } + catch( java.lang.ArithmeticException myExp_278 ) + { + if( ((++var_17)<=var_31.var_75)) + { + final int var_279 = (-956975297); + } + System.out.println("hello exception 12 !"); + } + } + else + { + double [][][] var_308 = {{{(40353.8D),(8.04945e+266D),(3.81654e+248D),(3.51888e-277D)},{(-1.4415e+250D),(2.64693e-250D),(-5.41098e-161D),(-1.65669e+129D)}},{{(8.48848e+181D),(4.75043e+72D),(-5.61995e+279D),(-1.55026e-136D)},{(4.29366e+273D),(4.13715e-24D),(-3.80896e-13D),(1.61762e-113D)}}}; + double var_338 = (-5.9413e+153D); + try + { + if( (!(!((var_47++)!=(-2.93678e+268D))))) + { + int [][] var_315 = {{(-374939805),(-7670888),(-843007895),(597093843),(-1391962134)},{(348078778),(-2132487282),(1769623386),(1871785065),(-366120552)},{(-1729555253),(101427430),(-315320346),(1470389572),(-301487043)},{(74379736),(-533921471),(-2071142665),(-1418665595),(523685720)},{(1204357355),(-1595193003),(-399422248),(1910490016),(-1627904148)},{(1697320313),(-1069917216),(462243613),(-1895984767),(-2141670154)}}; + var_277[((-(--var_18))&3)][(((var_17++)*func_19((++var_47) ,(~(var_35++)) ,(!((var_17++)>var_91)) ,(!(!((var_192++)<=func_48(var_62 ,(--var_14) ,var_46 ,func_26((!(((++var_35)-var_96.var_97)>=func_48(var_232 ,(-(++var_17)) ,var_285 ,(!((+(--var_17))func_19((~(--var_135)) ,(++var_14) ,(!((++var_215)var_102.var_298.var_299)) ,(var_35++) ,(2.52731e-271D) ,var_218 ,var_102 ,var_102 ,var_96.var_300)) ,(!(!((+(var_14--))func_37(var_144[((~(var_192++))&2)][5] ,((--var_17)*var_127.var_125) ,(var_16--) ,(!((var_18++)!=(-1.00104e+15F))) ,var_102 ,var_285 ,var_34)) ,(var_12++) ,(var_15++) ,((++var_17)>( ( double )(((var_35--)+func_19((var_99--) ,((var_18++)*( ( short )func_37((!(!(!(!(!(!var_62.var_334)))))) ,(-5.47107e+293D) ,(var_14--) ,(!(((var_338--)+( ( float )((var_114++)|var_18) ))==var_91)) ,var_46 ,var_46 ,var_34) )) ,var_144[((var_215--)&2)][((++var_14)&5)] ,((var_18--)=(byte)(-107))) ,((var_215++)*var_96.var_154) ,var_62) ,(-(++var_47)) ,var_149.var_63.var_162)) ,var_102.var_68.var_63))&3)] = func_48(var_149 ,(--var_215) ,var_102 ,(!(!((((-((var_135++)+var_17))*( ( int )(+(++var_17)) ))-var_31.var_116)>=var_91))) ,(var_18++) ,var_149.var_63.var_162) ; + } + else + { + var_46.var_298.var_60 = false ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_364 ) + { + if( ((var_12--)>( ( double )(var_93++) ))) + { + var_17 = (--var_114) ; + } + System.out.println("hello exception 13 !"); + } + } + } + } + else + { + try + { + for( var_366 = 267 ;(var_366>254);var_366 = (var_366-13) ) + { + try + { + for( var_367 = 210 ;(var_367<214);var_367 = (var_367+4) ) + { + var_15 = ((var_12--)*var_128.var_369) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_370 ) + { + cl_21 var_371 = new cl_21(); + System.out.println("hello exception 14 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_372 ) + { + int var_373 = (-1946654697); + for( var_373 = 610 ;(var_373<620);var_373 = (var_373+10) ) + { + try + { + int var_374 = (-152090816); + for( var_374 = 829 ;(var_374>825);var_374 = (var_374-4) ) + { + var_13 = var_127 ; + } + } + catch( java.lang.ArithmeticException myExp_375 ) + { + if( (!((var_18++)>var_47))) + { + var_13 = var_59 ; + } + System.out.println("hello exception 16 !"); + } + } + System.out.println("hello exception 15 !"); + } + } + } + else + { + double var_464 = (2.45529e-267D); + final cl_58 var_415 = new cl_58(); + short var_439 = (short)(27141); + int [][] var_468 = {{(692163384),(1211187397),(-581143667),(-658431999),(-1997003461)},{(298066242),(-9135423),(-1545822381),(-12675000),(610608392)},{(-1019681946),(564016400),(-653110096),(1890006027),(2049494894)},{(448436319),(934104386),(3107605),(2020412311),(-1186952704)},{(1003677818),(671625397),(628435623),(1205247296),(-976619790)},{(-467235562),(-719029881),(-461677528),(-934961461),(-1778420064)}}; + try + { + double [] var_390 = {(-4.06149e+258D)}; + try + { + try + { + int var_376 = (-975978990); + for( var_376 = 933 ;(var_376<963);var_376 = (var_376+6) ) + { + for( var_377 = 1004 ;(var_377<1018);var_377 = (var_377+14) ) + { + var_365[(((++var_47)*var_96.var_154)&6)] = (var_17++) ; + } + } + } + catch( java.lang.ArithmeticException myExp_378 ) + { + if( func_26(var_102.var_379 ,((--var_17)==var_47) ,(var_17++) ,var_149)) + { + try + { + double var_384 = (-1.86101e+276D); + } + catch( java.lang.IllegalArgumentException myExp_385 ) + { + var_127.var_386 = (-((--var_47)|func_19((-2710789548371004237L) ,var_388[((~(((++var_398)*var_59.var_111)|var_246))&2)][(((+(--var_17))+func_37((!((var_17++)<=var_91)) ,var_390[((var_17++)&0)] ,((var_17--)-(-2.32371e+42D)) ,((var_368++)!=var_99) ,var_394 ,var_102 ,var_34))&4)] ,(!((~(var_47++))>( ( double )(-(var_17++)) ))) ,((var_17++)>(-4.11367e+12F)) ,(+(var_47--)) ,var_102.var_68.var_63))) ; + System.out.println("hello exception 18 !"); + } + } + else + { + var_290.var_83 = var_149.var_63.var_83 ; + } + System.out.println("hello exception 17 !"); + } + } + catch( java.lang.ArithmeticException myExp_404 ) + { + try + { + for( var_405 = 979 ;(var_405>943);var_405 = (var_405-18) ) + { + short var_407 = (short)(27582); + if( (((+(var_17++))+var_62.var_77.var_105)>=func_37((!(!((((var_17++)*func_19((var_14--) ,var_388[(((++var_17)|var_405)&2)][((var_407--)&4)] ,false ,((var_14++)>=( ( int )(var_223++) )) ,(var_14++) ,var_102.var_68.var_63))-( ( short )var_34[((~(++var_35))&5)][((var_17--)&4)] ))>=func_48(var_62 ,(+((--var_17)|var_17)) ,var_415 ,(!(!(!(!((+(var_99++))!=var_31.var_105))))) ,((var_17++)+( ( int )(-1888127709165952510L) )) ,var_320)))) ,var_421[((-(var_422++))&3)][((var_215--)&1)] ,(var_17++) ,((++var_14)>var_62.var_425) ,var_394 ,var_102 ,var_429))) + { + var_14 = (var_407--) ; + } + else + { + var_59 = var_149.var_63.var_64 ; + } + } + } + catch( java.lang.ArithmeticException myExp_431 ) + { + try + { + if( var_96.var_110) + { + var_394 = var_415 ; + } + else + { + var_96 = var_149.var_63.var_109 ; + } + } + catch( java.lang.IllegalArgumentException myExp_432 ) + { + try + { + final cl_23 var_433 = new cl_23(); + } + catch( java.lang.IllegalArgumentException myExp_434 ) + { + var_390[((~((var_17++)&var_398))&0)] = (var_435++) ; + System.out.println("hello exception 22 !"); + } + System.out.println("hello exception 21 !"); + } + System.out.println("hello exception 20 !"); + } + System.out.println("hello exception 19 !"); + } + } + catch( java.lang.ArithmeticException myExp_436 ) + { + try + { + for( var_437 = 803 ;(var_437>784);var_437 = (var_437-19) ) + { + try + { + try + { + var_365[((++var_17)&6)] = (var_17--) ; + } + catch( java.lang.ArithmeticException myExp_438 ) + { + var_365[((--var_439)&6)] = (byte)(-46) ; + System.out.println("hello exception 24 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_440 ) + { + try + { + var_99 = (var_17--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_441 ) + { + double var_442 = (1.59302e-80D); + System.out.println("hello exception 26 !"); + } + System.out.println("hello exception 25 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_443 ) + { + try + { + try + { + cl_26 [][] var_458 = {{new cl_26(),new cl_26(),new cl_26(),new cl_26()}}; + if( (!(!((var_17++)<=func_48(var_149 ,((++var_17)+var_368) ,var_415 ,(!((++var_398)>=func_48(var_62 ,(1.04922e+22F) ,var_415 ,( ( boolean )((var_439++)=var_127.var_369))) ,var_102 ,var_394 ,var_468)) ,var_234))))) + { + var_464 = (2.22607e-99D) ; + } + } + catch( java.lang.IllegalArgumentException myExp_472 ) + { + int var_473 = (170964351); + for( var_473 = 503 ;(var_473>493);var_473 = (var_473-2) ) + { + long var_474 = (2337057581503960246L); + } + System.out.println("hello exception 28 !"); + } + } + catch( java.lang.ArithmeticException myExp_475 ) + { + try + { + if( (!(!(!(!((var_192++)!=var_439)))))) + { + var_31 = var_62.var_63.var_56 ; + } + else + { + var_62.var_268.var_195 = (-((var_135++)-var_128.var_369)) ; + } + } + catch( java.lang.IllegalArgumentException myExp_476 ) + { + boolean [][][] var_480 = {{{false,false,false},{true,false,false},{false,true,true},{false,false,false},{false,false,false}},{{false,true,false},{false,true,true},{false,true,false},{false,false,false},{false,true,false}},{{true,true,true},{true,false,true},{false,true,false},{false,false,true},{false,true,true}}}; + try + { + boolean [][][] var_477 = {{{false,false},{false,false}},{{true,true},{true,false}},{{true,false},{false,false}},{{true,true},{false,false}},{{true,false},{false,true}},{{true,false},{false,true}},{{true,true},{true,false}}}; + } + catch( java.lang.IllegalArgumentException myExp_478 ) + { + var_149.var_63.var_64.var_479 = var_482 ; + System.out.println("hello exception 31 !"); + } + System.out.println("hello exception 30 !"); + } + System.out.println("hello exception 29 !"); + } + System.out.println("hello exception 27 !"); + } + System.out.println("hello exception 23 !"); + } + } + return (+(var_483++)); +} +public strictfp byte func_19(long var_20, int var_21, boolean var_22, boolean var_23, double var_24, cl_39 var_25) +{ + cl_26 [][][] var_222 = {{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}},{{new cl_26(),new cl_26(),new cl_26(),new cl_26(),new cl_26()}}}; + try + { + short var_216 = (short)(-16810); + if( func_26((!((var_215++)>=( ( short )(-1565024479) ))) ,(!(!(!((var_216++)==var_135)))) ,(-1694489682) ,var_62)) + { + var_20 = (++var_215) ; + } + } + catch( java.lang.ArithmeticException myExp_217 ) + { + if( (!((var_35--)==(short)(-13418)))) + { + for( var_219 = 993 ;(var_219>975);var_219 = (var_219-6) ) + { + int var_220 = (-1110393801); + for( var_220 = 104 ;(var_220<139);var_220 = (var_220+7) ) + { + var_74 = var_222 ; + } + } + } + System.out.println("hello exception 32 !"); + } + return var_31.var_57; +} +public strictfp boolean func_26(boolean var_27, boolean var_28, int var_29, cl_44 var_30) +{ + int [][] var_212 = {{(-785809574),(-646697347),(-461041806),(1693926753),(497552439)},{(1086975180),(1721263592),(-2112277513),(1393174004),(-776057619)},{(775782452),(1985630693),(800545313),(879248177),(-661058969)},{(140011999),(1127367344),(704176417),(-1155308671),(-2056717077)},{(-1567561424),(291169546),(2119098105),(-1128813181),(1883872514)},{(-842418810),(-2135210934),(-891404516),(170668126),(-1417608210)}}; + byte var_36 = (byte)(-87); + if( var_31.var_32) + { + cl_58 var_209 = new cl_58(); + var_34[((~(((var_36--)+var_35)&func_37(var_124 ,(++var_36) ,(+(++var_36)) ,true ,var_209 ,var_102 ,var_212)))&5)][((--var_35)&4)] = ((var_36++)-var_99) ; + } + short var_214 = (short)(12549); + return ((var_214--)!=var_58); +} +public strictfp byte func_37(boolean var_38, double var_39, double var_40, boolean var_41, cl_58 var_42, cl_58 var_43, int[][] var_44) +{ + cl_26 [][] var_138 = {{new cl_26(),new cl_26(),new cl_26(),new cl_26()}}; + int var_172 = (577264212); + short var_196 = (short)(9596); + int var_45 = (1832032543); + final cl_44 var_177 = new cl_44(); + byte var_204 = (byte)(-69); + if( ((var_47--)==func_48(var_62 ,( ( float )(var_114--) ) ,var_43 ,((var_135++)>=var_47) ,(((--var_47)*var_47)+(short)(-10850)) ,var_138))) + { + long var_174 = (-6755172031999419185L); + cl_26 var_190 = new cl_26(); + try + { + short var_142 = (short)(-18764); + byte var_146 = (byte)(36); + try + { + for( var_140 = 810 ;(var_140<858);var_140 = (var_140+12) ) + { + int var_141 = (-1965559760); + final cl_26 [][] var_156 = {{new cl_26(),new cl_26(),new cl_26(),new cl_26()}}; + for( var_141 = 638 ;(var_141<663);var_141 = (var_141+5) ) + { + if( (!((var_142--)==var_5))) + { + var_40 = ((+(++var_146))*func_48(var_62 ,func_48(var_62 ,func_48(var_149 ,(var_47++) ,var_43 ,true ,(((+(++var_35))*var_96.var_154)-var_142) ,var_156) ,var_43 ,((++var_146)<=var_146) ,var_34[((var_142++)&5)][((var_47--)&4)] ,var_149.var_63.var_162) ,var_43 ,((var_146--)>=( ( double )((var_142++)*( ( short )(++var_93) )) )) ,var_44[((~(var_45--))&5)][((++var_142)&4)] ,var_149.var_63.var_162)) ; + } + } + } + } + catch( java.lang.IllegalArgumentException myExp_169 ) + { + try + { + if( (!(!(!(!(((--var_142)&var_5)>=var_31.var_78)))))) + { + var_142 = (short)(3310) ; + } + } + catch( java.lang.IllegalArgumentException myExp_170 ) + { + int var_171 = (1695169301); + for( var_171 = 302 ;(var_171<308);var_171 = (var_171+3) ) + { + long var_181 = (-9174726466604449660L); + if( (!(((var_172--)*var_0)func_48(var_177 ,var_58 ,var_102 ,(!(!(!((var_181++)!=( ( double )(++var_35) ))))) ,(var_146++) ,var_138)))))) ,((--var_146)+var_46.var_186.var_116) ,var_138)))) + { + int var_189 = (-766648022); + var_74[6][0][((--var_189)&4)] = var_62.var_63.var_64 ; + } + } + System.out.println("hello exception 34 !"); + } + System.out.println("hello exception 33 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_191 ) + { + if( ((var_45++)>=var_192)) + { + int var_193 = (1449672545); + for( var_193 = 912 ;(var_193>910);var_193 = (var_193-2) ) + { + try + { + if( ((!(((-(++var_114))-var_140)<=var_46.var_194.var_195))|var_38)) + { + var_174 = (+(var_135++)) ; + } + else + { + var_174 = (+(--var_196)) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_197 ) + { + int var_198 = (-331215545); + for( var_198 = 831 ;(var_198<846);var_198 = (var_198+5) ) + { + var_39 = (var_172++) ; + } + System.out.println("hello exception 36 !"); + } + } + } + else + { + int var_199 = (-2127743906); + for( var_199 = 681 ;(var_199<713);var_199 = (var_199+8) ) + { + try + { + var_93 = (var_114--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_200 ) + { + int var_201 = (-1449270401); + try + { + var_138[(((var_201--)+var_143.var_202)&0)][((+(var_35++))&3)] = var_149.var_63.var_64 ; + } + catch( java.lang.ArithmeticException myExp_203 ) + { + var_39 = (+((var_172--)*(byte)(-55))) ; + System.out.println("hello exception 38 !"); + } + System.out.println("hello exception 37 !"); + } + } + } + System.out.println("hello exception 35 !"); + } + } + return (var_204--); +} +public strictfp float func_48(cl_44 var_49, float var_50, cl_58 var_51, boolean var_52, int var_53, cl_26[][] var_54) +{ + cl_39 var_69 = new cl_39(); + int var_92 = (-715891184); + cl_26 var_129 = new cl_26(); + short var_117 = (short)(7368); + byte var_126 = (byte)(121); + try + { + cl_26 var_94 = new cl_26(); + try + { + if( (!((++var_35)=var_58))|var_59.var_60)))) + { + try + { + byte var_71 = (byte)(-9); + try + { + float var_66 = (2.72094e-36F); + double var_65 = (9.35144e-217D); + final double [][][] var_73 = {{{(-1.78607e+306D)}},{{(-7.11671e+217D)}},{{(1.0899e-135D)}}}; + long var_67 = (2292303673966189949L); + var_59 = var_62.var_63.var_64 ; + var_55 = var_69 ; + long var_80 = (-8038700297212754854L); + var_31.var_70 = (var_71++) ; + var_54[(((--var_71)*var_53)&0)][((var_71++)&3)] = var_62.var_63.var_64 ; + var_31 = var_72 ; + var_69 = var_55 ; + var_71 = (var_71--) ; + var_35 = (++var_71) ; + var_34[(((var_71++)&var_5)&5)][((-(var_71++))&4)] = (2061067244) ; + var_46.var_68.var_63.var_56.var_75 = ((--var_76)+var_62.var_77.var_78) ; + var_46.var_68.var_79 = var_62.var_63.var_56 ; + var_54[(((--var_76)+var_0)&0)][((var_53++)&3)] = var_61 ; + } + catch( java.lang.ArithmeticException myExp_81 ) + { + var_55 = var_69 ; + float var_82 = (-3.93809e+09F); + var_54[((-(-(var_71++)))&0)][((var_76--)&3)] = var_62.var_63.var_64 ; + final cl_44 var_85 = new cl_44(); + float var_84 = (-5.98711e-30F); + var_54[((var_35--)&0)][((var_35++)&3)] = var_62.var_63.var_64 ; + var_46.var_68.var_63.var_83 = var_62.var_63.var_56 ; + var_35 = (var_71--) ; + var_74[(((++var_35)&(765027901))&6)][((var_71++)&0)][((+(var_35++))&4)] = var_62.var_63.var_64 ; + System.out.println("hello exception 39 !"); + } + try + { + var_54[((+(++var_35))&0)][((var_35++)&3)] = var_59 ; + long var_86 = (848043401914808552L); + var_74[(((var_71--)+( ( int )(var_71++) ))&6)][0][(((~(--var_71))-var_35)&4)] = var_62.var_63.var_64 ; + var_71 = (++var_71) ; + } + catch( java.lang.ArithmeticException myExp_87 ) + { + int [][][] var_88 = {{{(242149794),(1995528791),(211183110),(-1726729085)},{(2114989104),(-2014944294),(46371718),(1243652994)},{(263429072),(1978391449),(1601436654),(1366799317)},{(485089362),(-1410598781),(-1290926725),(1480562794)},{(-1230877092),(1389088483),(-411408377),(2121967497)}}}; + System.out.println("hello exception 40 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_89 ) + { + if( ((~(var_76--))!=var_47)) + { + int var_90 = (-1614432941); + } + System.out.println("hello exception 41 !"); + } + } + } + else + { + if( (!((var_35++)>var_91))) + { + try + { + try + { + var_74[((--var_93)&6)][((++var_92)&0)][((~(var_35++))&4)] = var_59 ; + } + catch( java.lang.ArithmeticException myExp_95 ) + { + var_96.var_97 = (1.31486e-14F) ; + System.out.println("hello exception 42 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_98 ) + { + var_46.var_68.var_77.var_75 = (~(var_99++)) ; + System.out.println("hello exception 43 !"); + } + } + } + } + catch( java.lang.IllegalArgumentException myExp_100 ) + { + int var_101 = (-1584581734); + for( var_101 = 765 ;(var_101<801);var_101 = (var_101+9) ) + { + try + { + try + { + int var_103 = (-721293107); + for( var_103 = 833 ;(var_103<837);var_103 = (var_103+4) ) + { + var_69 = var_55 ; + } + } + catch( java.lang.IllegalArgumentException myExp_104 ) + { + try + { + var_55.var_56.var_105 = (~((--var_35)|var_35)) ; + } + catch( java.lang.IllegalArgumentException myExp_106 ) + { + double var_107 = (2.34249e-110D); + System.out.println("hello exception 46 !"); + } + System.out.println("hello exception 45 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_108 ) + { + if( var_55.var_109.var_110) + { + if( ( ( boolean )(!((var_47--)>=var_59.var_111)) )) + { + int var_112 = (-1273633660); + var_34[(((++var_113)|( ( int )(++var_114) ))&5)][(((++var_93)+( ( byte )(--var_112) ))&4)] = (var_113++) ; + } + } + System.out.println("hello exception 47 !"); + } + } + System.out.println("hello exception 44 !"); + } + } + catch( java.lang.ArithmeticException myExp_115 ) + { + try + { + var_92 = (~(var_117++)) ; + } + catch( java.lang.IllegalArgumentException myExp_118 ) + { + final int [] var_121 = {(-1851269321)}; + try + { + byte var_122 = (byte)(73); + try + { + var_31 = var_62.var_63.var_56 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_119 ) + { + var_92 = ((--var_122)&var_102.var_68.var_79.var_78) ; + System.out.println("hello exception 50 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_123 ) + { + cl_21 var_131 = new cl_21(); + if( var_124) + { + if( (!(!((((var_35--)-var_5)-var_59.var_125)>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/2344_2018110812026/MainClass.java b/test/testsuite/fuzz_test/fuzz/2344_2018110812026/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..dc128ab3ede7b94bbf79ed9b8aec3cbdaf52acd9 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2344_2018110812026/MainClass.java @@ -0,0 +1,249 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1360628436 + +import java.util.zip.CRC32; + +class MainClass +{ + static cl_16 var_17 = new cl_16(); + static byte var_32 = (byte)(89); + static int [] var_36 = {(2027585470),(1534538953)}; + static int var_38 = (-351409947); + double var_39 = (1.71059e+195D); + static int [] var_42 = {(1664958056),(1876843455)}; + final boolean var_43 = true; + short var_46 = (short)(-14339); + short var_47 = (short)(-11751); + int [][] var_49 = {{(-1259468423),(-230097085),(617481840),(612370114)},{(1465250835),(1936002676),(-1947951980),(-978942243)},{(-1228037016),(-1065505111),(-1936990465),(-1296467332)},{(-1978873434),(-1468974247),(-1011186781),(-1518377509)}}; + cl_44 var_50 = new cl_44(); + boolean [] var_53 = {true,true,true,false,false}; + float var_55 = (534.205F); + long var_62 = (-7556004645476335938L); + boolean [] var_89 = {true,true}; + float [][] var_92 = {{(1.50899e+25F),(1934.66F),(2.56918e+23F),(3.77461e+28F),(1.09553e+25F)},{(0.0235995F),(-3.33115e+20F),(3.98313e-30F),(2.83813e-28F),(5.2622e+25F)},{(1.1495e-39F),(-2.34695e+09F),(2.86208e+30F),(-1.40357e+37F),(6.41061e-23F)},{(4.26703e+35F),(3.27698e-32F),(-8.94196e+27F),(4.08445e+37F),(3.6314e+33F)},{(-6.75388e-10F),(-1.50121e+33F),(-3.16951e-15F),(4.13009e-29F),(-4.95789e-11F)}}; + int var_94 = (-1152832490); + int var_105 = (677035829); + int var_109 = (725103407); +/*********************************/ +public strictfp void run() +{ + float [][] var_86 = {{(-1.2023e-16F),(0.00727385F),(2.77546e-26F),(-4.36111e-08F),(-3.1829e-15F)},{(-1.49011e+10F),(9.46066e+06F),(55664.4F),(3.46801F),(2.99142e-35F)},{(-1.5755e-32F),(9.90511e+36F),(6.78018e-23F),(-1.60718e-16F),(3.03685e+10F)},{(8.29824e-22F),(1.51636e-22F),(-3.73056e-07F),(1.49572e+35F),(1.52408e-14F)},{(167035F),(5.6027e+09F),(-1.84363e+28F),(8.58493e+15F),(0.000748174F)}}; + byte var_108 = (byte)(105); + double [] var_87 = {(-3.34507e-226D),(6.52145e-112D)}; + try + { + byte var_0 = (byte)(69); + try + { + if( ((~(++var_0))>=func_1(( ( double )(((++var_0)*func_1(((++var_0)*var_38) ,var_50.var_85 ,false ,var_86 ,((var_38--)-(byte)(102)) ,(--var_32)))+func_1(var_87[(((+(var_0++))|var_17.var_57)&1)] ,var_89 ,(!(!((--var_32)<=(short)(591)))) ,var_92 ,var_42[(((var_94++)&var_47)&1)] ,((var_0--)&var_38))) ) ,var_89 ,(!(((++var_46)+var_50.var_70)!=( ( short )(++var_0) ))) ,var_17.var_100 ,( ( int )(--var_32) ) ,(++var_32)))) + { + var_0 = (var_0--) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_104 ) + { + for( var_105 = 311 ;(var_105<323);var_105 = (var_105+12) ) + { + long [] var_106 = {(4535090311450531435L),(1637574433026602804L),(8258225500689436066L),(433282804196297882L),(2347812584244197859L),(-321271690839974436L)}; + } + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_107 ) + { + if( (!(!(!((++var_108)>=(byte)(3)))))) + { + for( var_109 = 297 ;(var_109>225);var_109 = (var_109-18) ) + { + long var_110 = (288533214548157863L); + } + } + else + { + try + { + var_108 = (++var_108) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_111 ) + { + var_94 = (var_108++) ; + System.out.println("hello exception 2 !"); + } + } + System.out.println("hello exception 1 !"); + } + return ; +} +public strictfp byte func_1(double var_2, boolean[] var_3, boolean var_4, float[][] var_5, int var_6, int var_7) +{ + byte var_78 = (byte)(-19); + byte var_84 = (byte)(-103); + byte var_74 = (byte)(97); + byte var_80 = (byte)(-102); + byte var_8 = (byte)(-47); + byte var_76 = (byte)(-23); + if( ((var_8++)>=func_9(((var_47--)*var_39) ,((var_32--)+var_17.var_35) ,(--var_74) ,(~((++var_32)&( ( long )((var_76--)+var_17.var_35) ))) ,(var_78--) ,(var_80--) ,(-2.90273e-50D)))) + { + int [][] var_83 = {{(1799518769),(1095496210),(-1772250448),(1484478068),(1776677197),(-471764505),(-1803883284)},{(2100693069),(2052056504),(1601586635),(-1162581368),(-1291235189),(1268131897),(-944761601)},{(-1628791022),(-416098444),(1839745702),(1741599686),(987666294),(-126703748),(250554981)},{(620639956),(-238946990),(-179142126),(-239239874),(-1012824304),(1784244995),(80762239)},{(-114041463),(-2055334448),(-737005207),(-270583736),(1577312090),(1637482329),(1350107228)},{(156900215),(562935865),(-438192740),(-1680784377),(-1339754611),(-1372347357),(276702872)}}; + } + return (--var_84); +} +public strictfp double func_9(double var_10, double var_11, double var_12, long var_13, float var_14, float var_15, double var_16) +{ + var_17 = var_17 ; + byte var_65 = (byte)(99); + int var_68 = (-1820454759); + try + { + short var_61 = (short)(-23956); + var_17 = func_18(var_49 ,(~((var_61++)*var_62))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_63 ) + { + int var_64 = (-49623597); + byte [][][] var_69 = {{{(byte)(106),(byte)(-8),(byte)(4),(byte)(115),(byte)(44)}},{{(byte)(35),(byte)(-110),(byte)(-70),(byte)(94),(byte)(-90)}},{{(byte)(45),(byte)(93),(byte)(112),(byte)(70),(byte)(22)}},{{(byte)(-54),(byte)(118),(byte)(-120),(byte)(-73),(byte)(76)}},{{(byte)(87),(byte)(-18),(byte)(19),(byte)(-49),(byte)(40)}}}; + for( var_64 = 946 ;(var_64<979);var_64 = (var_64+11) ) + { + if( (!(!(!(((--var_65)-var_50.var_66)==var_17.var_67))))) + { + var_14 = ((var_68--)|( ( int )var_69[(((var_68--)&(byte)(-118))&4)][((var_47++)&0)][(((var_47--)*var_50.var_70)&4)] )) ; + } + } + System.out.println("hello exception 3 !"); + } + short var_71 = (short)(8118); + return (--var_71); +} +public strictfp cl_16 func_18(int[][] var_19, long var_20) +{ + final int var_22 = (1888473915); + byte var_21 = (byte)(75); + if( ((var_21++)977);var_48 = (var_48-17) ) + { + final boolean var_56 = true; + var_19 = var_49 ; + var_53[(var_48&4)] = ((--var_55)==var_32) ; + var_17 = func_24(var_43) ; + var_36[(var_48&1)] = (++var_38) ; + var_19[((var_21++)&3)][((++var_46)&3)] = ((var_21++)|var_32) ; + var_36[((~((~(--var_46))-var_38))&1)] = (((++var_32)&( ( int )(++var_20) ))|var_17.var_57) ; + var_50.var_58 = ((++var_32)>var_47) ; + var_39 = (+(~(var_32--))) ; + } + for( var_59 = 376 ;(var_59>344);var_59 = (var_59-8) ) + { + var_55 = ((++var_60)+var_47) ; + } + } + } + return var_17; +} +public static strictfp cl_16 func_24(boolean var_25) +{ + cl_16 var_45 = new cl_16(); + int var_26 = (-150156217); + for( var_26 = 890 ;(var_26>875);var_26 = (var_26-5) ) + { + int var_27 = (285037635); + byte var_34 = (byte)(-100); + short var_30 = (short)(2770); + for( var_27 = 616 ;(var_27>591);var_27 = (var_27-5) ) + { + double [][] var_29 = {{(8.83693e+33D),(4.30079e+216D),(-1.51044e-16D),(-3.5854e-308D),(8.16334e+133D)},{(1.48992e+266D),(1.47889e-207D),(-4.3872e-268D),(-2.92258e+65D),(3.16528e+158D)},{(2.25478e+175D),(-1.80511e-09D),(-6.56824e+204D),(1.64274e-42D),(-1.96298e-193D)},{(-6.99961e-162D),(1.66911e+169D),(-4.27857e-284D),(7.89205e-114D),(2.03137e+261D)}}; + try + { + var_25 = true ; + byte var_31 = (byte)(82); + final long var_37 = (6412040208739336219L); + var_29[((-(var_31--))&3)][((var_30--)&4)] = (var_32++) ; + var_17.var_33 = ((-(--var_34))-var_17.var_35) ; + var_17 = var_17 ; + var_30 = (var_34++) ; + var_36[((((++var_34)-var_17.var_35)+(short)(-28834))&1)] = (+((+(var_32--))|var_38)) ; + float var_40 = (2.9404e-09F); + var_29[3][4] = (var_40--) ; + } + catch( java.lang.IllegalArgumentException myExp_41 ) + { + final cl_16 var_44 = new cl_16(); + var_36 = var_42 ; + var_17 = var_17 ; + System.out.println("hello exception 4 !"); + } + } + } + return var_45; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(245); + CrcCheck.ToByteArray(this.var_17.GetChecksum(),b,"var_17.GetChecksum()"); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_36[a0],b,"var_36" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_38,b,"var_38"); + CrcCheck.ToByteArray(this.var_39,b,"var_39"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_42[a0],b,"var_42" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_49[a0][a1],b,"var_49" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_50.GetChecksum(),b,"var_50.GetChecksum()"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_53[a0],b,"var_53" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_89[a0],b,"var_89" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_92[a0][a1],b,"var_92" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/2344_2018110812026/Start.java b/test/testsuite/fuzz_test/fuzz/2344_2018110812026/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..aa3a1ebf0d69b6391a40b24b59e8125958bd51e4 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2344_2018110812026/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_16.java cl_44.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/2344_2018110812026/cl_16.java b/test/testsuite/fuzz_test/fuzz/2344_2018110812026/cl_16.java new file mode 100644 index 0000000000000000000000000000000000000000..05ef482e7d870344e2d2f35311091041f9e05931 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2344_2018110812026/cl_16.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1360628436 + +import java.util.zip.CRC32; + +class cl_16 +{ + double var_33 = (4.82747e-253D); + byte var_35 = (byte)(120); + int [][] var_52 = {{(133955242),(1642502907),(1375724831),(-1898416015)},{(564634648),(-507609140),(-393080150),(-703549017)},{(-797298299),(-417529472),(802583456),(871538127)},{(-1323007981),(1613806131),(-1694709398),(1100081521)}}; + boolean var_54 = false; + final short var_57 = (short)(-31317); + int var_67 = (-1235117507); + float [][] var_100 = {{(-7.38113e+25F),(-10.806F),(2.83154e-20F),(2.32975e+15F),(-4.27469e-26F)},{(6.23293e+30F),(1.24635e+34F),(-1.66331F),(3.96657e-10F),(-1.57215e-13F)},{(4.49792e-12F),(-4.53022e+06F),(8.07742e+19F),(1.02638e+09F),(9.88245e+21F)},{(-3.19923e+09F),(-5.74501e-37F),(-0.00145594F),(2.77709e-31F),(3.70232e-35F)},{(0.586482F),(2.2871e-16F),(6.17146e+07F),(-2.88526e+29F),(-3.02558e-35F)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(180); + CrcCheck.ToByteArray(this.var_33,b,"var_33"); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_52[a0][a1],b,"var_52" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_57,b,"var_57"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_100[a0][a1],b,"var_100" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/2344_2018110812026/cl_44.java b/test/testsuite/fuzz_test/fuzz/2344_2018110812026/cl_44.java new file mode 100644 index 0000000000000000000000000000000000000000..d6718789c14e7f56bd2dfd298c256f424bc1ef82 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2344_2018110812026/cl_44.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1360628436 + +import java.util.zip.CRC32; + +class cl_44 +{ + int [][] var_51 = {{(858466370),(-1689402372),(-407773764),(1298184552)},{(-1525787609),(1800448449),(1357783454),(-1728217368)},{(-1959666023),(-221706303),(-1011543760),(-2069636836)},{(-1958818183),(913289928),(-1608163524),(374196145)}}; + boolean var_58 = true; + byte var_66 = (byte)(13); + short var_70 = (short)(11172); + boolean [] var_85 = {false,false}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(70); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_51[a0][a1],b,"var_51" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_85[a0],b,"var_85" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/2506_2018101900375/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/2506_2018101900375/MainClass.java b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..9b323b1a7b88c53185089ae17a1caa60b466a99f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/MainClass.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=269244036 + +import java.util.zip.CRC32; + +class MainClass +{ + int [][][] var_2 = {{{(837946928),(-660474426),(-2127766514),(-169545397),(1348350546)},{(609939150),(975148344),(1757340617),(-1663163336),(-969675788)}},{{(-638260128),(-1499495229),(-30863088),(-1708866401),(-1758342832)},{(-435218721),(-269290684),(94663368),(-1736696015),(1439875372)}},{{(1334524206),(-2027802052),(994433411),(986925845),(353932478)},{(871769352),(2011195718),(1179101538),(743140597),(176989884)}},{{(135812008),(-1942569640),(754506983),(346659043),(-1431540706)},{(-1544902458),(-1336759356),(-858928454),(-375793072),(-163229264)}},{{(531819940),(-526949939),(-210823973),(-936667657),(-1040838342)},{(-1559045641),(704852546),(-1379638018),(1115979793),(1821631658)}}}; + static int var_9 = (-1737338598); + double var_17 = (2.95905e+11D); + static int [][] var_20 = {{(-1414457165),(-396162274)},{(113610426),(-1766591578)},{(1681965630),(202521042)},{(2042709735),(371780538)}}; + static cl_26 var_24 = new cl_26(); + static float var_31 = (3.10158e+07F); + static long var_32 = (-2890060341312528048L); + static byte var_33 = (byte)(-37); + static double [][] var_36 = {{(-3.97714e-260D),(2.07308e-299D),(-2.82148e-283D),(-2.95016e+50D)},{(1.91553e+242D),(4.28559e-117D),(1.06134e-15D),(4.11502e-196D)},{(-1.37379e+259D),(-5.50584e-301D),(-2.12746e-156D),(1.75015e-252D)},{(-3.20193e-52D),(-1.47025e-115D),(1.79742e+67D),(-2.35618e-181D)},{(-1.34519e+205D),(-4.14762e+306D),(-1.49848e+284D),(-1.49945e+42D)}}; + static cl_35 var_39 = new cl_35(); + final static cl_35 var_44 = new cl_35(); + cl_35 var_45 = new cl_35(); + static int [][] var_49 = {{(1286107551),(-468873662)},{(328576039),(-298047581)},{(-519605861),(-1962420272)},{(1798375985),(-1404918919)}}; + short var_54 = (short)(-990); + byte var_56 = (byte)(84); + boolean [] var_61 = {false,false,false,true,true,false,false}; + long [][] var_69 = {{(535208663675963296L)},{(6992529224844677230L)},{(7306064905734668167L)},{(4456182448598854786L)},{(1937522154505580592L)}}; + int var_74 = (-1925683563); + cl_35 [] var_77 = {new cl_35(),new cl_35()}; + final cl_35 var_78 = new cl_35(); + double [] var_83 = {(-6.00854e+101D),(7.07772e+300D),(-7.29899e-179D),(-2.3077e+136D),(1.00869e+267D),(-1.90653e+180D),(3.74913e+106D)}; + long var_87 = (6359266338046237912L); + byte var_90 = (byte)(107); + short var_101 = (short)(-25117); + short var_107 = (short)(32432); + int var_108 = (-1475420245); + int var_113 = (-11587299); +/*********************************/ +public strictfp void run() +{ + boolean [] var_104 = {true,false,false,false,false,true,true}; + long var_125 = (-8119924059162928326L); + final boolean [][][] var_103 = {{{false,true,true,false},{false,false,true,false},{false,true,true,true},{false,false,true,true},{true,false,false,false},{true,false,false,true},{false,true,true,true}},{{true,true,false,true},{false,false,true,true},{false,true,true,true},{true,false,false,true},{true,false,false,true},{false,true,false,false},{false,true,false,true}},{{false,true,true,true},{false,true,false,false},{true,false,true,true},{true,true,false,true},{false,false,true,false},{true,true,false,false},{true,false,true,true}},{{true,false,false,true},{false,false,true,true},{false,true,false,true},{true,true,true,false},{false,false,true,true},{true,false,true,false},{true,true,true,false}},{{true,true,false,true},{true,true,true,false},{false,true,false,true},{true,false,false,false},{false,true,false,false},{false,true,true,true},{false,true,false,true}},{{true,false,false,false},{false,false,true,true},{false,true,true,true},{true,true,true,true},{true,true,false,false},{true,true,false,true},{false,true,true,false}},{{false,true,false,false},{true,true,true,false},{true,false,false,true},{false,true,true,false},{false,false,false,true},{true,false,true,false},{false,false,true,false}}}; + try + { + float [][][] var_121 = {{{(-4.20428e+06F)},{(-1.4457e-07F)}},{{(-4.44627e+24F)},{(1.18763e+31F)}},{{(-6.32914e+23F)},{(2.7315e+32F)}},{{(-5.71232e-22F)},{(-2.24427e+21F)}},{{(5.31905e+14F)},{(1.00809e-28F)}},{{(9.54198e+10F)},{(0.0558958F)}}}; + byte var_102 = (byte)(-42); + short var_122 = (short)(26505); + float var_120 = (-8.1977e+36F); + long var_110 = (2477828976245910304L); + try + { + boolean [] var_100 = {true,true,false}; + int var_0 = (-964063408); + for( var_0 = 645 ;(var_0<669);var_0 = (var_0+8) ) + { + short var_3 = (short)(-19944); + var_2[((((var_90++)-var_39.var_106)&func_4((!(((var_33--)&( ( byte )(var_107--) ))>=func_4(var_61[((--var_108)&6)] ,var_110 ,var_103 ,((--var_113)>var_44.var_40)))) ,(+(var_110++)) ,var_103 ,var_103[((((var_33--)|(63957024))-(byte)(-87))&6)][6][((var_33--)&3)]))&4)][((var_33--)&1)][(((-(-(var_3++)))*func_4((!(!(((~(var_90++))787);var_127 = (var_127-16) ) + { + var_24 = func_25((!(!((var_17--)!=var_45.var_96))) ,(var_129--) ,var_87) ; + } + System.out.println("hello exception 3 !"); + } + System.out.println("hello exception 1 !"); + } + return ; +} +public strictfp short func_4(boolean var_5, long var_6, boolean[][][] var_7, boolean var_8) +{ + byte var_99 = (byte)(-91); + try + { + byte var_93 = (byte)(119); + for( var_9 = 547 ;(var_9<553);var_9 = (var_9+2) ) + { + short var_11 = (short)(8281); + int var_10 = (-1062201417); + for( var_10 = 996 ;(var_10<1032);var_10 = (var_10+12) ) + { + var_7[(((var_54++)&func_12(var_17 ,((++var_93)<( ( byte )((++var_90)-var_56) )) ,var_24))&6)][((--var_11)&6)][(((var_11++)|func_12((1.75266e-59D) ,var_24.var_73 ,var_24))&3)] = (!((++var_33)<=var_44.var_96)) ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_97 ) + { + double var_98 = (5.87357e-131D); + System.out.println("hello exception 4 !"); + } + return (--var_99); +} +public strictfp int func_12(double var_13, boolean var_14, cl_26 var_15) +{ + short var_16 = (short)(10012); + if( (!(!((var_16++)var_9)) + { + var_23[((~(--var_53))&6)] = (!(!((++var_58)>=( ( float )((--var_56)*(-1328213265)) )))) ; + } + else + { + var_23[(((--var_58)+var_9)&6)] = (!((~((++var_53)*var_9))=var_31))) + { + byte var_65 = (byte)(-59); + var_20[(((var_66++)|var_9)&3)][(((var_65--)*var_9)&1)] = (-(var_66--)) ; + } + else + { + var_23[((var_66++)&6)] = (!((--var_57)<=var_39.var_59)) ; + } + System.out.println("hello exception 8 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_67 ) + { + var_24.var_68 = var_69 ; + System.out.println("hello exception 9 !"); + } + return (++var_56); +} +public static strictfp cl_26 func_25(boolean var_26, float var_27, long var_28) +{ + cl_35 var_46 = new cl_35(); + byte var_29 = (byte)(5); + final cl_26 var_52 = new cl_26(); + if( (!((((var_29--)+var_9)+var_24.var_30)!=var_31))) + { + int var_38 = (-840783301); + if( (!(((++var_28)-var_32)>=var_33))) + { + long var_34 = (-1838320665646749903L); + cl_35 [] var_42 = {new cl_35(),new cl_35(),new cl_35(),new cl_35(),new cl_35(),new cl_35(),new cl_35()}; + try + { + var_36[((~(var_38++))&4)][(((--var_29)|var_24.var_37)&3)] = (++var_27) ; + var_34 = ((var_32++)&var_39.var_40) ; + cl_35 var_43 = new cl_35(); + var_42[((var_29++)&6)] = var_44 ; + var_20 = var_49 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_50 ) + { + float var_51 = (6010.9F); + System.out.println("hello exception 10 !"); + } + } + } + return var_52; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(636); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_2[a0][a1][a2],b,"var_2" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_9,b,"var_9"); + CrcCheck.ToByteArray(this.var_17,b,"var_17"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_20[a0][a1],b,"var_20" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_24.GetChecksum(),b,"var_24.GetChecksum()"); + CrcCheck.ToByteArray(this.var_31,b,"var_31"); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + CrcCheck.ToByteArray(this.var_33,b,"var_33"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_36[a0][a1],b,"var_36" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_39.GetChecksum(),b,"var_39.GetChecksum()"); + CrcCheck.ToByteArray(this.var_44.GetChecksum(),b,"var_44.GetChecksum()"); + CrcCheck.ToByteArray(this.var_45.GetChecksum(),b,"var_45.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_49[a0][a1],b,"var_49" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_61[a0],b,"var_61" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_69[a0][a1],b,"var_69" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_77[a0].GetChecksum(),b,"var_77" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_78.GetChecksum(),b,"var_78.GetChecksum()"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_83[a0],b,"var_83" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + CrcCheck.ToByteArray(this.var_90,b,"var_90"); + CrcCheck.ToByteArray(this.var_101,b,"var_101"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/2506_2018101900375/Start.java b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..224bac29ee02c5e28bda39ed60ea5d4f06fccfa7 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_35.java cl_26.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/2506_2018101900375/cl_26.java b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/cl_26.java new file mode 100644 index 0000000000000000000000000000000000000000..9b5bf100ee3f52d18c45a292f1d403ea981028b8 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/cl_26.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=269244036 + +import java.util.zip.CRC32; + +class cl_26 +{ + final byte var_30 = (byte)(-120); + short var_37 = (short)(24233); + int [][] var_47 = {{(1603840696),(1456490443)},{(2083149855),(789882397)},{(-1804750724),(1021341584)},{(-510736007),(1282750059)}}; + float var_55 = (1.68071e-35F); + boolean [] var_62 = {true,false,true,false,true,false,false}; + long [][] var_68 = {{(-2028809866702470038L)},{(-1645672198866988633L)},{(-7897929245869028064L)},{(4844246590984277068L)},{(-6397138307180900803L)}}; + boolean var_73 = true; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(87); + CrcCheck.ToByteArray(this.var_30,b,"var_30"); + CrcCheck.ToByteArray(this.var_37,b,"var_37"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_47[a0][a1],b,"var_47" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_62[a0],b,"var_62" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_68[a0][a1],b,"var_68" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/2506_2018101900375/cl_35.java b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/cl_35.java new file mode 100644 index 0000000000000000000000000000000000000000..04aa9eb1cafa5c945137ae1448aaae01aa371ebb --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2506_2018101900375/cl_35.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=269244036 + +import java.util.zip.CRC32; + +class cl_35 +{ + byte var_40 = (byte)(14); + int [][] var_48 = {{(382682512),(-199405722)},{(1754397942),(-1321786930)},{(-1017107822),(-52190277)},{(-1483275097),(-1504470813)}}; + short var_59 = (short)(-6819); + boolean [] var_60 = {false,false,true,true,true,true,true}; + long var_80 = (-6583896584871310622L); + double var_96 = (-3.96105e+210D); + int var_106 = (1311394830); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(62); + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_48[a0][a1],b,"var_48" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_60[a0],b,"var_60" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + CrcCheck.ToByteArray(this.var_106,b,"var_106"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/2601_2018110811698/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/2601_2018110811698/MainClass.java b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..04ada66985b01050a7c3891860af9ba18a1818a2 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/MainClass.java @@ -0,0 +1,323 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3930966242 + +import java.util.zip.CRC32; + +class MainClass +{ + int var_0 = (-935006042); + byte var_3 = (byte)(110); + static short var_7 = (short)(-4452); + static boolean [][][] var_9 = {{{true,false,false,false,false,true}},{{true,true,false,true,false,true}},{{true,true,false,true,true,false}},{{true,false,false,true,false,true}}}; + int var_18 = (-1724513506); + final static cl_21 var_23 = new cl_21(); + static byte var_25 = (byte)(26); + int var_31 = (1601377297); + static cl_21 var_32 = new cl_21(); + static cl_49 var_33 = new cl_49(); + static int var_45 = (649194294); + static cl_21 var_47 = new cl_21(); + static int [] var_51 = {(-842136352),(1311668388),(-674310710)}; + static int [] var_53 = {(-375208631),(-705149635),(-1699267816),(1120665751),(-1992879026),(-2015411130)}; + static int var_54 = (218814128); + final static double var_56 = (4.14848e-68D); + boolean var_58 = false; + static float var_69 = (-1.59542e-37F); + int var_70 = (744993437); + byte var_72 = (byte)(61); + cl_49 [][] var_77 = {{new cl_49(),new cl_49(),new cl_49(),new cl_49(),new cl_49()}}; + int var_78 = (1912192055); + short var_80 = (short)(-28167); + byte var_84 = (byte)(16); + long [][] var_91 = {{(576948663766337560L),(-5019117587023921364L),(7730344118306057004L),(1519180493092852836L),(5869637284720182885L),(9174867864540256408L),(-8273045526035508256L)}}; + long var_93 = (8544233049121036647L); + long var_95 = (-3323728350039537341L); + cl_21 [][][] var_103 = {{{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()},{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()}},{{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()},{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()}},{{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()},{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()}},{{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()},{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()}},{{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()},{new cl_21(),new cl_21(),new cl_21(),new cl_21(),new cl_21()}}}; + long var_105 = (-1209611975226130174L); + float [][][] var_112 = {{{(-2.49885e-23F),(-4.51844e-36F)}},{{(6.46512e-12F),(-1.08295e-16F)}},{{(8.66561e-36F),(-4.83646e+20F)}},{{(1.08886e+22F),(8.75875e+24F)}},{{(6.45384e-21F),(-8.91167e-14F)}},{{(6.17558e+35F),(4.53724e-20F)}}}; +/*********************************/ +public strictfp void run() +{ + for( var_0 = 319 ;(var_0<364);var_0 = (var_0+15) ) + { + boolean [][][] var_2 = {{{false,false,true,true,true,true}},{{false,false,false,true,false,true}},{{false,false,false,true,false,true}},{{false,true,false,true,true,false}}}; + byte var_5 = (byte)(86); + try + { + short var_6 = (short)(15934); + try + { + byte var_4 = (byte)(44); + final float var_8 = (-4.15758e+21F); + var_2[((--var_5)&3)][(((++var_4)-(50326925))&0)][((var_3++)&5)] = ((var_6--)!=var_7) ; + var_7 = (++var_5) ; + var_2 = func_10(( ( boolean )(!(((var_6--)-var_47.var_100)>=var_32.var_50)) ) ,(~((--var_6)|( ( short )(+(var_5--)) ))) ,var_103 ,(var_105--) ,var_47.var_107 ,(var_6--)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_110 ) + { + var_33.var_111 = var_112 ; + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.ArithmeticException myExp_113 ) + { + int var_114 = (1006828682); + for( var_114 = 702 ;(var_114>617);var_114 = (var_114-17) ) + { + var_5 = (--var_5) ; + } + System.out.println("hello exception 1 !"); + } + } + return ; +} +public strictfp boolean[][][] func_10(boolean var_11, int var_12, cl_21[][][] var_13, long var_14, boolean[][][] var_15, int var_16) +{ + int var_17 = (335086462); + for( var_17 = 361 ;(var_17<441);var_17 = (var_17+16) ) + { + short var_20 = (short)(-720); + for( var_18 = 148 ;(var_18<243);var_18 = (var_18+19) ) + { + int var_19 = (-1034996407); + for( var_19 = 673 ;(var_19<681);var_19 = (var_19+2) ) + { + float var_21 = (1.28543e-20F); + long var_22 = (-6367656699632076028L); + var_7 = (var_20++) ; + var_15[(var_17&0)][(var_18&2)][(var_19&1)] = (!((++var_25)>=func_26((var_16--) ,(!((+(var_84--))>var_47.var_50)) ,var_33 ,var_56))) ; + } + } + } + return var_9; +} +public strictfp float func_26(double var_27, boolean var_28, cl_49 var_29, double var_30) +{ + int var_92 = (334666119); + for( var_31 = 264 ;(var_31<272);var_31 = (var_31+2) ) + { + var_32 = var_32 ; + try + { + long var_86 = (-2516410894936870286L); + try + { + byte var_35 = (byte)(67); + var_33.var_34 = (((var_35--)&func_36((-(((var_25--)*( ( short )(314621775) ))+var_25)) ,(-(--var_84)) ,(var_86--) ,var_29))>var_56) ; + } + catch( java.lang.ArithmeticException myExp_89 ) + { + var_91[((++var_92)&0)][((var_72--)&6)] = (1647062054125426502L) ; + System.out.println("hello exception 2 !"); + } + } + catch( java.lang.ArithmeticException myExp_94 ) + { + var_32 = var_23 ; + System.out.println("hello exception 3 !"); + } + } + return (+(++var_95)); +} +public strictfp long func_36(long var_37, float var_38, double var_39, cl_49 var_40) +{ + if( func_41()) + { + try + { + int var_71 = (1186197865); + for( var_70 = 266 ;(var_70<290);var_70 = (var_70+12) ) + { + var_51[((var_71--)&2)] = (+(++var_72)) ; + } + } + catch( java.lang.IllegalArgumentException myExp_73 ) + { + long var_74 = (577148421894765492L); + try + { + var_38 = (++var_74) ; + } + catch( java.lang.ArithmeticException myExp_75 ) + { + var_77[((var_78++)&0)][((var_78++)&4)] = var_40 ; + System.out.println("hello exception 5 !"); + } + System.out.println("hello exception 4 !"); + } + } + else + { + try + { + var_33 = var_33 ; + } + catch( java.lang.ArithmeticException myExp_79 ) + { + try + { + var_33.var_52 = ((-(--var_80))|var_54) ; + } + catch( java.lang.IllegalArgumentException myExp_81 ) + { + var_23.var_59 = ((var_37++)+var_32.var_50) ; + System.out.println("hello exception 7 !"); + } + System.out.println("hello exception 6 !"); + } + } + byte var_82 = (byte)(-15); + return (var_82++); +} +public static strictfp boolean func_41() +{ + boolean [][][] var_44 = {{{true,false,false,false,false,true}},{{false,true,false,false,false,true}},{{false,true,false,false,true,false}},{{true,false,false,false,false,true}}}; + int var_42 = (1354362867); + var_9 = var_44 ; + try + { + byte var_49 = (byte)(34); + try + { + for( var_45 = 700 ;(var_45<715);var_45 = (var_45+5) ) + { + float var_46 = (-9.35142e+24F); + var_33 = var_33 ; + var_23.var_48 = ((~(var_49--))&var_32.var_50) ; + var_51[(var_45&2)] = (var_7++) ; + var_51[((var_42--)&2)] = var_53[((var_54--)&5)] ; + } + short var_57 = (short)(24975); + try + { + var_49 = (--var_49) ; + var_44 = var_9 ; + float [][][] var_60 = {{{(-1.54656e+19F),(647353F),(-5.86435e+10F),(0.0115822F),(9.0315e-13F),(-1.1397e-11F)}},{{(-1.48259e+32F),(6.88652e-32F),(1.86066e+09F),(-1.81286e-16F),(-1.76136e-35F),(-1.42359e-10F)}},{{(-4.40952e-35F),(4075.67F),(5.78221e+22F),(-2.33139e+32F),(1.65332e-31F),(-9.12286e-29F)}},{{(-7.13556e-13F),(214.192F),(-114.238F),(-1.61427e-05F),(-6.54932e-13F),(7.14034e-10F)}},{{(4.54056e+16F),(-6.95667e-32F),(-6.32534e-26F),(5.22552e-14F),(-9.50784e+26F),(-0.159423F)}},{{(6.44537e+10F),(-5.57458e+29F),(-6.23831e-23F),(0.000500223F),(1.35421e+13F),(-1.80169e-35F)}}}; + var_47 = var_23 ; + var_44[((var_42--)&3)][0][((++var_42)&5)] = (!(!((var_49++)==var_56))) ; + var_44[((++var_49)&3)][((~(var_25--))&0)][((+(++var_57))&5)] = ((var_49++)!=var_47.var_59) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_61 ) + { + cl_49 var_62 = new cl_49(); + System.out.println("hello exception 8 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_63 ) + { + int var_64 = (1200361568); + for( var_64 = 177 ;(var_64>150);var_64 = (var_64-9) ) + { + long var_65 = (-6377760367774072331L); + } + System.out.println("hello exception 9 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_66 ) + { + try + { + try + { + var_44 = var_9 ; + } + catch( java.lang.ArithmeticException myExp_67 ) + { + var_33 = var_33 ; + System.out.println("hello exception 11 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_68 ) + { + var_44 = var_9 ; + System.out.println("hello exception 12 !"); + } + System.out.println("hello exception 10 !"); + } + return ((var_69--)>=(-1545072130)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(709); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + CrcCheck.ToByteArray(this.var_3,b,"var_3"); + CrcCheck.ToByteArray(this.var_7,b,"var_7"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_9[a0][a1][a2],b,"var_9" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + CrcCheck.ToByteArray(this.var_23.GetChecksum(),b,"var_23.GetChecksum()"); + CrcCheck.ToByteArray(this.var_25,b,"var_25"); + CrcCheck.ToByteArray(this.var_31,b,"var_31"); + CrcCheck.ToByteArray(this.var_32.GetChecksum(),b,"var_32.GetChecksum()"); + CrcCheck.ToByteArray(this.var_33.GetChecksum(),b,"var_33.GetChecksum()"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + CrcCheck.ToByteArray(this.var_47.GetChecksum(),b,"var_47.GetChecksum()"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_51[a0],b,"var_51" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_53[a0],b,"var_53" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_77[a0][a1].GetChecksum(),b,"var_77" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_91[a0][a1],b,"var_91" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_93,b,"var_93"); + CrcCheck.ToByteArray(this.var_95,b,"var_95"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_103[a0][a1][a2].GetChecksum(),b,"var_103" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_112[a0][a1][a2],b,"var_112" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/2601_2018110811698/Start.java b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..2b043448f5d126f3b351f194ca555150412776ac --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java CrcCheck.java cl_49.java cl_21.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/2601_2018110811698/cl_21.java b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/cl_21.java new file mode 100644 index 0000000000000000000000000000000000000000..8907c944218b4e30008ca7d736ed6687d0a12c16 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/cl_21.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3930966242 + +import java.util.zip.CRC32; + +class cl_21 +{ + boolean var_24 = true; + double var_48 = (-1.23142e-304D); + int var_50 = (317723889); + boolean [][][] var_55 = {{{true,true,true,true,false,true}},{{false,false,true,false,true,true}},{{false,true,false,true,true,true}},{{false,true,true,true,false,true}}}; + float var_59 = (-1.18099e-24F); + short var_100 = (short)(10488); + final boolean [][][] var_107 = {{{true,false},{false,false},{false,true}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(49); + CrcCheck.ToByteArray(this.var_24,b,"var_24"); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_55[a0][a1][a2],b,"var_55" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_107[a0][a1][a2],b,"var_107" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/2601_2018110811698/cl_49.java b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/cl_49.java new file mode 100644 index 0000000000000000000000000000000000000000..e2e1e67155dbd0c760ca8aa2fcb4febb52f9462c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/2601_2018110811698/cl_49.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3930966242 + +import java.util.zip.CRC32; + +class cl_49 +{ + boolean var_34 = false; + boolean [][][] var_43 = {{{false,false,false,false,true,true}},{{true,true,false,false,false,false}},{{true,false,true,true,true,true}},{{false,true,false,true,false,true}}}; + long var_52 = (-1691200957586921690L); + float [][][] var_111 = {{{(3.93341e+37F),(-8.07758e-26F)}},{{(-0.804115F),(-1.28436e+36F)}},{{(-4.92953e+30F),(-2.10421e+38F)}},{{(-2.80597e-18F),(5.45795e-26F)}},{{(8.13332e-14F),(-6.48659e-25F)}},{{(-254419F),(4.60475e+17F)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(81); + CrcCheck.ToByteArray(this.var_34,b,"var_34"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_43[a0][a1][a2],b,"var_43" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_111[a0][a1][a2],b,"var_111" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/308_2019010202940/CRC32.java b/test/testsuite/fuzz_test/fuzz/308_2019010202940/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/308_2019010202940/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/308_2019010202940/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/308_2019010202940/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/308_2019010202940/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/308_2019010202940/MainClass.java b/test/testsuite/fuzz_test/fuzz/308_2019010202940/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..567e267544893520ebcf5d4dc1a5e9f1bbe8d6e3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/308_2019010202940/MainClass.java @@ -0,0 +1,295 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2776528782 + +//import java.util.zip.CRC32; + +class MainClass +{ + int var_6 = (-1001681241); + int var_7 = (976648357); + cl_23 var_20 = new cl_23(); + int var_23 = (257265693); + int var_24 = (-1858517115); + final cl_53 var_32 = new cl_53(); + cl_48 var_147 = new cl_48(); + byte var_149 = (byte)(26); + cl_57 var_150 = new cl_57(); + final cl_59 var_152 = new cl_59(); + float var_154 = (-8.01927e-23F); + final long var_158 = (1313859844404838498L); + cl_48 var_165 = new cl_48(); + boolean [] var_166 = {true}; + short var_167 = (short)(-16907); + boolean [] var_170 = {true,false,false,true}; + cl_57 var_171 = new cl_57(); + cl_25 var_173 = new cl_25(); + final int [][][] var_181 = {{{(123592671),(-1167812865),(-2109279859),(422462397)},{(1222810378),(-814500953),(766954787),(-1315945764)},{(-1422053403),(-2012994728),(-1529089115),(-350541765)},{(32511452),(1629549254),(1668122507),(2021088665)},{(-435366245),(70543357),(1164841238),(367355907)},{(339730586),(-333325086),(1129356141),(-1453714282)},{(1181590236),(1380685374),(59836907),(-474856294)}},{{(375619269),(888427547),(-1878201056),(580057580)},{(-1599289189),(572797930),(216190784),(-2066772546)},{(1860305549),(918934164),(-1108054795),(-352867419)},{(255009281),(430820210),(-1016906378),(-1496725829)},{(1311470205),(-481163945),(1095623503),(-441849847)},{(498918591),(2077052512),(-2040824086),(1891259066)},{(-119977790),(801867334),(1694710971),(289492217)}},{{(-996375353),(586922333),(-1885411494),(1687137098)},{(-183618623),(-1979509164),(-700603326),(665008462)},{(1147431381),(-1992178369),(-1159464952),(1929832112)},{(555705684),(-1758094688),(-1419571527),(-274127779)},{(-1967513754),(-1380349010),(-874847022),(-928878581)},{(1487138232),(-1770966971),(-1838973630),(-1652568785)},{(289091517),(343168041),(-1845642345),(251377516)}},{{(-1165648338),(1491231406),(381292519),(-1858232608)},{(1755865937),(1952809947),(-859975837),(-605071565)},{(-98974083),(-2126767799),(-1334581296),(-1143169199)},{(163595197),(731630713),(-804071645),(116858711)},{(-2049805362),(371223742),(924107310),(1552283970)},{(-146678082),(-1634098607),(1551170337),(-1504360905)},{(-847644689),(-571647377),(-1331621572),(-1579846063)}},{{(-1404717930),(-1747737860),(480044692),(-543737519)},{(1167038827),(-768470370),(457149326),(1547676063)},{(1387182902),(944957926),(1604474019),(1768694386)},{(-1722192474),(-1865678290),(-1515520925),(671890292)},{(-393633770),(1543673949),(-44540594),(1530627933)},{(1123067908),(507629225),(905989488),(-588558544)},{(-1003271763),(931004888),(-1232411161),(1882627723)}}}; + int var_183 = (512286265); + cl_25 [][][] var_184 = {{{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()},{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()},{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()}},{{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()},{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()},{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()}},{{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()},{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()},{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()}},{{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()},{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()},{new cl_25(),new cl_25(),new cl_25(),new cl_25(),new cl_25()}}}; + double [] var_185 = {(8.56701e+85D),(4.91379e-266D)}; + double var_186 = (3.41097e-213D); + double [] var_203 = {(-2.08102e-222D),(-8.98785e+265D)}; + boolean [][][] var_209 = {{{true,false},{false,true},{false,false},{false,false},{false,false}},{{false,true},{true,false},{false,true},{false,true},{true,true}},{{false,true},{false,false},{true,false},{false,true},{false,true}}}; + int var_212 = (-923670655); + int var_213 = (-447773509); + long var_214 = (-4430442535858011525L); + final double var_215 = (-1.05044e-63D); +/*********************************/ +public strictfp void run() +{ + long var_0 = (-3573576426764699428L); + byte var_190 = (byte)(-86); + byte var_191 = (byte)(-48); + cl_23 var_200 = new cl_23(); + if( (!(!((var_0--)!=func_1(var_185[(((++var_149)*var_20.var_189)&1)] ,var_154 ,(+(++var_190)) ,(!((var_191--)>var_186))))))) + { + // if stmt begin,id=1 + int var_195 = (-379273759); + boolean [][] var_211 = {{false},{true},{true},{true}}; + short var_210 = (short)(8643); + if( (!((var_190++)!=var_154))) + { + // if stmt begin,id=2 + if( ((++var_167)=( ( float )var_186 )))))))) + { + // if stmt begin,id=4 + final int var_207 = (-426477419); + // if stmt end,id=4 + } + else + { + // else stmt begin,id=1 + var_203[1] = (var_186--) ; + // else stmt end,id=1 + } + // if stmt end,id=3 + } + // if stmt end,id=2 + } + else + { + // else stmt begin,id=2 + var_209[(((--var_190)&( ( short )(var_210--) ))&2)][4][(((--var_190)-var_183)&1)] = var_211[((var_195++)&3)][0] ; + // else stmt end,id=2 + } + // if stmt end,id=1 + } + else + { + // else stmt begin,id=3 + for( var_212 = 220 ;(var_212>217);var_212 = (var_212-3) ) + { + try + { + for( var_213 = 1008 ;(var_213<1012);var_213 = (var_213+4) ) + { + var_32.var_40.var_216 = var_32.var_40.var_216 ; + } + } + catch( java.lang.IllegalArgumentException myExp_217 ) + { + var_173.var_146 = ((~(++var_191))|( ( int )(var_191++) )) ; + System.out.println("hello exception 0 !"); + } + } + // else stmt end,id=3 + } + return ; +} +public strictfp byte func_1(double var_2, float var_3, int var_4, boolean var_5) +{ + short var_187 = (short)(-13663); + float [][] var_9 = {{(-2.12565e+13F),(-4.96494e-25F),(-3.68841e-10F),(-4.07381e+31F),(-4.80873e+09F)},{(1.04248e+35F),(8.55652e+35F),(6.17068e-27F),(-2.62918e-09F),(3.43524e-25F)},{(-2.89663e+33F),(3.01996e+38F),(3.89994e+36F),(-6.3291e-19F),(8.84823e+20F)},{(-6.01182e+26F),(5.97856e-30F),(-1.93323e-31F),(2.44846e+14F),(1.38956e-20F)},{(-4.43169e+30F),(-6.97438e+22F),(1.91586e+29F),(-6.47053e-37F),(8.30862e+33F)},{(-23.4116F),(2.5718e+21F),(7.10196F),(1.66148e-22F),(1.92769e+20F)}}; + for( var_6 = 198 ;(var_6>160);var_6 = (var_6-19) ) + { + byte var_180 = (byte)(-49); + for( var_7 = 485 ;(var_7<535);var_7 = (var_7+10) ) + { + byte var_10 = (byte)(-27); + int var_182 = (-562637879); + int var_11 = (-1731331584); + var_9[((~((var_11++)&( ( short )func_12(((var_167++)*var_152.var_179) ,(~(((-(var_180--))-( ( byte )var_181[(((var_183++)&var_149)&4)][((++var_182)&6)][((var_180++)&3)] ))|var_149)) ,var_147.var_148.var_87 ,var_184 ,var_185 ,var_186 ,((var_187++)<=var_154)) )))&5)][((var_10--)&4)] = var_9[((var_180++)&5)][((var_187--)&4)] ; + } + } + byte var_188 = (byte)(103); + return (var_188++); +} +public strictfp byte func_12(float var_13, int var_14, cl_23 var_15, cl_25[][][] var_16, double[] var_17, double var_18, boolean var_19) +{ + boolean [] var_177 = {false}; + byte var_178 = (byte)(32); + if( var_20.var_21) + { + // if stmt begin,id=5 + int var_22 = (1460229576); + byte var_25 = (byte)(-115); + for( var_22 = 937 ;(var_22>917);var_22 = (var_22-4) ) + { + for( var_23 = 876 ;(var_23>821);var_23 = (var_23-11) ) + { + for( var_24 = 660 ;(var_24>575);var_24 = (var_24-17) ) + { + short var_169 = (short)(21495); + var_14 = (-(+(++var_25))) ; + final int [][] var_168 = {{(2013443287),(-482241114),(531305362)},{(-19111281),(552290350),(-537708669)},{(-2043159591),(1441533787),(1089598238)},{(1446067713),(-1922065543),(1275200811)}}; + var_16[(var_22&3)][(var_23&2)][(var_24&4)] = func_26(var_165 ,(!(!(!(!((--var_25)692);var_175 = (var_175-8) ) + { + var_166 = var_177 ; + } + // else stmt end,id=5 + } + System.out.println("hello exception 1 !"); + } + // else stmt end,id=4 + } + return (var_178++); +} +public strictfp cl_25 func_26(cl_48 var_27, boolean var_28, boolean[] var_29, double var_30, boolean[] var_31) +{ + byte var_161 = (byte)(19); + short var_153 = (short)(-9812); + short var_163 = (short)(-21343); + byte var_164 = (byte)(-64); + int var_151 = (847238557); + int var_162 = (-1561351560); + try + { + var_32.var_33 = var_147.var_148.func_34(var_147.var_148.var_74 ,var_147.var_148.var_40 ,((-(++var_149))<=var_150.var_84) ,((var_151--)-var_152.var_86) ,(((var_153++)&var_20.var_73)>var_154)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_155 ) + { + if( (!(((var_149++)|var_149)=var_40.var_41) ,((~(+(var_55++)))*var_87.var_145) ,var_40 ,var_33.var_146 ,((--var_113)+var_40.var_41)) ; + return var_33; +} +public static strictfp cl_25 func_42(int var_43, boolean var_44, double var_45, cl_59 var_46, double var_47, float var_48) +{ + byte var_123 = (byte)(-110); + try + { + byte var_115 = (byte)(-9); + var_40 = func_49(var_74.var_110 ,func_49((var_43++) ,var_40 ,var_111[(((--var_43)-var_74.var_112)&5)] ,func_49(((var_113--)-var_85) ,func_49(((--var_115)|var_40.var_116) ,func_49((~(var_118--)) ,var_40 ,(var_45++) ,var_40) ,(++var_48) ,var_40) ,(((~(--var_123))+var_33.var_78)+var_61) ,var_40)) ,(var_126++) ,var_40) ; + if( (((--var_123)-( ( short )var_55 ))>=var_77)) + { + // if stmt begin,id=9 + short var_129 = (short)(15452); + try + { + if( ((var_115--)431);var_139 = (var_139-14) ) + { + short var_140 = (short)(-4132); + if( ((var_140++)>=var_101)) + { + // if stmt begin,id=12 + long var_141 = (-540602672907944387L); + // if stmt end,id=12 + } + } + } + System.out.println("hello exception 4 !"); + } + return var_33; +} +public static strictfp cl_59 func_49(long var_50, cl_59 var_51, double var_52, cl_59 var_53) +{ + var_33.var_54 = ((-(var_55--))==var_33.var_56) ; + cl_57 var_88 = new cl_57(); + short var_98 = (short)(8864); + if( (!((var_55++)==var_57))) + { + // if stmt begin,id=13 + cl_57 [] var_81 = {new cl_57(),new cl_57(),new cl_57(),new cl_57()}; + int var_58 = (1474792108); + cl_23 var_95 = new cl_23(); + for( var_58 = 963 ;(var_58>930);var_58 = (var_58-11) ) + { + byte var_62 = (byte)(-53); + double [][][] var_65 = {{{(-6.08499e-41D),(-2.96943e+10D),(-6.43826e+288D),(5.44616e-53D),(4.69905e+294D)},{(5.17293e+111D),(6.63314e-40D),(3.12299e-06D),(3.38729e+40D),(5.36455e+286D)},{(1.11959e+83D),(-6.25799e-145D),(0.000108298D),(1.16036e+100D),(-1.24602e+197D)},{(1.96446e+44D),(-9.39051e+227D),(-3.79152e-190D),(5.68666e-125D),(-3.50266e+176D)}},{{(3.33828e+208D),(9.20686e+95D),(2.15925e-103D),(-8.13943e+291D),(-1.01113e+119D)},{(-2.72037e+38D),(1.44862e-194D),(-6.18347e-13D),(-8.35251e-49D),(-8.14421e-57D)},{(-2.10884e-306D),(2.69279e-211D),(2.16181e-149D),(2.27039e+100D),(5.65936e+113D)},{(6.70729e-17D),(9.46283e+243D),(1.48686e-138D),(7.45108e-27D),(-1.14641e-08D)}},{{(2.87267e+10D),(-7.0233e+303D),(-7.84222e-169D),(-2.87876e+262D),(-3.09745e+307D)},{(-6.73302e-205D),(-1.08232e+132D),(-1.79538e-100D),(3.71577e-112D),(-5.70326e-78D)},{(-1.30708e-230D),(2.3302e-48D),(-2.31433e-35D),(1.40997e+243D),(2.66986e-119D)},{(-4.07474e-246D),(-2.38827e-213D),(1.30075e+95D),(-1.24829e+137D),(1.05679e+12D)}},{{(-1.72186e-277D),(1.02574e+87D),(2.22145e+77D),(3.01385e+117D),(58996.7D)},{(1.151e+219D),(-9.27015e-17D),(-4.35417e+11D),(4.21329e-284D),(7.58187e+217D)},{(-3.55459e-230D),(2.46586e-246D),(5.22416e+258D),(9.69065e+56D),(-3.45417e-184D)},{(2.13939e-236D),(-2.84402e-87D),(-1.19913e-214D),(1.57507e+32D),(-2.24543e-34D)}},{{(-1.16579e-64D),(-6.31304e+193D),(1.76396e+152D),(-1.059e-98D),(3.89155e-236D)},{(7.2548e-140D),(-1.20372e-50D),(-2.96845e+274D),(-1.61468e-137D),(-1.3646e+30D)},{(3.94764e+151D),(-1.65464e-66D),(1.13616e+145D),(2.14888e+92D),(2.00969e-36D)},{(-2.09548e+15D),(-6.82821e-182D),(-6.77918e-129D),(-8.50166e+192D),(1.142e+163D)}},{{(7.17896e+75D),(1.43773e+86D),(-1.02835e-46D),(5.96107e+23D),(-1.48807e-260D)},{(-1.69958e+283D),(2.32943e+177D),(2.37049e+195D),(-1.61772e-240D),(-1.29649e-37D)},{(-5.24649e+210D),(-2.32241e-116D),(-4.38345e-63D),(4.26657e+229D),(-1.41531e-204D)},{(2.35361e-161D),(-3.66857e+270D),(-9.80632e-65D),(7.83198e+253D),(5.85342e+203D)}},{{(2.33577e-70D),(2.37987e+118D),(-2.81439e+13D),(1.84096e-277D),(-3.45106e+33D)},{(5.11346e+230D),(1.01902e+125D),(-2.36167e+71D),(9.52085e+267D),(3.53912e-108D)},{(5.76848e+125D),(-2.13122e+250D),(8.07769e-202D),(-2.09178e-120D),(-2.27561e-09D)},{(-4.54171e+224D),(-9.05176e+112D),(-1.96904e-196D),(-5.83395e-306D),(1.61807e-23D)}}}; + if( true) + { + // if stmt begin,id=14 + short var_71 = (short)(-21118); + int var_66 = (-953397454); + int [][] var_76 = {{(895283430),(920862503),(-131798294)},{(-1592267365),(1875449822),(-569752654)},{(-36809792),(1435129140),(-146444521)},{(-755561083),(1801000361),(1831167185)},{(-495994159),(-1721187742),(1388347014)},{(-585954240),(-902206479),(-1758927490)},{(-1725892751),(-1591425362),(1618206009)}}; + try + { + final cl_23 var_63 = new cl_23(); + var_60[6][((+(++var_56))&2)] = (var_61--) ; + var_52 = (-(--var_62)) ; + var_65[((--var_56)&6)][(((--var_55)&var_58)&3)][((var_61--)&4)] = (++var_66) ; + var_60[(((--var_62)+var_67.var_68)&6)][2] = (var_61++) ; + short var_69 = (short)(12199); + var_65[((~(var_69--))&6)][((--var_61)&3)][((-(var_62--))&4)] = (++var_66) ; + var_51 = var_40 ; + var_40 = var_40 ; + var_60[((var_62++)&6)][(((--var_62)-( ( int )(var_61--) ))&2)] = (2128054206) ; + var_61 = (var_62--) ; + var_66 = var_57 ; + var_65[((((var_66++)|var_72)&var_67.var_73)&6)][((++var_66)&3)][(((++var_71)+var_56)&4)] = (var_52++) ; + var_60 = var_76 ; + var_56 = (var_62++) ; + var_33.var_78 = (var_71--) ; + var_76[(((++var_71)|(short)(-19777))&6)][(((--var_56)+var_61)&2)] = ((var_62++)+var_33.var_78) ; + } + catch( java.lang.IllegalArgumentException myExp_79 ) + { + double [][][] var_94 = {{{(-7.63881e+87D),(-1.65633e+245D),(-2.28473e-107D),(-1.03767e+108D),(-1.02235e+145D)},{(2.55009e+264D),(-4.38022e-178D),(-1.90888e-254D),(8.16843e-195D),(4.4319e-185D)},{(-3.56507e-131D),(-1.69771e-222D),(1.37299e+177D),(9.01689e+260D),(-2.18957e-190D)},{(8.53407e+104D),(-2.10751e-170D),(4.2215e-142D),(-1.02434e-216D),(-1.60043e-74D)}},{{(2.7307e+134D),(1.95253e-42D),(8.37728e-113D),(-7.22427e+304D),(1.55823e+171D)},{(-1.91122e-10D),(-4.67818e-35D),(-2.06238e+71D),(-4.66527e-88D),(5.33033e-123D)},{(-4.53104e+216D),(-1.0858e-180D),(1.54835e-173D),(1.45076e-30D),(-6.38578e-287D)},{(3.08449e+156D),(-5.64273e+166D),(3.52842e+144D),(-6.3696e-24D),(7.27004e-230D)}},{{(-7.54109e-150D),(2.31138e-77D),(-1.15395e-21D),(-9.68071e+254D),(7.10147e+291D)},{(3.94558e-113D),(-5.72975e-98D),(-6.75849e+68D),(1.4882e+301D),(1.98513e-48D)},{(-6.06423e-113D),(-5.50361e-89D),(-2.77804e+47D),(2.09395e+47D),(-7.34849e+09D)},{(7.22144e-162D),(-6.45836e+124D),(-6.57674e-66D),(1.99616e+306D),(-5.06936e-297D)}},{{(-3.21541e+268D),(1.25776e-306D),(-6.71549e+266D),(-1.5487e-30D),(-2.99813e+136D)},{(-1.51541e-249D),(1.93232e-196D),(50143.4D),(3.18439e+21D),(-3.11951e-129D)},{(4.63748e-234D),(-2.71307e-185D),(-4.14931e+166D),(-3.92787e-43D),(5.20328e-143D)},{(7.02163e-281D),(2.12525e+54D),(-8.64213e-274D),(7.57354e+277D),(-1.59072e-294D)}},{{(-5.1711e+19D),(-2.77535e-85D),(-2.27935e-303D),(-5.20014e-155D),(1.18691e+72D)},{(1.76682e+118D),(1.62698e+251D),(1.46425e+09D),(3.49649e+115D),(4.98031e-213D)},{(2.30259e-258D),(4.19972e-146D),(7.00882e-71D),(-1.92442e-122D),(-3.34134e+188D)},{(-5.72332e-135D),(-6.04304e+177D),(-9.50361e-289D),(4.25053e+250D),(-1.173e+268D)}},{{(1.29506e+287D),(-3.57064e-100D),(1.84505e-177D),(3.85045e-105D),(-5.80651e-142D)},{(-6.00477e-93D),(5.66885e-277D),(4.50019e-181D),(5.06623e+54D),(-5.56408e+110D)},{(-8.56176e-238D),(-2.44483e+49D),(3.51956e+292D),(3.00712e-65D),(1.0086e-68D)},{(1.46541e-131D),(6.60107e-102D),(-1.55376e+210D),(-1.20278e-117D),(-1.46011e-269D)}},{{(-4.06874e+89D),(-9.36824e-27D),(-7.8134e-86D),(3.585e-132D),(-5.63525e+105D)},{(8.60399e+263D),(-4.23321e-274D),(-8.76336e-60D),(6.9888e+220D),(1.27607e-141D)},{(-1.05499e+192D),(6.7314e-60D),(-1.12999e-52D),(-1.15545e+94D),(-1.52813e-213D)},{(-5.06608e+243D),(-1.26069e+94D),(-1.73419e+123D),(1.36072e+268D),(-1.48331e+267D)}}}; + long var_82 = (140536532761865434L); + var_80 = var_80 ; + var_33.var_78 = (var_61++) ; + var_65[(((++var_62)+var_72)&6)][((++var_71)&3)][(((var_61++)&(-629459618))&4)] = (--var_52) ; + var_65[((var_72++)&6)][(((var_55++)&var_71)&3)][(((--var_62)&var_74.var_84)&4)] = (var_61++) ; + var_76[((-(var_62++))&6)][((-(++var_66))&2)] = (var_71++) ; + var_53 = var_51 ; + float var_89 = (-4.46553e-38F); + var_66 = (+(var_56++)) ; + var_71 = (--var_72) ; + var_81[((++var_72)&3)] = var_88 ; + var_81[(((--var_62)+var_33.var_90)&3)] = var_74 ; + var_60 = var_76 ; + var_80[(((++var_62)*var_40.var_92)&3)] = var_74 ; + var_65 = var_94 ; + var_90 = (++var_71) ; + var_87 = var_95 ; + var_65[((var_66++)&6)][3][4] = (+(var_62--)) ; + System.out.println("hello exception 5 !"); + } + // if stmt end,id=14 + } + else + { + // else stmt begin,id=9 + int var_96 = (-412610416); + for( var_96 = 764 ;(var_96>748);var_96 = (var_96-16) ) + { + double var_102 = (-4.06567e-147D); + var_60[((~((--var_56)&( ( short )(++var_62) )))&6)][(((var_90--)|var_57)&2)] = (++var_97) ; + var_65[((var_98++)&6)][3][((var_98++)&4)] = (++var_62) ; + double var_99 = (-2.85056e-12D); + int var_100 = (2099390531); + var_95 = var_67 ; + int var_105 = (-1495238388); + var_33 = var_33 ; + var_81[(var_96&3)] = var_88 ; + var_40.var_86 = (--var_98) ; + var_101 = (((--var_62)*var_40.var_104)+var_33.var_90) ; + var_60[((var_62++)&6)][((-(var_62++))&2)] = ((+(var_62--))|var_40.var_86) ; + var_65[((--var_98)&6)][(((var_55--)*( ( int )(var_50++) ))&3)][(((var_98++)&(short)(-13708))&4)] = (-((var_56--)-var_57)) ; + var_80[3] = var_74 ; + var_81[(((++var_62)+var_77)&3)] = var_74 ; + var_61 = (-(var_56--)) ; + } + if( (!(!((var_62--)<=var_72)))) + { + // if stmt begin,id=15 + var_81[((var_98++)&3)] = var_74 ; + var_81[(((--var_62)-var_56)&3)] = var_74 ; + var_107 = var_107 ; + // if stmt end,id=15 + } + else + { + // else stmt begin,id=10 + long var_109 = (-108441914627877141L); + // else stmt end,id=10 + } + // else stmt end,id=9 + } + } + // if stmt end,id=13 + } + else + { + // else stmt begin,id=11 + var_40 = var_40 ; + // else stmt end,id=11 + } + return var_51; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(978); + CrcCheck.ToByteArray(this.var_33.GetChecksum(),b,"var_33.GetChecksum()"); + CrcCheck.ToByteArray(this.var_40.GetChecksum(),b,"var_40.GetChecksum()"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_57,b,"var_57"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_60[a0][a1],b,"var_60" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_61,b,"var_61"); + CrcCheck.ToByteArray(this.var_67.GetChecksum(),b,"var_67.GetChecksum()"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_70[a0].GetChecksum(),b,"var_70" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + CrcCheck.ToByteArray(this.var_74.GetChecksum(),b,"var_74.GetChecksum()"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_80[a0].GetChecksum(),b,"var_80" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_85,b,"var_85"); + CrcCheck.ToByteArray(this.var_87.GetChecksum(),b,"var_87.GetChecksum()"); + CrcCheck.ToByteArray(this.var_90,b,"var_90"); + CrcCheck.ToByteArray(this.var_97,b,"var_97"); + CrcCheck.ToByteArray(this.var_101,b,"var_101"); + CrcCheck.ToByteArray(this.var_106,b,"var_106"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_107[a0][a1][a2].GetChecksum(),b,"var_107" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_108[a0][a1].GetChecksum(),b,"var_108" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_111[a0],b,"var_111" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_118,b,"var_118"); + CrcCheck.ToByteArray(this.var_126,b,"var_126"); + CrcCheck.ToByteArray(this.var_138,b,"var_138"); + CrcCheck.ToByteArray(this.var_146,b,"var_146"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_176[a0],b,"var_176" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/308_2019010202940/cl_57.java b/test/testsuite/fuzz_test/fuzz/308_2019010202940/cl_57.java new file mode 100644 index 0000000000000000000000000000000000000000..caee8b0ad2f2e7277dc87e6ea044f5372ae6fe81 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/308_2019010202940/cl_57.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2776528782 + +//import java.util.zip.CRC32; + +class cl_57 +{ + int [][] var_75 = {{(531397324),(-1250763649),(873139265)},{(1548468637),(-77667901),(-1059722600)},{(1948801826),(-683152146),(880051313)},{(-592523384),(1324162026),(-1405776732)},{(696312779),(-2069455898),(-1329907880)},{(838872338),(-1407850260),(-826154914)},{(2043881257),(-1153561296),(1903623225)}}; + int var_84 = (-819969934); + boolean var_91 = true; + double [][][] var_93 = {{{(-1.17446e-163D),(-8.66185e-183D),(-4.82415e-51D),(-2.40048e+256D),(1.00139e-133D)},{(-3.97828e-157D),(-2.76586e-294D),(-4.04337e-177D),(-5.57528e+214D),(-8.36866e+111D)},{(-1.12023e-187D),(5.58702e-30D),(-3.73068e+188D),(5.97791e+146D),(6.18138e+87D)},{(-2.91045e+80D),(-4.26337e+296D),(2.75991e-87D),(-9.56955e+34D),(-1.71918e-56D)}},{{(-8.13778e+28D),(1.48368e-119D),(7.45695e-138D),(1.34076e+100D),(4.2456e-188D)},{(9.43745e+205D),(-4.14638e+12D),(6.36298e+80D),(4.93795e-94D),(-1.35482e+231D)},{(-4.18128e-273D),(4.60284e+160D),(6.46519e-75D),(-1.90988e-06D),(8.59711e+187D)},{(1.43483e+210D),(-3.93167e-77D),(-2.88974e-14D),(2.68972e+271D),(-6.21929e+44D)}},{{(4.61598e-76D),(5.44618e-167D),(1.21001e+79D),(1.43425e-25D),(-8.89474e-117D)},{(3.36615e+97D),(-4.9297e+172D),(-2.30694e-282D),(-3.17598e+104D),(-3.60813e+108D)},{(-1.41939e+212D),(7.37231e-169D),(-2.20638e+279D),(1.76727e+09D),(-7.25437e+24D)},{(9.32765e+285D),(2.3669e+251D),(-1.02651e-137D),(1.07132e-166D),(-1.0214e-226D)}},{{(-1.56431e-201D),(-0.0899253D),(1.34822e+125D),(-8.49477e-296D),(7.50311e-178D)},{(2.14982e+246D),(-1.94892e-64D),(4.69775e-271D),(-2.27502e+43D),(2.10779e+229D)},{(-6.77594e-298D),(-1.96288e-210D),(9.95737e+238D),(-1.08387e-184D),(9.36909e-211D)},{(-4.46416e-276D),(5.53067e-31D),(-9.25546e-120D),(4.56521e-285D),(7.54225e+40D)}},{{(1.24546e+237D),(3.3704e+85D),(1.82643e+254D),(4.10683e+218D),(3.5611e+114D)},{(8.60181e-100D),(4.52641e+258D),(-6.47589e+53D),(-4.67688e-167D),(-2.47371e+182D)},{(3.82207e+83D),(9.83496e-219D),(-1.18319e-62D),(-2.63756e+132D),(-1.62652e+273D)},{(8.63304e+156D),(-2.84256e-178D),(-4.48835e+13D),(-9.51165e+71D),(-1.65108e+88D)}},{{(1.08586e-163D),(8.27014e-228D),(2.96243e-188D),(9.42918e+286D),(1.0422e+173D)},{(4.75131e-195D),(8.40344e-68D),(-1.26318e-191D),(-2.93058e-204D),(5.41014e-201D)},{(1.9492e+94D),(-5.8989e+279D),(1.19992e-181D),(-1.85496e-150D),(1.15236e+226D)},{(-1.97516e-109D),(4.19787e+197D),(-4.93175e-124D),(2.22353e+28D),(-1.02349e-262D)}},{{(-2.38248e+147D),(2.59539e+185D),(-4.10317e+173D),(7.90319e+107D),(2.3722e+07D)},{(8.77518e-188D),(-3.23886e-25D),(-1.4388e-53D),(-1.10977e+14D),(5.54929e+243D)},{(2.4389e-67D),(-7.68957e-129D),(-4.36624e+12D),(-1.28165e-97D),(-4.58848e+265D)},{(4.78146e+271D),(-2.28871e-113D),(-7.37855e-206D),(-5.08298e+180D),(-1.26466e-68D)}}}; + double var_103 = (-4.61663e-245D); + long var_110 = (-3452364138805768001L); + short var_112 = (short)(20055); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1227); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_75[a0][a1],b,"var_75" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_93[a0][a1][a2],b,"var_93" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_110,b,"var_110"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/308_2019010202940/cl_59.java b/test/testsuite/fuzz_test/fuzz/308_2019010202940/cl_59.java new file mode 100644 index 0000000000000000000000000000000000000000..d22f9857146521f6884f85cf9184e98ffe686170 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/308_2019010202940/cl_59.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2776528782 + +//import java.util.zip.CRC32; + +class cl_59 +{ + float var_41 = (-7.80011e-33F); + int var_86 = (391708806); + final byte var_92 = (byte)(105); + double var_104 = (-1.00263e+62D); + long var_116 = (1040921520548197877L); + short var_179 = (short)(-8110); + int [] var_216 = {(975155499),(1928137490)}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(35); + CrcCheck.ToByteArray(this.var_41,b,"var_41"); + CrcCheck.ToByteArray(this.var_86,b,"var_86"); + CrcCheck.ToByteArray(this.var_92,b,"var_92"); + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + CrcCheck.ToByteArray(this.var_179,b,"var_179"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_216[a0],b,"var_216" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/CRC32.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/MainClass.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..9c13fea1ffb5b9f2c8be394c0a910f98c6ef03c2 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/MainClass.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=538048686 + +//import java.util.zip.CRC32; + +class MainClass +{ + static byte var_11 = (byte)(-17); + static cl_16 var_18 = new cl_16(); + static int var_20 = (-443805494); + boolean [][][] var_21 = {{{false,false,false,false,false,true,true},{true,true,false,true,false,true,false},{false,true,false,true,false,true,false},{true,true,false,true,false,false,false},{true,false,false,false,true,true,false}},{{true,true,true,true,true,true,false},{false,false,false,true,false,false,false},{false,false,true,false,true,false,false},{false,true,false,false,true,true,false},{false,false,false,true,false,false,true}},{{true,false,true,false,false,false,false},{false,true,false,true,true,true,false},{false,false,false,true,false,true,false},{false,false,false,false,true,false,true},{false,true,false,false,true,false,true}},{{true,false,true,false,false,false,false},{false,true,false,true,true,true,false},{false,false,true,false,false,false,false},{false,true,false,true,false,true,true},{false,false,true,false,true,true,false}},{{false,true,true,false,true,true,true},{true,true,false,false,true,false,true},{true,true,false,true,false,false,true},{true,false,false,false,true,false,true},{true,false,true,false,true,true,false}}}; + static cl_43 var_168 = new cl_43(); + static double [] var_172 = {(2.59583e+193D),(-6.84164e+121D),(1.63596e-71D),(-5.72683e+182D),(-1.61391e-197D),(9.16676e-45D)}; + static int var_173 = (-2079580788); + static cl_113 var_174 = new cl_113(); + static int [][][] var_176 = {{{(1652859159),(1230227910),(-1139048411),(-1183937098),(-374828479)},{(-800740595),(-1414397697),(1586376214),(-1862904356),(-570338143)},{(120314685),(1739389249),(1090622348),(292903625),(-326340841)},{(-161461434),(557180495),(-439133475),(1845579310),(-1647136630)},{(1266557598),(-965846615),(-459507949),(346335941),(615897387)},{(-1818298044),(1399519842),(1702037825),(-1008368678),(-491868178)},{(253144396),(1865192498),(469420679),(398243913),(-1492603083)}},{{(483809035),(-805692703),(1265897400),(1079425511),(-1004507980)},{(-142803143),(637135303),(909794978),(-518436200),(1446185188)},{(-61017765),(182425656),(1283052373),(-1232579977),(1616910835)},{(-1253968645),(1659474976),(-85965970),(-943508289),(-1279839329)},{(-1457081523),(11995092),(-3651419),(1613007786),(-714176256)},{(-1377085270),(-1877393240),(-1508288838),(-83789155),(-792755376)},{(-392465609),(1391954034),(-1101560939),(641143520),(370214984)}},{{(-1644408941),(-389240337),(1724927929),(-1997446452),(-1237099888)},{(-308160700),(622294055),(-823763057),(1944645599),(1547868088)},{(-1883130501),(-52035648),(31799030),(-1396657876),(-2074832771)},{(-422955866),(330115806),(1723925007),(-717393719),(-1701395488)},{(858196560),(-1756721090),(-2119674301),(1369719035),(-375103860)},{(-1417771518),(-908630197),(1204289559),(-90277651),(1140858891)},{(-1301744318),(-1856278791),(-1924367056),(-1458300831),(-227617684)}},{{(867982156),(-1155659658),(-1181208486),(-1557747055),(-326060966)},{(-1731635508),(-253049348),(1455351799),(-238917719),(-181349511)},{(-820582520),(-1768191715),(-695127984),(1564424362),(-1114614942)},{(1051942465),(1284543162),(-1817275396),(-2010660267),(1010431555)},{(2147295851),(-1934423170),(-1820952381),(612282408),(639510299)},{(-443542764),(492497485),(90511767),(1351862064),(-1792898201)},{(1592253303),(-1208153306),(-1994901271),(-1549374477),(877127219)}}}; + static cl_115 var_179 = new cl_115(); + final long [] var_183 = {(-8708550544224561801L),(4357673662620528591L)}; + static double [] var_184 = {(-9.55126e-253D)}; + static byte var_185 = (byte)(-67); + static long var_186 = (-4800297573979217520L); + static cl_123 var_187 = new cl_123(); + static cl_16 var_193 = new cl_16(); + static float var_197 = (-4.30599e-29F); + final static short var_200 = (short)(23520); + static int var_205 = (-704354806); + static cl_100 var_208 = new cl_100(); + short var_213 = (short)(19299); + byte var_217 = (byte)(-125); + double [][] var_219 = {{(-6.7433e+205D),(-2.29873e+225D)},{(2.45891e+188D),(-3.6811e-258D)},{(-8.05957e-181D),(6.7765e+100D)},{(7.91695e+179D),(0.111431D)}}; + byte var_221 = (byte)(-74); + short var_226 = (short)(-7202); + byte var_228 = (byte)(68); + float [][][] var_239 = {{{(0.0951094F),(-1.72015e+25F),(-3.36927e+12F)},{(1.93951e-30F),(3.69123e+17F),(3.29367e+24F)},{(-1.43243e+07F),(0.000401962F),(-3.31693e+16F)},{(-5.48472e+08F),(-2.87203e+26F),(-5.77017e-08F)},{(7.1767e+37F),(-1.76541e-30F),(5.95145e+31F)},{(6.22868e-37F),(3.03701e+38F),(392.874F)},{(-744.537F),(-1.62952e-26F),(-24840.7F)}},{{(1.85837e+30F),(1.8062e+22F),(-1.19096e+30F)},{(3.99984e+24F),(2.69485e-37F),(1.43522e-33F)},{(-1.38373e+10F),(-2.52877e-30F),(2.49046e-29F)},{(-1.85167e-12F),(1.41383e-19F),(-5.49243e+21F)},{(-5.71163e-17F),(2.11013e-08F),(-1.35818e+06F)},{(3.11333e-29F),(-1.21029e-35F),(-1.34873e-34F)},{(-1.96571e-24F),(9.72221e+12F),(-3.09491e+11F)}},{{(-9.52112F),(1.36096e-35F),(0.0814543F)},{(-5.63393e-34F),(6.53442e-28F),(-1.44653e-35F)},{(-1.41601e-19F),(1.10275e+09F),(2.11843e-08F)},{(1.70021e-16F),(6.96759e-06F),(3.16326e-31F)},{(2.17318e+29F),(-2.43819e-22F),(-0.158096F)},{(3.06533e-12F),(4.84198e+31F),(28.3231F)},{(-2.2609e-21F),(-1.40247e-17F),(-2.9173e-06F)}},{{(-2.49031e-18F),(3.56989e+30F),(-8.97123e-12F)},{(-519.233F),(-5.6064e-10F),(3.87244e-38F)},{(-3.864e-27F),(4.62484e-33F),(-5.78501e+28F)},{(5.41599e+20F),(-1.89943e-13F),(1.38798e-14F)},{(1.41242e+34F),(-9.8842e+27F),(2.15347e+34F)},{(-5.75625e+21F),(46.4425F),(-1.06106e+15F)},{(1.05513e-19F),(6.40436e-06F),(-1.35354e-08F)}},{{(-4.48232e+17F),(-2.15815e+14F),(-1.47978e-15F)},{(1.99484e-30F),(2.50315e-05F),(-1.51127e+13F)},{(-1.57966e-21F),(2.30277e+36F),(2.73483F)},{(9.18048e-33F),(-3211.19F),(1.74832e-26F)},{(5.2556e+18F),(-0.12575F),(-1.90086e-10F)},{(3.9609e+24F),(-3.70896e-16F),(1.17027e-09F)},{(-1.79359e+19F),(8.39039e-13F),(5.41715e-20F)}}}; + byte var_245 = (byte)(13); + int var_249 = (-945202019); + final float [] var_254 = {(-1.65906e-34F)}; + int var_255 = (-902568159); + byte var_261 = (byte)(-74); +/*********************************/ +public strictfp void run() +{ + byte var_237 = (byte)(13); + byte var_227 = (byte)(-9); + byte var_230 = (byte)(80); + long [][][] var_1 = {{{(3533050254348593300L),(-7658568003212487948L),(1254825731499067548L),(1165086836944890013L)}},{{(3188301273290827946L),(5576288046275211564L),(8744940225156954153L),(-615500990925321708L)}},{{(-3611493840964721534L),(-7833788179911833442L),(7220013618498272000L),(-7947832179496882139L)}},{{(464404204922504481L),(7919259138865778101L),(-6936083344670116525L),(-2388515171928237760L)}},{{(-8968559424629145663L),(-6655404331292624832L),(-4590757926578901492L),(1427903001576026698L)}}}; + short var_2 = (short)(7647); + byte var_252 = (byte)(-81); + short var_211 = (short)(-3407); + int var_260 = (-1115575460); + int var_259 = (1988473213); + short var_214 = (short)(-5210); + byte var_257 = (byte)(-31); + cl_16 var_246 = new cl_16(); + final int [][][] var_225 = {{{(-2118816803),(-361351585),(-845832837),(-1779598285)},{(347852832),(141871703),(-1463525092),(-1259726951)},{(767636796),(-1702581124),(-485428518),(-897342543)},{(658920638),(1395090241),(-1995507237),(-1717611491)},{(-413195028),(-1456382124),(985808214),(1251167688)}},{{(-516551063),(229289154),(-1200906250),(1714735879)},{(962408610),(-1752153145),(-1914945460),(1698799902)},{(143499590),(13898485),(-1788291690),(-1928674085)},{(1377757988),(740874316),(-1663421263),(658317290)},{(594507917),(-728085771),(719308250),(-639949062)}},{{(2079307572),(1072724926),(-806937977),(562711331)},{(1804158893),(-276141054),(-1287799812),(-405966207)},{(1514754955),(137639879),(749098770),(-309097872)},{(-448485293),(-1456395214),(-22788920),(-1012045779)},{(-2023196013),(-1785452168),(1270416913),(194503849)}},{{(146200193),(-2131522250),(-1050716555),(2026469664)},{(-568380606),(602296006),(-404046781),(-224086004)},{(-718230238),(397826457),(-57775912),(-1129756320)},{(-2048227063),(1059132976),(1457370046),(-601462483)},{(1143437703),(2068540488),(2082276240),(-1485931025)}}}; + short var_231 = (short)(3034); + float var_241 = (-11.8654F); + short var_233 = (short)(-18333); + double [][] var_212 = {{(-9.59376e+111D),(-2.09635e+286D)},{(4.83766e-304D),(1.13339e-299D)},{(-9.16089e-27D),(2.98748e-127D)},{(-1.5586e+305D),(4.54242e-263D)}}; + var_1[((var_245++)&4)][(((--var_2)|func_3((--var_20) ,(+(++var_211)) ,var_212 ,((++var_213)-func_3(((var_214++)-var_193.var_215) ,((var_217--)|var_20) ,var_219 ,((--var_221)*func_3((var_213++) ,var_174.var_76.var_110 ,var_219 ,var_225[((var_228--)&3)][((var_227--)&4)][(((--var_226)|var_213)&3)] ,((++var_230)+func_3((~(++var_231)) ,((var_233++)*var_193.var_132) ,var_179.var_235 ,(~(--var_237)) ,var_239[(((var_185++)|var_205)&4)][((var_221--)&6)][((var_185--)&2)] ,(--var_241) ,(var_213++))) ,((-((++var_245)+func_12(var_246)))+(10290.3F)) ,(var_249++))) ,(~(--var_252)) ,var_254[((var_255++)&0)] ,(+(++var_257)))) ,(var_226++) ,(var_259--) ,(++var_260)))&0)][3] = ((++var_261)&var_186) ; + return ; +} +public static strictfp short func_3(long var_4, int var_5, double[][] var_6, int var_7, float var_8, float var_9, float var_10) +{ + byte var_207 = (byte)(34); + final cl_16 var_209 = new cl_16(); + if( (!((var_11++)==func_12(var_193)))) + { + // if stmt begin,id=1 + int var_195 = (992846161); + short var_199 = (short)(-17715); + for( var_195 = 152 ;(var_195>151);var_195 = (var_195-1) ) + { + byte var_196 = (byte)(-111); + short var_198 = (short)(23853); + final cl_113 var_202 = new cl_113(); + if( ((++var_196)>var_197)) + { + // if stmt begin,id=2 + var_176[(((var_199++)+var_200)&3)][((var_196--)&6)][((-(var_198++))&4)] = (--var_199) ; + // if stmt end,id=2 + } + else + { + // else stmt begin,id=1 + int var_201 = (-444133072); + for( var_201 = 981 ;(var_201>977);var_201 = (var_201-1) ) + { + var_174 = var_202 ; + } + // else stmt end,id=1 + } + } + // if stmt end,id=1 + } + else + { + // else stmt begin,id=2 + short var_203 = (short)(472); + try + { + if( ( ( boolean )(!((var_7--)>( ( float )((++var_11)-var_20) ))) )) + { + // if stmt begin,id=3 + if( (!(!((--var_203)!=var_168.func_45(var_172 ,(++var_197)))))) + { + // if stmt begin,id=4 + final cl_113 [][] var_204 = {{new cl_113()},{new cl_113()},{new cl_113()},{new cl_113()},{new cl_113()},{new cl_113()}}; + // if stmt end,id=4 + } + // if stmt end,id=3 + } + else + { + // else stmt begin,id=3 + for( var_205 = 646 ;(var_205<710);var_205 = (var_205+16) ) + { + var_6[((++var_20)&3)][((++var_11)&1)] = (++var_197) ; + } + // else stmt end,id=3 + } + } + catch( java.lang.IllegalArgumentException myExp_206 ) + { + if( ((++var_207)<=var_208.var_103)) + { + // if stmt begin,id=5 + var_6[(((--var_207)*func_12(var_209))&3)][((var_207--)&1)] = (var_207++) ; + // if stmt end,id=5 + } + System.out.println("hello exception 0 !"); + } + // else stmt end,id=2 + } + short var_210 = (short)(16566); + return (var_210--); +} +public static strictfp byte func_12(cl_16 var_13) +{ + int var_190 = (654959544); + long [] var_16 = {(-6937231635443888860L),(8251857311792368528L)}; + if( true) + { + // if stmt begin,id=6 + short var_170 = (short)(-6104); + try + { + int var_14 = (-995329217); + byte var_17 = (byte)(69); + for( var_14 = 211 ;(var_14<239);var_14 = (var_14+7) ) + { + try + { + double [] var_171 = {(6.07563e-173D),(6.378e+244D),(3.26555e+155D),(-2.93748e+212D),(-1.04454e+278D),(9.15997e+58D)}; + var_16[((((--var_17)+var_18.var_19)-var_17)&1)] = (++var_20) ; + var_17 = (--var_17) ; + var_16 = var_18.func_22(var_168.var_87.var_169 ,(var_170--) ,(!((var_11--)>=var_168.func_45(var_171 ,var_172[((++var_173)&5)]))) ,(!(!(!(!((++var_170)>var_174.var_103)))))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_175 ) + { + var_18.var_165.var_92.var_94 = ((var_17--)>var_168.var_67) ; + System.out.println("hello exception 1 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_177 ) + { + double [][][] var_189 = {{{(2.04289e+254D),(1.51143e-140D)},{(7.47511e+163D),(-2.45119e-274D)}},{{(-2.65304e-119D),(6.70331e+87D)},{(1.45363e+280D),(-4.58282e-171D)}},{{(1.94195e-106D),(-4.69478e+194D)},{(-8.73888e-266D),(4.63804e+255D)}},{{(4.17747e+189D),(9.9345e+300D)},{(3.90915e-193D),(-5.68413e+69D)}},{{(5.28252e-51D),(2.33946e-202D)},{(1.27293e+132D),(-8.29698e+304D)}}}; + short var_178 = (short)(-28015); + if( (!(!((var_178++)<=var_179.var_105)))) + { + // if stmt begin,id=7 + int var_180 = (483243612); + for( var_180 = 184 ;(var_180>178);var_180 = (var_180-6) ) + { + var_16[(var_180&1)] = (var_20--) ; + } + // if stmt end,id=7 + } + else + { + // else stmt begin,id=4 + byte var_192 = (byte)(-58); + int var_181 = (1752191529); + for( var_181 = 883 ;(var_181>841);var_181 = (var_181-14) ) + { + byte var_188 = (byte)(69); + byte var_191 = (byte)(-52); + var_16 = var_18.func_22(var_184 ,(-99231875) ,(!((var_11++)>( ( int )(-4415383330338165089L) ))) ,var_18.func_36(var_168 ,(!(!(((-(++var_185))-var_186)>var_187.var_164))) ,(~(var_188++)) ,(var_186--) ,var_189[((var_191--)&4)][((++var_190)&1)][((var_170++)&1)] ,var_168.var_75.var_110 ,(--var_192))) ; + } + // else stmt end,id=4 + } + System.out.println("hello exception 2 !"); + } + // if stmt end,id=6 + } + return (var_185++); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1396); + CrcCheck.ToByteArray(this.var_11,b,"var_11"); + CrcCheck.ToByteArray(this.var_18.GetChecksum(),b,"var_18.GetChecksum()"); + CrcCheck.ToByteArray(this.var_20,b,"var_20"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_21[a0][a1][a2],b,"var_21" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_168.GetChecksum(),b,"var_168.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_172[a0],b,"var_172" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_173,b,"var_173"); + CrcCheck.ToByteArray(this.var_174.GetChecksum(),b,"var_174.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_176[a0][a1][a2],b,"var_176" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_179.GetChecksum(),b,"var_179.GetChecksum()"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_183[a0],b,"var_183" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_184[a0],b,"var_184" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_185,b,"var_185"); + CrcCheck.ToByteArray(this.var_186,b,"var_186"); + CrcCheck.ToByteArray(this.var_187.GetChecksum(),b,"var_187.GetChecksum()"); + CrcCheck.ToByteArray(this.var_193.GetChecksum(),b,"var_193.GetChecksum()"); + CrcCheck.ToByteArray(this.var_197,b,"var_197"); + CrcCheck.ToByteArray(this.var_200,b,"var_200"); + CrcCheck.ToByteArray(this.var_205,b,"var_205"); + CrcCheck.ToByteArray(this.var_208.GetChecksum(),b,"var_208.GetChecksum()"); + CrcCheck.ToByteArray(this.var_213,b,"var_213"); + CrcCheck.ToByteArray(this.var_217,b,"var_217"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_219[a0][a1],b,"var_219" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_221,b,"var_221"); + CrcCheck.ToByteArray(this.var_226,b,"var_226"); + CrcCheck.ToByteArray(this.var_228,b,"var_228"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_239[a0][a1][a2],b,"var_239" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_245,b,"var_245"); + CrcCheck.ToByteArray(this.var_249,b,"var_249"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_254[a0],b,"var_254" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_255,b,"var_255"); + CrcCheck.ToByteArray(this.var_261,b,"var_261"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/Start.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..210e0ccd46b8522123ef5e7945da812cd5730f24 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_123.java MainClass.java cl_16.java cl_115.java CRC32.java CrcCheck.java cl_113.java cl_43.java cl_100.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_100.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_100.java new file mode 100644 index 0000000000000000000000000000000000000000..62c8417d97b29fa21a4297ae5cb9902fd4be4cae --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_100.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=538048686 + +//import java.util.zip.CRC32; + +class cl_100 +{ + double var_70 = (8.81385e-111D); + long var_77 = (4389403111596022123L); + final long [][] var_88 = {{(343010707749934819L),(-7067304214456653645L),(-1720946528573572274L),(-6827068922486482030L),(4581128704408823737L)},{(-8944672306847716139L),(-2455023433652486370L),(1725731083383904110L),(-1761666139651480650L),(1622601915734113184L)},{(-161311910856815767L),(-2899780519714832605L),(2344565802313404058L),(-3586432854774312295L),(3872659907668983256L)},{(-4463892588833262447L),(3577258062525383534L),(7948056784735094731L),(-3541318981839720934L),(7082492804530590404L)},{(1047073401151268100L),(798901914483810360L),(-430665683575483802L),(-1482719779938774353L),(-8225330596588823680L)},{(8727301324922518055L),(-5835039583164939257L),(6096737232778019680L),(-2377127083666566737L),(5803680893143673139L)},{(2403981377041917310L),(-3296748839976403847L),(-5311241514547696117L),(-5570701433002801868L),(-7346718456315025061L)}}; + float var_103 = (-0.00513271F); + int var_110 = (499803681); + byte var_113 = (byte)(-124); + final short var_114 = (short)(22743); + boolean var_146 = false; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(308); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_88[a0][a1],b,"var_88" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_110,b,"var_110"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CrcCheck.ToByteArray(this.var_146,b,"var_146"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_113.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_113.java new file mode 100644 index 0000000000000000000000000000000000000000..8734ff74b2677b87b913c1de4b85797368d4a09b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_113.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=538048686 + +//import java.util.zip.CRC32; + +class cl_113 extends cl_100 +{ + cl_100 var_76 = new cl_100(); + cl_123 var_89 = new cl_123(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(324); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_76.GetChecksum(),b,"var_76.GetChecksum()"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_88[a0][a1],b,"var_88" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_89.GetChecksum(),b,"var_89.GetChecksum()"); + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_110,b,"var_110"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CrcCheck.ToByteArray(this.var_146,b,"var_146"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_115.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_115.java new file mode 100644 index 0000000000000000000000000000000000000000..9d610a41ab26156b6e1316554c21b8f302995251 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_115.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=538048686 + +//import java.util.zip.CRC32; + +class cl_115 +{ + cl_113 var_85 = new cl_113(); + cl_100 var_91 = new cl_100(); + cl_123 var_92 = new cl_123(); + byte var_98 = (byte)(116); + float var_105 = (3.13712e-32F); + int var_166 = (1014137424); + double [][] var_235 = {{(2.57927e-32D),(2.7759e+253D)},{(-2.3786e+244D),(6.8058e+214D)},{(2.4977e-296D),(-1.13583e+78D)},{(7.29805e-26D),(-4.32351e+175D)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(97); + CrcCheck.ToByteArray(this.var_85.GetChecksum(),b,"var_85.GetChecksum()"); + CrcCheck.ToByteArray(this.var_91.GetChecksum(),b,"var_91.GetChecksum()"); + CrcCheck.ToByteArray(this.var_92.GetChecksum(),b,"var_92.GetChecksum()"); + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + CrcCheck.ToByteArray(this.var_166,b,"var_166"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_235[a0][a1],b,"var_235" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_123.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_123.java new file mode 100644 index 0000000000000000000000000000000000000000..b67ebfc97115bb85e2aa706cb2c9b5b27fea1182 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_123.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=538048686 + +//import java.util.zip.CRC32; + +class cl_123 +{ + long [][] var_90 = {{(5229752552271110253L),(-4913309046452838073L),(5162240367647145848L),(4264290875097534268L),(-2104496683475282040L)},{(4374772185759916630L),(-306836400417222913L),(5978157413040034736L),(-8950139927706962545L),(-4283975254837504116L)},{(5304700131676707682L),(1839753771477876542L),(-780768483200617518L),(6484492641573390697L),(2268124448074484492L)},{(-3519906890958711609L),(2322483596080656289L),(-7117514191930190687L),(-3277847815941057150L),(742217670321962958L)},{(3932217135429026326L),(-1449404999287174821L),(485621642044506764L),(-6754858427034741879L),(3970657973969034822L)},{(411002072395751583L),(9206904977079795498L),(-2346325529490436030L),(-358649888272058498L),(-1464769798455735705L)},{(-8941099245224252212L),(-5646697487811543468L),(8073543830630643023L),(2787138011350284874L),(-1110250860840070412L)}}; + final double var_93 = (3.60666e-101D); + boolean var_94 = false; + long var_96 = (4432952396820741873L); + double var_106 = (-2.93053e-226D); + short var_112 = (short)(-11915); + int var_164 = (18591877); + double [] var_169 = {(-1.24193e-37D)}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(319); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_90[a0][a1],b,"var_90" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_93,b,"var_93"); + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + CrcCheck.ToByteArray(this.var_106,b,"var_106"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CrcCheck.ToByteArray(this.var_164,b,"var_164"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_169[a0],b,"var_169" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_16.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_16.java new file mode 100644 index 0000000000000000000000000000000000000000..f2cb98ff712a281150ec2424dcab87843edb300f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_16.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=538048686 + +//import java.util.zip.CRC32; + +class cl_16 +{ + static int var_19 = (-1090614702); + static cl_43 var_117 = new cl_43(); + static cl_113 var_119 = new cl_113(); + cl_123 var_120 = new cl_123(); + static cl_100 var_127 = new cl_100(); + static int var_129 = (-814245778); + static byte var_132 = (byte)(-72); + static short var_134 = (short)(6224); + final static double var_137 = (3.6346e+241D); + static byte var_143 = (byte)(-11); + static byte var_147 = (byte)(25); + static float var_163 = (-1.63318e-06F); + final static cl_115 var_165 = new cl_115(); + long [] var_182 = {(-7443103397738659260L),(2942562586733840917L)}; + long var_215 = (3600719636529478844L); +/*********************************/ +public static strictfp long[] func_22(double[] var_23, int var_24, boolean var_25, boolean var_26) +{ + long [] var_167 = {(-1750647623511723765L),(-2704399810438825363L)}; + short var_140 = (short)(-6267); + try + { + short var_27 = (short)(-18438); + short var_136 = (short)(14426); + byte var_156 = (byte)(-44); + if( (!(((var_27++)>func_28((-(++var_134)) ,(!(!(!(!(((var_136++)|var_134)=var_127.var_113) ,(var_19--) ,(++var_143) ,(!((var_129++)>=var_19))))|var_127.var_146))) + { + // if stmt begin,id=8 + var_143 = (++var_147) ; + // if stmt end,id=8 + } + else + { + // else stmt begin,id=5 + float var_151 = (3.10917e-32F); + byte var_149 = (byte)(-38); + if( func_36(var_117 ,(!((!((var_149++)==var_129))!=var_26)) ,(++var_151) ,(2.17918e+117D) ,(var_143++) ,var_19 ,(var_156++))) + { + // if stmt begin,id=9 + try + { + var_23[((var_140++)&0)] = ((--var_136)/( ( short )((++var_149)|var_19) )) ; + } + catch( java.lang.ArithmeticException myExp_158 ) + { + double var_159 = (-4.66075e-236D); + System.out.println("hello exception 3 !"); + } + // if stmt end,id=9 + } + // else stmt end,id=5 + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_160 ) + { + if( (!((var_140--)==var_147))) + { + // if stmt begin,id=10 + double var_161 = (9.56275e+300D); + // if stmt end,id=10 + } + else + { + // else stmt begin,id=6 + int var_162 = (216812222); + for( var_162 = 729 ;(var_162<805);var_162 = (var_162+19) ) + { + if( ((var_134++)==var_163)) + { + // if stmt begin,id=11 + var_24 = (~(var_132++)) ; + // if stmt end,id=11 + } + else + { + // else stmt begin,id=7 + var_23[(((var_132--)+var_165.var_166)&0)] = (var_140--) ; + // else stmt end,id=7 + } + } + // else stmt end,id=6 + } + System.out.println("hello exception 4 !"); + } + return var_167; +} +public static strictfp double func_28(long var_29, boolean var_30, double var_31, boolean var_32, int var_33, long var_34, boolean var_35) +{ + short var_131 = (short)(-31606); + float var_128 = (1.7571e+35F); + long var_130 = (-8420518763590617625L); + if( func_36(var_117 ,(!((--var_128)!=var_127.var_70)) ,var_117.var_100 ,(var_129++) ,(-(var_130--)) ,(var_131++) ,((var_132--)&var_132))) + { + // if stmt begin,id=12 + short var_133 = (short)(-17632); + var_29 = (var_133--) ; + // if stmt end,id=12 + } + return var_119.var_70; +} +public static strictfp boolean func_36(cl_43 var_37, boolean var_38, float var_39, double var_40, double var_41, int var_42, long var_43) +{ + short var_44 = (short)(-25917); + final double [] var_118 = {(-1.0709e+23D),(-5.91394e-223D),(-1.05957e+124D),(1.64204e+220D),(-1.96028e-59D),(2.2233e-35D)}; + try + { + if( ((++var_44)<=var_117.func_45(var_118 ,(var_39--)))) + { + // if stmt begin,id=13 + var_119.var_89 = var_117.var_75.var_89 ; + // if stmt end,id=13 + } + else + { + // else stmt begin,id=8 + var_44 = (var_44++) ; + // else stmt end,id=8 + } + } + catch( java.lang.ArithmeticException myExp_121 ) + { + byte var_126 = (byte)(126); + if( true) + { + // if stmt begin,id=14 + float [] var_125 = {(33495.8F),(9.87111e+14F),(-1.42515e+06F)}; + try + { + try + { + var_117.var_69.var_110 = var_119.var_110 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_122 ) + { + var_40 = (++var_40) ; + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_123 ) + { + var_125[((--var_126)&2)] = (var_44++) ; + System.out.println("hello exception 7 !"); + } + // if stmt end,id=14 + } + System.out.println("hello exception 5 !"); + } + return (!((++var_43)>=var_127.var_114)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(89); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + CrcCheck.ToByteArray(this.var_117.GetChecksum(),b,"var_117.GetChecksum()"); + CrcCheck.ToByteArray(this.var_119.GetChecksum(),b,"var_119.GetChecksum()"); + CrcCheck.ToByteArray(this.var_120.GetChecksum(),b,"var_120.GetChecksum()"); + CrcCheck.ToByteArray(this.var_127.GetChecksum(),b,"var_127.GetChecksum()"); + CrcCheck.ToByteArray(this.var_129,b,"var_129"); + CrcCheck.ToByteArray(this.var_132,b,"var_132"); + CrcCheck.ToByteArray(this.var_134,b,"var_134"); + CrcCheck.ToByteArray(this.var_137,b,"var_137"); + CrcCheck.ToByteArray(this.var_143,b,"var_143"); + CrcCheck.ToByteArray(this.var_147,b,"var_147"); + CrcCheck.ToByteArray(this.var_163,b,"var_163"); + CrcCheck.ToByteArray(this.var_165.GetChecksum(),b,"var_165.GetChecksum()"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_182[a0],b,"var_182" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_215,b,"var_215"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_43.java b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_43.java new file mode 100644 index 0000000000000000000000000000000000000000..c128727ca7dd80d904ac4f1c75972a789a522c73 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/326_2019010202954/cl_43.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=538048686 + +//import java.util.zip.CRC32; + +class cl_43 +{ + static int var_48 = (-512766328); + static byte var_50 = (byte)(25); + static float var_51 = (5.59975e+37F); + static long var_59 = (-332427603580103951L); + final static long [][] var_61 = {{(244799968170885440L),(-6449233708765206281L),(5028781875243171074L),(-5192270417207838563L),(2626705526581190722L)},{(7236218441196641405L),(6133910622107315255L),(-1675283157318812149L),(158524640820372407L),(3180056076060228889L)},{(-4939854715459110752L),(-6976113303126288608L),(-1727546774588346734L),(2739113141272474554L),(-7459823276372190666L)},{(2342180857834910789L),(7756914535191023963L),(6887218936851753719L),(-5961387468123765810L),(-7010673727026566098L)},{(-8845946231391316414L),(6891156191650276061L),(-1824365123123459944L),(4937586861485618855L),(-3593194340341816546L)},{(-1230666175196247356L),(-6769261852378722976L),(-6129882223057426776L),(-353598568719992427L),(-8206803251423465901L)},{(2361446568188240822L),(-5880745842406319182L),(-7970329455718857803L),(-2685248659285251145L),(-5065170787663942105L)}}; + static double var_63 = (-2.38495e+291D); + int [][][] var_64 = {{{(-927345348)}},{{(-1584002291)}},{{(-1727331512)}},{{(-1507080969)}}}; + long var_65 = (-375304733945261100L); + static double [][][] var_66 = {{{(5.60621e-29D)},{(4.68006e+232D)},{(-1.28047e-213D)},{(-1.15154e-78D)}},{{(4.20123e-294D)},{(6.92287e-78D)},{(5.74196e-289D)},{(-1.71832e+229D)}},{{(5.54442e-63D)},{(1.14754e+194D)},{(1.10002e+32D)},{(8.22856e-66D)}}}; + static short var_67 = (short)(19865); + static int var_68 = (-1942316371); + static cl_100 var_69 = new cl_100(); + static int var_71 = (1425905944); + static cl_115 [] var_74 = {new cl_115()}; + final static cl_113 var_75 = new cl_113(); + static float [] var_80 = {(-3.9708e+36F)}; + static cl_100 [] var_81 = {new cl_100(),new cl_100(),new cl_100(),new cl_100()}; + static cl_100 var_83 = new cl_100(); + static cl_115 var_84 = new cl_115(); + static cl_123 var_87 = new cl_123(); + float var_100 = (0.000824737F); + static cl_115 [] var_101 = {new cl_115(),new cl_115()}; + static float [] var_104 = {(1.65974e-24F)}; + static double [] var_107 = {(-2.53686e-302D),(3.22388e-22D),(2.87109e+159D),(-2.93676e+194D),(-6.07838e-161D)}; + static boolean [] var_109 = {true,false,false,true,true,false,true}; + static int [][][] var_111 = {{{(-1536445415),(-565188454),(1316215162),(2086451481),(-1326701697),(1294543446),(1181978958)},{(1661742362),(1398695634),(401655060),(-1320333751),(1667392144),(-1115339514),(-1816995850)},{(-756649210),(-49948371),(1910157063),(725841635),(-1003080093),(-1688114152),(380195791)},{(1818447999),(-1520091826),(1050271720),(2144113545),(783855019),(-987721507),(2061567327)},{(-325782146),(2087562521),(1095998514),(-1465960072),(-1025699072),(818094318),(1076225723)}},{{(383468337),(-240871521),(-1943596824),(1914525456),(1681870583),(-1454880301),(2020715815)},{(-1014531633),(457191326),(1580577218),(-1247614046),(14807790),(-970744149),(-906713339)},{(-606394056),(-1887998145),(1000460188),(1111707501),(567246964),(227242964),(415827564)},{(663462123),(870101771),(1615713141),(464947408),(-129310096),(672364039),(557265272)},{(-1392697821),(-1412117091),(1394852653),(927939885),(1602216597),(-361527622),(630456840)}},{{(93116024),(1499192584),(-855170282),(-729272609),(214541331),(1887038145),(343628388)},{(-1600344068),(-71931533),(1541269635),(-1640177654),(381698062),(1015514135),(-678229702)},{(-2089050055),(990542730),(-29785772),(1672074901),(746282471),(1551043517),(-1294182904)},{(-1136704261),(-1025541835),(2038181611),(949680584),(1378938351),(2118867635),(2125219860)},{(1800044917),(641491762),(583136217),(-673414502),(-1291585197),(-1576032045),(-41498894)}},{{(939623610),(823816714),(-116137030),(-477261140),(753520301),(2112255530),(-1471450880)},{(-1775123304),(432298320),(1758802363),(-656318851),(964527456),(-353661114),(1799982399)},{(1580072195),(779763901),(1293756603),(-921013905),(272106688),(446704573),(2062696021)},{(760213531),(-1165217325),(1640301801),(-1803374538),(-865451696),(210017825),(-751818900)},{(1875025421),(-818276474),(629116400),(1017273773),(2141112594),(-154279078),(1589552121)}},{{(-586151967),(-468610646),(1273005378),(282183536),(948437727),(179297021),(-19342213)},{(-1230621164),(1558745990),(939501086),(-2045407050),(1637183058),(-2078918671),(45963674)},{(-26312888),(671799393),(469614691),(1861528570),(-208988950),(-1531340173),(80228544)},{(-790521260),(-565383410),(-1022793787),(-508639736),(840834181),(1722198248),(339563764)},{(1191005049),(1192715237),(457058992),(-618638510),(834653068),(1701706511),(-1989475352)}},{{(-1804109228),(-2042247881),(-888239582),(-1252556589),(-1668604708),(-1722717054),(1408849882)},{(-1111612716),(1909583652),(464672972),(867187350),(-917702379),(1731237153),(1370192850)},{(837294270),(-272297500),(-1009144520),(-146297992),(369947138),(-268603416),(-1085291719)},{(-198784311),(-230554685),(981910478),(157803720),(1270581993),(1594700702),(-1073293428)},{(470200760),(-1380458882),(710880706),(-1969681914),(1471951885),(595610464),(899201442)}}}; +/*********************************/ +public static strictfp short func_45(double[] var_46, double var_47) +{ + cl_115 var_102 = new cl_115(); + long var_78 = (-4237774223357415305L); + final cl_100 var_86 = new cl_100(); + byte var_55 = (byte)(116); + for( var_48 = 773 ;(var_48<797);var_48 = (var_48+12) ) + { + float var_116 = (-2.021e+17F); + int var_72 = (1753685662); + int var_49 = (-471026696); + for( var_49 = 778 ;(var_49>768);var_49 = (var_49-5) ) + { + short var_58 = (short)(12923); + double [][][] var_57 = {{{(2.27995e+191D)},{(3.10974e+191D)},{(3.11735e+254D)},{(9.53605e+208D)}},{{(-3.44277e+58D)},{(-6.31454e-136D)},{(1.68909e-308D)},{(7.22489e-228D)}},{{(5.93898e-197D)},{(4.32195D)},{(-4.1797e+305D)},{(5.26432e-64D)}}}; + if( (!(!(((var_50--)|var_50)<=var_51)))) + { + // if stmt begin,id=15 + int var_52 = (1787738158); + long [][] var_54 = {{(-7399929501816070872L),(8758966659531179080L),(3786135046827896119L),(1846625329270322927L),(8608451082565785990L)},{(2524029902269799095L),(2035880971858404404L),(2592808477956734791L),(4849605546339456096L),(1897271573333476068L)},{(-5150744213426396879L),(-3544686554199499264L),(9061302341550667771L),(-7315003463848137257L),(-1369249031813066083L)},{(5154680454292994624L),(3144968153461589601L),(-6847017812026469070L),(-8908625739481727478L),(-7230778262849269221L)},{(183592421476750684L),(-6459369615923883551L),(-497171297358201930L),(-6835358117118540212L),(5025090854434112775L)},{(3072166066494083673L),(-4243671963568180797L),(2371275051867212869L),(-7790211004129507370L),(-288976641837608063L)},{(-4424999379122091167L),(-8170791118036096776L),(-936392181904770952L),(4742897915739857138L),(-4885371862483822751L)}}; + int var_62 = (-912555546); + for( var_52 = 656 ;(var_52>596);var_52 = (var_52-15) ) + { + float [] var_60 = {(2.01355e+09F),(-3.02847e-20F),(-3.89553e-06F),(-2.42625e+16F),(4.77255e-34F),(3.50149e-14F),(1.07794e-36F)}; + var_54[6][((~(var_50++))&4)] = ((--var_55)*( ( byte )(var_50--) )) ; + var_57[((var_55--)&2)][((++var_58)&3)][((var_55++)&0)] = (++var_59) ; + var_51 = (3.76121e+36F) ; + var_54 = var_61 ; + continue; + + } + for( var_62 = 353 ;(var_62>293);var_62 = (var_62-12) ) + { + var_55 = (++var_55) ; + var_57 = var_66 ; + var_54[(((++var_58)|var_67)&6)][4] = ((++var_50)|var_50) ; + var_58 = (var_67--) ; + } + int var_95 = (1018550275); + for( var_68 = 987 ;(var_68<1011);var_68 = (var_68+8) ) + { + var_69 = var_69 ; + cl_113 var_73 = new cl_113(); + int var_79 = (1331791907); + var_69.var_70 = (-((+(-(+(++var_72))))+var_50)) ; + var_75.var_76.var_77 = (var_78++) ; + var_80[(var_68&0)] = (~(var_55--)) ; + cl_100 var_82 = new cl_100(); + var_66 = var_57 ; + var_81[(var_68&3)] = var_84.var_85.var_76 ; + var_54 = var_61 ; + var_57[((var_58++)&2)][((~(++var_55))&3)][(((var_71++)+var_50)&0)] = (--var_58) ; + var_72 = (var_55++) ; + var_84.var_85.var_89.var_94 = var_75.var_89.var_94 ; + } + for( var_95 = 548 ;(var_95<575);var_95 = (var_95+9) ) + { + double var_99 = (3.27236e-284D); + var_87.var_96 = ((var_55--)-var_55) ; + long var_97 = (-2198791439415120240L); + var_57[((~(~(++var_55)))&2)][((+(~(++var_55)))&3)][((--var_55)&0)] = (++var_55) ; + var_54[((-(+(++var_55)))&6)][(((++var_55)|var_84.var_98)&4)] = (-(--var_58)) ; + var_58 = (var_58++) ; + var_54[((--var_50)&6)][((~(--var_58))&4)] = ((~(var_55++))&var_50) ; + var_101[(var_95&1)] = var_84 ; + var_81[(var_95&3)] = var_84.var_85.var_76 ; + var_104[(var_95&0)] = ((++var_58)+var_84.var_105) ; + var_84.var_92.var_106 = (var_72--) ; + var_74[((++var_58)&0)] = var_84 ; + var_107[(var_95&4)] = ((var_55++)*var_51) ; + final cl_100 var_108 = new cl_100(); + var_107[(var_95&4)] = (++var_63) ; + var_109[(var_95&6)] = true ; + } + try + { + var_66[((var_58--)&2)][((++var_72)&3)][((++var_58)&0)] = ((-(var_72--))-var_59) ; + var_84.var_91.var_110 = (-(--var_55)) ; + var_111[((var_71--)&5)][4][((((var_50--)|var_75.var_76.var_113)&var_48)&6)] = ((--var_55)*var_71) ; + var_57[(((var_58--)*var_69.var_114)&2)][((+(++var_67))&3)][((((--var_55)|(byte)(84))*var_87.var_112)&0)] = (-((--var_72)+var_75.var_113)) ; + } + catch( java.lang.IllegalArgumentException myExp_115 ) + { + var_74[((~(var_55--))&0)] = var_102 ; + var_54[(((--var_67)*( ( short )(1527979575) ))&6)][(((++var_55)|var_83.var_110)&4)] = (--var_67) ; + System.out.println("hello exception 8 !"); + } + // if stmt end,id=15 + } + else + { + // else stmt begin,id=9 + if( (!((++var_55)<=var_58))) + { + // if stmt begin,id=16 + var_57[((-(var_55++))&2)][((var_71++)&3)][((var_72++)&0)] = (4.35222e-103D) ; + // if stmt end,id=16 + } + else + { + // else stmt begin,id=10 + var_47 = (+((var_116++)-var_87.var_96)) ; + // else stmt end,id=10 + } + // else stmt end,id=9 + } + } + } + return (var_67--); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1430); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + CrcCheck.ToByteArray(this.var_51,b,"var_51"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_61[a0][a1],b,"var_61" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_63,b,"var_63"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_64[a0][a1][a2],b,"var_64" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_66[a0][a1][a2],b,"var_66" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_69.GetChecksum(),b,"var_69.GetChecksum()"); + CrcCheck.ToByteArray(this.var_71,b,"var_71"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_74[a0].GetChecksum(),b,"var_74" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_75.GetChecksum(),b,"var_75.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_80[a0],b,"var_80" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_81[a0].GetChecksum(),b,"var_81" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_83.GetChecksum(),b,"var_83.GetChecksum()"); + CrcCheck.ToByteArray(this.var_84.GetChecksum(),b,"var_84.GetChecksum()"); + CrcCheck.ToByteArray(this.var_87.GetChecksum(),b,"var_87.GetChecksum()"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_101[a0].GetChecksum(),b,"var_101" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_104[a0],b,"var_104" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_107[a0],b,"var_107" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_109[a0],b,"var_109" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_111[a0][a1][a2],b,"var_111" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/3636_2018110811698/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/3636_2018110811698/MainClass.java b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..b5a3900163c7b87361445543d52afa63cdea961c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/MainClass.java @@ -0,0 +1,415 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=87166108 + +import java.util.zip.CRC32; + +class MainClass +{ + static cl_1 var_0 = new cl_1(); + static double var_1 = (-2.32046e+64D); + long [][] var_4 = {{(-1949216910439784134L),(6541137341730614675L),(-2178589745403727373L),(-5493894632770091974L),(4659070670066566054L)},{(322915560848113399L),(-4954828987014068564L),(-5056110746384400407L),(-3433344396396618865L),(7272323074693703039L)},{(2025068705797499084L),(873351063082481405L),(-4937526045039061386L),(-3335116614723087441L),(7585121181769637808L)},{(4038889442560057176L),(1800467485079300164L),(-4228329260152290988L),(-4198034590135350695L),(8031792068935280444L)},{(-6151323093054475073L),(428628914531065148L),(2621506116445236453L),(6319050735565442016L),(7866684124874509817L)},{(-4903049076686465091L),(-6091130285970572311L),(-7219499861987790079L),(677086967099614267L),(-6872264574035388907L)}}; + static cl_24 var_22 = new cl_24(); + static byte var_33 = (byte)(70); + static int var_35 = (-1440412063); + static int var_38 = (1797367356); + static byte var_44 = (byte)(58); + static int [][][] var_50 = {{{(1646067067),(-1500790673),(1631355751),(-1694227395),(-1775121482)},{(-1821404614),(763046592),(1237747169),(-1797636100),(-2102930538)},{(1838023310),(-834713908),(622431967),(697107478),(1746487570)},{(258721938),(-1276517463),(1597107784),(-2058227154),(132702363)},{(1016769790),(-1537223326),(-795836832),(-813153693),(-1555687673)},{(254939675),(-780254101),(1556081820),(-912298428),(-2120713682)}},{{(-386868680),(-478307921),(168222294),(-1387652623),(1292274154)},{(-1099291204),(1013592081),(1524649111),(953726096),(1987609272)},{(-1736627644),(1451112113),(344949374),(-1482648264),(-1389626416)},{(-44305773),(1484560051),(1282973556),(173497103),(-2075015010)},{(403340627),(-938055759),(230316402),(1065057368),(1755245011)},{(469151656),(125673001),(-534214667),(-471535690),(-282911447)}}}; + static short var_62 = (short)(26736); + static cl_1 var_64 = new cl_1(); + static int [][] var_65 = {{(1218955604),(1491591766),(-39907183),(38633093),(73014700),(-1407251873),(350108667)},{(-934205158),(572062197),(1347641422),(-1537853829),(143957500),(1722408044),(-87162235)},{(1545603086),(-742117353),(778333391),(514410337),(1772179143),(-1037197696),(1057048729)},{(-406314735),(2006291083),(-1924374466),(-333039093),(-366124291),(699230383),(1195583015)},{(-109034238),(-989257711),(323849577),(-1384614538),(1903395232),(-811789209),(326927369)},{(1894221141),(-365691525),(-1935633205),(-371884458),(-493795169),(-940639614),(-936683309)}}; + static double [][][] var_75 = {{{(1.24176e-69D),(-2.15961e+172D),(2.34966e+51D),(3.53226e+34D),(-2.60446e-185D)},{(1.98478e+52D),(4.64907e+208D),(-4.48667e-56D),(6.846e-35D),(-2.56046e-17D)},{(1.91312e+257D),(3.91649e-128D),(-1.50286e-222D),(-7.73463e+176D),(1.08695e+305D)}},{{(-2.25956e+64D),(-3.1363e-126D),(-8.87002e+132D),(1.73293e-173D),(-1.1238e-247D)},{(-1.00811e+57D),(-9.96782e+268D),(-2.99473e-179D),(8.21936e+304D),(-2.46791e-239D)},{(-4.27386e+36D),(-6.4289e-242D),(-2.59455e+187D),(5.03049e+128D),(8.22755e-93D)}},{{(-3.66615e-95D),(-2.07732e+198D),(-4.66163e+204D),(-2.22454e-81D),(-5.22559e+156D)},{(-3.78621e+142D),(3.41283e+17D),(-7.90845e-140D),(2.31207e-220D),(5.73813e-99D)},{(1.64264e+105D),(7.03304e-89D),(-1.08269e-232D),(2.71862e+26D),(-1.78778e-31D)}},{{(-7.59954e-48D),(1.71787e+200D),(-6.87564e+39D),(5.98799e-258D),(3.18499e-204D)},{(8.09845e-293D),(4.43299e+111D),(9.62612e+41D),(-1.7675e-83D),(1.08857e-141D)},{(-4.18297e+273D),(6.25051e+68D),(-4.91945e-127D),(1.08482e-117D),(-4.69438e+186D)}},{{(1.93187e-292D),(1.54281e-45D),(-2.69359e-143D),(-9.83465e-27D),(1.90198e-94D)},{(3.2593e+203D),(1.90089e+134D),(4.87222e-163D),(-2.00338e+93D),(3.32968e-221D)},{(-5.08041e+268D),(7.27973e-07D),(-1.0625e+72D),(-3.17599e-215D),(1.1937e+30D)}},{{(-5.00753e-131D),(-2.47033e+235D),(-3.39192e+75D),(1.01879e+171D),(1.62461e-183D)},{(49.5847D),(-5.82115e+56D),(2.44198e+162D),(2.22223e-252D),(-8.41841e+157D)},{(-3.84403e+48D),(-4.15733e-291D),(-5.70687e+85D),(-1.17984e-16D),(8.67572e-159D)}},{{(1.13767e+173D),(-4.34271e-52D),(1.25419e+132D),(-1.48822e+47D),(-4.50394e-67D)},{(-9.1672e+304D),(-1.89051e+273D),(-8.30402e-172D),(2.51221e-297D),(-3.51496e+189D)},{(1.95969e-258D),(-1.69838e+169D),(8.73622e-261D),(1.5707e+294D),(1.29394e+149D)}}}; + static short var_76 = (short)(29252); + static double var_77 = (-2.00595e+290D); + static int var_79 = (-2070279700); + static float var_92 = (3.42789e-18F); + static double var_108 = (-1.3805e+112D); + static cl_24 var_113 = new cl_24(); + static cl_24 var_114 = new cl_24(); + static boolean [][][] var_116 = {{{false,true,true,true,true},{true,false,false,false,false},{false,true,false,false,false},{false,true,true,false,true},{false,true,false,false,false},{true,true,true,false,false}},{{false,false,true,true,true},{true,true,false,true,true},{true,false,true,true,false},{true,true,false,false,true},{false,true,true,true,true},{false,true,false,true,false}},{{false,false,false,true,true},{true,true,false,false,false},{true,false,true,true,false},{true,true,false,false,true},{false,true,false,false,false},{true,true,false,false,false}},{{true,false,true,false,false},{true,true,true,false,false},{false,false,true,false,false},{true,false,true,false,false},{false,false,false,true,true},{false,false,false,true,true}},{{false,true,true,true,false},{false,false,true,false,false},{false,false,true,false,true},{false,true,true,false,false},{false,false,true,false,true},{false,false,false,true,true}},{{false,false,true,true,true},{false,false,true,true,false},{true,false,false,true,true},{true,true,false,false,true},{false,true,true,true,true},{true,false,false,false,true}},{{true,true,false,false,true},{false,true,false,false,true},{true,false,false,false,true},{true,false,true,true,false},{false,false,true,false,false},{false,false,true,true,false}}}; + static int var_131 = (-275309498); + static cl_24 var_135 = new cl_24(); + static int var_150 = (-1218799871); + static int var_155 = (-1493210235); + static cl_24 var_157 = new cl_24(); + final short var_159 = (short)(-21482); + float [] var_165 = {(-1.08801e-34F),(-6.42932e+13F)}; + int var_167 = (209561362); + byte var_168 = (byte)(87); + int var_178 = (493231903); + final byte var_180 = (byte)(-47); + long var_183 = (7132151217229649122L); + int var_184 = (-1918562318); + byte var_191 = (byte)(-120); + final short var_192 = (short)(-2132); + byte var_194 = (byte)(65); + int var_203 = (-411054485); + short var_204 = (short)(-20972); + cl_24 var_208 = new cl_24(); + int var_212 = (-176911921); + byte var_215 = (byte)(-103); + float var_218 = (-8.50647e+13F); + byte var_219 = (byte)(-83); + boolean var_221 = false; + double [][] var_230 = {{(-2.09909e+188D),(-1.01736e+142D),(1.5705e+187D),(8.30763e+185D),(7.88448e+130D)},{(-5.96452e-50D),(7.9929e-277D),(6.80465e-90D),(1.1336e-77D),(-2.9121e+57D)},{(-2.77578e+279D),(-8.82969e+19D),(-2.235e+208D),(3.35703e+13D),(-3.9021e-243D)}}; + byte var_235 = (byte)(-19); + byte var_238 = (byte)(-96); + byte var_242 = (byte)(72); + byte var_249 = (byte)(-58); + short var_264 = (short)(-15960); + int var_266 = (-1078439361); + byte var_271 = (byte)(58); + byte var_283 = (byte)(-66); + byte var_284 = (byte)(82); + byte var_286 = (byte)(86); + int [][] var_295 = {{(1641108262),(-773819316),(-984411933),(1208218173),(1588236766),(1010299561),(-548961303)},{(434256693),(1534905001),(1464129374),(1039621772),(-1427661000),(-781448334),(-390012070)},{(919550517),(1435665648),(-1426047807),(-1548250250),(-1737669650),(156553861),(1308041245)},{(-1660676351),(724430727),(1695336574),(-583422028),(-178900175),(598930675),(960071213)},{(1095547424),(-153117393),(1243647685),(-647302012),(-1839608096),(610312979),(1711937142)}}; + int var_298 = (-593734398); + cl_1 var_299 = new cl_1(); + cl_1 var_300 = new cl_1(); + final cl_1 var_301 = new cl_1(); +/*********************************/ +public strictfp void run() +{ + int var_7 = (720815182); + final cl_1 var_302 = new cl_1(); + try + { + int var_2 = (-316579458); + var_0 = var_0 ; + float var_287 = (1.43919e-11F); + short var_291 = (short)(26995); + byte var_6 = (byte)(-94); + for( var_2 = 105 ;(var_2<117);var_2 = (var_2+4) ) + { + short var_5 = (short)(31615); + var_4[((+(--var_6))&5)][((var_5++)&4)] = (((var_7--)*func_8((var_287--) ,var_0.var_289 ,(var_291++)))&var_0.var_36) ; + } + } + catch( java.lang.IllegalArgumentException myExp_293 ) + { + try + { + if( (!(!((var_76--)<=( ( byte )(--var_194) ))))) + { + byte var_296 = (byte)(108); + var_295[4][((--var_131)&6)] = (var_296++) ; + } + } + catch( java.lang.IllegalArgumentException myExp_297 ) + { + for( var_298 = 652 ;(var_298>645);var_298 = (var_298-7) ) + { + var_64 = var_64 ; + } + System.out.println("hello exception 1 !"); + } + System.out.println("hello exception 0 !"); + } + return ; +} +public strictfp int func_8(double var_9, boolean[][][] var_10, long var_11) +{ + if( func_12()) + { + int [] var_161 = {(-883464311),(1500965461)}; + if( ((var_33++)>=var_159)) + { + int var_160 = (-929198775); + for( var_160 = 716 ;(var_160>708);var_160 = (var_160-2) ) + { + short var_162 = (short)(22069); + var_161[(var_160&1)] = (var_162--) ; + } + } + else + { + byte var_163 = (byte)(37); + try + { + var_161[((((--var_163)+var_44)|var_33)&1)] = ((++var_163)*var_155) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_164 ) + { + var_114.var_166 = (!((+(var_44--))>=var_167)) ; + System.out.println("hello exception 2 !"); + } + } + } + byte var_177 = (byte)(-62); + byte var_226 = (byte)(-26); + byte var_285 = (byte)(-61); + byte var_181 = (byte)(-33); + final cl_24 var_261 = new cl_24(); + int var_175 = (1227586298); + short var_276 = (short)(19210); + cl_24 var_240 = new cl_24(); + cl_24 var_278 = new cl_24(); + cl_24 var_281 = new cl_24(); + short var_187 = (short)(22571); + byte var_217 = (byte)(-93); + byte var_267 = (byte)(-80); + int var_206 = (-347946942); + int var_228 = (-647123031); + cl_24 var_251 = new cl_24(); + int var_211 = (-72452547); + short var_263 = (short)(-4860); + float var_256 = (8.14478e+18F); + byte var_171 = (byte)(108); + int var_220 = (-142667540); + double [][][] var_265 = {{{(3.29972e+73D),(2.09677e+91D),(7.46705e-207D),(5.67985e-98D)},{(1.08549e-80D),(-1.17622e-149D),(-9.37415e-48D),(2.4859e+155D)}},{{(1.0608e-88D),(7.63853e+277D),(3.20506e-226D),(-1.20795e+170D)},{(6.42246e+151D),(-1.58572e+156D),(7.84018e+28D),(-2.29433e-26D)}},{{(3.59106e+171D),(-1.12689e+105D),(-5.57464e+211D),(-5.07465e-179D)},{(-4.61622e-77D),(6.7125e+209D),(4.84024e-107D),(-8.00923e+123D)}},{{(-2.19163e-44D),(6.86761e-228D),(8.83001e+196D),(-9.7619e-246D)},{(1.37864e+177D),(-6.54921e+50D),(5.5819e+234D),(-1.68912e+75D)}},{{(-7.7665e+266D),(6.24773e-17D),(100893D),(8.61928e+158D)},{(-4.59883e+55D),(-2.78132e-191D),(6.63196e-254D),(3.31571e+187D)}},{{(2.11394e+25D),(-2.7697e-126D),(-1.01584e-167D),(8.16601e-285D)},{(-1.92596e+53D),(1.02338e+247D),(1.90999e+71D),(2.04964e+191D)}}}; + byte var_258 = (byte)(123); + short var_214 = (short)(-13219); + short var_275 = (short)(-4028); + byte var_210 = (byte)(60); + short var_189 = (short)(2407); + byte var_273 = (byte)(-94); + byte var_179 = (byte)(-86); + float var_213 = (1.04157e-29F); + byte var_254 = (byte)(-27); + short var_173 = (short)(-23089); + int var_182 = (-1264998964); + double [][][] var_202 = {{{(1.02311e+291D),(-5.68257e-52D),(-1.00221e+36D),(2.93319e+134D),(2.20319e-201D),(-7.25958e-62D)},{(1.54453e-153D),(1.66465e-61D),(2.08971e+288D),(-7.74707e-36D),(-3.45903e-48D),(-5.85703e-230D)},{(-2.00924e+296D),(2.38739e+29D),(3.34679e+138D),(1.50944e-269D),(-1.14124e-20D),(-7.81796e-254D)},{(2.62095e+97D),(-7.34198e+176D),(3.73066e+10D),(-5.6697e+37D),(-1.93112e+279D),(8.61174e+148D)},{(5.15632e+101D),(9.27348e-54D),(2.03356e+137D),(1.72075e+193D),(-2.96934e-265D),(-2.99904e-162D)}},{{(-1.84901e+215D),(2.45853e+279D),(-4.15621e+237D),(3.67316e-153D),(7.73304e+257D),(0.00202057D)},{(3.37481e-105D),(-2.29497e+240D),(-2.49742e-39D),(4.93324e-29D),(-4.49599e-64D),(1.50923e+55D)},{(2.51683e-203D),(-9.04181e-34D),(-1.61751e+279D),(-1.93246e-255D),(3.31018e-12D),(2.71263e+205D)},{(-6.85681e+100D),(7.028e+267D),(4.85121e-207D),(4.60746e-180D),(3.11678e+88D),(-3.96464e+154D)},{(7.22778e+265D),(4.62469e+127D),(-1.41295e-150D),(-3.68575e-280D),(-4.01806e-266D),(5.03958e+95D)}},{{(3.8871e+178D),(-2.2981e+248D),(2.0392e-112D),(-9.66126e-244D),(-5.16941e+81D),(-3.32807e-304D)},{(-1.56446e-38D),(-3.30725e-282D),(5.66015e+20D),(2.54913e-203D),(-1.02121e+65D),(-5.74995e-303D)},{(-3.72073e+205D),(2.04924e+127D),(3.76139e-143D),(5.69776e+191D),(2.68552e+279D),(1.29197e-161D)},{(4.80078e-187D),(-1.8246e-62D),(4.30155e-266D),(3.60739e+277D),(-1.18122e-285D),(-99840.6D)},{(-6.46702e+223D),(0.000451589D),(4.24117e-144D),(-1.22714e+84D),(-1.6135e+189D),(-6.09237e-150D)}},{{(9.09594e-282D),(-2.57279e+296D),(1.07569e+270D),(3.50769e+15D),(4.97944e+260D),(4.29126e-163D)},{(3.765e-61D),(-1.71937e+76D),(8.41237e+267D),(1.08757e-214D),(-1.21171e+106D),(1.34635e-114D)},{(-1.22612e-291D),(5.26435e+118D),(-1.09941e-152D),(1.75908e+53D),(-3.32347e+134D),(-4.29131e-144D)},{(5.00851e+126D),(-6.47405e+166D),(4.78519e-262D),(-1.01453e-178D),(-6.67142e-08D),(-1.75451e-19D)},{(-1.05517e+257D),(-4.46401e+123D),(1.76873e+264D),(1.59967e-254D),(-6.09091e+127D),(1.58147e-138D)}},{{(-7.75001e+278D),(2.68675e+280D),(-1.27034e+91D),(-7.83808e+149D),(-1.17591e+64D),(-1.72905e-86D)},{(1.30291e+170D),(-2.49523e-50D),(-2.30371e-229D),(2.63579e+53D),(2.45001e+197D),(-2.63968e+54D)},{(-1.18322e-60D),(2.0721e-290D),(1.83767e+75D),(-1.01807e+225D),(2.06955e-35D),(7.85481e+83D)},{(8.32053e+68D),(1.01395e+46D),(2.50567e-118D),(8.04452e+195D),(-9.11575e+52D),(4.00506e-262D)},{(-9.47283e-302D),(3.32658e-305D),(-1.64997e-224D),(-1.88081e-08D),(2.21124e+26D),(-7.7729e-287D)}},{{(-1.40223e+103D),(2.76162e-301D),(8.81848e+198D),(8.58504e+296D),(-7.60337e-91D),(-2.63549e+261D)},{(8.7263e+21D),(-2.00533e+293D),(-9.24001e+208D),(9.74359e-93D),(3.27678e-292D),(1.27657e-65D)},{(6.21009e-282D),(-2.02402e-206D),(4.51014e+114D),(1.21225e-209D),(9.66593e+171D),(1.5747e+180D)},{(1.95928e+96D),(7.75551e+49D),(-2.16715e-304D),(-5.87708e+279D),(-4.89312e+177D),(-2.05325e-126D)},{(-1.18359e-260D),(-1.68953e+116D),(9.27162e-170D),(-4.58535e+31D),(-1.81937e+167D),(3.69309e+252D)}}}; + byte var_185 = (byte)(-1); + byte var_216 = (byte)(-15); + return func_25(((var_155--)*var_0.var_43) ,(((var_76--)%var_159)>=var_92) ,((--var_168)+func_25((var_11--) ,func_12() ,(--var_171) ,(~(var_173--)) ,(++var_175) ,((--var_177)|func_25(var_75[(((var_44--)|func_25((~(var_179--)) ,(!(!(!((var_76++)==var_180)))) ,((var_181++)*var_168) ,(var_182++) ,(var_183++) ,(+(+(var_150--))) ,var_113))&6)][((var_62--)&2)][((var_178--)&4)] ,var_10[((var_210--)&3)][(((++var_33)&func_25((((--var_185)-var_113.var_47)-( ( byte )(((++var_33)&var_168)*var_0.var_89) )) ,(!((-(++var_187))==var_0.var_34)) ,((--var_189)*func_25((+((var_168--)|var_22.var_51)) ,((-(--var_191))==var_192) ,(var_194--) ,var_92 ,(var_194--) ,(++var_62) ,var_135)) ,var_92 ,var_202[5][((var_204++)&4)][((~(--var_203))&5)] ,(-(var_206--)) ,var_208))&0)][((++var_184)&3)] ,(var_211--) ,((-(var_212++))-var_92) ,(var_213++) ,var_50[((((var_217--)-func_25((var_218++) ,(!((-(((var_219++)|var_220)-func_25((var_1++) ,(((--var_194)<=var_135.var_51)!=var_221) ,func_25((+(var_108--)) ,var_221 ,func_25((5.60391e-173D) ,(!((~(++var_62))>(1.81795e+237D))) ,(var_226--) ,(var_228--) ,var_230[2][4] ,( ( int )(-5986228672998543887L) ) ,var_135) ,((var_235++)+( ( long )(1223224572) )) ,( ( double )(++var_76) ) ,var_50[((--var_215)&1)][5][((-(++var_238))&4)] ,var_240) ,(-(--var_242)) ,(--var_203) ,(++var_242) ,var_114)))!=var_77)) ,func_25((var_183++) ,((--var_242)var_1))) ,((--var_219)+var_0.var_89) ,var_157.var_147 ,(++var_9) ,(~(--var_249)) ,var_251)) ,(((--var_254)*(byte)(35))|var_113.var_51) ,(var_256--) ,(++var_258) ,(var_191--) ,var_261) ,(((--var_263)&var_64.var_36)*var_0.var_14) ,(3.03701e+179D) ,(--var_264) ,var_113))&func_25(var_265[((-(++var_267))&5)][((+(--var_242))&1)][((var_266++)&3)] ,(!(!(!(!(!(var_64.var_34var_22.var_47) ,(var_33++) ,(~(var_74--)) ,var_75[((+(var_74--))&6)][((-(var_76++))&2)][(((var_33--)|var_44)&4)] ,((+(--var_33))*func_25(((--var_74)/( ( short )(var_44++) )) ,((((--var_74)|func_25(var_77 ,((--var_79)<( ( short )(var_80--) )) ,(-(var_74++)) ,((-(var_80--))-var_64.var_14) ,((++var_76)/var_62) ,(var_44++) ,var_22))=func_25((var_145--) ,((--var_44)>=var_135.var_147) ,(-243533800) ,(var_150--) ,(~(++var_152)) ,((--var_154)&var_155) ,var_157)); +} +public static strictfp cl_1 func_16(int[][] var_17, long var_18, boolean[][][] var_19, double var_20, double var_21) +{ + short var_24 = (short)(-9069); + short var_61 = (short)(-27251); + byte var_63 = (byte)(34); + short var_60 = (short)(12711); + var_22.var_23 = ((var_24--)-func_25((--var_44) ,((var_60--)<( ( float )(+(var_61--)) )) ,var_0.var_52 ,((--var_38)+var_62) ,( ( double )var_22.var_23 ) ,(+(var_63++)) ,var_22)) ; + return var_64; +} +public static strictfp int func_25(double var_26, boolean var_27, int var_28, float var_29, double var_30, int var_31, cl_24 var_32) +{ + if( (!(!(!(((var_33--)&var_0.var_34)774);var_35 = (var_35-4) ) + { + var_0.var_36 = var_0.var_36 ; + if( ((++var_33)!=var_22.var_37)) + { + boolean var_39 = false; + } + try + { + boolean var_42 = false; + var_29 = (var_29++) ; + var_0.var_40 = ((++var_41)<=var_1) ; + cl_1 var_45 = new cl_1(); + var_22 = var_22 ; + var_26 = ((++var_44)-var_30) ; + var_41 = (((var_46++)-var_22.var_47)*(7961291087331233053L)) ; + float [][] var_49 = {{(-1.13524e+14F),(-1.49954e-14F),(9.16699e-35F),(7.0956e-20F),(-2.78171e+37F),(-3.35008e-15F),(-1.88604e-17F)},{(-2907.84F),(1.7084e-21F),(-5.36987e-14F),(-1.60197e-32F),(5.19258e-06F),(-7.12184e-19F),(-1.90575e+06F)},{(-2.06812e+32F),(-2.81712e-34F),(1.66325e-23F),(1.85117e+28F),(-4.46443e+23F),(8.32618e-11F),(-9.60553e-09F)},{(1.86777e+22F),(-3.08157e-28F),(-48609.6F),(-3.03833e-30F),(-1.37961e+36F),(7.09154e+16F),(2.35417e+06F)},{(1.22402e-16F),(3.70626e+06F),(-9.14643e+21F),(1.64714e-09F),(-1.11389e+17F),(-1.83904e-28F),(1.61609e+36F)},{(1.25589e-15F),(-1.77704e-12F),(1.68546e-25F),(2.36771e-31F),(-1.75494e-13F),(1.90368e-19F),(-49576.2F)}}; + float [][] var_57 = {{(1.6999e-28F),(1.93293e-10F),(1.81311F),(26.3609F),(2.71982e+10F)}}; + var_49[(((var_46++)*var_0.var_52)&5)][(((--var_33)*( ( byte )var_50[((var_33--)&1)][((var_38--)&5)][(((var_46--)&var_22.var_51)&4)] ))&6)] = (var_29--) ; + double [] var_54 = {(-5.39466e+302D)}; + var_54[((~(var_55--))&0)] = (var_55++) ; + var_57[((((--var_46)-var_0.var_52)|var_28)&0)][(((var_44--)|( ( int )(var_31--) ))&4)] = ((var_28--)|var_0.var_52) ; + } + catch( java.lang.IllegalArgumentException myExp_58 ) + { + var_22 = var_22 ; + System.out.println("hello exception 7 !"); + } + } + } + short var_59 = (short)(98); + return (var_59--); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2175); + CrcCheck.ToByteArray(this.var_0.GetChecksum(),b,"var_0.GetChecksum()"); + CrcCheck.ToByteArray(this.var_1,b,"var_1"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_4[a0][a1],b,"var_4" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_22.GetChecksum(),b,"var_22.GetChecksum()"); + CrcCheck.ToByteArray(this.var_33,b,"var_33"); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + CrcCheck.ToByteArray(this.var_38,b,"var_38"); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_50[a0][a1][a2],b,"var_50" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_64.GetChecksum(),b,"var_64.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_65[a0][a1],b,"var_65" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_75[a0][a1][a2],b,"var_75" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_92,b,"var_92"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_113.GetChecksum(),b,"var_113.GetChecksum()"); + CrcCheck.ToByteArray(this.var_114.GetChecksum(),b,"var_114.GetChecksum()"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_116[a0][a1][a2],b,"var_116" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_131,b,"var_131"); + CrcCheck.ToByteArray(this.var_135.GetChecksum(),b,"var_135.GetChecksum()"); + CrcCheck.ToByteArray(this.var_150,b,"var_150"); + CrcCheck.ToByteArray(this.var_155,b,"var_155"); + CrcCheck.ToByteArray(this.var_157.GetChecksum(),b,"var_157.GetChecksum()"); + CrcCheck.ToByteArray(this.var_159,b,"var_159"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_165[a0],b,"var_165" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_167,b,"var_167"); + CrcCheck.ToByteArray(this.var_168,b,"var_168"); + CrcCheck.ToByteArray(this.var_178,b,"var_178"); + CrcCheck.ToByteArray(this.var_180,b,"var_180"); + CrcCheck.ToByteArray(this.var_183,b,"var_183"); + CrcCheck.ToByteArray(this.var_184,b,"var_184"); + CrcCheck.ToByteArray(this.var_191,b,"var_191"); + CrcCheck.ToByteArray(this.var_192,b,"var_192"); + CrcCheck.ToByteArray(this.var_194,b,"var_194"); + CrcCheck.ToByteArray(this.var_203,b,"var_203"); + CrcCheck.ToByteArray(this.var_204,b,"var_204"); + CrcCheck.ToByteArray(this.var_208.GetChecksum(),b,"var_208.GetChecksum()"); + CrcCheck.ToByteArray(this.var_212,b,"var_212"); + CrcCheck.ToByteArray(this.var_215,b,"var_215"); + CrcCheck.ToByteArray(this.var_218,b,"var_218"); + CrcCheck.ToByteArray(this.var_219,b,"var_219"); + CrcCheck.ToByteArray(this.var_221,b,"var_221"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_230[a0][a1],b,"var_230" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_235,b,"var_235"); + CrcCheck.ToByteArray(this.var_238,b,"var_238"); + CrcCheck.ToByteArray(this.var_242,b,"var_242"); + CrcCheck.ToByteArray(this.var_249,b,"var_249"); + CrcCheck.ToByteArray(this.var_264,b,"var_264"); + CrcCheck.ToByteArray(this.var_266,b,"var_266"); + CrcCheck.ToByteArray(this.var_271,b,"var_271"); + CrcCheck.ToByteArray(this.var_283,b,"var_283"); + CrcCheck.ToByteArray(this.var_284,b,"var_284"); + CrcCheck.ToByteArray(this.var_286,b,"var_286"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_295[a0][a1],b,"var_295" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_298,b,"var_298"); + CrcCheck.ToByteArray(this.var_299.GetChecksum(),b,"var_299.GetChecksum()"); + CrcCheck.ToByteArray(this.var_300.GetChecksum(),b,"var_300.GetChecksum()"); + CrcCheck.ToByteArray(this.var_301.GetChecksum(),b,"var_301.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/3636_2018110811698/Start.java b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..2aac91e5c75e43b77a54e80077682745db39ca5f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_24.java CrcCheck.java cl_1.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/3636_2018110811698/cl_1.java b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/cl_1.java new file mode 100644 index 0000000000000000000000000000000000000000..a3085bfd48c66e7f17dcb6165bf3687714c3d0e4 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/cl_1.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=87166108 + +import java.util.zip.CRC32; + +class cl_1 +{ + float var_14 = (-4.38136e-31F); + byte var_34 = (byte)(106); + long var_36 = (1531311117969934958L); + boolean var_40 = true; + double var_43 = (-1.96711e-88D); + int var_52 = (-1476327195); + short var_89 = (short)(2467); + final boolean [][][] var_289 = {{{true,true,true,true}},{{true,true,false,true}},{{true,true,false,false}},{{true,false,false,false}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(44); + CrcCheck.ToByteArray(this.var_14,b,"var_14"); + CrcCheck.ToByteArray(this.var_34,b,"var_34"); + CrcCheck.ToByteArray(this.var_36,b,"var_36"); + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_289[a0][a1][a2],b,"var_289" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/3636_2018110811698/cl_24.java b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/cl_24.java new file mode 100644 index 0000000000000000000000000000000000000000..898ef0bb6214614567d435e216f4e82075d0302a --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/3636_2018110811698/cl_24.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=87166108 + +import java.util.zip.CRC32; + +class cl_24 +{ + int var_23 = (-431562253); + double var_37 = (4.81147e+83D); + short var_47 = (short)(11183); + byte var_51 = (byte)(-58); + boolean [][][] var_67 = {{{true,false,true,true,false},{false,false,false,false,true},{false,false,false,false,true},{false,false,false,false,true},{false,true,true,true,false},{true,true,true,false,false}},{{false,false,false,false,false},{false,false,true,false,false},{true,false,false,false,true},{false,false,true,true,true},{true,true,false,false,false},{true,false,false,true,true}},{{true,false,true,false,true},{false,false,true,true,false},{true,true,false,true,false},{true,true,true,false,false},{false,false,false,true,true},{true,true,true,false,false}},{{true,true,false,true,false},{false,false,true,true,false},{true,false,false,true,true},{true,true,false,true,true},{true,true,true,false,true},{true,false,false,true,true}},{{false,true,false,true,true},{true,false,true,false,false},{true,true,false,false,false},{true,true,true,true,false},{false,true,false,true,true},{true,false,true,false,true}},{{false,false,true,true,false},{false,true,true,false,true},{true,true,true,false,true},{false,false,false,false,false},{false,true,false,false,false},{true,false,true,false,true}},{{false,true,true,false,true},{true,true,false,true,false},{false,true,true,false,true},{false,true,false,false,true},{false,true,false,true,false},{false,false,false,false,true}}}; + long var_118 = (3831756633247288239L); + float var_147 = (1.59305e-28F); + boolean var_166 = true; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(238); + CrcCheck.ToByteArray(this.var_23,b,"var_23"); + CrcCheck.ToByteArray(this.var_37,b,"var_37"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_51,b,"var_51"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_67[a0][a1][a2],b,"var_67" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_118,b,"var_118"); + CrcCheck.ToByteArray(this.var_147,b,"var_147"); + CrcCheck.ToByteArray(this.var_166,b,"var_166"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4381_2018110811800/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/4381_2018110811800/MainClass.java b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..b4a04f1a2dbbb45dc86f8808cd0d7f8c67f71978 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/MainClass.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4093507686 + +import java.util.zip.CRC32; + +class MainClass +{ + static short var_1 = (short)(-18554); + static boolean [][][] var_20 = {{{false,true,false},{false,false,false},{false,true,true},{true,true,true}}}; + static byte var_23 = (byte)(-1); + static int var_32 = (-1469396647); + static byte var_33 = (byte)(30); + static cl_11 var_39 = new cl_11(); + final static cl_13 var_42 = new cl_13(); + static cl_13 var_45 = new cl_13(); + static int var_46 = (1526218865); + static long var_50 = (-7885060060634321423L); + boolean var_53 = true; + static float var_58 = (1.59143e-19F); + static double var_60 = (9.93374e-48D); + static int var_62 = (1628689316); + final int [] var_66 = {(-871649397),(-123955740),(-587084003),(-1148469159),(-2016120266),(1456598550),(-447945298)}; + static boolean var_71 = true; + static short var_75 = (short)(-7606); + static byte var_86 = (byte)(69); + static byte var_87 = (byte)(-97); + static cl_11 [] var_89 = {new cl_11(),new cl_11()}; + static short var_93 = (short)(22964); + static double [][] var_99 = {{(3.19428e-177D),(-1.2142e-194D)}}; + double [][] var_102 = {{(-1.56616e+187D),(1.9898e+273D),(-8.13986e+45D),(-1.99465e-17D),(1.54371e+65D),(7.06877e-73D),(3.12563e+48D)},{(-2.36442e-269D),(-5.77165e+145D),(-1.19267e+22D),(3.29319e-88D),(8.78249e-23D),(3.78155e-82D),(-1.09629e-38D)},{(-1.31005e-132D),(-1.17652e-169D),(1.65977e+188D),(3.0708e-168D),(-8.76503e-45D),(-3.08932e-115D),(-2.89899e+43D)},{(1.08266e-67D),(-2.42792e-213D),(1.66441e-133D),(1.55857e+140D),(3.82857e-305D),(3.29869e+289D),(-3.17466e+67D)}}; + static short var_106 = (short)(-17906); + byte var_117 = (byte)(31); + byte var_121 = (byte)(16); + float [][][] var_124 = {{{(2.69133e-17F),(-2.56953e-23F),(5.21041e+23F)},{(-2.82018e+35F),(3.10438e+09F),(0.000112332F)},{(-2.10372e+13F),(-1.3586e+14F),(2.83379e-06F)},{(-7.05157e-19F),(-4.32553e-11F),(3.85171F)},{(-110775F),(-5.72279e+29F),(-7.07538e+14F)},{(1.00621e-21F),(5.79258e+23F),(4.21667e-07F)}},{{(-259155F),(9.94172e+21F),(0.027998F)},{(-4.70366e-21F),(8.06428e-06F),(1.64959e-24F)},{(-8.17163e-15F),(2.10347e-32F),(8.52979e-35F)},{(-2.58986e+11F),(-2.79377e+25F),(2.981e+37F)},{(-1.04994e+29F),(4.27262e-18F),(-1.64729e-36F)},{(-2.4942e+28F),(0.833689F),(-3.17905e-07F)}},{{(-1.33465e-31F),(5.85699e-27F),(-0.000354863F)},{(5.48419e+28F),(9.37686e-35F),(3.2285e+29F)},{(-3.54556e+31F),(-1.15146e+32F),(2.59869e-27F)},{(-63283.3F),(-1.11247e+32F),(0.0609055F)},{(108.847F),(6.98045e+21F),(-9.64546e+29F)},{(-6.10195e+23F),(-4.60272e+16F),(-5.96782e+29F)}},{{(-2.41585e-27F),(1.87717e+30F),(1.27396e+31F)},{(6.43841e+24F),(9.96289e-17F),(-4.64932e+17F)},{(3.58821e+37F),(-4.55334e+20F),(-7.91678e-40F)},{(3.4276e-08F),(4.77221e+06F),(5.14417e-32F)},{(1.18997e-16F),(-4.24803e-23F),(-6.45989e-08F)},{(1.51877e-31F),(-1.66388e+25F),(6.05673e+37F)}},{{(3.72389e-33F),(3.08729e-33F),(1.17946e-11F)},{(-3.70405e-31F),(3.51358e-19F),(-2.46427e-32F)},{(913116F),(-1.25626e+38F),(2.58841e-22F)},{(-1.18005e+37F),(-4.91884e+06F),(-4.57944e+37F)},{(-13.3832F),(-2.78673e+17F),(-6.18647e+12F)},{(1.05442e+35F),(-3.44594e+15F),(-9.98019e-38F)}},{{(-56868F),(-1.25467e+11F),(0.0458368F)},{(1.06353e-05F),(-7.40238e+36F),(-2.54784e+13F)},{(-8.51931e-30F),(4.24593e+18F),(1.73258e+37F)},{(-1.08006e-10F),(-8.51783e+23F),(1.50002e-27F)},{(-4.25298e+37F),(-0.00352812F),(6.68066e+31F)},{(1.28265e-20F),(3.10311e-26F),(-6.17447e+07F)}},{{(1.19197e+22F),(-5.47149e-07F),(-3.92241e+26F)},{(-4.43963e+08F),(-9.46784e+06F),(-1.50878e-33F)},{(1.06493e-35F),(1.40752e-11F),(-8.92733e-26F)},{(-1.90264e-06F),(1.51624e+29F),(-3.60011F)},{(-1.20345e+32F),(1.67028e+13F),(-3.13108e+15F)},{(-2.52887e-07F),(6.92887e+28F),(2.10496e-18F)}}}; + double var_135 = (2.88729e+66D); + final float [][][] var_143 = {{{(8.23921e+30F),(7.71804e-11F),(-1.88838e+19F)},{(-5.8986e+34F),(2.45821e+28F),(5.56674e-33F)},{(-236443F),(3.99308e+37F),(-6.31321e-25F)},{(-7.40424e+34F),(-4.42815e+15F),(0.396063F)},{(1.02704e-10F),(-6.48349e-28F),(4.42585e-16F)},{(2.96038e-23F),(-0.047897F),(-5.11287e-17F)}},{{(-2.18563e-10F),(-9.75818e-37F),(2.73901e+22F)},{(-1.18281e+11F),(-1.64571e+19F),(-1.22043e+33F)},{(-3.61626e+13F),(9.03039e-38F),(3.25897e-24F)},{(-5.914e-29F),(-4.35118e+10F),(1.81568e+16F)},{(-1.71993e-31F),(1.26212e+23F),(5.45731e-11F)},{(-2.15148e-30F),(-0.00642953F),(-4.53354e+16F)}},{{(1.43492e+25F),(2.28386e+21F),(-7.33838e+33F)},{(-6.52673e+34F),(-5.80295e-28F),(7.06618e+22F)},{(-15.0342F),(1.33257e-36F),(-2.1487e-12F)},{(5.10137e-08F),(-9.9898e+17F),(-410.63F)},{(-3.26912e-32F),(1.54968e+08F),(3.08818e-16F)},{(-3.37088e+23F),(-1.02029e-38F),(-0.0115683F)}},{{(-1.51733e-05F),(3.54332e+06F),(3.46806e-32F)},{(-1.58203e-32F),(4.86574e-32F),(4.27321e-16F)},{(2.1783e+20F),(-8.56117e-38F),(-1.10281e-11F)},{(5.87902e+23F),(7.2169e+13F),(-2.12088e-14F)},{(66.092F),(-1.99169e-16F),(6.50894e-33F)},{(1.39853e-15F),(1.1181e-29F),(1.52554e+20F)}},{{(-8.85819e-14F),(4.60958e+29F),(7.37695e-25F)},{(-5.23771e-30F),(1.39817e+15F),(2.45733e+17F)},{(-1.23863e-18F),(4.58841e-37F),(6.26877e-16F)},{(-5.41827e-34F),(1.0427e+38F),(-8.46936e+14F)},{(3.04953e-12F),(0.116707F),(6.51825e-31F)},{(5.27269e+08F),(-2.19328e+12F),(-1.92541e+28F)}},{{(1.18628e-30F),(-6.95609e-38F),(-5.64792e-15F)},{(-3.15038e-33F),(-1.24751e-31F),(-2.76922e+17F)},{(-8.23649e-21F),(5.80602e-28F),(-4.24689e+31F)},{(1.30556e+09F),(-1.47807e+28F),(-2.7807e-16F)},{(-4.44821e-25F),(2.46413F),(6.93849e-20F)},{(-1.5392e-22F),(1.40179e-36F),(-8.68441e+24F)}},{{(1.33329e-19F),(2.44995e+37F),(-1.16642e-32F)},{(7.73874e-36F),(1.06686e-35F),(1.34351e-33F)},{(-3.3367e-37F),(-1.9095e+30F),(-7.57579e-10F)},{(2.90419e+38F),(-3.1789e-10F),(-6.27374e-25F)},{(-7.91638e+35F),(-1.02124e+30F),(1.62523e+26F)},{(1.82022e+06F),(6.25649e-36F),(4.25319e+33F)}}}; + final double [] var_149 = {(-2.6199e+219D),(8.0642e-89D),(2.19644e+91D),(-6.65229e-210D),(-3.36464D)}; + float [][] var_154 = {{(-4.58076e+21F)}}; +/*********************************/ +public strictfp void run() +{ + byte var_129 = (byte)(-57); + short var_0 = (short)(-27841); + long var_111 = (6103328048027781300L); + try + { + float var_116 = (-3.10722e-38F); + int var_130 = (1755725896); + byte var_115 = (byte)(120); + byte var_113 = (byte)(112); + if( (((var_0++)-var_1)>=func_2(((var_111++)&var_42.var_112) ,((--var_113)=( ( double )(var_129--) )))))) + { + cl_11 [] var_138 = {new cl_11(),new cl_11()}; + if( (((var_130++)+var_39.var_56)var_39.var_48)) ,(((var_0++)|( ( int )(var_113--) ))>=(short)(-24131))))))) ,(-6.06796e+08F) ,var_71 ,(!((var_135++)!=var_129))))) + { + var_102[((var_115++)&3)][(((var_129--)*var_23)&6)] = ((var_0++)-func_9((var_50--) ,var_138 ,var_42 ,(var_111--) ,(var_62++) ,var_143 ,var_99)) ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_146 ) + { + try + { + int var_147 = (-2029377820); + if( var_20[(((--var_129)&var_62)&0)][((-(++var_147))&3)][((~(--var_33))&2)]) + { + var_45.var_148 = ((var_75++)+( ( double )(var_46--) )) ; + } + else + { + var_99[(((++var_129)&var_46)&0)][((((var_0--)&var_39.var_48)&func_2(((var_1++)*var_45.var_47) ,var_42.var_128 ,((+(var_0--))+var_39.var_56) ,((++var_0)<( ( float )(var_0++) )) ,(!((var_1--)>var_39.var_56))))&1)] = var_149[4] ; + } + } + catch( java.lang.IllegalArgumentException myExp_150 ) + { + try + { + float var_151 = (2.22341e+33F); + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_152 ) + { + var_154[(((++var_93)+var_45.var_57)&0)][((~(--var_0))&0)] = (--var_86) ; + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 1 !"); + } + System.out.println("hello exception 0 !"); + } + return ; +} +public static strictfp int func_2(float var_3, boolean var_4, float var_5, boolean var_6, boolean var_7) +{ + byte var_8 = (byte)(23); + float [][][] var_97 = {{{(-9.80822e+06F),(-6.07664e-15F),(-6.68202e-35F)},{(1.72054e+14F),(5.039e-17F),(3.57066e-09F)},{(9.28844e+21F),(-1.53322e+31F),(1.84844e-10F)},{(1.54752e+33F),(5.004e-20F),(2.90136e-05F)},{(3.51651e+21F),(-2.13249e+29F),(1.28737e-21F)},{(9.64414e+26F),(2.25307e+24F),(-1.24117F)}},{{(5.50298e-20F),(-4.58289e-07F),(-1.54386e+37F)},{(1.42844e+38F),(2.46154e+10F),(0.000417665F)},{(2.74795e-11F),(-4.87078e-17F),(-1.44964e-25F)},{(2.82719e-38F),(9.42998e+08F),(-1.76827e-13F)},{(3.23e-15F),(-6.0324e-06F),(7.7306e+17F)},{(3.25143e-08F),(-5.2617e-18F),(-1.46736e-15F)}},{{(-4.97834e-06F),(-25.9783F),(-2.09624e+37F)},{(0.137071F),(-7.21121e-16F),(-4.77162e+13F)},{(-0.983756F),(-0.000760798F),(2.64574e+31F)},{(-9.87576e+26F),(3.18579e-10F),(2.32089e+24F)},{(3.81617e+12F),(2.1686e+21F),(2.10477e-06F)},{(-3.1787e-13F),(-6.61473e+09F),(-1.46647e+20F)}},{{(-5.56227e-33F),(1.04576e+17F),(1.58966e+27F)},{(6.84575e-33F),(5.39013e-25F),(-7.06798e-06F)},{(-1.90158e-32F),(1.58864e+18F),(5.55199e-30F)},{(-1.2755e-35F),(1.38812e+26F),(8.0507e-07F)},{(1.10553e+09F),(2.60137e-33F),(-1.15839e+20F)},{(-1.63988e+34F),(-1.05221e+26F),(0.146092F)}},{{(1.43341e+18F),(3952.39F),(-5.38502e+25F)},{(15.6201F),(7.5102e+20F),(3.09154e-28F)},{(-3.26027F),(-6.7006e+09F),(-7.95696e+34F)},{(-1.59843e+20F),(-4.63435e+30F),(2.51501e+37F)},{(-3.77352e-05F),(-6.15937e-37F),(-5.01315e-06F)},{(1.87726e+06F),(-5.21176e-10F),(3.26476e+21F)}},{{(-2.84851e-09F),(-9.76661e+14F),(9.5035e-08F)},{(-7.2321e-30F),(1.51387e+20F),(-2.37106e-06F)},{(2.45426e-09F),(1.66693e+11F),(-6.38727e-25F)},{(7.1021e-33F),(-6.4823e+12F),(1.62212e+18F)},{(2.92571e-37F),(-8.47552e+28F),(-3.46705e+15F)},{(4.5018e-33F),(-5.59724e-05F),(4.85556e+20F)}},{{(-2.81572e+21F),(691531F),(1.24793e+29F)},{(-8.4844e+37F),(-4.48034e-10F),(4.35928e-31F)},{(-0.0198917F),(1.45483e-28F),(-0.027737F)},{(-3.93353e-32F),(0.000489359F),(-7.11959e-36F)},{(1.26067e+16F),(-0.195049F),(-1.09692e-20F)},{(4.18281e-22F),(4.1726F),(-7.68174e-36F)}}}; + byte var_95 = (byte)(119); + cl_13 var_91 = new cl_13(); + if( (!(!((-(var_8--))382);var_32 = (var_32-10) ) + { + var_31[((var_33++)&3)] = func_34(var_71 ,var_45.var_73 ,((++var_75)!=var_1)) ; + } + return var_39; +} +public static strictfp int func_34(boolean var_35, float[][][] var_36, boolean var_37) +{ + byte var_38 = (byte)(-28); + int var_69 = (436561457); + boolean [][] var_59 = {{true,true,true,false,false,false},{true,false,true,false,false,true}}; + try + { + int var_44 = (1848658238); + final cl_11 var_55 = new cl_11(); + if( ((--var_38)!=var_39.var_40)) + { + short var_41 = (short)(32612); + var_36[((var_38++)&1)][((+(++var_44))&6)][(((var_41--)-var_42.var_43)&1)] = ((--var_1)|(-33101719)) ; + try + { + float var_51 = (9.38356e-27F); + double var_52 = (-623.082D); + var_45 = var_45 ; + var_36[((--var_41)&1)][((var_46--)&6)][1] = (-(var_38--)) ; + var_36[((+(var_33--))&1)][((((var_44--)&var_39.var_49)&(446068287))&6)][(((var_1++)*var_39.var_48)&1)] = (((var_38--)&var_50)+var_51) ; + var_1 = (short)(18021) ; + var_35 = (!((var_38--)780);var_64 = (var_64-10) ) + { + if( ((var_65++)>=var_1)) + { + var_39.var_40 = var_45.var_67 ; + } + else + { + float var_68 = (-4.16867e-35F); + } + } + System.out.println("hello exception 7 !"); + } + return ((var_69--)*var_45.var_70); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1428); + CrcCheck.ToByteArray(this.var_1,b,"var_1"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_20[a0][a1][a2],b,"var_20" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_23,b,"var_23"); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + CrcCheck.ToByteArray(this.var_33,b,"var_33"); + CrcCheck.ToByteArray(this.var_39.GetChecksum(),b,"var_39.GetChecksum()"); + CrcCheck.ToByteArray(this.var_42.GetChecksum(),b,"var_42.GetChecksum()"); + CrcCheck.ToByteArray(this.var_45.GetChecksum(),b,"var_45.GetChecksum()"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + CrcCheck.ToByteArray(this.var_53,b,"var_53"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_60,b,"var_60"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_66[a0],b,"var_66" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_71,b,"var_71"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_86,b,"var_86"); + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_89[a0].GetChecksum(),b,"var_89" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_93,b,"var_93"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_99[a0][a1],b,"var_99" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_102[a0][a1],b,"var_102" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_106,b,"var_106"); + CrcCheck.ToByteArray(this.var_117,b,"var_117"); + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_124[a0][a1][a2],b,"var_124" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_135,b,"var_135"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_143[a0][a1][a2],b,"var_143" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_149[a0],b,"var_149" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_154[a0][a1],b,"var_154" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4381_2018110811800/Start.java b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..42b3e6380311b05cd61ae367bd893e0982fea080 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_13.java CrcCheck.java cl_11.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/4381_2018110811800/cl_11.java b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/cl_11.java new file mode 100644 index 0000000000000000000000000000000000000000..5d99fd421859bb24f33bfba2439d731bcb9fff60 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/cl_11.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4093507686 + +import java.util.zip.CRC32; + +class cl_11 +{ + double var_40 = (-2.90194e-293D); + final int var_48 = (1150143658); + short var_49 = (short)(5132); + float var_54 = (-3.26437e+07F); + byte var_56 = (byte)(122); + final double [][] var_126 = {{(2.53572e-36D),(-2.49758e+101D)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(35); + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_126[a0][a1],b,"var_126" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4381_2018110811800/cl_13.java b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/cl_13.java new file mode 100644 index 0000000000000000000000000000000000000000..b5b00254fed20a560662502873ef06414216ae85 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4381_2018110811800/cl_13.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4093507686 + +import java.util.zip.CRC32; + +class cl_13 +{ + int var_43 = (-290735559); + float var_47 = (-9.73824e-09F); + short var_57 = (short)(-18176); + final double var_67 = (-1.1249e+78D); + byte var_70 = (byte)(-38); + float [][][] var_73 = {{{(-4.03514e+14F),(0.000291683F)},{(9.27866e-19F),(-2.96779e+15F)},{(-1.41534e+07F),(4.67288e-05F)},{(-4.39985e+13F),(-0.00666687F)},{(4.4928e-26F),(-1.8676e-06F)},{(3.32846e+23F),(3091.18F)},{(1.26916e+37F),(2.25058e-19F)}},{{(-6.644e-37F),(-7.04248e-37F)},{(1.20972e-12F),(-2221.5F)},{(1.87276e-17F),(2219.94F)},{(3.66002e-30F),(1.78455e-33F)},{(-8.8663e-28F),(-3.17405e+27F)},{(-1.86676F),(-2.9793e+28F)},{(-2.80894e+15F),(-8.33024e+33F)}}}; + long var_112 = (-7012547105102853200L); + float [][][] var_114 = {{{(-2.60602e-23F),(1.00299e-09F),(-1.20225e-27F)},{(-4.23153e+16F),(-5.60362e+19F),(1.85628e-38F)},{(1.56057e-06F),(-2.57296e+12F),(-2.33438e-08F)},{(-555.283F),(-1.70998e-28F),(2.59107e+19F)},{(8.17428e+18F),(-1.29733e+32F),(-2.70627e-05F)},{(1.03195e-14F),(440270F),(7.71178e+08F)}},{{(2.62065e+36F),(723649F),(7.99891e-19F)},{(-6.48944e+29F),(-3.49422e-26F),(-5.82777e-36F)},{(-6.7104e-26F),(-5.74346e-15F),(-235.332F)},{(-2.04872e-11F),(-6.23566e-38F),(1.02213e+12F)},{(4.50477e+33F),(-5.03836e+31F),(2.73621e-14F)},{(-7.91225e-07F),(-1.28634e-25F),(-3.80469e-14F)}},{{(6.25646e+33F),(-5.74378e-22F),(-130089F)},{(1.08585e-20F),(9.91357e+22F),(-0.00105807F)},{(-4.93684e-23F),(-2.67872e+12F),(-6.44456e+34F)},{(2.18428e-09F),(-3.21431e-13F),(2.88508e+30F)},{(1.51817e-19F),(-1.13403e+17F),(1.16061e-33F)},{(-5.12732e-14F),(9.93017e+24F),(8.18179e+32F)}},{{(-1.87528e+11F),(3.61224e-07F),(2.27451e+07F)},{(4.47369e-14F),(2.54281e-14F),(-1.40084e+09F)},{(0.00561948F),(-1736.5F),(-252.023F)},{(-7.87662e-10F),(-4.13842e+25F),(-8.57525e+29F)},{(-6.03393e-21F),(-1.48243e+35F),(-2.16053e+15F)},{(1.90587e+22F),(-6.24434e+22F),(4.24747e+06F)}},{{(-3.35917e+24F),(-1.26564e-19F),(9.7409e-37F)},{(-9.57681e+08F),(1.94682e+38F),(-9.20547e-30F)},{(37166.2F),(-3.37687e-15F),(-6.54517e+16F)},{(-1.15309e+38F),(4.87242e-18F),(8.97784e-38F)},{(4.65726e-30F),(-1.66612e+21F),(-2.97216e+33F)},{(-43513.7F),(1.80804e-07F),(1.07923e-09F)}},{{(1.4601e+14F),(-2.20572e-10F),(1.19244e-18F)},{(-7.1086e-06F),(-3.55678e+19F),(4.70936e+17F)},{(-1.33763e+25F),(1.67296e+24F),(-736.13F)},{(-4.71928e+13F),(3.69018e-35F),(-3.94903e+34F)},{(1.93817e-19F),(-1.14414e-29F),(1.13885e-08F)},{(-2.38813e+30F),(2.51638e+09F),(8.99075e+08F)}},{{(4.21722e-35F),(8.36757e+30F),(3.72266e+37F)},{(1.26582e+17F),(-9.18496e+31F),(-1.52847e-15F)},{(1.53948e-37F),(2.39115e+37F),(-4.38372e+28F)},{(-2.10941e+08F),(3.04956e+14F),(-7.49563F)},{(-1.97344e+25F),(-9.10306e+14F),(-5.01733e-19F)},{(6.07552e+22F),(-1.87755e-18F),(-3.35299e+21F)}}}; + boolean var_128 = true; + double var_148 = (-9.97571e+187D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(652); + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_57,b,"var_57"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_73[a0][a1][a2],b,"var_73" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_114[a0][a1][a2],b,"var_114" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_128,b,"var_128"); + CrcCheck.ToByteArray(this.var_148,b,"var_148"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4421_2018110811948/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/4421_2018110811948/MainClass.java b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..dc1bc6d0f84ae85914ddab4eba126069c9434200 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/MainClass.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1738597656 + +import java.util.zip.CRC32; + +class MainClass +{ + byte var_0 = (byte)(-50); + long var_1 = (-5358085371687587993L); + final float var_6 = (-1.17756e-27F); + int var_16 = (94924767); + final cl_12 var_74 = new cl_12(); + cl_30 var_76 = new cl_30(); + cl_30 var_78 = new cl_30(); + final cl_12 [][] var_84 = {{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()}}; + int [][][] var_87 = {{{(324840076),(1186829469)},{(499077826),(-1091824412)},{(678841302),(1363238080)},{(484357644),(-675737966)},{(1858668174),(-1432263588)}},{{(1717444867),(-2110107126)},{(1588252294),(334952646)},{(902369081),(-181211414)},{(-646255100),(-580016631)},{(-1123376797),(-414279041)}},{{(-1850173804),(-1578481267)},{(361564846),(156508094)},{(1689327471),(1394394385)},{(-308564683),(-1020485457)},{(-1393436885),(-724528940)}}}; + int var_91 = (1200421648); + boolean [][] var_103 = {{false},{true},{true},{false}}; + byte var_104 = (byte)(124); +/*********************************/ +public strictfp void run() +{ + int var_120 = (21116490); + long var_117 = (1527991077502234703L); + long [] var_126 = {(-3440038059958223400L),(-2601692075130966864L)}; + try + { + short var_99 = (short)(21924); + try + { + if( (!(!(((--var_0)|var_1)>=func_2(var_74.var_28.var_98 ,(+(var_99--))))))) + { + var_99 = (--var_99) ; + } + } + catch( java.lang.IllegalArgumentException myExp_100 ) + { + int var_101 = (-829622465); + for( var_101 = 645 ;(var_101>617);var_101 = (var_101-7) ) + { + var_103[(((var_99--)-(1213771124))&3)][0] = ((var_104++)==( ( byte )(897125095) )) ; + } + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_105 ) + { + if( (!(!((var_104++)<=var_78.var_52)))) + { + short var_109 = (short)(24922); + try + { + cl_12 [][] var_107 = {{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()},{new cl_12(),new cl_12(),new cl_12()}}; + byte var_106 = (byte)(-51); + var_74.var_28.var_39 = (!(((var_106--)%func_9(var_107 ,((var_109++)+var_16) ,var_74.var_111 ,(var_91++) ,(var_109++) ,(995857102)))==func_9(var_84 ,(var_117--) ,var_87 ,(var_120++) ,(--var_120) ,(var_91--)))) ; + } + catch( java.lang.ArithmeticException myExp_124 ) + { + var_126[1] = (var_91--) ; + System.out.println("hello exception 2 !"); + } + } + else + { + var_74.var_28 = var_78 ; + } + System.out.println("hello exception 1 !"); + } + return ; +} +public strictfp int func_2(long[][] var_3, long var_4) +{ + byte var_8 = (byte)(-63); + short var_89 = (short)(-2272); + int var_97 = (516985664); + try + { + int var_5 = (-1481261170); + if( (!(!((var_5++)!=var_6)))) + { + short var_85 = (short)(-9313); + short var_7 = (short)(-26009); + try + { + var_3[((-((var_8--)|func_9(var_84 ,((--var_85)*var_76.var_86) ,var_87 ,(++var_85) ,(var_1++) ,((var_8++)*var_16))))&6)][((var_7--)&2)] = (var_5--) ; + } + catch( java.lang.IllegalArgumentException myExp_88 ) + { + var_87[((var_89++)&2)][(((var_5++)*var_78.var_52)&4)][1] = ( ( int )var_76.var_64 ) ; + System.out.println("hello exception 3 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_90 ) + { + try + { + try + { + var_78.var_39 = (!((var_91++)>=var_76.var_40)) ; + } + catch( java.lang.IllegalArgumentException myExp_92 ) + { + short var_93 = (short)(14273); + var_87[2][(((var_89++)&var_78.var_40)&4)][((var_93++)&1)] = (-1155198286) ; + System.out.println("hello exception 5 !"); + } + } + catch( java.lang.ArithmeticException myExp_94 ) + { + double [] var_96 = {(1.9857e-52D),(5.76752e-51D),(-2.86473e-123D),(9.42959e-66D),(2.91044e-182D),(3.05333e+91D),(-1.51076e-137D)}; + int var_95 = (679099766); + for( var_95 = 439 ;(var_95<442);var_95 = (var_95+1) ) + { + var_74.var_28.var_54 = (var_8--) ; + } + System.out.println("hello exception 6 !"); + } + System.out.println("hello exception 4 !"); + } + return (--var_97); +} +public strictfp short func_9(cl_12[][] var_10, float var_11, int[][][] var_12, int var_13, long var_14, int var_15) +{ + for( var_16 = 106 ;(var_16<125);var_16 = (var_16+19) ) + { + int var_18 = (-2117136197); + cl_30 var_80 = new cl_30(); + long [][] var_17 = {{(-5431935709065531090L),(4059281764850476659L),(-8799622737425050441L)},{(-6152142338250203718L),(7261434441679103152L),(4463017353207425453L)},{(-8870358870375614432L),(5517477033598843026L),(-6378315056640443254L)},{(-3211050090491440588L),(-3694494815002139183L),(8761414936371765702L)},{(-3416358148203686332L),(746834112480589099L),(-2262245510023008641L)},{(2481589282790031230L),(-42809636202883914L),(4622839057539721244L)},{(-3134979781525769393L),(-4757395864231960952L),(8844198722000689145L)}}; + for( var_18 = 397 ;(var_18<417);var_18 = (var_18+5) ) + { + byte var_75 = (byte)(54); + float [][][] var_82 = {{{(-3.61205e+24F),(-8.7906e-06F),(-0.0311539F),(-2.3103e+09F),(3.55742e+28F)},{(0.077181F),(2.06174e+31F),(1.34032e+14F),(3.97093e+11F),(-1.42608e-35F)},{(-2.22292e-29F),(-0.00592346F),(-1.87634e+12F),(-6.05319e+36F),(-1.53796e+32F)},{(3.39011e-27F),(-1.59148e-21F),(-1.38335e-14F),(1.01693e-10F),(1.26073e-20F)},{(878017F),(-2.00559e+24F),(3.69587e-07F),(-3.63979e+15F),(1.01298e-22F)},{(-1.12273e+15F),(1.03598e-20F),(-2.07654e+13F),(2.7658e+07F),(3.7937e+24F)}}}; + int [][][] var_79 = {{{(1716241598),(-1726874023),(600274726),(-1719365741),(-632674162),(974199692),(54702086)},{(750072318),(428509831),(-1630762330),(1971180356),(1554815114),(-781278827),(1767184350)}},{{(1167565823),(-1727041354),(-1227030243),(-1318722758),(702704994),(-1253428388),(449116773)},{(57056777),(-1428236960),(-1711187655),(-958452605),(-1915253617),(1540623399),(1092650251)}},{{(934647906),(1264013160),(808995639),(-969064706),(1222718348),(-905265079),(1840426132)},{(434385545),(-1731184177),(1742584199),(-643375280),(-1453763061),(169263317),(-1276150416)}},{{(1051678263),(-1647927178),(1224151160),(-1754386078),(269361802),(-1565704756),(1760567786)},{(-994124454),(-331018204),(-1941336299),(-417995021),(-1961000541),(-1894860136),(363973068)}},{{(-1545297561),(519246893),(-1163648859),(1606843026),(485656184),(-967151818),(-1191250621)},{(-1482860163),(-1754649990),(674229102),(-1705527793),(522639033),(-545500692),(-1169117675)}},{{(833548954),(-103456495),(-725231135),(991033237),(-1677267033),(-1801155204),(1917118486)},{(-384999170),(343958643),(840392528),(103491555),(1789700616),(-189328412),(-1519936973)}}}; + int var_83 = (1541353116); + if( var_74.func_19(((var_75++)-var_76.var_52) ,var_76.var_77 ,var_78 ,(var_1--) ,var_79 ,var_80 ,var_78)) + { + var_82[((var_83++)&0)][(((((var_0++)+var_74.var_50)|var_78.var_46)*(-1673694745))&5)][4] = (+((+(var_75++))|var_1)) ; + } + else + { + var_74.var_28.var_40 = var_16 ; + } + } + } + return var_74.var_66; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(338); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + CrcCheck.ToByteArray(this.var_1,b,"var_1"); + CrcCheck.ToByteArray(this.var_6,b,"var_6"); + CrcCheck.ToByteArray(this.var_16,b,"var_16"); + CrcCheck.ToByteArray(this.var_74.GetChecksum(),b,"var_74.GetChecksum()"); + CrcCheck.ToByteArray(this.var_76.GetChecksum(),b,"var_76.GetChecksum()"); + CrcCheck.ToByteArray(this.var_78.GetChecksum(),b,"var_78.GetChecksum()"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_84[a0][a1].GetChecksum(),b,"var_84" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_87[a0][a1][a2],b,"var_87" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_103[a0][a1],b,"var_103" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4421_2018110811948/Start.java b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..bcbda42b66ff6a219a28d5223932768ee8297378 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_30.java cl_12.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/4421_2018110811948/cl_12.java b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/cl_12.java new file mode 100644 index 0000000000000000000000000000000000000000..607348a1ca369e106569013e65b682c1ef16ecbd --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/cl_12.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1738597656 + +import java.util.zip.CRC32; + +class cl_12 +{ + static cl_30 var_28 = new cl_30(); + static short var_38 = (short)(-17025); + static double var_41 = (5.01768e+147D); + static byte var_42 = (byte)(-49); + static long var_48 = (2468010921817869450L); + static int var_50 = (1845796418); + static short var_53 = (short)(-26341); + final double [] var_56 = {(-2.23909e+168D),(-1.01082e+63D),(7.60999e-164D),(5.89834e+66D)}; + static int [] var_58 = {(68067765),(-1024726390),(2093646627)}; + static cl_30 [][] var_61 = {{new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30()},{new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30()},{new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30()},{new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30()}}; + final double var_63 = (-1.47916e-298D); + static short var_66 = (short)(-15183); + final float var_67 = (-0.000364533F); + byte var_68 = (byte)(6); + float var_69 = (1.211e+23F); + short var_70 = (short)(14738); + int [][][] var_111 = {{{(767601144),(-2023030905)},{(-2042873661),(792328492)},{(645898688),(-1419467842)},{(1724562503),(-959171368)},{(115367999),(242221715)}},{{(1257160833),(1563630839)},{(79676133),(818978109)},{(-1057838944),(927751287)},{(-872420788),(2117299224)},{(1726557),(1964547056)}},{{(-1993293973),(2135461696)},{(942614853),(1094488723)},{(-1668762794),(-214494079)},{(-1731014983),(-137075764)},{(-260194198),(638315535)}}}; +/*********************************/ +public strictfp boolean func_19(double var_20, long[][][] var_21, cl_30 var_22, long var_23, int[][][] var_24, cl_30 var_25, cl_30 var_26) +{ + int var_27 = (-841336250); + float var_73 = (0.0106774F); + int var_72 = (2095316341); + for( var_27 = 808 ;(var_27<903);var_27 = (var_27+19) ) + { + int var_71 = (11749725); + var_28 = func_29(var_67 ,(((+((--var_68)-var_28.var_46))+var_67)+( ( float )(var_69++) )) ,var_50 ,(var_70++) ,var_21[((var_50++)&2)][(((var_42++)|var_53)&2)][((++var_71)&3)] ,(--var_72)) ; + } + return (!((-(var_53++))!=var_73)); +} +public static strictfp cl_30 func_29(float var_30, float var_31, int var_32, float var_33, long var_34, long var_35) +{ + byte var_37 = (byte)(-42); + cl_30 var_43 = new cl_30(); + try + { + short var_55 = (short)(22937); + byte var_36 = (byte)(-48); + if( ((+(++var_36))!=(1275921207))) + { + float var_47 = (-6.07152e+10F); + double [][][] var_45 = {{{(8.18416e+156D),(-77376.8D),(-1.8722e+19D),(1.11513e-218D),(3.09068e-97D),(2.9463e+09D)},{(5.77262e-74D),(7376.1D),(-4.11536e+197D),(-4.59461e+54D),(1.13849e+300D),(4.39001e-207D)}},{{(-11710.7D),(1.54046e-258D),(-4.91069e-56D),(5.81588e+155D),(-1.80388e+32D),(2.94257e+147D)},{(-1.56471e+154D),(9.05243e-37D),(-1.60876e+268D),(6.84919e-90D),(-6.58099e-253D),(1.40293e-157D)}},{{(-2.50111e-245D),(-3.8357e+264D),(-5.20327e-148D),(2.73513e-41D),(2.19575e-42D),(2.3085e+266D)},{(2.32362e+147D),(1.63229e-203D),(7.11799e+167D),(1.68688e-13D),(4.324e+192D),(-4.27784e+100D)}},{{(1.61293e+278D),(7.75954e-184D),(3.89356e-58D),(-1.95365e-281D),(-7.01243e+287D),(-4.05454e-231D)},{(7.14859e+233D),(2.69546e+205D),(-5.89208e-11D),(-5.2192e+97D),(-1.32731e+83D),(1.22882e-166D)}},{{(7.02539e-17D),(4.43714e-305D),(-6.74863e-149D),(-2.6694e-136D),(-8.22557e+78D),(-4.14927e-222D)},{(-2.93018e+81D),(3.26838e-06D),(-7.77722e+161D),(8.73733e-118D),(9.01911e-62D),(-9.91872e+63D)}},{{(1.30324e-106D),(1.59712e+112D),(-3.5356e+168D),(2.13007e+281D),(-7.44374e-187D),(3.15207e+149D)},{(4.04519e-29D),(1.01392e+131D),(1.41583e+193D),(-3.42166e-36D),(1.7304e-62D),(-2.48034e-92D)}},{{(3.58616e+47D),(3.83883e-86D),(-5.25015e-135D),(1.11288e-259D),(3.15524e+68D),(-9.13113e+219D)},{(1.52434e+242D),(9.41825e-168D),(5.96479e-245D),(1.41922e-43D),(-8.58261e-52D),(-4.53966e+31D)}}}; + if( (((++var_37)+var_38)<(239817173))) + { + short var_49 = (short)(-21695); + var_28.var_39 = ((--var_37)==var_28.var_40) ; + var_33 = ( ( float )(var_42++) ) ; + var_28 = var_43 ; + var_28 = var_28 ; + var_45[6][(((++var_42)|var_28.var_46)&1)][((var_36--)&5)] = ((var_47++)-var_48) ; + var_45[((var_32--)&6)][((var_50--)&1)][((var_49--)&5)] = (1.68282e+21D) ; + } + else + { + short var_51 = (short)(23547); + var_28 = var_43 ; + var_45[((--var_38)&6)][(((+((++var_51)&var_28.var_52))+var_42)&1)][((++var_38)&5)] = (-(--var_35)) ; + float var_60 = (-3.09963e-23F); + int [] var_59 = {(1188440215),(-906676825),(1040722972)}; + var_45[(((--var_53)-var_38)&6)][((--var_37)&1)][(((var_36--)&( ( byte )(var_32++) ))&5)] = (var_50++) ; + var_45[((((--var_42)-var_42)|var_42)&6)][((var_37--)&1)][(((++var_53)|var_28.var_52)&5)] = (((--var_36)*var_28.var_46)+var_28.var_54) ; + var_38 = (var_55--) ; + var_28.var_57 = var_58 ; + var_58[(((--var_37)+var_28.var_40)&2)] = ((++var_55)-var_50) ; + var_58[((var_32++)&2)] = (~(var_37--)) ; + var_58 = var_59 ; + var_58[((--var_50)&2)] = (~(++var_42)) ; + var_61 = var_61 ; + } + try + { + var_45[((var_50++)&6)][((var_32++)&1)][((-(var_50--))&5)] = (++var_41) ; + } + catch( java.lang.IllegalArgumentException myExp_62 ) + { + var_30 = (((--var_36)-var_48)+var_28.var_64) ; + System.out.println("hello exception 7 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_65 ) + { + if( (!(((var_50--)+(-1.52039e-31D))>=var_41))) + { + if( (((var_37++)+var_53)!=var_32)) + { + var_28.var_54 = (++var_66) ; + } + else + { + var_28 = var_28 ; + } + } + System.out.println("hello exception 8 !"); + } + return var_28; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(410); + CrcCheck.ToByteArray(this.var_28.GetChecksum(),b,"var_28.GetChecksum()"); + CrcCheck.ToByteArray(this.var_38,b,"var_38"); + CrcCheck.ToByteArray(this.var_41,b,"var_41"); + CrcCheck.ToByteArray(this.var_42,b,"var_42"); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + CrcCheck.ToByteArray(this.var_53,b,"var_53"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_56[a0],b,"var_56" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_58[a0],b,"var_58" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_61[a0][a1].GetChecksum(),b,"var_61" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_63,b,"var_63"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_111[a0][a1][a2],b,"var_111" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4421_2018110811948/cl_30.java b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/cl_30.java new file mode 100644 index 0000000000000000000000000000000000000000..10f45f5db2536d99e4ec24b72dc93599671d0665 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4421_2018110811948/cl_30.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1738597656 + +import java.util.zip.CRC32; + +class cl_30 +{ + boolean var_39 = true; + int var_40 = (1611951211); + byte var_46 = (byte)(-43); + short var_52 = (short)(-21298); + double var_54 = (1.17889e-297D); + int [] var_57 = {(-536661324),(16343643),(774393382)}; + long var_64 = (9102588774310969404L); + long [][][] var_77 = {{{(-2511102005351033354L),(-978630090420447661L),(-4835063643337143434L),(4539791564346190241L)},{(4587528220981470945L),(-7129192313491234680L),(-528161857177647632L),(-7120100485348189314L)},{(6252516301832085586L),(7043391239657081674L),(-8034406595513134879L),(3513224825781810823L)}},{{(-6010607985777437594L),(-4648621699761415227L),(-5585039729022962044L),(-664359733431122048L)},{(-5313496878532615672L),(-5860856650313023849L),(-6248661515363813871L),(5003638183880687371L)},{(-3726307126320979336L),(-4502859966278208920L),(3208398760264947760L),(-8472873344887757263L)}},{{(-3925116976723419554L),(-1768847774034075776L),(6612907659321557025L),(-1277983811552706531L)},{(-3305416212927268484L),(5097727925215889303L),(-8927743154941866104L),(-1852819001156843639L)},{(-4862556068649593629L),(1907830048821406376L),(-7164873056100358260L),(2847865267445213801L)}}}; + float var_86 = (0.00387697F); + final long [][] var_98 = {{(5798891899726577186L),(3599580295138384362L),(-3912431811196932416L)},{(4151741990219093065L),(-749407215685465658L),(6891471295107466575L)},{(-1747833879490389438L),(7542390628617238346L),(8473175571192116148L)},{(6255311629947454803L),(4746834303895384232L),(8240922169835955018L)},{(1811041125746399313L),(8447725690162246286L),(8334461830759026632L)},{(1863821257795554162L),(3843147083985724345L),(-6844815724691273592L)},{(7590696162917067770L),(5749852070519049863L),(-4891728130826015188L)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(496); + CrcCheck.ToByteArray(this.var_39,b,"var_39"); + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_57[a0],b,"var_57" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_77[a0][a1][a2],b,"var_77" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_86,b,"var_86"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_98[a0][a1],b,"var_98" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4488_2018110812102/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/4488_2018110812102/MainClass.java b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..4496f9f13c8acb7a244cc4dacb99d084df2ea055 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/MainClass.java @@ -0,0 +1,252 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1438312272 + +import java.util.zip.CRC32; + +class MainClass +{ + static int var_14 = (-301095812); + static cl_8 var_16 = new cl_8(); + static boolean [][] var_21 = {{true,false,false},{true,true,true},{true,true,true},{true,true,false},{false,false,true},{false,true,true}}; + static short var_24 = (short)(19569); + static byte var_25 = (byte)(2); + static cl_10 var_27 = new cl_10(); + long var_32 = (-440384844363856966L); + static int [][][] var_34 = {{{(-876042297)},{(1910324450)},{(-1289675697)},{(1239477158)},{(-171197301)},{(1995232290)},{(45546341)}},{{(-1931604949)},{(1528182911)},{(-939446272)},{(757391920)},{(-1362934118)},{(1881957385)},{(-1924384671)}},{{(1506216776)},{(-797207330)},{(1286364533)},{(1572415714)},{(-82464935)},{(9483582)},{(400866858)}},{{(239954308)},{(461889588)},{(1385446963)},{(886018721)},{(-55749325)},{(-1173663421)},{(867219252)}}}; + long var_37 = (-7238142325265186137L); + static cl_10 [][][] var_39 = {{{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()}},{{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()}},{{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()}}}; + static int var_40 = (-1430410845); + static boolean [][][] var_43 = {{{true,false,false,true},{false,false,false,false},{true,true,false,true},{true,true,false,false},{true,false,false,false},{false,false,true,false}},{{true,false,false,false},{false,false,false,false},{true,true,true,false},{true,true,true,true},{false,false,true,false},{true,false,true,false}}}; + static short var_44 = (short)(1181); + boolean [] var_46 = {false,false,true,true}; + static cl_8 var_50 = new cl_8(); + static cl_10 var_52 = new cl_10(); + float var_56 = (-1.80894e-26F); + int var_62 = (1692434612); + cl_8 var_70 = new cl_8(); + int var_78 = (-874471887); + double [][] var_100 = {{(1.3917e+86D)}}; +/*********************************/ +public strictfp void run() +{ + boolean [][] var_84 = {{true,true,true,false},{false,true,true,false},{false,false,false,true}}; + try + { + cl_8 [] var_79 = {new cl_8(),new cl_8(),new cl_8()}; + long var_0 = (-3637834465915421549L); + cl_8 var_80 = new cl_8(); + try + { + byte var_1 = (byte)(-101); + boolean [][] var_75 = {{false,false,false,true,true,true}}; + try + { + var_0 = (((~(~(-(--var_1))))-func_2(((var_62--)>var_52.var_63) ,((-(var_1++))+var_16.var_65) ,(7812131453026186908L) ,func_18(var_21) ,var_70 ,var_27))-var_27.var_45) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_73 ) + { + int var_76 = (-190165789); + var_75[(((--var_1)+(short)(-7224))&0)][((var_62++)&5)] = (!((-(--var_1))==( ( byte )(var_76--) ))) ; + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_77 ) + { + for( var_78 = 348 ;(var_78>315);var_78 = (var_78-11) ) + { + var_79[(var_78&2)] = var_70 ; + } + System.out.println("hello exception 1 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_81 ) + { + cl_10 var_95 = new cl_10(); + short var_82 = (short)(-17285); + if( ((var_82--)>var_16.var_83)) + { + long [][][] var_90 = {{{(5173809686027068455L),(9139160759138714770L),(-9015646580582433928L),(-4077324923389421841L)},{(-7478603073615421721L),(5540963233062123001L),(-359747481818936979L),(-6328709578365494359L)},{(-8897402839574110948L),(1351814434365336419L),(-8471444006092908197L),(-7221638100608684120L)},{(7645338757584191501L),(1722270615004652917L),(3746193037840427378L),(6892337201740284438L)},{(608845583060987353L),(-3889427108022155525L),(8535146309969635451L),(7353695988702410229L)},{(7649716871777818238L),(6581492584994799413L),(7987011771567348048L),(-195357487878177334L)},{(-7245309493783310378L),(-7729145011404993390L),(2951606044830211692L),(-4190639379812386205L)}},{{(-1558700988459343166L),(-4190272880103504879L),(3733080686326473884L),(563656151105915343L)},{(-857499647138011433L),(-5099953849936805171L),(-1432286238159295498L),(1687743677734317528L)},{(-8204407477997146173L),(-5653415052589158292L),(4962043146222425166L),(5166706179613061046L)},{(3608689311154267389L),(-5591948340331710328L),(-3055248420430531971L),(-3721778174752806996L)},{(3402926431931181058L),(-3017687493456690733L),(-3896311845671330543L),(7497991133412808663L)},{(-7337635605282317770L),(4108902575451821697L),(85081246029917152L),(-8271973229105638924L)},{(6024846857472256219L),(-2929670000558860265L),(4522031786881769863L),(-6500512550158161543L)}},{{(3006202787493469494L),(7978921165324531845L),(-2220484924835530113L),(-7161499284773652438L)},{(4322970443721967751L),(5256760002149287162L),(5439895188680783695L),(-3585750725525379383L)},{(56793689058483450L),(-253712005713742245L),(4315248218806254706L),(-3714321824585250940L)},{(4177371258647412946L),(5700426875779554457L),(-8627950997641151117L),(-6981273522000468093L)},{(3852094769472365337L),(-1318970303904614045L),(-7182435452589361481L),(7088348547150047830L)},{(-4022720336872389875L),(-8237918893307949634L),(4652937210449280419L),(-1388690561021889471L)},{(-7849907354214764610L),(2146538273261754639L),(-7042789045145768468L),(-5866351419828074151L)}}}; + try + { + byte var_86 = (byte)(59); + var_52.var_38 = (!((++var_25)>=(1598981659))) ; + } + catch( java.lang.IllegalArgumentException myExp_97 ) + { + var_52 = var_52 ; + System.out.println("hello exception 3 !"); + } + } + else + { + int var_98 = (-1813598889); + for( var_98 = 532 ;(var_98>516);var_98 = (var_98-8) ) + { + var_50.var_99 = var_100 ; + } + } + System.out.println("hello exception 2 !"); + } + return ; +} +public strictfp int func_2(boolean var_3, float var_4, long var_5, float var_6, cl_8 var_7, cl_10 var_8) +{ + int var_9 = (-1294768138); + for( var_9 = 777 ;(var_9<811);var_9 = (var_9+17) ) + { + byte var_10 = (byte)(-99); + byte var_57 = (byte)(126); + if( ((--var_10)<=func_11((var_57++) ,(~((var_25--)&var_52.var_45))))) + { + int var_60 = (-1213546930); + for( var_60 = 207 ;(var_60<211);var_60 = (var_60+1) ) + { + boolean var_61 = true; + } + } + } + return (1014401633); +} +public strictfp float func_11(int var_12, float var_13) +{ + for( var_14 = 268 ;(var_14<296);var_14 = (var_14+14) ) + { + byte var_15 = (byte)(-31); + if( (!(!((var_15++)>var_16.var_17)))) + { + var_13 = func_18(var_21) ; + } + } + return (var_56--); +} +public static strictfp float func_18(boolean[][] var_19) +{ + byte var_54 = (byte)(0); + var_19 = func_22(var_52) ; + return (-(var_54++)); +} +public static strictfp boolean[][] func_22(cl_10 var_23) +{ + byte var_26 = (byte)(-28); + try + { + float var_28 = (-3.79741e+21F); + try + { + try + { + boolean var_31 = false; + var_21[((++var_25)&5)][((var_24++)&2)] = ((var_26--)!=var_24) ; + long var_30 = (6996854234064466788L); + float var_29 = (1.67968e+32F); + var_27 = var_27 ; + var_16.var_17 = (var_28++) ; + var_26 = (var_26--) ; + var_25 = (++var_26) ; + int [][] var_36 = {{(-959350003),(1155300940),(-1855388240),(-1024834839)},{(1567809337),(92958688),(-624694697),(-115731712)}}; + var_34[(((var_26++)*var_27.var_35)&3)][(((var_26++)+var_14)&6)][(((var_25--)&var_14)&0)] = var_36[((((var_26++)|var_25)|( ( short )((--var_26)*( ( byte )(-1713897324) )) ))&1)][(((--var_26)&var_14)&3)] ; + var_39[((var_40++)&2)][(((var_26++)+var_25)&6)][((var_25--)&4)] = var_27 ; + var_43[1][(((var_26++)|(byte)(-86))&5)][((var_44++)&3)] = (!((--var_26)==var_27.var_45)) ; + var_23 = var_27 ; + } + catch( java.lang.IllegalArgumentException myExp_47 ) + { + var_16.var_41 = var_27.var_38 ; + System.out.println("hello exception 4 !"); + } + } + catch( java.lang.ArithmeticException myExp_48 ) + { + try + { + var_16 = var_16 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_49 ) + { + var_27 = var_27 ; + System.out.println("hello exception 6 !"); + } + System.out.println("hello exception 5 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_51 ) + { + var_16 = var_50 ; + System.out.println("hello exception 7 !"); + } + return var_21; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1111); + CrcCheck.ToByteArray(this.var_14,b,"var_14"); + CrcCheck.ToByteArray(this.var_16.GetChecksum(),b,"var_16.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_21[a0][a1],b,"var_21" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_24,b,"var_24"); + CrcCheck.ToByteArray(this.var_25,b,"var_25"); + CrcCheck.ToByteArray(this.var_27.GetChecksum(),b,"var_27.GetChecksum()"); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_34[a0][a1][a2],b,"var_34" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_37,b,"var_37"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_39[a0][a1][a2].GetChecksum(),b,"var_39" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_43[a0][a1][a2],b,"var_43" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_46[a0],b,"var_46" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_50.GetChecksum(),b,"var_50.GetChecksum()"); + CrcCheck.ToByteArray(this.var_52.GetChecksum(),b,"var_52.GetChecksum()"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_70.GetChecksum(),b,"var_70.GetChecksum()"); + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_100[a0][a1],b,"var_100" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4488_2018110812102/Start.java b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..ded79e14638d195946330cdb70132b9079403ad1 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_10.java MainClass.java cl_8.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/4488_2018110812102/cl_10.java b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/cl_10.java new file mode 100644 index 0000000000000000000000000000000000000000..ef5cf0fe5ccddda50eeb73de0ef016ed7ce636bb --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/cl_10.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1438312272 + +import java.util.zip.CRC32; + +class cl_10 +{ + short var_35 = (short)(-31346); + boolean var_38 = false; + final byte var_45 = (byte)(-81); + double var_63 = (-3.36352e-254D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(12); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + CrcCheck.ToByteArray(this.var_38,b,"var_38"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + CrcCheck.ToByteArray(this.var_63,b,"var_63"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4488_2018110812102/cl_8.java b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/cl_8.java new file mode 100644 index 0000000000000000000000000000000000000000..ab6e1cf72bac721e7e891eda5278a4bca4f104a6 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4488_2018110812102/cl_8.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1438312272 + +import java.util.zip.CRC32; + +class cl_8 +{ + float var_17 = (2.28423e+37F); + boolean [][] var_20 = {{false,true,true},{false,false,false},{false,true,false},{false,false,true},{true,true,false},{true,false,true}}; + boolean var_41 = true; + final long var_65 = (-2049594020404315578L); + int var_83 = (-1676829792); + short var_91 = (short)(4532); + double [][] var_99 = {{(-5.60182e-25D)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(45); + CrcCheck.ToByteArray(this.var_17,b,"var_17"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_20[a0][a1],b,"var_20" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_41,b,"var_41"); + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_99[a0][a1],b,"var_99" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/CRC32.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/MainClass.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..ac820d0fa7a43cd9c896e966f185c0480edf1537 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/MainClass.java @@ -0,0 +1,575 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=205973598 + +//import java.util.zip.CRC32; + +class MainClass +{ + static int var_0 = (380035040); + static byte var_9 = (byte)(92); + static int var_24 = (-461997171); + static byte var_25 = (byte)(23); + static cl_56 var_46 = new cl_56(); + static int var_47 = (-908649785); + static boolean var_48 = true; + static int var_49 = (777265049); + final static cl_37 var_50 = new cl_37(); + static float [][] var_52 = {{(2.92873e+20F),(1.94459e+32F),(-6.65291e+12F),(2.29164e-30F),(-3.88573e-30F),(-1.61358e-15F),(-3.67466e+22F)}}; + static byte var_53 = (byte)(23); + static short var_54 = (short)(-30601); + static cl_76 var_57 = new cl_76(); + static cl_21 var_63 = new cl_21(); + static int [][][] var_71 = {{{(-518226809)},{(-1606368393)},{(254202824)}},{{(232939826)},{(36781730)},{(-1458046305)}},{{(-505767502)},{(-182724108)},{(-1997663054)}},{{(-2112078170)},{(-820789061)},{(-479824032)}},{{(-604373204)},{(-374764266)},{(-1104890756)}}}; + static cl_109 var_76 = new cl_109(); + static cl_109 var_77 = new cl_109(); + static cl_113 var_78 = new cl_113(); + static float var_79 = (4.13102e-07F); + boolean var_84 = true; + static byte var_93 = (byte)(86); + static double var_94 = (-1.60332e+150D); + static int var_97 = (-1082341717); + static cl_109 [][] var_99 = {{new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109()},{new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109()},{new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109()},{new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109()},{new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109()},{new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109(),new cl_109()}}; + static long var_113 = (2845597354395666302L); + static int var_124 = (-2021512885); + boolean [] var_152 = {false,true,false,false,true,true,false}; + static int var_153 = (-1032077564); + static int var_167 = (1258543778); + static int var_168 = (1570674324); + static int var_172 = (381622679); + static int [][][] var_189 = {{{(-1905836030),(1922100848)},{(-1636409703),(-1091064363)},{(-1163895876),(1704949989)},{(-213545736),(-1324430907)}},{{(350648381),(-272233889)},{(-1748961148),(-1484754538)},{(321364109),(-1723508404)},{(-1484912266),(1999405257)}}}; + static byte var_190 = (byte)(-21); + static double var_239 = (-2.86397e-24D); + static float [][][] var_242 = {{{(-2.46273e+37F),(3.60166e-29F),(-8.31564e-24F),(-5.08202e-24F)},{(-1.23834e+34F),(-4.02937e+30F),(7.53265e+26F),(-0.122114F)},{(3.76382e-18F),(-1.31391e+35F),(-6.50056e+29F),(141245F)},{(-2.87289e+08F),(-1.40146e-27F),(1.97933e-28F),(-1.34152e+13F)},{(1.35246e-37F),(-6.71441e-15F),(6.04612e+20F),(-1.15218e+09F)},{(1.69575e+33F),(1.26032e-30F),(-4.33252e+37F),(2.36533e-32F)},{(1.11087e+17F),(-7.5474e-18F),(2.15923e+29F),(4.76823e+25F)}},{{(1.54453e-14F),(-2.90535e+19F),(-8.49928e+08F),(1.2895e-31F)},{(-3.98544e-20F),(3.20173e+32F),(109435F),(9.0677e-32F)},{(9.14996e-34F),(-8.70814e+36F),(-4.72218e+14F),(-3.90572e-39F)},{(1.55655e+31F),(-2.11157e-19F),(-3.33028e-19F),(6.11136e-19F)},{(-5.55078e-18F),(-3.50608e-15F),(-2.29177e-38F),(-4.91205e+29F)},{(-0.1968F),(1.6192e+14F),(5.22175e-30F),(3.49625e+28F)},{(3.62044e-18F),(5.29188e-06F),(-1.09418e-30F),(2.91785e+12F)}},{{(-2.68379e-27F),(3.69559e+09F),(7.44621e-19F),(2.96325e-11F)},{(7.74993e+37F),(4989.42F),(7.5025e-28F),(4.09137e-23F)},{(-1.09477e+10F),(-0.000931683F),(-5.65206e-28F),(-5.3269e-25F)},{(-8.66951e+34F),(7.89222e+14F),(4.27984e-18F),(2.22184e-32F)},{(-2.97472e-22F),(-2.74714e-38F),(2.81664e-17F),(-1.68205e+29F)},{(1.45173e+28F),(-1.90496e-26F),(4.61271e+08F),(2.6925e+06F)},{(2.09448e-23F),(1.60912e+36F),(-7.33605e+20F),(-2.04846e-08F)}},{{(3.45778e-25F),(-5.06406e+34F),(1.31365F),(-2.07544e+29F)},{(1.62937e-16F),(-1.90684e+15F),(-1164.31F),(-8.76868e+17F)},{(4.57011e-19F),(9.66124e-10F),(4.19754e+21F),(3.49937e+22F)},{(-7.27088e-14F),(-36227.4F),(-2.18157e-14F),(2.29475e-23F)},{(2.46117e+17F),(4.81208e+33F),(-1.39514e-08F),(-7.65983e-14F)},{(-1.77194e+13F),(1.44102e+22F),(-6183.14F),(-6.15631e+37F)},{(-1.86758e-23F),(1.00343e-22F),(5.36937e+17F),(-4.40332e-31F)}}}; + final static float [][][] var_251 = {{{(-6.29889e+20F),(-2.51978e-33F)},{(-1.12846e+36F),(1814.63F)},{(-0.000309064F),(-363.988F)},{(-8.77465e-17F),(-3.35056e-12F)},{(-3.29358e-17F),(-6.49527e+28F)}},{{(5.62444e-39F),(0.000476097F)},{(-1.26699e+38F),(2.21785e+28F)},{(-1.00468e+11F),(1.42145e-35F)},{(1.76099e+14F),(-6.3468e-16F)},{(-1.94139e+22F),(1.83149e-17F)}},{{(-0.00384972F),(-3.97361e+19F)},{(-0.00740556F),(0.0938172F)},{(7.70488e-31F),(2.40767e+21F)},{(3.27284e-12F),(-1.1682e-07F)},{(5.55568e-37F),(-1.5132e+24F)}},{{(-4.17424e+12F),(1.36204e-25F)},{(8.04576e+31F),(1.40597e-12F)},{(1.90243e-27F),(4.61346e+36F)},{(8.94823e+33F),(1.76854e-32F)},{(6.33132e-35F),(-3.12843e-32F)}},{{(9.79751e+16F),(9.7257e-29F)},{(0.114112F),(-3.71228e-07F)},{(5.85275e+34F),(8.05351e+36F)},{(-4.29384e-06F),(-1.72797e-12F)},{(-2.04524e-30F),(-2.78363e-34F)}}}; + static byte var_255 = (byte)(50); + final static float [][][] var_265 = {{{(0.0208992F),(-0.0121205F)},{(-2.11457e-32F),(-9.70054e+36F)},{(-1.0249e-25F),(-8.87068e-14F)},{(0.198668F),(-9.31521e-11F)},{(-2.43917e+20F),(-1.60993e-30F)}},{{(-9.93092e+33F),(-1.84405e+10F)},{(1.92035e+31F),(-0.000305944F)},{(-3.33386e+13F),(-1.938e-12F)},{(1.60295e+24F),(-2.70086e+25F)},{(-1.64215e+08F),(-1.24375e-09F)}},{{(2.5939e+21F),(-3.40421e-21F)},{(-5.10209e+07F),(3.87135e+29F)},{(0.185591F),(6.69025e+21F)},{(8.52134e-19F),(1.14726e-22F)},{(-1.93154e+11F),(1.05389e+12F)}},{{(4.96603e+22F),(6.90733e+13F)},{(3.24686e-24F),(2.35714e+10F)},{(1.04654e+15F),(5.56091e+32F)},{(1.32305e+07F),(7.41316e-19F)},{(-3.00168e+25F),(-2.03773e+37F)}},{{(4.39022e+14F),(3.274e+15F)},{(4.3914e-06F),(-9.1649e+16F)},{(-8.74939e-11F),(7.96022e+17F)},{(-8.68414e+15F),(-4.89107e+23F)},{(-2.41594e+18F),(9.81756e-10F)}}}; + static float [][][] var_276 = {{{(-210.061F),(-1.09044e-06F)},{(-4.83673e+17F),(-5.1083F)},{(-8.38628e-26F),(-2.76233e-27F)},{(4.26364e-33F),(-3.91209e-18F)},{(-1.13452e-33F),(1.36183e+27F)}},{{(-1.82649e+17F),(2.10502e-23F)},{(-0.000204723F),(1.23096e+10F)},{(2.09161e-09F),(-9.89688e-38F)},{(-8.33848F),(2.71578e-07F)},{(-1.32569e-17F),(8.8768e+23F)}},{{(2.75684e+32F),(1.95733e-28F)},{(-5.18112e-06F),(3.37021e-06F)},{(2.37238e+36F),(3.32572e+31F)},{(2.02665e-09F),(5.16409e-27F)},{(762.652F),(2.00909e-07F)}},{{(-1.1555e-11F),(-1.46558e-09F)},{(1.38282e+06F),(7.08801e-25F)},{(5.33353e+13F),(-220.039F)},{(1.71965e-25F),(-1.7387F)},{(6.63016e-19F),(-45.2144F)}},{{(1.2924e-26F),(0.0420071F)},{(-1.7455e+07F),(4.01141e+11F)},{(-8.43179e+31F),(1.41316e+30F)},{(1.41048e-19F),(1.78196e+11F)},{(-5.97473e+15F),(1.65421e-12F)}}}; + static int var_284 = (-284091821); + static float [][] var_295 = {{(7.94098e+07F),(8.14281e-09F),(-2.48494e-22F),(242.578F),(3.488e-09F)}}; + static short var_309 = (short)(10725); + boolean [][] var_315 = {{true,false,true,false,true,false},{false,true,true,true,true,false},{false,false,true,true,false,true},{true,true,false,false,false,false},{false,false,true,true,false,false},{true,true,false,true,false,false}}; + final cl_109 var_343 = new cl_109(); +/*********************************/ +public strictfp void run() +{ + byte var_313 = (byte)(108); + long var_318 = (-7758100345167701013L); + short var_1 = (short)(-14943); + for( var_0 = 687 ;(var_0>659);var_0 = (var_0-14) ) + { + int var_332 = (114210950); + long [][][] var_331 = {{{(-403660512659858056L),(-8564847259118536992L),(-8533755153357887654L),(-3359781970237761012L)}}}; + final boolean [][] var_342 = {{false,true,false},{false,false,true},{false,false,false},{false,false,true},{false,true,false}}; + if( ((++var_1)>=func_2(var_57.var_311 ,((++var_313)-func_40((var_1++) ,var_315[((var_313++)&5)][5] ,((++var_313)&( ( byte )((--var_124)&var_53) )) ,(var_318--) ,(var_313++))) ,((--var_313)+var_78.var_322) ,func_40(((var_313++)*func_11(var_318 ,var_189[1][(((++var_313)*var_313)&3)][(((--var_1)&(short)(26699))&1)] ,(var_313--) ,var_265)) ,(!(((++var_313)+var_78.var_329)!=var_309)) ,var_331[((-(var_9++))&0)][((++var_332)&0)][((-(++var_1))&3)] ,((+(var_93++))-var_76.var_334) ,(1814979880)) ,(var_113++) ,(!(((+(var_313++))+var_46.var_96)==( ( double )(-2087579131) )))))) + { + // if stmt begin,id=1 + long [][][] var_341 = {{{(-3890945107888312440L),(6659725629082110898L),(3645745629159408839L),(-991857966880595799L)}}}; + var_331 = var_341 ; + // if stmt end,id=1 + } + else + { + // else stmt begin,id=1 + final cl_109 var_344 = new cl_109(); + if( var_342[(((var_313++)-(byte)(-28))&4)][((var_9++)&2)]) + { + // if stmt begin,id=2 + var_77 = var_76 ; + // if stmt end,id=2 + } + // else stmt end,id=1 + } + } + return ; +} +public static strictfp float func_2(double var_3, int var_4, float var_5, int var_6, double var_7, boolean var_8) +{ + long var_246 = (-6617647963910411543L); + byte var_261 = (byte)(37); + short var_10 = (short)(13631); + float [][][] var_308 = {{{(-2.14316e+22F),(-8.3334e+06F)},{(2.25208e+07F),(0.00940087F)},{(-1.94766e+18F),(4.61203e-18F)},{(-1.78119e+20F),(6.99703e+20F)},{(1.4506e-09F),(1.81993e-24F)},{(-2.67437e+38F),(3.77066e-28F)},{(-3.88242e+21F),(-5.92123e+21F)}},{{(7.54755e+09F),(5.54041e+28F)},{(1.19601e-14F),(1.68389e+13F)},{(-5.35766e-12F),(2.8995e-08F)},{(5.89712e-07F),(3.91091e-37F)},{(-1.00554e+07F),(-1.9718e+34F)},{(-4.72481e-21F),(-2.63031e-20F)},{(-1.51716e-22F),(2.96604e+08F)}},{{(1.28537e-05F),(-6.41732e+30F)},{(7.36952e+13F),(-7.08387e-29F)},{(-2.107e-36F),(-6.52732e-22F)},{(-8.33117e+21F),(-1.86482F)},{(9.2649e-15F),(-1.28107e+16F)},{(1.24235e-38F),(2.99929e+24F)},{(1.37517e-08F),(1.03695e-28F)}},{{(-3.33852e-19F),(5.35501e-33F)},{(-1.54437e+19F),(7.77895e-28F)},{(-1.14337e-09F),(-4.79519e+20F)},{(-9.45299e+37F),(1.23102e-20F)},{(-6.94135e-08F),(3.28987e-20F)},{(3.21046e+35F),(8.67799e-32F)},{(-3.19886e-21F),(-3.32623e-13F)}}}; + short var_310 = (short)(-6382); + if( ((+(--var_9))>( ( int )(var_10++) ))) + { + // if stmt begin,id=3 + long [][][] var_272 = {{{(4839659561132303066L)}},{{(-4512156697235293838L)}},{{(4789797903333976400L)}},{{(-3570788085593211671L)}},{{(-9009722365737454992L)}}}; + long var_241 = (-3408146530202101001L); + byte var_259 = (byte)(-67); + byte var_257 = (byte)(66); + int [] var_244 = {(1634820864),(833361885),(-530837183),(-1139883756),(-1164917010),(1658248650)}; + byte var_245 = (byte)(118); + if( (!(!((+((var_9++)*var_0))>=func_11((var_241--) ,((++var_9)|func_40(var_242[((((++var_54)&var_78.var_108)&var_50.var_128)&3)][6][3] ,(!(!((~(-(++var_53)))!=func_40(func_26(var_244[((var_245++)&5)] ,(var_239++) ,var_50 ,((var_93--)+func_40((var_246--) ,(!(!(!(!((var_93--)!=func_11((~(var_53++)) ,(var_10++) ,(--var_4) ,var_251)))))) ,(var_4--) ,(((++var_255)&var_93)+var_78.var_108) ,((var_257--)&var_47))) ,(var_113++) ,var_242[((var_4++)&3)][((++var_261)&6)][(((+(++var_255))|func_40(( ( float )((-((++var_259)+var_57.var_88))+var_79) ) ,false ,var_46.var_260 ,(--var_79) ,(var_261++)))&3)] ,((var_261--)+func_11((-(var_261--)) ,((+(++var_261))+(-1999835125)) ,(-(var_4++)) ,var_265))) ,(!(!(!((var_10++)>=var_3)))) ,(8643717328783493960L) ,(var_113++) ,((var_261--)*( ( byte )(-(var_25++)) )))))) ,(--var_4) ,(var_79++) ,((++var_53)&(byte)(18)))) ,((var_93++)|func_11((var_261++) ,(var_124++) ,(var_10++) ,var_251)) ,var_46.var_271))))) + { + // if stmt begin,id=4 + if( (!(!(!((var_113--)!=func_11(var_272[((var_10++)&4)][0][((++var_4)&0)] ,(-(var_54++)) ,((var_53++)-( ( short )var_53 )) ,var_276)))))) + { + // if stmt begin,id=5 + int var_278 = (1852554506); + for( var_278 = 934 ;(var_278>913);var_278 = (var_278-7) ) + { + var_244[(((++var_261)|func_40((var_54++) ,(!((++var_257)>( ( double )(var_259--) ))) ,(var_246++) ,(+(var_10++)) ,(var_153++)))&5)] = (var_190--) ; + } + // if stmt end,id=5 + } + else + { + // else stmt begin,id=2 + if( false) + { + // if stmt begin,id=6 + var_46 = var_46 ; + // if stmt end,id=6 + } + else + { + // else stmt begin,id=3 + var_272[((var_9--)&4)][0][((-(++var_245))&0)] = (+(--var_257)) ; + // else stmt end,id=3 + } + // else stmt end,id=2 + } + // if stmt end,id=4 + } + else + { + // else stmt begin,id=4 + try + { + for( var_284 = 809 ;(var_284>804);var_284 = (var_284-5) ) + { + final boolean var_285 = false; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_286 ) + { + if( ((var_245--)==var_79)) + { + // if stmt begin,id=7 + var_244[((var_4++)&5)] = var_189[((var_259--)&1)][((var_10--)&3)][((++var_10)&1)] ; + // if stmt end,id=7 + } + System.out.println("hello exception 0 !"); + } + // else stmt end,id=4 + } + // if stmt end,id=3 + } + else + { + // else stmt begin,id=5 + if( true) + { + // if stmt begin,id=8 + if( (!(!((--var_261)==func_40(func_26((++var_4) ,(var_25--) ,var_50 ,(+(++var_261)) ,(~(var_261--)) ,(~(--var_190)) ,((var_255--)&func_17((--var_4) ,var_63 ,var_295 ,((var_261--)-var_0) ,(var_261--)))) ,var_78.var_301 ,(((var_4--)|var_246)*( ( byte )(var_10--) )) ,((var_261--)-(3.14253F)) ,var_189[((var_4--)&1)][((var_10++)&3)][(((var_4--)|var_25)&1)]))))) + { + // if stmt begin,id=9 + int var_306 = (238673121); + for( var_306 = 987 ;(var_306>957);var_306 = (var_306-15) ) + { + boolean var_307 = true; + } + // if stmt end,id=9 + } + // if stmt end,id=8 + } + // else stmt end,id=5 + } + return var_308[((~(var_172++))&3)][((var_310--)&6)][((--var_309)&1)]; +} +public static strictfp short func_11(long var_12, int var_13, int var_14, float[][][] var_15) +{ + cl_37 var_184 = new cl_37(); + short var_16 = (short)(16605); + final cl_21 var_236 = new cl_21(); + byte var_193 = (byte)(-102); + if( (!(!((var_9--)>var_9)))) + { + // if stmt begin,id=10 + float [][] var_233 = {{(-4.02815e-38F),(-1.12613e+09F),(3.55177e+26F),(-0.0134437F),(1.05437e-09F)}}; + final long [][] var_197 = {{(3643590251289491037L),(7579730379337104854L),(-2163663002539837276L),(-2570150642313342741L)},{(1991165599097431522L),(9070072481039678079L),(-4502645331793264343L),(-3650407756255144060L)},{(2201617593847866805L),(-3952887471179456623L),(4322946828262027884L),(4018634699341492501L)},{(371741542724224636L),(-4194456806731405821L),(-3669718537887078458L),(-2971328496946609210L)},{(7266905751641781753L),(-4304744533790193110L),(5413520297553416735L),(8317696651932526040L)}}; + final long [] var_225 = {(-6498520604625005377L),(-8202306616557650661L),(-4255803551780314202L),(-5218864652659439007L),(-4547935394717326246L)}; + long [] var_209 = {(729496209892555642L)}; + int [][][] var_181 = {{{(1738626164),(-1122728652)},{(472455916),(-875789949)},{(1827914594),(1437888596)}},{{(-784279735),(-1571773263)},{(1440715422),(794104079)},{(-1614036910),(880847181)}}}; + if( ((var_16--)==func_17((((var_25++)*var_12)-func_40((-((var_25++)*func_26(var_181[((var_14++)&1)][((var_13--)&2)][((var_54--)&1)] ,(var_94++) ,var_184 ,(var_124--) ,(~(-(var_93++))) ,(--var_54) ,var_189[((var_190++)&1)][3][1]))) ,(!((var_193--)>=var_9)) ,(var_16--) ,var_79 ,((var_193--)*func_17(var_197[((var_193--)&4)][((((var_193--)*var_53)+func_40((var_193--) ,func_35(((++var_25)&var_93) ,(var_113--) ,(!(((((var_193--)+func_26(((++var_193)-func_40(((var_193++)-var_79) ,( ( boolean )(((var_13--)+func_40((4.14213e-29F) ,(!(!(!(!(!((++var_54)!=var_63.var_203)))))) ,(var_172--) ,(0.000524326F) ,(-922489028)))<(6.7061e+21F)) ) ,var_209[((-(var_16++))&0)] ,((--var_193)+var_46.var_116) ,((var_193--)*func_40((var_14++) ,var_48 ,(var_16--) ,(var_193++) ,((var_25++)&var_53))))) ,(var_94--) ,var_184 ,(var_16++) ,(var_13--) ,((+(--var_14))|(5472690139862226081L)) ,var_153))*func_40((~((--var_193)+func_40((((++var_13)+(2759394417953978790L))*func_40((var_93++) ,true ,var_225[((((--var_193)*var_46.var_226)&var_54)&4)] ,(1.90298e-18F) ,( ( int )(++var_190) ))) ,true ,(~(~(--var_193))) ,((var_193--)&(short)(28928)) ,var_189[((--var_16)&1)][3][((var_16++)&1)]))) ,((++var_93)==var_50.var_80) ,(~(--var_12)) ,(+(var_193--)) ,(((+(var_16++))|var_54)&var_54)))*var_57.var_87)<=var_93)) ,(var_14++)) ,(++var_16) ,(var_12--) ,(++var_193)))&3)] ,var_63 ,var_233 ,(((--var_193)+( ( long )(-(var_193++)) ))+var_76.var_234) ,(~(-(++var_193))))))) ,var_236 ,var_78.var_237 ,((++var_193)-var_77.var_238) ,(var_54++)))) + { + // if stmt begin,id=11 + var_63 = var_63 ; + // if stmt end,id=11 + } + // if stmt end,id=10 + } + else + { + // else stmt begin,id=6 + int var_240 = (-1235503160); + for( var_240 = 582 ;(var_240<633);var_240 = (var_240+17) ) + { + if( (!(!(((++var_16)|var_54)>=var_93)))) + { + // if stmt begin,id=12 + var_57 = var_57 ; + // if stmt end,id=12 + } + } + // else stmt end,id=6 + } + return (short)(-22118); +} +public static strictfp short func_17(long var_18, cl_21 var_19, float[][] var_20, long var_21, long var_22) +{ + int var_23 = (1465648809); + short var_180 = (short)(-13737); + cl_37 var_170 = new cl_37(); + byte var_169 = (byte)(-110); + float var_175 = (-1.76747e-05F); + for( var_23 = 385 ;(var_23>372);var_23 = (var_23-13) ) + { + for( var_24 = 875 ;(var_24>825);var_24 = (var_24-10) ) + { + int var_171 = (530876089); + if( ((++var_25)!=func_26((++var_168) ,((--var_169)+( ( double )(1417726169) )) ,var_170 ,(var_171++) ,(++var_172) ,(148362F) ,var_71[(((var_169++)&var_97)&4)][((var_169--)&2)][(((((--var_93)*var_54)&var_50.var_173)*func_40((--var_18) ,(!((var_175--)!=var_79)) ,(--var_18) ,((++var_169)+(short)(-24517)) ,(+(--var_9))))&0)]))) + { + // if stmt begin,id=13 + var_63 = var_63 ; + // if stmt end,id=13 + } + } + } + return (--var_180); +} +public static strictfp float func_26(int var_27, double var_28, cl_37 var_29, int var_30, long var_31, float var_32, int var_33) +{ + short var_161 = (short)(-14210); + long [] var_166 = {(-4188546749801854484L),(-4329086174555276840L),(837661933128926446L),(5878305004509178036L),(1979535553895031661L)}; + byte var_158 = (byte)(113); + if( true) + { + // if stmt begin,id=14 + int var_34 = (1191053774); + for( var_34 = 575 ;(var_34<627);var_34 = (var_34+13) ) + { + if( func_35((var_158--) ,(++var_31) ,((++var_161)<=var_50.var_128) ,(~(var_158++)))) + { + // if stmt begin,id=15 + int var_164 = (498378588); + for( var_164 = 920 ;(var_164<972);var_164 = (var_164+13) ) + { + var_166[((var_54++)&4)] = (--var_31) ; + } + // if stmt end,id=15 + } + else + { + // else stmt begin,id=7 + for( var_167 = 496 ;(var_167<524);var_167 = (var_167+7) ) + { + var_63 = var_63 ; + } + // else stmt end,id=7 + } + } + // if stmt end,id=14 + } + return ((var_9--)|var_25); +} +public static strictfp boolean func_35(int var_36, float var_37, boolean var_38, long var_39) +{ + short var_103 = (short)(3496); + byte var_115 = (byte)(-43); + cl_21 var_106 = new cl_21(); + if( (!((var_9++)>func_40(((var_39++)-(-3852.49F)) ,(((--var_36)!=var_79)&&var_48) ,(6441165639975645757L) ,(var_103++) ,(var_53--))))) + { + // if stmt begin,id=16 + byte var_110 = (byte)(-116); + byte var_107 = (byte)(59); + byte var_112 = (byte)(72); + final byte [][] var_109 = {{(byte)(126),(byte)(-125),(byte)(54)},{(byte)(72),(byte)(-117),(byte)(105)},{(byte)(-41),(byte)(7),(byte)(-110)},{(byte)(13),(byte)(59),(byte)(-60)}}; + var_63 = var_63 ; + int var_119 = (-1659752313); + int [] var_121 = {(1152878572),(1530944152)}; + var_71[4][((((var_107++)+var_78.var_108)-( ( short )var_109[((var_53--)&3)][(((var_103++)*( ( short )func_40((++var_110) ,((var_37--)==func_40((((var_112++)+var_113)*var_79) ,(((--var_115)&var_54)>var_46.var_116) ,((-((var_39--)+var_77.var_95))*var_63.var_64) ,((var_119--)-var_46.var_116) ,var_121[1])) ,((var_124--)-var_50.var_125) ,((((var_103++)*func_40((-(var_103++)) ,(((++var_115)+var_50.var_128)>=( ( short )(var_25--) )) ,(~(-(var_115++))) ,(var_124--) ,func_40((var_36--) ,(!(!(((+(++var_54))-( ( float )(-(++var_93)) ))>=var_46.var_133))) ,((--var_115)|var_50.var_128) ,(+(--var_53)) ,(var_115++))))-func_40((((--var_103)-var_54)-(5411854534399536653L)) ,((--var_103)>( ( double )var_47 )) ,((var_103++)-var_50.var_141) ,(8.10333e-16F) ,(var_115++)))*var_113) ,(var_36++)) ))&2)] ))&2)][((var_103++)&0)] = (++var_124) ; + // if stmt end,id=16 + } + else + { + // else stmt begin,id=8 + double [] var_155 = {(5.3072e+57D),(4.13662e+271D),(-6.70845e+81D)}; + try + { + int var_147 = (-326143011); + for( var_147 = 263 ;(var_147<283);var_147 = (var_147+5) ) + { + try + { + final cl_37 var_148 = new cl_37(); + } + catch( java.lang.ArithmeticException myExp_149 ) + { + var_36 = (--var_115) ; + System.out.println("hello exception 1 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_150 ) + { + int var_151 = (5348186); + for( var_151 = 210 ;(var_151<258);var_151 = (var_151+16) ) + { + var_155[((var_115++)&2)] = (var_115++) ; + } + System.out.println("hello exception 2 !"); + } + // else stmt end,id=8 + } + short var_156 = (short)(-3556); + return (!(!(!(!((((++var_156)+var_54)-var_113)>var_76.var_157))))); +} +public static strictfp int func_40(float var_41, boolean var_42, long var_43, float var_44, int var_45) +{ + cl_21 var_68 = new cl_21(); + short var_66 = (short)(-24861); + double [] var_69 = {(-4.05337e+78D)}; + int [][][] var_62 = {{{(1773662909)},{(1086878164)},{(810808127)}},{{(830347417)},{(1876812371)},{(-1911277499)}},{{(1640454227)},{(125954580)},{(1143210274)}},{{(-896860983)},{(-72878516)},{(-1806788760)}},{{(344854254)},{(-2038554912)},{(-1507370459)}}}; + try + { + int var_85 = (-1598762727); + var_46 = var_46 ; + for( var_47 = 830 ;(var_47<866);var_47 = (var_47+18) ) + { + long var_55 = (-4376699521326670747L); + byte var_58 = (byte)(59); + if( var_48) + { + // if stmt begin,id=17 + int var_59 = (1883474083); + cl_56 var_82 = new cl_56(); + for( var_49 = 782 ;(var_49>767);var_49 = (var_49-5) ) + { + var_50.var_51 = var_52 ; + var_52[((var_45--)&0)][((+(+(--var_53)))&6)] = (~(+(var_54++))) ; + double var_56 = (-1.01115e+177D); + var_41 = (var_55++) ; + var_57 = var_57 ; + var_55 = (++var_54) ; + var_43 = (++var_58) ; + continue; + + } + for( var_59 = 465 ;(var_59<473);var_59 = (var_59+8) ) + { + float [][] var_60 = {{(7.59937e-14F),(-9.61542e+37F),(5.63132e+17F),(1.58051e+35F),(3.47512e+27F),(4.94581e+11F),(2.63323e-33F)}}; + var_52 = var_60 ; + var_52[((+(++var_54))&0)][(((var_58--)-var_49)&6)] = (var_43++) ; + var_62[(((var_66--)&var_58)&4)][((((-(var_25--))&var_63.var_64)|var_57.var_65)&2)][0] = ( ( int )(var_58++) ) ; + var_63.var_67 = (var_66++) ; + var_66 = (++var_58) ; + var_58 = var_53 ; + final int var_70 = (-1506111546); + var_63 = var_68 ; + var_52[((+(++var_58))&0)][(((--var_9)|var_66)&6)] = (var_55--) ; + var_69[(var_59&0)] = (1.12469e+209D) ; + var_62 = var_71 ; + var_76 = var_77 ; + var_45 = (--var_45) ; + var_69[(((++var_66)*var_63.var_64)&0)] = ((var_58--)/var_54) ; + var_69[(var_59&0)] = (var_44--) ; + var_62[((((var_66--)-var_54)*var_54)&4)][((var_54++)&2)][((++var_58)&0)] = (((var_54++)-var_54)+var_78.var_81) ; + continue; + + } + var_68 = var_63 ; + if( ((--var_58)==var_57.var_83)) + { + // if stmt begin,id=18 + var_62[((--var_85)&4)][(((++var_58)+var_9)&2)][((++var_66)&0)] = ((++var_58)&( ( byte )(var_53++) )) ; + // if stmt end,id=18 + } + else + { + // else stmt begin,id=9 + long [] var_89 = {(8458917841934981475L)}; + double var_86 = (8.18675e-305D); + var_76 = var_76 ; + var_52[((((~(++var_58))*(byte)(-46))-var_57.var_87)&0)][((var_54--)&6)] = ((++var_43)+var_57.var_88) ; + var_55 = (~(+(var_58++))) ; + var_62[((var_66--)&4)][((var_58--)&2)][((var_85++)&0)] = var_71[4][((+(++var_25))&2)][((var_66--)&0)] ; + var_69[((-(+(++var_66)))&0)] = (var_66++) ; + var_52[((var_53++)&0)][((var_58--)&6)] = (++var_66) ; + var_69[0] = ((--var_66)/var_54) ; + var_62 = var_71 ; + var_58 = (--var_58) ; + // else stmt end,id=9 + } + // if stmt end,id=17 + } + } + } + catch( java.lang.ArithmeticException myExp_92 ) + { + if( (!((var_93--)!=var_9))) + { + // if stmt begin,id=19 + if( (!(!((++var_54)>=var_54)))) + { + // if stmt begin,id=20 + if( ((var_45--)>=var_94)) + { + // if stmt begin,id=21 + var_71 = var_62 ; + // if stmt end,id=21 + } + // if stmt end,id=20 + } + else + { + // else stmt begin,id=10 + if( (!((+(++var_45))>=var_77.var_95))) + { + // if stmt begin,id=22 + var_46.var_96 = (var_41++) ; + // if stmt end,id=22 + } + // else stmt end,id=10 + } + // if stmt end,id=19 + } + else + { + // else stmt begin,id=11 + for( var_97 = 880 ;(var_97>868);var_97 = (var_97-6) ) + { + int var_98 = (911782926); + for( var_98 = 852 ;(var_98<870);var_98 = (var_98+9) ) + { + var_99 = var_99 ; + } + } + // else stmt end,id=11 + } + System.out.println("hello exception 3 !"); + } + return (+(var_54++)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1747); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + CrcCheck.ToByteArray(this.var_9,b,"var_9"); + CrcCheck.ToByteArray(this.var_24,b,"var_24"); + CrcCheck.ToByteArray(this.var_25,b,"var_25"); + CrcCheck.ToByteArray(this.var_46.GetChecksum(),b,"var_46.GetChecksum()"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + CrcCheck.ToByteArray(this.var_50.GetChecksum(),b,"var_50.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_52[a0][a1],b,"var_52" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_53,b,"var_53"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_57.GetChecksum(),b,"var_57.GetChecksum()"); + CrcCheck.ToByteArray(this.var_63.GetChecksum(),b,"var_63.GetChecksum()"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_71[a0][a1][a2],b,"var_71" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_76.GetChecksum(),b,"var_76.GetChecksum()"); + CrcCheck.ToByteArray(this.var_77.GetChecksum(),b,"var_77.GetChecksum()"); + CrcCheck.ToByteArray(this.var_78.GetChecksum(),b,"var_78.GetChecksum()"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + CrcCheck.ToByteArray(this.var_93,b,"var_93"); + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_97,b,"var_97"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_99[a0][a1].GetChecksum(),b,"var_99" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_124,b,"var_124"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_152[a0],b,"var_152" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_153,b,"var_153"); + CrcCheck.ToByteArray(this.var_167,b,"var_167"); + CrcCheck.ToByteArray(this.var_168,b,"var_168"); + CrcCheck.ToByteArray(this.var_172,b,"var_172"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_189[a0][a1][a2],b,"var_189" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_190,b,"var_190"); + CrcCheck.ToByteArray(this.var_239,b,"var_239"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_242[a0][a1][a2],b,"var_242" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_251[a0][a1][a2],b,"var_251" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_255,b,"var_255"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_265[a0][a1][a2],b,"var_265" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_276[a0][a1][a2],b,"var_276" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_284,b,"var_284"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_295[a0][a1],b,"var_295" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_309,b,"var_309"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_315[a0][a1],b,"var_315" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_343.GetChecksum(),b,"var_343.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/Start.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..a0c57bf2875eb71a5f0c38bb7e0bb3072d86b47b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java CRC32.java cl_109.java CrcCheck.java cl_113.java cl_37.java cl_56.java cl_76.java cl_21.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_109.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_109.java new file mode 100644 index 0000000000000000000000000000000000000000..8be44148a6be0118760b6a7da0de3b6dcc58460d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_109.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=205973598 + +//import java.util.zip.CRC32; + +class cl_109 +{ + int [][][] var_90 = {{{(-1827119121)},{(-906018197)},{(-492526293)}},{{(567604741)},{(549838094)},{(381883604)}},{{(-7717794)},{(2004953713)},{(-258643)}},{{(-511901411)},{(-1792501838)},{(541747737)}},{{(49446871)},{(939234031)},{(-1295295670)}}}; + int var_95 = (346077022); + short var_157 = (short)(4713); + byte var_234 = (byte)(-76); + final long var_238 = (-6338892837850530152L); + float var_334 = (9.13251e-15F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(79); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_90[a0][a1][a2],b,"var_90" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_95,b,"var_95"); + CrcCheck.ToByteArray(this.var_157,b,"var_157"); + CrcCheck.ToByteArray(this.var_234,b,"var_234"); + CrcCheck.ToByteArray(this.var_238,b,"var_238"); + CrcCheck.ToByteArray(this.var_334,b,"var_334"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_113.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_113.java new file mode 100644 index 0000000000000000000000000000000000000000..e103a3e9183e9bb27357fe885bd3edf62a972a5e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_113.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=205973598 + +//import java.util.zip.CRC32; + +class cl_113 +{ + int var_81 = (-751374861); + byte var_108 = (byte)(99); + float [][] var_237 = {{(-6.71945e-11F),(-6.03991e-16F),(-4.84868e-05F),(4.33974e-30F),(7.96902e+12F)}}; + boolean var_301 = false; + final short var_322 = (short)(-21382); + float var_329 = (-1.03187e+23F); + long [][][] var_340 = {{{(5057738857728261356L),(5195249985633062576L),(-6023704061923021387L),(-8891276371742186670L)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(64); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_237[a0][a1],b,"var_237" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_301,b,"var_301"); + CrcCheck.ToByteArray(this.var_322,b,"var_322"); + CrcCheck.ToByteArray(this.var_329,b,"var_329"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_340[a0][a1][a2],b,"var_340" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_21.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_21.java new file mode 100644 index 0000000000000000000000000000000000000000..b36a49292ca906d1f5f2b3190a53fb9a8dae36fa --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_21.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=205973598 + +//import java.util.zip.CRC32; + +class cl_21 +{ + byte var_64 = (byte)(-57); + int var_67 = (1178927746); + int [][][] var_74 = {{{(1757079249)},{(-761550206)},{(1316252243)}},{{(-752295658)},{(1631678116)},{(-644472184)}},{{(-469579264)},{(1511530781)},{(-945885764)}},{{(195014157)},{(378394463)},{(-920411983)}},{{(648825318)},{(-620665474)},{(396377003)}}}; + float var_203 = (9.28401e+35F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(69); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_74[a0][a1][a2],b,"var_74" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_203,b,"var_203"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_37.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_37.java new file mode 100644 index 0000000000000000000000000000000000000000..b0d102327bbb0e806fe50b7ad5b91a35b5857ae9 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_37.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=205973598 + +//import java.util.zip.CRC32; + +class cl_37 +{ + float [][] var_51 = {{(-1.5111e-21F),(-4.69207e+36F),(2.04196e-12F),(-9.51574e-14F),(4.05267e-20F),(5.77881e+22F),(-9.13087e+19F)}}; + boolean var_75 = false; + double var_80 = (-7.99438e-10D); + int [][][] var_91 = {{{(551547644)},{(-1044396287)},{(-935941465)}},{{(928213280)},{(1619975602)},{(341022479)}},{{(-1973984621)},{(1756070411)},{(1300155112)}},{{(1921850736)},{(845859766)},{(1027146520)}},{{(2141568905)},{(-1684718438)},{(-217648498)}}}; + int var_125 = (-470597138); + short var_128 = (short)(23616); + long var_141 = (-2101988099306245011L); + final byte var_173 = (byte)(-49); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(112); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_51[a0][a1],b,"var_51" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_91[a0][a1][a2],b,"var_91" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_125,b,"var_125"); + CrcCheck.ToByteArray(this.var_128,b,"var_128"); + CrcCheck.ToByteArray(this.var_141,b,"var_141"); + CrcCheck.ToByteArray(this.var_173,b,"var_173"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_56.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_56.java new file mode 100644 index 0000000000000000000000000000000000000000..22979b5c061ba567c794e05d57bf8cc373d1cd97 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_56.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=205973598 + +//import java.util.zip.CRC32; + +class cl_56 +{ + int [][][] var_73 = {{{(1961336781)},{(-1709181994)},{(-1767121385)}},{{(1524299597)},{(-335028499)},{(1484784568)}},{{(-683195338)},{(1577601614)},{(-253506153)}},{{(1954894057)},{(1558151970)},{(-583795305)}},{{(285210962)},{(463886050)},{(907299031)}}}; + float var_96 = (5.55706F); + final byte var_116 = (byte)(90); + double var_133 = (9.86053e+76D); + final int var_226 = (-972001571); + long var_260 = (-8753070466079353371L); + float [][][] var_271 = {{{(12.3949F),(-1.44143e+35F)},{(-1.6336e-21F),(2.47716e+36F)},{(-6.01359e+32F),(2.1974e+15F)},{(2.89359e-11F),(3.99632e+22F)},{(-1.12805e-15F),(-4.12761e-19F)}},{{(-5.64436e-38F),(29.9785F)},{(-1.89625F),(-6.48737e+32F)},{(-1.64082e-07F),(1.93096e+15F)},{(-3.9671e+12F),(-5.90804e+35F)},{(1.38579e-35F),(3.00651e+29F)}},{{(-1.06887e+07F),(5.11453e+29F)},{(1.05895e-31F),(-1.12325e-33F)},{(8.67038e-13F),(-50686F)},{(-1.92829e+22F),(0.0112868F)},{(7.21592e+21F),(-1.41579e-05F)}},{{(1.15998e-35F),(126583F)},{(-1014.68F),(-6681.22F)},{(-1.17678e-16F),(5.34559e-36F)},{(3.13449e+21F),(-2.10189e-06F)},{(6.20066e+10F),(-1.38597e+18F)}},{{(-2.54722e-23F),(-3.136e-16F)},{(-2.52167e-06F),(3.75221e-37F)},{(2.09495e+23F),(4.44148e+36F)},{(-8.01549e+21F),(679.456F)},{(-5.42828e-14F),(5.04539e+30F)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(285); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_73[a0][a1][a2],b,"var_73" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + CrcCheck.ToByteArray(this.var_133,b,"var_133"); + CrcCheck.ToByteArray(this.var_226,b,"var_226"); + CrcCheck.ToByteArray(this.var_260,b,"var_260"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_271[a0][a1][a2],b,"var_271" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_76.java b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_76.java new file mode 100644 index 0000000000000000000000000000000000000000..1491c65cbc321814d772f542281e93a2f00ea602 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/453_2019010203642/cl_76.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=205973598 + +//import java.util.zip.CRC32; + +class cl_76 +{ + int var_65 = (570801366); + int [][][] var_72 = {{{(921844524)},{(650825937)},{(-421821818)}},{{(-543040609)},{(621844322)},{(-1749836892)}},{{(247998990)},{(1476475974)},{(-542117281)}},{{(1867831804)},{(1990739389)},{(-1430945029)}},{{(-2044699835)},{(-675179744)},{(1023572172)}}}; + float var_83 = (-1.16923e-26F); + short var_87 = (short)(5716); + byte var_88 = (byte)(-39); + final double var_311 = (5.73663e+165D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(79); + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_72[a0][a1][a2],b,"var_72" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + CrcCheck.ToByteArray(this.var_88,b,"var_88"); + CrcCheck.ToByteArray(this.var_311,b,"var_311"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/CRC32.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/MainClass.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..413528fecdc1ad768a42e478b8e8ccaecbc6be21 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/MainClass.java @@ -0,0 +1,513 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2309790164 + +//import java.util.zip.CRC32; + +class MainClass +{ + byte var_2 = (byte)(47); + cl_27 var_138 = new cl_27(); + cl_42 var_140 = new cl_42(); + int var_142 = (-637611582); + short var_145 = (short)(-13115); + cl_58 var_150 = new cl_58(); + final cl_101 var_152 = new cl_101(); + long var_163 = (-474549182042989774L); + cl_120 var_164 = new cl_120(); + int var_172 = (-2056948835); + byte var_174 = (byte)(-45); + cl_101 var_176 = new cl_101(); + int [][][] var_181 = {{{(1688418193),(-498881420)},{(-1442415529),(156343447)},{(1602734094),(-955524677)},{(166309942),(1351971951)},{(673416015),(-1205569474)}},{{(700532611),(658852872)},{(-643312158),(-1653644245)},{(1381019237),(-97832434)},{(-978402749),(1319526895)},{(-2140806124),(-678542379)}},{{(958373215),(-1250211676)},{(-1981885705),(-282609155)},{(-1058803868),(-1212846361)},{(-289489195),(342272538)},{(-773237755),(-45266062)}},{{(920970124),(2092406510)},{(-778451024),(-58852949)},{(2026425379),(-476039458)},{(1347392293),(89020534)},{(1699014770),(1051475699)}},{{(-1380356847),(-484984566)},{(-1308450070),(-1456367200)},{(-694753977),(-128351232)},{(601644951),(1053614027)},{(748846383),(-803405774)}},{{(916335308),(1512711121)},{(-37843776),(-825531889)},{(-474566906),(-1355595124)},{(-1678658838),(2116915731)},{(1361804428),(633667008)}}}; + byte var_184 = (byte)(-46); + int var_191 = (474165302); + byte var_197 = (byte)(8); + final cl_54 var_202 = new cl_54(); + byte var_214 = (byte)(52); + int [][][] var_219 = {{{(430704409),(-1702382811)},{(114782785),(-1864870)},{(-2021152531),(1888696736)},{(1502665476),(-1275796330)},{(1779060476),(1558489772)}},{{(-2096611835),(2016658082)},{(2102373054),(1829884103)},{(2031434950),(-785504930)},{(236059196),(-1570721327)},{(-266680001),(-677963158)}},{{(462186087),(1344500287)},{(181694712),(1544328493)},{(1863169660),(1146532355)},{(262975399),(520369009)},{(-265923835),(2024275124)}},{{(-842004344),(1184886457)},{(795180015),(1463555460)},{(708691377),(-1928475575)},{(-555527822),(1986051698)},{(1642390662),(445945864)}},{{(1767523870),(-1356933382)},{(2049065968),(-1462245824)},{(-375373474),(223654725)},{(-314339131),(1072500191)},{(1956974289),(32273819)}},{{(-100960742),(638907479)},{(-1975727201),(-719753087)},{(-41868126),(1780628718)},{(712137618),(-1297274304)},{(1984306444),(1751444327)}}}; + int var_223 = (-906399317); + boolean var_225 = true; + int [][][] var_229 = {{{(-1374732023),(-2025791688)},{(-1179033433),(-1571224061)},{(555902216),(-1095673257)},{(-562118932),(-481925381)},{(-1219115856),(1549091798)}},{{(551771317),(-933071116)},{(1489266509),(-533227400)},{(27554026),(806202651)},{(-1616740296),(681180988)},{(1539841739),(-1399967433)}},{{(-499908320),(-1268116028)},{(2117613225),(-1686471853)},{(-630159462),(690745630)},{(250903784),(-580013436)},{(-226226968),(532082771)}},{{(-1777083719),(957929377)},{(-313911037),(1561537396)},{(862358558),(560587010)},{(-1326257521),(2112206423)},{(1434068868),(-1213436816)}},{{(-593890172),(-587043559)},{(759234701),(1384667095)},{(936358849),(-1733666419)},{(-865923875),(-1859123635)},{(-714570920),(-655601526)}},{{(-1851316432),(247401443)},{(-1591375847),(135016503)},{(-1572952575),(-1390301825)},{(1131258217),(1533179689)},{(2021346684),(-1364160955)}}}; + final float [][] var_239 = {{(1.39366e+29F),(-1.02849e+12F),(-1.28415e-23F),(1.03913e+07F),(-1.0185e+14F),(-1.97913e+16F)},{(211060F),(-2.0121e-18F),(-3.05774e-36F),(-1.31638e+30F),(-6.84997e+24F),(8.4132e-16F)},{(-1.82235e-28F),(5.22084e-11F),(1.84216e+35F),(-2.39036e-16F),(101.674F),(-1.50555e+27F)},{(3.25499e-21F),(6.10879F),(-5.01534e+17F),(12541.5F),(2.12601e+06F),(-3.33735e-37F)},{(5.62462e-05F),(-4.91296e-08F),(1.69294e-09F),(5.88033e-29F),(1.14801e-19F),(-7.10932e+06F)}}; + boolean [][][] var_242 = {{{true,true,true,true,false,false},{true,true,true,true,true,false},{false,false,true,true,false,false},{false,false,true,false,true,true},{false,true,true,false,false,true}},{{false,false,false,true,true,true},{false,true,false,true,false,false},{false,true,true,false,false,false},{true,true,true,true,false,true},{false,true,false,false,true,false}},{{true,false,false,true,true,false},{true,false,false,true,true,false},{false,true,true,true,true,true},{false,false,false,true,false,true},{true,false,true,false,false,false}}}; + int [][][] var_244 = {{{(-26814370),(2092701763)},{(1248926270),(1900813529)},{(-1313415128),(1222266541)},{(-1624364681),(-1325113268)},{(2027196470),(-929700386)}},{{(-1831371629),(1652841679)},{(2042617914),(-794092528)},{(-1776041180),(340233790)},{(1717345875),(1960962019)},{(1191915726),(-723910094)}},{{(301263036),(-1223155485)},{(-2145278322),(2002554458)},{(219768749),(1349934286)},{(-1204348205),(105975456)},{(-841446358),(-316912531)}},{{(975226478),(-262430693)},{(-1022756221),(-872008520)},{(-1811027286),(1374379370)},{(-1718380466),(-1778545205)},{(-548482878),(-1957216246)}},{{(55602802),(-727736417)},{(932672981),(1896631399)},{(1404626504),(-1575310389)},{(1276791706),(-94838350)},{(1354006696),(1684627311)}},{{(-1842863368),(2051510768)},{(-1309209423),(-1235614193)},{(111498214),(1870246031)},{(1124310717),(-851571013)},{(-1925908094),(-832174726)}}}; + int var_253 = (1468109793); +/*********************************/ +public strictfp void run() +{ + boolean var_0 = false; + boolean [][][] var_251 = {{{true,true,false,true},{true,false,true,true},{false,true,true,true},{true,true,false,true}},{{true,false,false,false},{true,true,true,false},{false,true,false,false},{false,false,true,true}}}; + double var_255 = (-1.58499e-126D); + boolean [][] var_1 = {{false},{true},{false},{false},{false}}; + byte var_259 = (byte)(65); + var_0 = (!((+(var_2--))>func_3(var_251 ,(((~(++var_184))&var_202.var_73)|( ( long )(var_253++) )) ,(--var_255) ,var_202.var_257 ,(var_259++)))) ; + return ; +} +public strictfp double func_3(boolean[][][] var_4, long var_5, double var_6, float var_7, int var_8) +{ + short var_10 = (short)(-6547); + short var_13 = (short)(23844); + byte var_12 = (byte)(33); + final long [][][] var_9 = {{{(-5704458895168009170L),(-3952972920084251260L),(-3212455141355811754L),(3560496882043756395L),(-6275099568110854393L)},{(-3540802667130522385L),(5380801732928616872L),(825673590820739537L),(3911736429336667331L),(-1880530449667471425L)},{(-4260661954698564867L),(6981897987288149949L),(-2019719131826685530L),(-7359066177864863564L),(923652635328966133L)}},{{(3652078158543816861L),(-1300751690727483010L),(-8175659616127693963L),(8695232126678150745L),(-3923512611722252888L)},{(2087975037079761186L),(-158557037538432331L),(4091582019611390928L),(-9120965146241926362L),(1583615494495681508L)},{(-6518007615230620262L),(-8863152671709644781L),(9185726763487219075L),(-1425889114836755539L),(7833917583215957641L)}},{{(1044594554906103783L),(6416277435899838222L),(-8053665192745161623L),(-6100673364179889474L),(2121122023186050545L)},{(5744337949625218885L),(-7436256491928068513L),(3583302826037897704L),(247772663303178463L),(-5545141304672545806L)},{(-5643959470540002494L),(-5486714035724027400L),(5269539959182771565L),(-3757809549614315104L),(8643813226736325931L)}},{{(-8601628827251984514L),(3253605707042038078L),(-5509352060751683310L),(2129187372675473906L),(-192302615853073219L)},{(-6541688595486509169L),(5255854309537625626L),(-6668204650570419583L),(-8258571382664011535L),(-1305205856506398658L)},{(9025516075944617551L),(2351177553946710106L),(-1211118881296959690L),(-1606160782642322075L),(-2009085993228491630L)}},{{(-1451589628490588558L),(392810482004846545L),(-2362365358470354580L),(-5242224194346665735L),(4363902892915647763L)},{(5158429701728172675L),(5568669197921630821L),(902818152408307921L),(1024159822105202358L),(-352260243104774817L)},{(8433486388120513430L),(-8055476729724778151L),(-5126732110251658072L),(-3432971379387294453L),(-3681148715732792206L)}}}; + short var_11 = (short)(-16979); + short var_217 = (short)(22981); + final boolean [][] var_15 = {{false,false,false,true},{false,false,true,false},{false,true,true,true},{false,true,false,true}}; + int var_14 = (208600607); + cl_27 var_232 = new cl_27(); + short var_209 = (short)(-24988); + var_5 = (var_8--) ; + if( var_15[((--var_217)&3)][(((-((--var_8)-func_16(func_16((~(+(var_2++))) ,var_140.var_151 ,( ( double )(-(var_209--)) ) ,var_138) ,var_152.var_153 ,( ( double )(var_214--) ) ,var_138)))&var_174)&3)]) + { + System.out.println(" if stmt begin,id=1 "); + if( (!(!(!(!((var_14--)==var_145)))))) + { + System.out.println(" if stmt begin,id=2 "); + try + { + if( ((++var_10)181);var_234 = (var_234-4) ) + { + var_4[((var_12++)&1)][(((var_12++)&(byte)(-82))&3)][((--var_14)&3)] = (!((-(((++var_2)|func_16((var_12++) ,var_181 ,(var_12++) ,var_138))|(short)(31579)))880);var_236 = (var_236-17) ) + { + int var_237 = (845288069); + for( var_237 = 616 ;(var_237<635);var_237 = (var_237+19) ) + { + var_138.var_238.var_203 = ( ( boolean )((~(var_8++))<=var_150.var_58.var_235) ) ; + } + } + System.out.println(" else stmt end,id=1 "); + } + System.out.println("hello exception 1 !"); + } + System.out.println(" if stmt end,id=2 "); + } + else + { + System.out.println(" else stmt begin,id=2 "); + int var_240 = (-1478062985); + double var_249 = (4.65333e+134D); + for( var_240 = 1015 ;(var_240>991);var_240 = (var_240-12) ) + { + int var_241 = (-1241228322); + double [] var_246 = {(9.97336e+31D),(-1.72928e+224D),(-5.70609e-180D),(3.76303e-245D),(4.57857e-280D)}; + for( var_241 = 492 ;(var_241<552);var_241 = (var_241+15) ) + { + if( (!(!(!((-(++var_12))>(-4.91913e+180D)))))) + { + System.out.println(" if stmt begin,id=6 "); + if( var_242[((((var_184++)|func_16(( ( int )(var_11--) ) ,var_244 ,var_246[((var_223--)&4)] ,var_232))+var_14)&2)][((var_12++)&4)][((++var_217)&5)]) + { + System.out.println(" if stmt begin,id=7 "); + var_164 = var_138.var_110.var_88 ; + System.out.println(" if stmt end,id=7 "); + } + else + { + System.out.println(" else stmt begin,id=3 "); + var_4[((-(--var_12))&1)][(((var_2--)-var_191)&3)][3] = ((!((var_249--)>=var_145))||( ( boolean )(!((var_12--)!=var_138.var_250)) )) ; + System.out.println(" else stmt end,id=3 "); + } + System.out.println(" if stmt end,id=6 "); + } + } + } + System.out.println(" else stmt end,id=2 "); + } + System.out.println(" if stmt end,id=1 "); + } + return (var_7++); +} +public strictfp int func_16(int var_17, int[][][] var_18, double var_19, cl_27 var_20) +{ + int [][][] var_154 = {{{(-1650067959),(-1635192288)},{(979302119),(810473296)},{(165279340),(-1796939516)},{(1096659950),(-38322115)},{(45695816),(-92021069)}},{{(351523287),(1444680856)},{(-1456756318),(2147010828)},{(-1597740474),(-368410523)},{(1338175417),(1002198458)},{(1486623426),(1419197353)}},{{(1126318213),(-762985191)},{(-2037877830),(1095403310)},{(1132778624),(-279041979)},{(-756135438),(1321598470)},{(1177092720),(-1082852213)}},{{(-1478418236),(-735962126)},{(407293031),(-125514467)},{(1961935681),(1052170803)},{(1507226331),(-2090880351)},{(-1638232568),(-1934738753)}},{{(141805746),(1353144352)},{(-813565894),(350878469)},{(1571415785),(748471470)},{(1725398593),(-185982895)},{(-1139830695),(558919584)}},{{(-2124901145),(-1207285860)},{(2001424869),(-1945932571)},{(428271747),(-643413790)},{(100216043),(1518360231)},{(1569428588),(-1774183981)}}}; + long [][] var_161 = {{(5408283981982655843L),(6402188888752778439L),(5133636855447492077L),(1667134627475657718L),(-5691039057543633671L),(2576312605478200298L),(6035757961094341971L)},{(-2429170516917281548L),(-8643731640591565537L),(-6136807171828890028L),(-4373791771019136455L),(-664778127797672212L),(-5176044800151210488L),(192688233330814192L)},{(7079993388834438841L),(308971001234230513L),(1660714329569919560L),(-4604868038699224718L),(1905347476245740434L),(2942417837587660847L),(7376785249781314840L)},{(5479221281207888848L),(5651571883964351734L),(-3941593061453308137L),(-3807643577068194331L),(-8422227623153857185L),(-9169299792218171544L),(-324665431102373549L)},{(-8262563628476888484L),(7931541817621476341L),(-4438188552620177905L),(-8016705263518902246L),(-1313292517518144055L),(-6194310539549104962L),(-8181969591208874482L)},{(-2498444971132078885L),(3542958972905175633L),(1224608831633355737L),(922991255306539469L),(-449219725155750389L),(7902848580104192779L),(9153295627080257740L)},{(-4949829406292989424L),(-1927632551522238923L),(6131962312490445430L),(-4337829306514973689L),(2767141770005662291L),(-7365551098578146260L),(7772920462446296008L)}}; + byte var_206 = (byte)(18); + boolean [] var_193 = {false,true}; + if( var_138.func_21((-6.39514e+08F))) + { + System.out.println(" if stmt begin,id=8 "); + byte var_139 = (byte)(60); + if( (!(!((-(-(++var_139)))!=var_140.var_91)))) + { + System.out.println(" if stmt begin,id=9 "); + if( true) + { + System.out.println(" if stmt begin,id=10 "); + int var_141 = (-126549730); + for( var_141 = 690 ;(var_141<693);var_141 = (var_141+3) ) + { + cl_42 var_144 = new cl_42(); + for( var_142 = 1015 ;(var_142>985);var_142 = (var_142-15) ) + { + int var_143 = (-1035834199); + for( var_143 = 789 ;(var_143<859);var_143 = (var_143+14) ) + { + var_140 = var_138.var_110.var_79 ; + } + } + } + System.out.println(" if stmt end,id=10 "); + } + else + { + System.out.println(" else stmt begin,id=4 "); + if( (!((var_139++)>var_140.var_91))) + { + System.out.println(" if stmt begin,id=11 "); + if( ((++var_145)>(short)(15559))) + { + System.out.println(" if stmt begin,id=12 "); + try + { + boolean var_146 = false; + } + catch( java.lang.ArithmeticException myExp_147 ) + { + var_18 = var_154 ; + System.out.println("hello exception 2 !"); + } + System.out.println(" if stmt end,id=12 "); + } + System.out.println(" if stmt end,id=11 "); + } + else + { + System.out.println(" else stmt begin,id=5 "); + int var_155 = (574361125); + for( var_155 = 166 ;(var_155<184);var_155 = (var_155+9) ) + { + if( ((var_139--)347);var_156 = (var_156-13) ) + { + try + { + try + { + int var_157 = (-715362740); + for( var_157 = 999 ;(var_157<1019);var_157 = (var_157+5) ) + { + var_138 = var_20 ; + } + } + catch( java.lang.IllegalArgumentException myExp_158 ) + { + int var_159 = (-1707070391); + for( var_159 = 767 ;(var_159>759);var_159 = (var_159-8) ) + { + var_161[6][(((var_2++)&var_142)&6)] = (1915163222523886679L) ; + } + System.out.println("hello exception 3 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_162 ) + { + try + { + cl_54 var_167 = new cl_54(); + if( (!(((var_139--)|( ( int )(++var_163) ))!=( ( byte )((--var_145)*var_145) )))) + { + System.out.println(" if stmt begin,id=14 "); + var_164.var_165 = ((var_139--)-var_145) ; + System.out.println(" if stmt end,id=14 "); + } + else + { + System.out.println(" else stmt begin,id=7 "); + var_150.var_166 = var_138.var_110.var_72 ; + System.out.println(" else stmt end,id=7 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_169 ) + { + if( ((++var_170)>=var_152.var_171)) + { + System.out.println(" if stmt begin,id=15 "); + var_150.var_72.var_80 = (-(var_2--)) ; + System.out.println(" if stmt end,id=15 "); + } + System.out.println("hello exception 5 !"); + } + System.out.println("hello exception 4 !"); + } + } + System.out.println(" else stmt end,id=6 "); + } + System.out.println(" if stmt end,id=8 "); + } + else + { + System.out.println(" else stmt begin,id=8 "); + cl_42 var_205 = new cl_42(); + int var_195 = (-88763367); + try + { + for( var_172 = 192 ;(var_172>127);var_172 = (var_172-13) ) + { + int var_173 = (1047287038); + for( var_173 = 827 ;(var_173>820);var_173 = (var_173-7) ) + { + try + { + int var_178 = (976069298); + if( (((var_174++)+(byte)(65))==var_138.var_175)) + { + System.out.println(" if stmt begin,id=16 "); + var_176 = var_138.var_110.var_58 ; + System.out.println(" if stmt end,id=16 "); + } + else + { + System.out.println(" else stmt begin,id=9 "); + byte var_177 = (byte)(3); + var_18[(((var_2++)*var_142)&5)][((--var_178)&4)][((var_177++)&1)] = ((--var_2)|var_2) ; + System.out.println(" else stmt end,id=9 "); + } + } + catch( java.lang.ArithmeticException myExp_179 ) + { + int var_180 = (1114187236); + for( var_180 = 945 ;(var_180>900);var_180 = (var_180-9) ) + { + var_18 = var_181 ; + } + System.out.println("hello exception 6 !"); + } + } + } + } + catch( java.lang.ArithmeticException myExp_182 ) + { + boolean [] var_183 = {true,false}; + byte var_204 = (byte)(-69); + try + { + try + { + try + { + if( var_183[(((((++var_184)&var_164.var_185)*var_140.var_91)-(byte)(84))&1)]) + { + System.out.println(" if stmt begin,id=17 "); + cl_54 var_186 = new cl_54(); + System.out.println(" if stmt end,id=17 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_187 ) + { + int var_188 = (-1403669868); + for( var_188 = 347 ;(var_188<387);var_188 = (var_188+10) ) + { + float var_189 = (3.30103e-28F); + } + System.out.println("hello exception 8 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_190 ) + { + for( var_191 = 360 ;(var_191>316);var_191 = (var_191-11) ) + { + int var_192 = (1803776385); + for( var_192 = 1020 ;(var_192>975);var_192 = (var_192-15) ) + { + var_183 = var_193 ; + } + } + System.out.println("hello exception 9 !"); + } + } + catch( java.lang.ArithmeticException myExp_194 ) + { + try + { + byte var_198 = (byte)(-87); + if( ((var_195--)>var_145)) + { + System.out.println(" if stmt begin,id=18 "); + int var_196 = (-1370961714); + for( var_196 = 310 ;(var_196<324);var_196 = (var_196+7) ) + { + var_18[((((++var_198)|var_150.var_166.var_107)+var_145)&5)][((--var_197)&4)][((--var_195)&1)] = (--var_198) ; + } + System.out.println(" if stmt end,id=18 "); + } + else + { + System.out.println(" else stmt begin,id=10 "); + int var_199 = (-467766773); + for( var_199 = 393 ;(var_199<438);var_199 = (var_199+9) ) + { + cl_58 var_200 = new cl_58(); + } + System.out.println(" else stmt end,id=10 "); + } + } + catch( java.lang.IllegalArgumentException myExp_201 ) + { + if( var_202.var_203) + { + System.out.println(" if stmt begin,id=19 "); + if( (!((+(--var_204))<=var_145))) + { + System.out.println(" if stmt begin,id=20 "); + var_174 = (byte)(27) ; + System.out.println(" if stmt end,id=20 "); + } + else + { + System.out.println(" else stmt begin,id=11 "); + var_195 = (-(++var_184)) ; + System.out.println(" else stmt end,id=11 "); + } + System.out.println(" if stmt end,id=19 "); + } + else + { + System.out.println(" else stmt begin,id=12 "); + var_140 = var_205 ; + System.out.println(" else stmt end,id=12 "); + } + System.out.println("hello exception 11 !"); + } + System.out.println("hello exception 10 !"); + } + System.out.println("hello exception 7 !"); + } + System.out.println(" else stmt end,id=8 "); + } + return (--var_206); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1262); + CrcCheck.ToByteArray(this.var_2,b,"var_2"); + CrcCheck.ToByteArray(this.var_138.GetChecksum(),b,"var_138.GetChecksum()"); + CrcCheck.ToByteArray(this.var_140.GetChecksum(),b,"var_140.GetChecksum()"); + CrcCheck.ToByteArray(this.var_142,b,"var_142"); + CrcCheck.ToByteArray(this.var_145,b,"var_145"); + CrcCheck.ToByteArray(this.var_150.GetChecksum(),b,"var_150.GetChecksum()"); + CrcCheck.ToByteArray(this.var_152.GetChecksum(),b,"var_152.GetChecksum()"); + CrcCheck.ToByteArray(this.var_163,b,"var_163"); + CrcCheck.ToByteArray(this.var_164.GetChecksum(),b,"var_164.GetChecksum()"); + CrcCheck.ToByteArray(this.var_172,b,"var_172"); + CrcCheck.ToByteArray(this.var_174,b,"var_174"); + CrcCheck.ToByteArray(this.var_176.GetChecksum(),b,"var_176.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_181[a0][a1][a2],b,"var_181" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_184,b,"var_184"); + CrcCheck.ToByteArray(this.var_191,b,"var_191"); + CrcCheck.ToByteArray(this.var_197,b,"var_197"); + CrcCheck.ToByteArray(this.var_202.GetChecksum(),b,"var_202.GetChecksum()"); + CrcCheck.ToByteArray(this.var_214,b,"var_214"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_219[a0][a1][a2],b,"var_219" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_223,b,"var_223"); + CrcCheck.ToByteArray(this.var_225,b,"var_225"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_229[a0][a1][a2],b,"var_229" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_239[a0][a1],b,"var_239" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_242[a0][a1][a2],b,"var_242" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_244[a0][a1][a2],b,"var_244" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_253,b,"var_253"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/Start.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..be75a7f5ccb8164ec94fc0e33eff6e10a18820dd --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_120.java MainClass.java cl_42.java CRC32.java cl_58.java cl_54.java CrcCheck.java cl_101.java cl_27.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_101.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_101.java new file mode 100644 index 0000000000000000000000000000000000000000..17b9678e85521220c64d7d16403a2e31445e0dbb --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_101.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2309790164 + +//import java.util.zip.CRC32; + +class cl_101 +{ + int var_113 = (-609594025); + final int [][][] var_153 = {{{(705408753),(-921736171)},{(-244864984),(-1141382535)},{(306789196),(1316276520)},{(512898319),(151586644)},{(189499308),(-401388611)}},{{(-1975834221),(-708488053)},{(573554818),(-735408544)},{(433092652),(1491552243)},{(3345465),(1574040000)},{(-1074018544),(-1248672986)}},{{(-1156286499),(-1826274011)},{(2016862984),(-810541301)},{(55449680),(-1325265670)},{(-1116700620),(-346394619)},{(-1318371227),(648105875)}},{{(639194003),(-1761746497)},{(1651221356),(1452725643)},{(-64842877),(1026607627)},{(1205836472),(984359607)},{(330123890),(-1447558144)}},{{(696016412),(-486397925)},{(-1111812907),(-657720150)},{(-70725177),(1624224493)},{(1247923136),(1318202070)},{(-1915641380),(1144539459)}},{{(1555363568),(280204677)},{(-88790895),(-1968392160)},{(1046664159),(-1963910722)},{(701479018),(169304127)},{(178935136),(-1136447879)}}}; + double var_171 = (1.19187e-78D); + float var_235 = (-6.3488e+08F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(256); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_153[a0][a1][a2],b,"var_153" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_171,b,"var_171"); + CrcCheck.ToByteArray(this.var_235,b,"var_235"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_120.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_120.java new file mode 100644 index 0000000000000000000000000000000000000000..f45cf468f49474ef50f681ba145bf1f1dad42294 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_120.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2309790164 + +//import java.util.zip.CRC32; + +class cl_120 +{ + short var_87 = (short)(-30307); + final double [] var_98 = {(-1.47532e+168D),(-1.53651e+306D),(1.14433e+261D),(4.13971e-202D),(3.02433e+118D),(-1.68545e+72D),(-1.40414e-124D)}; + float var_101 = (-1.83945e+37F); + final int [][][] var_149 = {{{(-1246117603),(-1080757889)},{(-610590317),(1218002460)},{(-2089884237),(2109702998)},{(1218917967),(-418851303)},{(-1122621027),(-660069785)}},{{(-822395502),(640886798)},{(2036320404),(326749496)},{(-1533531329),(-893219280)},{(525354729),(-1265610679)},{(1579406884),(1088646474)}},{{(-1213143560),(-2059033758)},{(-702767798),(1658433867)},{(1475088967),(447618954)},{(1993160463),(750617030)},{(1487662961),(263975422)}},{{(82961734),(-374136109)},{(235660212),(-634983350)},{(-690642596),(603993841)},{(-105577975),(-288315963)},{(1535913995),(-769953035)}},{{(-1364988553),(412723975)},{(-1259038953),(-353301166)},{(1920864433),(-1391871145)},{(1100884313),(-1365197405)},{(-95985627),(1493629554)}},{{(68956879),(1498622969)},{(535361539),(1261533468)},{(1757502222),(940822658)},{(-89302995),(1901237289)},{(-2010303146),(1637042635)}}}; + long var_165 = (-4030719856334671451L); + int var_185 = (-415303754); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(314); + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_98[a0],b,"var_98" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_101,b,"var_101"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_149[a0][a1][a2],b,"var_149" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_165,b,"var_165"); + CrcCheck.ToByteArray(this.var_185,b,"var_185"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_27.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_27.java new file mode 100644 index 0000000000000000000000000000000000000000..6ef917e69f94f73af0ee570d999facc1e18169ca --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_27.java @@ -0,0 +1,166 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2309790164 + +//import java.util.zip.CRC32; + +class cl_27 +{ + int var_24 = (6184535); + cl_42 [][][] var_26 = {{{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()}},{{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()}},{{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()},{new cl_42(),new cl_42(),new cl_42(),new cl_42()}}}; + final static cl_42 var_27 = new cl_42(); + static cl_42 [][][] var_33 = {{{new cl_42(),new cl_42(),new cl_42(),new cl_42(),new cl_42()}},{{new cl_42(),new cl_42(),new cl_42(),new cl_42(),new cl_42()}}}; + static int var_38 = (-595832897); + static cl_58 var_110 = new cl_58(); + static byte var_111 = (byte)(38); + static cl_101 var_112 = new cl_101(); + short var_119 = (short)(9041); + int var_127 = (-1048436311); + int var_129 = (-641394401); + int var_136 = (-25921332); + cl_120 var_148 = new cl_120(); + float var_175 = (-9.07156e-23F); + cl_54 var_238 = new cl_54(); + double var_250 = (2.57032e-146D); +/*********************************/ +public strictfp boolean func_21(float var_22) +{ + try + { + short var_121 = (short)(-15919); + int var_23 = (1011158248); + for( var_23 = 972 ;(var_23<988);var_23 = (var_23+16) ) + { + for( var_24 = 265 ;(var_24<285);var_24 = (var_24+5) ) + { + int var_25 = (-1350684017); + for( var_25 = 181 ;(var_25<200);var_25 = (var_25+19) ) + { + var_26[(var_23&2)][(var_24&5)][(var_25&3)] = func_28((--var_119) ,(var_121--) ,(var_121++)) ; + } + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_124 ) + { + byte var_137 = (byte)(54); + if( ((var_119++)<=var_27.var_125)) + { + System.out.println(" if stmt begin,id=21 "); + double var_126 = (1.53341e-69D); + System.out.println(" if stmt end,id=21 "); + } + else + { + System.out.println(" else stmt begin,id=13 "); + long [][][] var_135 = {{{(-7976213192894720767L),(6804238758574680648L),(-7812287925227177946L),(-3640458936704678245L),(-8546771600919468296L),(4638980226543948486L)},{(1628303897997643916L),(-25440959491941363L),(5690968627859704741L),(7247774654466435772L),(-1224238868048658075L),(-6158208434430955639L)},{(-4595989913672553036L),(-549725956291779312L),(-416824968428931303L),(-8507433205110997231L),(5178290841897601302L),(2098463778959310648L)},{(298823555335723493L),(-4718837730935883220L),(-7284963934679455462L),(-7911939316212788656L),(-325758248938368905L),(-336901362140582499L)},{(-8413331651272682419L),(4788327043368299675L),(590643122820090621L),(5764890078144914264L),(-7080188012887229740L),(-6593938422469067991L)},{(-5691244418993943138L),(-4891467835798989824L),(7706455164476901884L),(-2951467308437488738L),(1305244871309417952L),(6506109576381418882L)},{(3742358104912175539L),(136967365871451619L),(7060304275744611364L),(4238143961986301498L),(3596692617233062757L),(3977890595066398701L)}},{{(-7801734548218957163L),(-8707016339379063596L),(-6170429536824999459L),(-2208650880810790319L),(8152991618474613544L),(-7188696914616687614L)},{(7770509949083814010L),(-1671207561366360601L),(-4326751691589050006L),(-3012284250221843904L),(7524647009441514595L),(-5892608736734187311L)},{(7901349666570648519L),(-7944026809422258597L),(-8792960124375404575L),(3558924541643666288L),(-4873855838962159112L),(-7510715586648544715L)},{(9126464639577324617L),(-4288462499648196779L),(6496207033507812280L),(7812715832722812022L),(-2079694901743114614L),(8308038140620960635L)},{(-5930121041413420672L),(-1658276194968365725L),(9061138457913527503L),(-623009234899139050L),(1825022975136704374L),(-104849221584992986L)},{(-6630085527726106748L),(3373298961069477818L),(-415538220212071552L),(-4539352310849287874L),(-221603332317838172L),(-6752622154731589567L)},{(-6965392423204894790L),(5161909438543082006L),(-3445390949742596676L),(-424159810750291040L),(3669132958891984448L),(3528558269717422085L)}}}; + try + { + for( var_127 = 296 ;(var_127>251);var_127 = (var_127-9) ) + { + cl_101 var_132 = new cl_101(); + cl_101 [] var_130 = {new cl_101()}; + if( true) + { + System.out.println(" if stmt begin,id=22 "); + int var_128 = (-1127214408); + for( var_128 = 843 ;(var_128<855);var_128 = (var_128+6) ) + { + final cl_101 var_131 = new cl_101(); + var_130[(var_128&0)] = var_112 ; + } + System.out.println(" if stmt end,id=22 "); + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_133 ) + { + var_135[((var_137++)&1)][(((~(var_137--))&var_112.var_113)&6)][(((var_136++)-var_137)&5)] = (var_137++) ; + System.out.println("hello exception 13 !"); + } + System.out.println(" else stmt end,id=13 "); + } + System.out.println("hello exception 12 !"); + } + return true; +} +public static strictfp cl_42 func_28(float var_29, int var_30, long var_31) +{ + int var_32 = (-839707176); + final cl_58 var_117 = new cl_58(); + short var_116 = (short)(20311); + for( var_32 = 587 ;(var_32<613);var_32 = (var_32+13) ) + { + int var_118 = (906683223); + var_33 = func_34((var_116++) ,var_117 ,((var_116++)+( ( long )(--var_118) ))) ; + } + return var_27; +} +public static strictfp cl_42[][][] func_34(int var_35, cl_58 var_36, long var_37) +{ + boolean [][] var_41 = {{true,true,false,false,false,true},{true,false,true,false,false,true}}; + byte var_42 = (byte)(98); + for( var_38 = 209 ;(var_38<248);var_38 = (var_38+13) ) + { + boolean var_114 = false; + int var_39 = (1011592912); + for( var_39 = 145 ;(var_39>124);var_39 = (var_39-7) ) + { + var_41[1][(((++var_42)+var_110.func_43((!((-(++var_111))==var_112.var_113))))&5)] = ( ( boolean )var_114 ) ; + } + } + final cl_42 [][][] var_115 = {{{new cl_42(),new cl_42(),new cl_42(),new cl_42(),new cl_42()}},{{new cl_42(),new cl_42(),new cl_42(),new cl_42(),new cl_42()}}}; + return var_115; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(731); + CrcCheck.ToByteArray(this.var_24,b,"var_24"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_26[a0][a1][a2].GetChecksum(),b,"var_26" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_27.GetChecksum(),b,"var_27.GetChecksum()"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_33[a0][a1][a2].GetChecksum(),b,"var_33" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_38,b,"var_38"); + CrcCheck.ToByteArray(this.var_110.GetChecksum(),b,"var_110.GetChecksum()"); + CrcCheck.ToByteArray(this.var_111,b,"var_111"); + CrcCheck.ToByteArray(this.var_112.GetChecksum(),b,"var_112.GetChecksum()"); + CrcCheck.ToByteArray(this.var_119,b,"var_119"); + CrcCheck.ToByteArray(this.var_127,b,"var_127"); + CrcCheck.ToByteArray(this.var_129,b,"var_129"); + CrcCheck.ToByteArray(this.var_136,b,"var_136"); + CrcCheck.ToByteArray(this.var_148.GetChecksum(),b,"var_148.GetChecksum()"); + CrcCheck.ToByteArray(this.var_175,b,"var_175"); + CrcCheck.ToByteArray(this.var_238.GetChecksum(),b,"var_238.GetChecksum()"); + CrcCheck.ToByteArray(this.var_250,b,"var_250"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_42.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_42.java new file mode 100644 index 0000000000000000000000000000000000000000..2bfbfae938e25320bea69a20bf85210a28c8cc3b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_42.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2309790164 + +//import java.util.zip.CRC32; + +class cl_42 +{ + byte var_91 = (byte)(-25); + int var_108 = (-836233929); + float var_125 = (6.6401e-33F); + int [][][] var_151 = {{{(1547868765),(-441036367)},{(-1609604360),(757351172)},{(-1657701628),(-877327111)},{(-222367922),(-1341810560)},{(-1339355081),(1103704780)}},{{(931223025),(-640792912)},{(-1290609025),(-1996882014)},{(2054089252),(390188892)},{(-1013964122),(-822277118)},{(751739597),(657617199)}},{{(1219647746),(-1465065576)},{(-337900745),(702745488)},{(-646852106),(1214943955)},{(-1479676882),(1283888310)},{(-1655954534),(-708427909)}},{{(30980784),(-731228442)},{(302569819),(-2113038906)},{(136484805),(-405228398)},{(1764558422),(791593181)},{(1929297698),(840363477)}},{{(-1780480765),(1679357909)},{(-58413451),(-1870523956)},{(2103247219),(-2081848758)},{(-1400635151),(-864149323)},{(75362637),(176680947)}},{{(532346093),(2056781852)},{(349436307),(810958220)},{(-670932097),(-1581960415)},{(-1442343479),(-834758913)},{(692902025),(293956820)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(249); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_125,b,"var_125"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_151[a0][a1][a2],b,"var_151" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_54.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_54.java new file mode 100644 index 0000000000000000000000000000000000000000..c0251d58031c622291383e866c50b5c01ef04c72 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_54.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2309790164 + +//import java.util.zip.CRC32; + +class cl_54 +{ + long var_73 = (1771654923121792967L); + short var_75 = (short)(13644); + int var_80 = (44800671); + final byte var_107 = (byte)(55); + boolean var_203 = true; + float var_257 = (-2339.77F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(20); + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_203,b,"var_203"); + CrcCheck.ToByteArray(this.var_257,b,"var_257"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_58.java b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_58.java new file mode 100644 index 0000000000000000000000000000000000000000..d753fa96bd5e9d259244d4003a7cb0100bf63ba6 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/4825_2018121004970/cl_58.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2309790164 + +//import java.util.zip.CRC32; + +class cl_58 +{ + static double var_46 = (-3.87624e+147D); + static int var_49 = (1127572544); + static int var_50 = (228395016); + static short var_53 = (short)(-21471); + static short var_56 = (short)(22151); + static int var_57 = (-112542735); + static cl_101 var_58 = new cl_101(); + static int var_65 = (-1730848789); + static short var_66 = (short)(-2914); + static cl_42 [][] var_70 = {{new cl_42(),new cl_42()},{new cl_42(),new cl_42()}}; + cl_42 [][] var_71 = {{new cl_42(),new cl_42()},{new cl_42(),new cl_42()}}; + final static cl_54 var_72 = new cl_54(); + static long var_74 = (-1231253718151243546L); + static byte var_76 = (byte)(88); + static cl_42 var_79 = new cl_42(); + static int var_82 = (-674239514); + static cl_120 var_86 = new cl_120(); + static cl_120 var_88 = new cl_120(); + long var_90 = (8747783636321567637L); + long var_94 = (7909315524004293632L); + static double [] var_97 = {(-9.40278e-291D),(-2.32277e+80D),(-2.96494e-195D),(-3.37976e-175D),(1.8567e-90D),(-9.22935e-173D),(-3.62082e-34D)}; + int var_100 = (212213568); + static short var_109 = (short)(1200); + cl_54 var_166 = new cl_54(); +/*********************************/ +public static strictfp int func_43(boolean var_44) +{ + final int [][] var_105 = {{(-113176156),(-968050365),(-1143414627),(-1279564510),(1868813082)}}; + byte var_106 = (byte)(-15); + byte var_45 = (byte)(44); + if( ( ( boolean )((++var_45)>=var_46) )) + { + System.out.println(" if stmt begin,id=23 "); + int var_47 = (2021452255); + for( var_47 = 761 ;(var_47<777);var_47 = (var_47+16) ) + { + int var_48 = (-1934147985); + double [] var_60 = {(1.93829e-212D),(-1.48756e+88D),(-2.61898e-52D),(3.00196e+09D),(1.35597e-31D),(-1.19349e+107D),(-6.50975e+299D)}; + for( var_48 = 366 ;(var_48>350);var_48 = (var_48-8) ) + { + double [] var_83 = {(1.67836e-308D),(-7.82678e-145D),(-1.10868e-69D),(4.65121e+136D),(-1.21757e-101D),(-9.74993e-26D),(4.54327e+266D)}; + short var_81 = (short)(-4245); + int [] var_52 = {(255214897),(-264807376),(329868375),(-1931631372)}; + for( var_49 = 694 ;(var_49>691);var_49 = (var_49-3) ) + { + float [] var_68 = {(-4.12698e+14F),(-7.87406e+15F),(3.08512e-19F),(-4.0143e-08F),(-1.83518e-22F),(2.11806e+20F),(-89.7471F)}; + int [] var_96 = {(-663569165),(-580718382),(-167202699),(-2114349412)}; + try + { + long var_61 = (7236313970849646936L); + cl_42 var_78 = new cl_42(); + int var_69 = (1970638538); + int var_85 = (2003363952); + for( var_50 = 765 ;(var_50>764);var_50 = (var_50-1) ) + { + int [][][] var_54 = {{{(1555249574),(356118425)},{(-584301452),(-1258592023)},{(2027882978),(794437467)},{(413374497),(1939253963)},{(-894016900),(-643219329)},{(-1989117672),(1601881905)},{(301030679),(-238957757)}},{{(-754850633),(-712767042)},{(-449960540),(-1622030333)},{(450567284),(359734924)},{(-255279790),(1959632568)},{(620946776),(1745161387)},{(-367546278),(1735928951)},{(361079375),(758873606)}},{{(1860876341),(-244595382)},{(587982554),(913744273)},{(-18661246),(1339008101)},{(378259725),(1892611740)},{(-252704),(1469365576)},{(-1080788660),(-686072389)},{(-1415339532),(1758220372)}},{{(979095350),(1462054881)},{(-1568723753),(-1840102119)},{(-1417946179),(1849863638)},{(-1202521889),(-1242054685)},{(-797914981),(1044610514)},{(1809562564),(1533040785)},{(-1423475865),(760490713)}},{{(1266301136),(-1857425253)},{(-902704312),(1364957875)},{(1638089278),(-756521320)},{(1306525409),(-698643659)},{(-204146120),(-1586988209)},{(1492510274),(-1040068396)},{(-925520859),(44282210)}}}; + float var_55 = (2.99438e-32F); + long [][] var_62 = {{(-8725629335096705995L)},{(-647687977963976379L)}}; + long var_64 = (2190945422569850143L); + var_52[((+((var_45++)*var_53))&3)] = (1202919527) ; + var_52[(var_50&3)] = (+(var_56--)) ; + float var_63 = (3.32378e+23F); + var_58 = var_58 ; + var_60[((var_57--)&6)] = (++var_61) ; + long var_67 = (-9181270313497410742L); + var_53 = (++var_56) ; + var_60[(var_50&6)] = (var_66--) ; + var_68[(var_50&6)] = (++var_45) ; + } + for( var_69 = 668 ;(var_69>662);var_69 = (var_69-6) ) + { + var_70 = var_70 ; + var_72.var_73 = (((-(var_45--))*var_74)*var_72.var_75) ; + final cl_42 var_77 = new cl_42(); + var_70[(((var_76++)-var_50)&1)][((~(++var_76))&1)] = var_79 ; + var_52[((--var_81)&3)] = (-(var_45++)) ; + var_70[((++var_76)&1)][((-((++var_65)|var_57))&1)] = var_79 ; + long var_84 = (-6676076002799481806L); + var_60 = var_83 ; + var_83[(var_69&6)] = (var_76--) ; + var_83[((var_57++)&6)] = (var_85++) ; + var_82 = (((++var_45)&var_53)-var_86.var_87) ; + var_86 = var_88 ; + } + try + { + boolean var_89 = false; + var_52[3] = (-((++var_45)+var_72.var_75)) ; + long [][][] var_95 = {{{(1762200148628569702L),(1559656204042290598L),(-7881899707958632273L),(-4218498203583654008L),(-1317639388872202L),(414592246447513045L),(-1119313903762313171L)},{(1294119602388261394L),(3543895088396064185L),(5060188391113043889L),(5778576693267176421L),(1529459928289557453L),(-6138787893512390976L),(3420850813544623338L)},{(1702509749708500592L),(5082045597084278944L),(8546502426382446481L),(-788821464280058733L),(-4419006215475792543L),(-9019172579804884217L),(2746083036499682105L)}},{{(-5944673435077309247L),(-5676083470605086009L),(-829694740250700526L),(98388727561740653L),(-2592491813988063328L),(-3799276441054378819L),(1462376981324429380L)},{(5976910882241113622L),(1788400566005078848L),(5548147758912098488L),(-7369618610466096935L),(-6972316718472217394L),(1042596673508662230L),(9132832658029119802L)},{(-1442577964937625842L),(-8557485623874255811L),(1027774937140767264L),(-6914946708814863402L),(286250278049029115L),(563403091080034160L),(1144644510970978125L)}},{{(-7911187521544527589L),(-8185685119666502771L),(-8714523044066063115L),(-2117213275108550213L),(5878717013343037588L),(-3245739525329569413L),(2044117023012276283L)},{(246199077922376395L),(8733099889365065423L),(-8549571521579104256L),(-7865394552733494L),(647950635242393978L),(-1758063111178313239L),(-8722594432440052138L)},{(-8395176619037306025L),(6122396369280653690L),(-7124111381686938337L),(7402729611407008252L),(-4735417107679311709L),(-7146114973809398020L),(-5728486550477035200L)}},{{(-5366190407354878705L),(1922980955043514976L),(-8723988552863193670L),(-3552258381462799668L),(1841401345279511843L),(-4866861386278934472L),(-8601482218205506617L)},{(-631155195347184681L),(-7330442501559371157L),(6246238297330429292L),(-8300847544118573114L),(4364398797572992052L),(-1113562365267978171L),(-5265649856493596846L)},{(-1889824325388583532L),(1398578423715519232L),(-1962102685069748868L),(5001180075487187691L),(3083822029878324362L),(236514150938738214L),(4012709453157456903L)}},{{(6694815054336587984L),(4536604355475035586L),(-5913663381153814901L),(7847915935726201631L),(-1177497971001205920L),(868456793575893057L),(5212592916169902777L)},{(5727045707534449720L),(4031507793908323690L),(-4892173890740315759L),(-8589425282678788470L),(-1859784022338210153L),(-8302374947661896110L),(6182280972878838659L)},{(6115700682166358233L),(-7998420683061878528L),(3464537141145419305L),(-261108474811073793L),(-7236429543626510593L),(-1649507342424649767L),(-2122799768792935682L)}}}; + float var_92 = (3.18971e+34F); + float var_93 = (-8.14287e+31F); + var_70[(((var_76--)*var_79.var_91)&1)][((+(var_82--))&1)] = var_79 ; + var_83[((var_76--)&6)] = (++var_74) ; + var_72.var_80 = (var_85--) ; + var_52 = var_96 ; + var_83 = var_97 ; + var_60[((--var_66)&6)] = (--var_61) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_99 ) + { + var_88.var_101 = ((--var_45)*( ( byte )(++var_76) )) ; + System.out.println("hello exception 14 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_102 ) + { + try + { + double var_103 = (-5.1641e-194D); + } + catch( java.lang.IllegalArgumentException myExp_104 ) + { + var_60[((--var_76)&6)] = (+((+(~(-(var_45--))))*var_76)) ; + System.out.println("hello exception 16 !"); + } + System.out.println("hello exception 15 !"); + } + } + } + } + System.out.println(" if stmt end,id=23 "); + } + return var_105[((--var_109)&0)][((((var_106++)|var_72.var_107)*var_79.var_108)&4)]; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(233); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + CrcCheck.ToByteArray(this.var_53,b,"var_53"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_57,b,"var_57"); + CrcCheck.ToByteArray(this.var_58.GetChecksum(),b,"var_58.GetChecksum()"); + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_70[a0][a1].GetChecksum(),b,"var_70" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_71[a0][a1].GetChecksum(),b,"var_71" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_72.GetChecksum(),b,"var_72.GetChecksum()"); + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + CrcCheck.ToByteArray(this.var_79.GetChecksum(),b,"var_79.GetChecksum()"); + CrcCheck.ToByteArray(this.var_82,b,"var_82"); + CrcCheck.ToByteArray(this.var_86.GetChecksum(),b,"var_86.GetChecksum()"); + CrcCheck.ToByteArray(this.var_88.GetChecksum(),b,"var_88.GetChecksum()"); + CrcCheck.ToByteArray(this.var_90,b,"var_90"); + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_97[a0],b,"var_97" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + CrcCheck.ToByteArray(this.var_166.GetChecksum(),b,"var_166.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/CRC32.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/MainClass.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..8476d1a14e2fd6897456806d3f3d20d8152a8a98 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/MainClass.java @@ -0,0 +1,585 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=764790408 + +//import java.util.zip.CRC32; + +class MainClass +{ + int var_5 = (-1733404042); + final boolean var_14 = false; + double var_16 = (-6.59386e+138D); + cl_27 var_17 = new cl_27(); + short var_171 = (short)(26017); + final cl_37 var_173 = new cl_37(); + short var_176 = (short)(24158); + cl_45 var_182 = new cl_45(); + cl_144 var_185 = new cl_144(); + cl_65 var_186 = new cl_65(); + int var_188 = (-1549185782); + long [][] var_192 = {{(-3312990591793487277L),(1233434029171570757L),(4810328681070878048L),(4002667481985016383L),(6498422541731326098L)}}; + int var_193 = (324521810); + short var_195 = (short)(-29994); + byte var_196 = (byte)(85); + cl_37 var_202 = new cl_37(); + short var_207 = (short)(30459); + float var_215 = (1423.01F); + int var_220 = (-1300123286); + int var_229 = (718280649); + cl_65 [][][] var_238 = {{{new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65()},{new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65()}},{{new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65()},{new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65()}},{{new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65()},{new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65(),new cl_65()}}}; + cl_65 var_239 = new cl_65(); + cl_37 [][] var_243 = {{new cl_37()},{new cl_37()}}; + int var_247 = (1821442045); + boolean [] var_250 = {false,true}; + byte var_254 = (byte)(34); + cl_96 var_275 = new cl_96(); + int var_276 = (1882972242); + final float [][] var_280 = {{(-6.94687e-26F),(5.03995e+15F),(0.0006704F),(1.16836e-20F),(3.55726e+34F),(-3.53485e-32F),(-1.07344e-33F)},{(-462622F),(9.04621e-32F),(1.90071e-14F),(-1.56783e+18F),(-1.56272e+11F),(-8.80576e+17F),(5.44798e+09F)}}; + cl_144 var_282 = new cl_144(); +/*********************************/ +public strictfp void run() +{ + byte var_3 = (byte)(41); + int var_0 = (-1699419620); + double [] var_2 = {(8.99164e+59D),(4.66517e+303D),(1.9561e+271D),(3.08242e-48D),(2.73585e-158D),(3.10291e+105D),(-8.54371e-37D)}; + for( var_0 = 243 ;(var_0<278);var_0 = (var_0+7) ) + { + short var_271 = (short)(7679); + float var_4 = (1.56534e+34F); + var_2[((var_3++)&6)] = (var_4--) ; + for( var_5 = 239 ;(var_5<289);var_5 = (var_5+10) ) + { + if( ((var_3++)!=func_6(var_182.var_269 ,(+(++var_3)) ,(++var_3) ,(--var_207) ,(!(((--var_196)>var_17.var_270)&var_14)) ,((-(var_3--))*var_17.var_177) ,( ( double )(var_271++) )))) + { + System.out.println(" if stmt begin,id=1 "); + if( ((-(var_3++))>var_185.var_219)) + { + System.out.println(" if stmt begin,id=2 "); + int var_272 = (-1798003853); + for( var_272 = 461 ;(var_272>443);var_272 = (var_272-6) ) + { + double [] var_273 = {(2.7757e+217D),(-3.76434e-67D),(9.63115e+170D),(2.17624e-143D),(1.43962e-260D),(-8.77121e+275D),(5.82386e-130D)}; + try + { + var_16 = (-1.04721e+99D) ; + } + catch( java.lang.ArithmeticException myExp_274 ) + { + var_2[((var_271--)&6)] = (var_271--) ; + System.out.println("hello exception 0 !"); + } + } + System.out.println(" if stmt end,id=2 "); + } + System.out.println(" if stmt end,id=1 "); + } + else + { + System.out.println(" else stmt begin,id=1 "); + if( ((var_171++)!=( ( float )var_275.var_100 ))) + { + System.out.println(" if stmt begin,id=3 "); + try + { + for( var_276 = 312 ;(var_276>282);var_276 = (var_276-15) ) + { + int var_277 = (464573529); + } + } + catch( java.lang.ArithmeticException myExp_278 ) + { + final cl_144 var_284 = new cl_144(); + try + { + var_17.var_155.var_279 = var_280 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_281 ) + { + var_17.var_283 = var_17.var_150.var_85 ; + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 1 !"); + } + System.out.println(" if stmt end,id=3 "); + } + System.out.println(" else stmt end,id=1 "); + } + } + } + return ; +} +public strictfp byte func_6(boolean var_7, float var_8, int var_9, int var_10, boolean var_11, long var_12, double var_13) +{ + if( var_14) + { + System.out.println(" if stmt begin,id=4 "); + byte var_257 = (byte)(74); + int var_15 = (-1899008532); + for( var_15 = 895 ;(var_15<930);var_15 = (var_15+7) ) + { + cl_65 var_268 = new cl_65(); + if( (!((++var_8)738);var_264 = (var_264-4) ) + { + long var_265 = (1406893994893548016L); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_266 ) + { + int var_267 = (-1186725204); + for( var_267 = 797 ;(var_267<848);var_267 = (var_267+17) ) + { + var_186 = var_268 ; + } + System.out.println("hello exception 7 !"); + } + System.out.println("hello exception 6 !"); + } + System.out.println(" else stmt end,id=2 "); + } + } + System.out.println(" if stmt end,id=4 "); + } + return (var_196--); +} +public strictfp cl_27 func_18(float var_19, double var_20, int var_21, double var_22) +{ + byte var_253 = (byte)(71); + byte var_251 = (byte)(-56); + byte var_252 = (byte)(103); + var_17 = func_23((((var_251--)+var_186.var_75)==var_185.var_107) ,((var_252--)+var_17.var_156) ,((var_253++)-( ( short )(++var_196) ))) ; + return var_17; +} +public strictfp cl_27 func_23(boolean var_24, long var_25, int var_26) +{ + byte var_175 = (byte)(75); + try + { + long var_178 = (-3238476090100560241L); + cl_37 var_169 = new cl_37(); + float [][][] var_170 = {{{(-2.00288e-28F)},{(5.08831e-20F)},{(-5.00097e-27F)},{(-37319.7F)},{(-7.1285e+25F)}},{{(-4.58256e+27F)},{(-1.14242e+08F)},{(3.12584e-34F)},{(3.19176e-06F)},{(-50.5118F)}},{{(-1.18212e+25F)},{(700051F)},{(6.00005e+37F)},{(-6.10243e+37F)},{(1.20134e+07F)}},{{(2.62404e+19F)},{(2.01709e-23F)},{(-6.63435e-34F)},{(-1.27075e+13F)},{(-3.27541e+38F)}},{{(3.05896e-08F)},{(3.95149e-20F)},{(-6.7825e-25F)},{(6.62641e-23F)},{(6.98686e-37F)}},{{(-7.15065e-26F)},{(-4.40011e-17F)},{(-2.51544e+23F)},{(-1.84172e-37F)},{(-1.03714e-33F)}},{{(2.20518e+13F)},{(-112048F)},{(1.69969e+28F)},{(-1.05862e+23F)},{(969.994F)}}}; + try + { + short var_189 = (short)(-28138); + byte var_172 = (byte)(26); + if( var_17.func_27(var_169 ,var_170[(((var_172--)+var_173.var_174)&6)][(((--var_171)-var_26)&4)][((var_171++)&0)] ,(-(--var_175)) ,(var_26--))) + { + System.out.println(" if stmt begin,id=8 "); + try + { + if( ( ( boolean )(((var_176--)&var_17.var_177)>=( ( int )(var_178--) )) )) + { + System.out.println(" if stmt begin,id=9 "); + byte var_179 = (byte)(-117); + try + { + var_176 = (var_179--) ; + } + catch( java.lang.ArithmeticException myExp_180 ) + { + boolean var_181 = true; + System.out.println("hello exception 8 !"); + } + System.out.println(" if stmt end,id=9 "); + } + else + { + System.out.println(" else stmt begin,id=5 "); + var_182.var_61.var_153 = (++var_26) ; + System.out.println(" else stmt end,id=5 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_183 ) + { + try + { + int var_184 = (1187673385); + for( var_184 = 966 ;(var_184<977);var_184 = (var_184+11) ) + { + var_26 = ((((var_175--)+var_185.var_98)+( ( int )(--var_172) ))*var_186.var_82) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_187 ) + { + for( var_188 = 568 ;(var_188>538);var_188 = (var_188-15) ) + { + var_171 = (++var_189) ; + } + System.out.println("hello exception 11 !"); + } + System.out.println("hello exception 10 !"); + } + System.out.println(" if stmt end,id=8 "); + } + else + { + System.out.println(" else stmt begin,id=6 "); + var_182.var_85 = var_17.var_150.var_85 ; + System.out.println(" else stmt end,id=6 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_190 ) + { + try + { + var_192[((var_193++)&0)][4] = (var_178--) ; + } + catch( java.lang.ArithmeticException myExp_194 ) + { + try + { + try + { + if( (((--var_195)-var_196)<=var_185.var_98)) + { + System.out.println(" if stmt begin,id=10 "); + var_17.var_197.var_107 = (var_175++) ; + System.out.println(" if stmt end,id=10 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_198 ) + { + int var_199 = (177878712); + for( var_199 = 946 ;(var_199>894);var_199 = (var_199-13) ) + { + double [][][] var_200 = {{{(4.23572e-37D),(1.07738e+294D),(1.00582e+101D),(2.32398e+227D),(-1.12446e-187D),(5.63412e-148D)},{(-3.83116e-66D),(-5.94833e+75D),(-7.8124e-147D),(4.50657e+246D),(-1.92252e-290D),(2.59331e-14D)},{(5.32454e+13D),(1.02568e+99D),(-4.99148e-74D),(-6.09314e-63D),(7.22371e+229D),(-1.32393e-264D)},{(8.17372e+218D),(-9.12519e+29D),(-3.77041e-205D),(1.86099e-171D),(3.54008e-288D),(-6.52524e-276D)},{(-3.10807e-42D),(-6.94464e-183D),(-3.86406e+164D),(3.19675e+136D),(9.19716e-205D),(-1.8986e+223D)},{(-3.197e+112D),(1.091e-110D),(1.90474e+301D),(-1.12053e-63D),(-1.76992e-301D),(9.66876e+217D)}},{{(-7.91181e+266D),(-6.14869e+181D),(-1.90909e+291D),(6.35064e-166D),(1.34949e-147D),(-1.77793e+264D)},{(2.75067e+220D),(-9.33675e-90D),(3.7205e-239D),(-4.63374e+231D),(6.81116e-68D),(-4.99561e+208D)},{(1.45483e-124D),(9.47952e+220D),(-2.52882e+294D),(1.61442e+244D),(-5.53802e-297D),(4.27213e+131D)},{(1.05481e+276D),(2.21445e-77D),(2.75346e+184D),(7.5337e+99D),(-3.12091e-100D),(-2.96784e+75D)},{(-1.53065e+24D),(3.77077e+165D),(-3.43372e+215D),(1.39669e-114D),(1.00335e-190D),(2.14496e+240D)},{(-2.16136e-92D),(5.16349e-131D),(1.88559e-288D),(7.60421e+237D),(-1.07681e-28D),(-7.10768e-24D)}}}; + } + System.out.println("hello exception 15 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_201 ) + { + try + { + var_202 = var_17.var_150.var_61 ; + } + catch( java.lang.ArithmeticException myExp_203 ) + { + var_192[((var_26++)&0)][((var_26--)&4)] = (-5837925703955892398L) ; + System.out.println("hello exception 17 !"); + } + System.out.println("hello exception 16 !"); + } + System.out.println("hello exception 14 !"); + } + System.out.println("hello exception 13 !"); + } + } + catch( java.lang.ArithmeticException myExp_204 ) + { + cl_144 var_210 = new cl_144(); + cl_65 var_240 = new cl_65(); + try + { + if( ((++var_175)==var_188)) + { + System.out.println(" if stmt begin,id=11 "); + try + { + float [][] var_206 = {{(2.06977e-21F),(1.44612e-26F),(-1.2509e-13F),(5.27667e+29F)},{(1.38848e-08F),(509531F),(-0.0460611F),(7.85295e+37F)},{(0.00520421F),(1.63622e-13F),(1.16062e+33F),(1.49846e-38F)},{(-5.65594e+07F),(-2.42925e-28F),(2.70102e+07F),(-4.53877e-19F)},{(-1.20696e-11F),(-5.51081e+32F),(2.64088e+16F),(-1.26999e-14F)},{(0.976744F),(6.88235e-22F),(2.02313e-06F),(-3.71159e+24F)},{(0.00052249F),(1.71577e+32F),(7.36861e+30F),(-1.39828e-20F)}}; + try + { + float [][] var_208 = {{(-2.29564e-11F)},{(3.4953e+34F)}}; + try + { + var_206[(((var_207++)*var_17.var_197.var_98)&6)][((((--var_196)-var_182.var_81)&var_17.var_177)&3)] = var_208[(((var_196++)*var_186.var_75)&1)][((+(var_175--))&0)] ; + } + catch( java.lang.ArithmeticException myExp_209 ) + { + var_185 = var_17.var_150.var_85 ; + System.out.println("hello exception 19 !"); + } + } + catch( java.lang.ArithmeticException myExp_211 ) + { + try + { + boolean [][] var_212 = {{false,false,true,true,false,false},{false,false,true,false,true,true},{true,false,false,false,true,true},{true,true,false,false,false,false},{false,false,true,false,false,true},{false,false,true,true,true,false},{true,false,true,false,false,true}}; + } + catch( java.lang.IllegalArgumentException myExp_213 ) + { + var_192[((var_26--)&0)][((+(var_175--))&4)] = (var_193++) ; + System.out.println("hello exception 21 !"); + } + System.out.println("hello exception 20 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_214 ) + { + try + { + try + { + var_24 = (!(!((var_26++)!=var_215))) ; + } + catch( java.lang.ArithmeticException myExp_216 ) + { + var_210 = var_185 ; + System.out.println("hello exception 23 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_217 ) + { + int var_218 = (-1612670795); + for( var_218 = 670 ;(var_218<692);var_218 = (var_218+11) ) + { + var_185.var_219 = (~(++var_175)) ; + } + System.out.println("hello exception 24 !"); + } + System.out.println("hello exception 22 !"); + } + System.out.println(" if stmt end,id=11 "); + } + else + { + System.out.println(" else stmt begin,id=7 "); + short var_226 = (short)(20423); + for( var_220 = 733 ;(var_220>685);var_220 = (var_220-12) ) + { + try + { + try + { + final int var_221 = (-1167372894); + } + catch( java.lang.ArithmeticException myExp_222 ) + { + double var_223 = (1.51215e-32D); + System.out.println("hello exception 26 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_224 ) + { + try + { + var_192[((var_196++)&0)][4] = ((++var_195)-( ( short )((~(var_196--))+var_188) )) ; + } + catch( java.lang.IllegalArgumentException myExp_225 ) + { + var_192[((+(++var_175))&0)][((--var_226)&4)] = (var_26++) ; + System.out.println("hello exception 28 !"); + } + System.out.println("hello exception 27 !"); + } + } + System.out.println(" else stmt end,id=7 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_227 ) + { + try + { + try + { + int var_228 = (-100358275); + for( var_228 = 149 ;(var_228<152);var_228 = (var_228+1) ) + { + for( var_229 = 153 ;(var_229>146);var_229 = (var_229-7) ) + { + boolean var_230 = false; + } + } + } + catch( java.lang.ArithmeticException myExp_231 ) + { + int var_232 = (-754033778); + for( var_232 = 148 ;(var_232>126);var_232 = (var_232-11) ) + { + try + { + var_171 = (short)(15233) ; + } + catch( java.lang.ArithmeticException myExp_233 ) + { + var_210 = var_185 ; + System.out.println("hello exception 31 !"); + } + } + System.out.println("hello exception 30 !"); + } + } + catch( java.lang.ArithmeticException myExp_234 ) + { + final cl_45 var_235 = new cl_45(); + try + { + try + { + try + { + var_182 = var_235 ; + } + catch( java.lang.IllegalArgumentException myExp_236 ) + { + var_238[((var_26--)&2)][((var_196++)&1)][((var_196++)&6)] = var_17.var_150.var_51 ; + System.out.println("hello exception 33 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_241 ) + { + cl_37 var_244 = new cl_37(); + try + { + var_243[((var_176--)&1)][0] = var_17.var_150.var_61 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_245 ) + { + var_24 = ((++var_196)850);var_247 = (var_247-3) ) + { + long var_248 = (-4906283543850075892L); + } + System.out.println(" if stmt end,id=12 "); + } + else + { + System.out.println(" else stmt begin,id=8 "); + int var_249 = (935725612); + for( var_249 = 963 ;(var_249>944);var_249 = (var_249-19) ) + { + var_250[(var_249&1)] = (((var_175++)&var_196)>=var_185.var_107) ; + } + System.out.println(" else stmt end,id=8 "); + } + System.out.println("hello exception 36 !"); + } + System.out.println("hello exception 32 !"); + } + System.out.println("hello exception 29 !"); + } + System.out.println("hello exception 18 !"); + } + return var_17; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(573); + CrcCheck.ToByteArray(this.var_5,b,"var_5"); + CrcCheck.ToByteArray(this.var_14,b,"var_14"); + CrcCheck.ToByteArray(this.var_16,b,"var_16"); + CrcCheck.ToByteArray(this.var_17.GetChecksum(),b,"var_17.GetChecksum()"); + CrcCheck.ToByteArray(this.var_171,b,"var_171"); + CrcCheck.ToByteArray(this.var_173.GetChecksum(),b,"var_173.GetChecksum()"); + CrcCheck.ToByteArray(this.var_176,b,"var_176"); + CrcCheck.ToByteArray(this.var_182.GetChecksum(),b,"var_182.GetChecksum()"); + CrcCheck.ToByteArray(this.var_185.GetChecksum(),b,"var_185.GetChecksum()"); + CrcCheck.ToByteArray(this.var_186.GetChecksum(),b,"var_186.GetChecksum()"); + CrcCheck.ToByteArray(this.var_188,b,"var_188"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_192[a0][a1],b,"var_192" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_193,b,"var_193"); + CrcCheck.ToByteArray(this.var_195,b,"var_195"); + CrcCheck.ToByteArray(this.var_196,b,"var_196"); + CrcCheck.ToByteArray(this.var_202.GetChecksum(),b,"var_202.GetChecksum()"); + CrcCheck.ToByteArray(this.var_207,b,"var_207"); + CrcCheck.ToByteArray(this.var_215,b,"var_215"); + CrcCheck.ToByteArray(this.var_220,b,"var_220"); + CrcCheck.ToByteArray(this.var_229,b,"var_229"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_238[a0][a1][a2].GetChecksum(),b,"var_238" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_239.GetChecksum(),b,"var_239.GetChecksum()"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_243[a0][a1].GetChecksum(),b,"var_243" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_247,b,"var_247"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_250[a0],b,"var_250" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_254,b,"var_254"); + CrcCheck.ToByteArray(this.var_275.GetChecksum(),b,"var_275.GetChecksum()"); + CrcCheck.ToByteArray(this.var_276,b,"var_276"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_280[a0][a1],b,"var_280" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_282.GetChecksum(),b,"var_282.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/Start.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..0cdbc7a0612d08eaf40c310807536e15acd5c84b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_65.java cl_45.java CRC32.java cl_96.java CrcCheck.java cl_37.java cl_144.java cl_27.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_144.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_144.java new file mode 100644 index 0000000000000000000000000000000000000000..f51a12c69506bc6a6a14b26369326764c101c25b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_144.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=764790408 + +//import java.util.zip.CRC32; + +class cl_144 +{ + int var_98 = (-100250005); + boolean var_99 = false; + float var_107 = (-1.42034e+23F); + final short var_129 = (short)(19067); + double var_219 = (-1.44871e-84D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(19); + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CrcCheck.ToByteArray(this.var_99,b,"var_99"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_129,b,"var_129"); + CrcCheck.ToByteArray(this.var_219,b,"var_219"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_27.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_27.java new file mode 100644 index 0000000000000000000000000000000000000000..61e59f3f1b77637dae73a81380562a51df57a7bb --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_27.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=764790408 + +//import java.util.zip.CRC32; + +class cl_27 +{ + cl_37 var_33 = new cl_37(); + cl_45 var_150 = new cl_45(); + cl_65 var_151 = new cl_65(); + cl_96 var_155 = new cl_96(); + byte var_156 = (byte)(92); + short var_157 = (short)(28012); + int var_177 = (402882666); + final cl_144 var_197 = new cl_144(); + double var_270 = (1.29591e+197D); + cl_144 var_283 = new cl_144(); +/*********************************/ +public strictfp boolean func_27(cl_37 var_28, float var_29, int var_30, float var_31) +{ + byte var_154 = (byte)(-97); + final cl_96 var_167 = new cl_96(); + byte var_34 = (byte)(29); + int var_32 = (61685064); + for( var_32 = 497 ;(var_32>481);var_32 = (var_32-16) ) + { + byte var_35 = (byte)(118); + var_33 = var_33 ; + int [][][] var_40 = {{{(-1537784933),(-1096184569),(-130534131),(-1877122500),(128617256),(23419590),(480748017)},{(356799673),(-871791058),(-1499058249),(433969350),(-802642297),(-866506263),(-1282252236)},{(-1930207003),(1081229673),(713403077),(-1378762634),(1493671523),(1383366540),(1490529399)}},{{(1814952551),(319087539),(2008513943),(-1643368748),(59869938),(527269440),(-1051473426)},{(-177861564),(750996147),(35203932),(1809657566),(-1767676933),(-109338395),(-824433151)},{(77518001),(1252094944),(-97697702),(1283967264),(1314277886),(-2138171115),(1442446679)}},{{(2136110912),(698313855),(2140944236),(1496709705),(-1763311282),(-1097277555),(1810315848)},{(1825582343),(214047380),(-369998115),(595151981),(1420955513),(-1339869309),(-144820487)},{(-434478593),(-1199368685),(1304836821),(-657560261),(-1878929044),(-689550232),(1078053642)}},{{(1087469184),(-620048632),(-199777154),(-453226691),(-1310281233),(-1946587166),(-263849341)},{(-2096474350),(-2086204056),(-1580097352),(1646039095),(-1964162344),(-884854314),(-1889664048)},{(820582683),(343016359),(-1270817720),(-884210478),(1654751056),(-377869697),(379622900)}}}; + int [] var_39 = {(-1169296695),(517861080),(1303796327),(959591943),(-1767292750),(450135207)}; + try + { + boolean var_161 = true; + if( ((--var_34)<=( ( float )(--var_35) ))) + { + System.out.println(" if stmt begin,id=13 "); + long var_152 = (-6500553287566730464L); + try + { + boolean [][][] var_36 = {{{false,false},{false,false}},{{false,true},{false,false}},{{false,true},{false,true}},{{true,false},{true,false}}}; + if( var_33.var_37) + { + System.out.println(" if stmt begin,id=14 "); + short var_41 = (short)(-15700); + int var_42 = (2370969); + int var_38 = (1039676273); + for( var_38 = 793 ;(var_38>745);var_38 = (var_38-12) ) + { + var_39[(var_38&5)] = var_40[(((var_42++)|var_150.func_43(var_151 ,((var_152++)*var_33.var_153) ,((+(var_154++))( ( float )var_150.func_53((!(!(!((--var_154)<( ( short )(((var_154--)+( ( short )(var_156--) ))&var_33.var_104) )))))) ))) + { + System.out.println(" if stmt begin,id=15 "); + try + { + var_34 = (++var_35) ; + } + catch( java.lang.ArithmeticException myExp_159 ) + { + var_150.var_67.var_160 = false ; + System.out.println("hello exception 38 !"); + } + System.out.println(" if stmt end,id=15 "); + } + else + { + System.out.println(" else stmt begin,id=9 "); + try + { + double [] var_162 = {(-1.06651e-124D),(-1.37118e-98D),(5.68824e-38D),(7.33075e+289D)}; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_163 ) + { + var_39[5] = (+(--var_156)) ; + System.out.println("hello exception 40 !"); + } + System.out.println(" else stmt end,id=9 "); + } + System.out.println("hello exception 37 !"); + } + System.out.println(" if stmt end,id=13 "); + } + } + catch( java.lang.ArithmeticException myExp_164 ) + { + cl_96 var_165 = new cl_96(); + cl_96 var_166 = new cl_96(); + var_155 = var_155 ; + System.out.println("hello exception 42 !"); + } + } + return var_155.var_168; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(63); + CrcCheck.ToByteArray(this.var_33.GetChecksum(),b,"var_33.GetChecksum()"); + CrcCheck.ToByteArray(this.var_150.GetChecksum(),b,"var_150.GetChecksum()"); + CrcCheck.ToByteArray(this.var_151.GetChecksum(),b,"var_151.GetChecksum()"); + CrcCheck.ToByteArray(this.var_155.GetChecksum(),b,"var_155.GetChecksum()"); + CrcCheck.ToByteArray(this.var_156,b,"var_156"); + CrcCheck.ToByteArray(this.var_157,b,"var_157"); + CrcCheck.ToByteArray(this.var_177,b,"var_177"); + CrcCheck.ToByteArray(this.var_197.GetChecksum(),b,"var_197.GetChecksum()"); + CrcCheck.ToByteArray(this.var_270,b,"var_270"); + CrcCheck.ToByteArray(this.var_283.GetChecksum(),b,"var_283.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_37.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_37.java new file mode 100644 index 0000000000000000000000000000000000000000..34728c60866d5897d87797257ad578b68541d108 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_37.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=764790408 + +//import java.util.zip.CRC32; + +class cl_37 +{ + final boolean var_37 = false; + int var_62 = (2091024729); + float var_77 = (-7932.42F); + boolean var_97 = false; + short var_104 = (short)(32313); + long var_153 = (-7957439555808437802L); + byte var_174 = (byte)(119); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(21); + CrcCheck.ToByteArray(this.var_37,b,"var_37"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_97,b,"var_97"); + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + CrcCheck.ToByteArray(this.var_153,b,"var_153"); + CrcCheck.ToByteArray(this.var_174,b,"var_174"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_45.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_45.java new file mode 100644 index 0000000000000000000000000000000000000000..5f880d4736772ef0a3855e40f822dba3cc7cf955 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_45.java @@ -0,0 +1,399 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=764790408 + +//import java.util.zip.CRC32; + +class cl_45 +{ + final static cl_65 var_51 = new cl_65(); + static cl_37 var_61 = new cl_37(); + static int [][][] var_65 = {{{(-818587981),(557298196),(543220347),(-300799928)},{(67507896),(-1179978359),(-919564686),(-1078597307)},{(1682467431),(1649843908),(-1533150507),(854263352)}},{{(239101684),(889287196),(1003928433),(-2132824567)},{(575956660),(1852532183),(1651304781),(-197407843)},{(693706259),(-1353526138),(-903511042),(-1615753307)}},{{(1229106358),(447247500),(1397775851),(-134994275)},{(1187753578),(-715853668),(1377300150),(-1741131963)},{(-1060633466),(-461332872),(-21431465),(696576042)}},{{(-1946699517),(530419579),(2000596039),(-102073820)},{(-229842369),(-1772316850),(-1253769117),(-1339307129)},{(519719382),(-1973856120),(704873413),(198082857)}},{{(381826454),(-1752198884),(563873194),(672826733)},{(-1788198002),(-585034017),(-1996436338),(1510874716)},{(1630686894),(-1832840335),(-696087623),(1375558077)}},{{(-1946489794),(-1722953367),(328689616),(-104282753)},{(-818060891),(-881442683),(-1801658445),(743355198)},{(840235842),(-158260231),(-2055252885),(1428593705)}}}; + static cl_65 var_67 = new cl_65(); + static short var_69 = (short)(11626); + static float var_70 = (-9.45085e+35F); + static int var_71 = (-887924383); + float var_74 = (4.78028e+36F); + static byte var_81 = (byte)(-3); + final static cl_96 var_83 = new cl_96(); + static cl_144 var_85 = new cl_144(); + static int var_87 = (6254955); + static cl_96 var_89 = new cl_96(); + static int [][] var_90 = {{(-889826825),(-1433443472),(-1413660076),(-1656177290)},{(-749546324),(601828493),(-591041384),(2083806258)},{(928396515),(-1480031397),(-1808058751),(-217274312)}}; + final static double var_92 = (-2.49038e+147D); + static byte [][] var_93 = {{(byte)(-93),(byte)(24),(byte)(94),(byte)(95),(byte)(18),(byte)(-120),(byte)(114)},{(byte)(-75),(byte)(-92),(byte)(110),(byte)(-94),(byte)(79),(byte)(98),(byte)(9)},{(byte)(25),(byte)(-49),(byte)(63),(byte)(-31),(byte)(-77),(byte)(127),(byte)(-98)}}; + static float [][][] var_95 = {{{(5.82977e+16F),(-5.77463e+12F)},{(-1.09663e+08F),(1.69251e+29F)},{(2.74152e+22F),(1.74258e+25F)},{(-4.42464e-07F),(1.00393e+14F)},{(8.43157e+16F),(-1.89733e+17F)},{(1.01251e-34F),(4.76181e+10F)},{(-3.86259e+24F),(1.9822e+25F)}},{{(2.43725e-36F),(1.19522e+07F)},{(-1.09969e-05F),(-5.83437e+27F)},{(8.45543e+09F),(-880.119F)},{(1.61437e-22F),(7.65039e-21F)},{(1.13404e+08F),(1.00272e-30F)},{(3.23862e+31F),(-0.00450657F)},{(2276.78F),(3.67364e-37F)}}}; + float var_96 = (2.422e-11F); + final static int [][][] var_102 = {{{(-336035144),(-1325437540),(-75647961),(-879527566)},{(-1718570964),(-760118100),(-1599807326),(-185026962)},{(1052219545),(-877456330),(-212851250),(-111577736)}},{{(1256117222),(1535037910),(-1027141702),(1236795319)},{(1065258109),(536482984),(1532525399),(-1066643853)},{(1336976746),(-1045820087),(-2067774036),(-1136531628)}},{{(-1364782559),(-1707390698),(-1602028219),(-1767917128)},{(1952105675),(601266054),(-336088701),(-2063741231)},{(1689291778),(-1093212101),(-590300399),(-323400661)}},{{(1856506684),(-1918725511),(-813500605),(795987823)},{(-682720177),(1349323104),(1714233002),(436887417)},{(380091258),(-1608344704),(-1167043771),(934074426)}},{{(1938326541),(-11221752),(-927434855),(-2044882840)},{(723126069),(-612664832),(-1713695842),(1122033026)},{(1652120207),(-1708466319),(1814809309),(-1077261302)}},{{(-39627081),(1715359271),(-1251819096),(1121003763)},{(-681954065),(1351659646),(-1471666672),(-1481900934)},{(949444095),(-58576638),(-1311845256),(-1123446412)}}}; + int var_105 = (1941162044); + static int var_111 = (-359042528); + static short var_113 = (short)(-20994); + static short var_120 = (short)(-16619); + static long var_125 = (5605726944057604971L); + static boolean [] var_130 = {false,true,false}; + long [] var_135 = {(-2816845596208209120L),(-3818785630352878938L),(-573967887574412726L),(-5156536568698917622L)}; + static int var_138 = (541722532); + static int var_143 = (-1523047973); + boolean var_269 = false; +/*********************************/ +public static strictfp byte func_43(cl_65 var_44, float var_45, boolean var_46, double var_47, float var_48, long var_49, float var_50) +{ + byte var_141 = (byte)(-33); + byte var_149 = (byte)(20); + try + { + try + { + var_51.var_52 = func_53(var_130[(((var_81++)+var_87)&2)]) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_132 ) + { + var_85 = var_85 ; + System.out.println("hello exception 43 !"); + } + } + catch( java.lang.ArithmeticException myExp_133 ) + { + short var_147 = (short)(26661); + try + { + var_51.var_134 = (var_49--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_136 ) + { + try + { + double [][] var_146 = {{(1.10672e+126D),(-1.69906e-43D),(-8.25095e+154D),(2.10582e+271D),(-4.48053e-173D),(-8.69855e-98D),(-1.83582e-89D)},{(-1.13026e+148D),(-1.24883e-289D),(5.53571e-205D),(1.67298e+162D),(1.06286e-80D),(-2.06539e+216D),(-3.66356e-193D)},{(-1.9017e-62D),(-5.48821e+166D),(1.21622e-272D),(-2.04221e+78D),(-1.04481e-26D),(-1.3761e-174D),(-3.72834e+105D)},{(1.79971e+06D),(-3.14791e-226D),(1.13721e+260D),(-1.6933e-22D),(6.1994e+56D),(3.64796e-244D),(-4.05947e+139D)}}; + try + { + int [][][] var_139 = {{{(-731992466),(-1279052932),(223354663),(-609016669),(293766021),(965638854),(-579473797)},{(-1159404692),(-1001827143),(-1632195906),(-523751740),(490678429),(571552502),(1942321970)},{(-825888979),(-1235862557),(889127388),(1714314792),(586099494),(-834086622),(873630298)},{(1575144042),(-528226901),(337807176),(730998749),(1191766718),(851236454),(1162102904)},{(-1101320739),(-2028962279),(-1802178803),(1624182895),(-1176797151),(-1875879654),(-1934079362)},{(1372367216),(-1383760641),(-724401164),(1296878158),(-2079485828),(-1726918479),(-83545337)},{(-1216554340),(517317082),(-1022945809),(544370344),(-1202263153),(943226293),(-1943677311)}},{{(188884383),(-1903832137),(-1841189616),(644728000),(1096629933),(-1727657859),(387839484)},{(151675496),(-384935217),(802039349),(18509689),(-1201685812),(-1506652303),(460310563)},{(118580713),(-1876154831),(-1452090365),(-1192315178),(-72456778),(678475402),(-154292883)},{(-1470234746),(1658320345),(-578891613),(696451750),(-41445280),(-1735252815),(-1211087045)},{(1605649612),(-461496119),(-1849642544),(729727223),(-865139390),(-1422126358),(1060422782)},{(-1122052954),(-1457012045),(-562265012),(-305908377),(475052545),(-2122709124),(1329678150)},{(1155876888),(-332212737),(-632668908),(404870639),(1299648771),(1463293307),(1343224326)}},{{(1787048785),(110033120),(1437463127),(995311745),(1753995866),(482287992),(-1527507795)},{(1266056845),(1641906920),(1334775374),(-1427537032),(1897604017),(698783529),(327603262)},{(93380077),(177862889),(-1282329548),(418106800),(-1794638632),(1767912360),(931622218)},{(-319621014),(-1726436791),(639181230),(-1018323447),(129506712),(-1124349219),(520377476)},{(804378081),(321370232),(-1042856434),(-374253376),(1097821663),(1274855833),(-1009175054)},{(-1045147656),(-838520583),(-1262404438),(1616359493),(1796363687),(-1448046997),(617961757)},{(-1832801255),(-1107556045),(-203250593),(1780683078),(1738063415),(522272279),(-285556627)}},{{(759031212),(-182087188),(947041653),(-249213735),(-986401858),(839633449),(1925054786)},{(-711356869),(1584710833),(-661582666),(-1008791479),(-744357179),(-1242912207),(-1409977392)},{(1754931177),(-415685445),(-811058764),(1700345035),(-1200423942),(1455915748),(-2000089130)},{(120803867),(116316887),(1914316556),(-2144388369),(417112377),(761771866),(617580515)},{(1105276101),(323311600),(-2114152347),(1395475497),(1432847754),(-2039273231),(1594732284)},{(1880126822),(1686676153),(417711680),(614953491),(-1506168439),(2078905482),(-1859847346)},{(1542998424),(-695300810),(2023363274),(-727276097),(1576369632),(398473008),(1595365615)}},{{(-1734200328),(-998579725),(1315698601),(-1032503737),(-381304835),(-1458883635),(1632986417)},{(-1440324810),(868328790),(1008867287),(122278865),(-1393120569),(1422444868),(771358808)},{(913808234),(-708799466),(1829787876),(-66410023),(313513120),(-1068904365),(-531208427)},{(1552455893),(1308399386),(123346320),(-1011590623),(-1133254960),(-1401966548),(246291458)},{(-86115636),(1651914031),(1238952187),(-1791539713),(1284455174),(1285754397),(-257687308)},{(1967221589),(157334214),(964914737),(578225801),(1628751525),(1779153641),(2083410277)},{(1024067855),(-131191301),(-386197044),(-230493149),(-1850375071),(1569924171),(1394858064)}}}; + int var_137 = (-793044257); + for( var_137 = 432 ;(var_137>400);var_137 = (var_137-16) ) + { + if( ((var_138++)var_85.var_107)&var_85.var_99)) + { + System.out.println(" if stmt begin,id=17 "); + var_146[((var_111++)&3)][(((--var_141)+var_81)&6)] = func_53((!(!(!((--var_81)!=func_53((!(((var_147++)|var_69)615);var_55 = (var_55-6) ) + { + byte var_60 = (byte)(122); + byte var_80 = (byte)(115); + cl_144 var_86 = new cl_144(); + try + { + int var_57 = (-1688800247); + long var_88 = (-466832669936100777L); + short var_115 = (short)(2418); + try + { + int var_56 = (1405236791); + for( var_56 = 778 ;(var_56>746);var_56 = (var_56-8) ) + { + short var_66 = (short)(10158); + if( (((var_57++)*var_51.var_58)464);var_112 = (var_112-19) ) + { + short var_114 = (short)(13042); + if( ((((~(var_113--))-(6414580332621050531L))+( ( double )(+(var_114--)) ))<( ( float )((var_115--)+var_92) ))) + { + System.out.println(" if stmt begin,id=20 "); + var_68[1][((--var_115)&6)][1] = (++var_88) ; + System.out.println(" if stmt end,id=20 "); + } + } + System.out.println("hello exception 55 !"); + } + System.out.println("hello exception 52 !"); + } + } + catch( java.lang.ArithmeticException myExp_116 ) + { + if( (!((++var_60)!=var_83.var_117))) + { + System.out.println(" if stmt begin,id=21 "); + try + { + try + { + if( ((++var_80)<=var_87)) + { + System.out.println(" if stmt begin,id=22 "); + long var_118 = (-5744590987699466776L); + var_51.var_52 = (++var_118) ; + System.out.println(" if stmt end,id=22 "); + } + } + catch( java.lang.ArithmeticException myExp_119 ) + { + if( (!(!((var_120++)==( ( byte )((++var_80)*var_81) ))))) + { + System.out.println(" if stmt begin,id=23 "); + float [][][] var_121 = {{{(3.48305e+34F),(0.000271986F),(7.64302e+18F),(4.72874e+23F),(1.07823e-33F)}},{{(-0.000133861F),(-1.15299e-17F),(-2.94428e-22F),(-4.9588e+27F),(-4.0465e-16F)}},{{(-2.24236e-10F),(5.91805e-29F),(-2.05357e-35F),(1.1883e-16F),(1.25629e+31F)}},{{(1.01324e+30F),(-3.22473e-13F),(1.04842e+21F),(-3.46499e+32F),(-0.000104061F)}},{{(-12.1933F),(-1.97722e-14F),(1.30896e+14F),(0.0849696F),(7.05868e-29F)}},{{(-1.35009e+34F),(0.131002F),(-558853F),(3.9187e-17F),(5.68297e-25F)}}}; + System.out.println(" if stmt end,id=23 "); + } + else + { + System.out.println(" else stmt begin,id=12 "); + final float var_122 = (-5.05552e+36F); + System.out.println(" else stmt end,id=12 "); + } + System.out.println("hello exception 57 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_123 ) + { + var_120 = (var_81--) ; + System.out.println("hello exception 58 !"); + } + System.out.println(" if stmt end,id=21 "); + } + else + { + System.out.println(" else stmt begin,id=13 "); + if( (!(!((--var_80)>=var_87)))) + { + System.out.println(" if stmt begin,id=24 "); + int var_124 = (-666084530); + for( var_124 = 326 ;(var_124<334);var_124 = (var_124+4) ) + { + var_61.var_97 = (!((var_125++)!=var_85.var_98)) ; + } + System.out.println(" if stmt end,id=24 "); + } + else + { + System.out.println(" else stmt begin,id=14 "); + int var_126 = (-775354443); + for( var_126 = 690 ;(var_126<709);var_126 = (var_126+19) ) + { + int var_127 = (-1274941119); + for( var_127 = 696 ;(var_127>692);var_127 = (var_127-4) ) + { + cl_37 var_128 = new cl_37(); + } + } + System.out.println(" else stmt end,id=14 "); + } + System.out.println(" else stmt end,id=13 "); + } + System.out.println("hello exception 56 !"); + } + } + return (-(((var_69--)|var_61.var_104)+var_85.var_129)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(900); + CrcCheck.ToByteArray(this.var_51.GetChecksum(),b,"var_51.GetChecksum()"); + CrcCheck.ToByteArray(this.var_61.GetChecksum(),b,"var_61.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_65[a0][a1][a2],b,"var_65" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_67.GetChecksum(),b,"var_67.GetChecksum()"); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_71,b,"var_71"); + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_83.GetChecksum(),b,"var_83.GetChecksum()"); + CrcCheck.ToByteArray(this.var_85.GetChecksum(),b,"var_85.GetChecksum()"); + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + CrcCheck.ToByteArray(this.var_89.GetChecksum(),b,"var_89.GetChecksum()"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_90[a0][a1],b,"var_90" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_92,b,"var_92"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_93[a0][a1],b,"var_93" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_95[a0][a1][a2],b,"var_95" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_102[a0][a1][a2],b,"var_102" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + CrcCheck.ToByteArray(this.var_111,b,"var_111"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_120,b,"var_120"); + CrcCheck.ToByteArray(this.var_125,b,"var_125"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_130[a0],b,"var_130" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_135[a0],b,"var_135" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_138,b,"var_138"); + CrcCheck.ToByteArray(this.var_143,b,"var_143"); + CrcCheck.ToByteArray(this.var_269,b,"var_269"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_65.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_65.java new file mode 100644 index 0000000000000000000000000000000000000000..731970f419286af8af8236c965a03734f43d821c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_65.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=764790408 + +//import java.util.zip.CRC32; + +class cl_65 +{ + double var_52 = (6.56791e-16D); + float var_58 = (8.24876e+37F); + byte var_59 = (byte)(-120); + int var_75 = (-398448237); + final short var_82 = (short)(2015); + int [][][] var_101 = {{{(-1009320809),(789466479),(122201560),(1569245340)},{(-1946580350),(-507053990),(-1415218566),(1627446122)},{(477040524),(-88652061),(1839801928),(44401650)}},{{(-1168058847),(109206480),(-1673971454),(-857826916)},{(1183686990),(-1846641398),(-1437691092),(84934419)},{(-1208551795),(240260210),(-521802344),(-1773308815)}},{{(-1360164006),(-1039116439),(-756095491),(1643931736)},{(551943944),(-1954482843),(-1792708012),(330608525)},{(-773374921),(1099082495),(-1746246942),(643940855)}},{{(-659684293),(1251689454),(-1483452039),(152542833)},{(1531550856),(2084116257),(-502037883),(743429781)},{(-1647981446),(1955895094),(-1996828685),(-84421722)}},{{(-804204051),(2045552119),(9949939),(2080788178)},{(-392976210),(1883652329),(-909136343),(576235016)},{(592016601),(1393349967),(771038895),(-747677577)}},{{(2001135334),(-355863645),(1517622312),(-1735946337)},{(-1683625520),(-1152219932),(300110118),(315286357)},{(1498659769),(-1709601514),(-2136962700),(-802493410)}}}; + long var_134 = (5017151865002531238L); + boolean var_160 = false; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(316); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_82,b,"var_82"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_101[a0][a1][a2],b,"var_101" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_134,b,"var_134"); + CrcCheck.ToByteArray(this.var_160,b,"var_160"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_96.java b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_96.java new file mode 100644 index 0000000000000000000000000000000000000000..f4bc34cec222b637356d59228e59eaaaf49a1387 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5091_2018121004717/cl_96.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=764790408 + +//import java.util.zip.CRC32; + +class cl_96 +{ + int var_84 = (1525597661); + float [][][] var_94 = {{{(-1.02368e-14F),(1.91413e-15F)},{(0.000143955F),(5.40125e+14F)},{(340310F),(-2.26866e+30F)},{(6.50668e+35F),(265611F)},{(-1.6758e+21F),(6.06965e-15F)},{(-457999F),(-2.91196e+06F)},{(-2.40429e-35F),(-1.85702e+08F)}},{{(7.1143e-28F),(0.0234171F)},{(-2.49526e+29F),(-1.3839e-30F)},{(1.58576e-10F),(-8.30638e-37F)},{(1.29498e+20F),(-4.34371e-31F)},{(8.48755e+35F),(5.91403e-17F)},{(1.204e-22F),(-3.68927e+17F)},{(-4.68516e-06F),(2.2018e+33F)}}}; + double var_100 = (8.78332e-207D); + final short var_103 = (short)(-19398); + final byte var_117 = (byte)(-98); + boolean var_168 = false; + float [][] var_279 = {{(1.05203e-12F),(-7.34983F),(-3.91121e-16F),(4.02461F),(4.28812e-20F),(0.116055F),(2.3627e-10F)},{(1.96275e+37F),(8.38502e-22F),(0.00346377F),(-2.1909e-26F),(-4.26688e-21F),(0.00474246F),(-1.3438e+35F)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(184); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_94[a0][a1][a2],b,"var_94" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_117,b,"var_117"); + CrcCheck.ToByteArray(this.var_168,b,"var_168"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_279[a0][a1],b,"var_279" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5950_2018110811698/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/5950_2018110811698/MainClass.java b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..a8e02dfc41328c615d0c06c979e68de54002f58d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/MainClass.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1595514112 + +import java.util.zip.CRC32; + +class MainClass +{ + static byte var_3 = (byte)(18); + static cl_9 var_5 = new cl_9(); + static byte var_9 = (byte)(105); + static long var_11 = (4161532736081967335L); + static byte var_13 = (byte)(-102); + static int var_16 = (-1522402437); + static cl_38 var_22 = new cl_38(); + static float [][][] var_23 = {{{(0.00848503F),(1.00384e+15F),(8.71853e-18F),(1.84957e-12F),(-5.27505e+06F),(-1.63963e-12F)},{(-9.26624e-29F),(-2.94897e-22F),(-0.00212667F),(1.09413e-14F),(-5.14647e-29F),(-2.7418e+20F)},{(4.27499e+23F),(9.90969e+26F),(2.19793e-05F),(-2.31779e-21F),(-6.25542e-13F),(-1.00226e+18F)},{(1.24278e-29F),(6.68537e-08F),(1.75566e-16F),(3.22681e+16F),(-1.31349e+29F),(-1.23907e+15F)},{(-9.94582e+07F),(-8.97219e+22F),(-4.43838e-30F),(-2.19858e+38F),(8.44428e-35F),(3.14113e+35F)}},{{(-12.8831F),(0.221322F),(-1.41005e-24F),(-1.01131e-29F),(-9.03956e-05F),(9.39518e+14F)},{(-3.18579e+21F),(2.95155e+17F),(6.07236e+19F),(-1.46357e+18F),(-3.76036e-18F),(-5.89672e-23F)},{(-5.25992e-37F),(7.55779e+13F),(-2.8475e+28F),(-2.23066e-25F),(1.22672e+38F),(2.35847e+33F)},{(-4.42688e-29F),(1.81037e+32F),(-1.34705e-16F),(2.07837e-23F),(2.28997e+21F),(2.05998e+38F)},{(-8.4691e+14F),(7.02539e+35F),(3.74185e-31F),(-1.71868e-08F),(1.64436e-19F),(-2.68183e-08F)}},{{(-3.20933F),(9.54228e-20F),(-0.00560349F),(-1.58483e+14F),(7.82671e-37F),(8.86914e+16F)},{(1.44445e-18F),(-8.56587e-19F),(7.75535e-10F),(-1.0948e-16F),(0.00506286F),(1.73177e-26F)},{(2.63367e-24F),(1.83811e+15F),(-840.62F),(2.0805e+12F),(3.52213e-06F),(8.24046e-05F)},{(6.06742e+30F),(-1.18098e-23F),(3.22977e-20F),(-3.24002e-37F),(-48.8912F),(-1.25173e-24F)},{(-3.91229e+37F),(-9.60536e-28F),(8.73533e-30F),(1.11446e-16F),(-28706.9F),(-543.102F)}},{{(1.64258e+31F),(3.99345e-27F),(-8.41663e-16F),(2.92898e-12F),(1.04744e-25F),(-2.42787e+17F)},{(-5.00629e-14F),(-972.069F),(9.31803e+34F),(4.27775e+25F),(6.57614e+18F),(-6.72027e+15F)},{(-1.16761e-08F),(-7.513e+31F),(-1.76898e+29F),(3.31408e+12F),(-9.3867e-24F),(-1.28495e+16F)},{(-8.46378e+15F),(-4062.93F),(112.92F),(0.310715F),(1.7772e-29F),(0.00141826F)},{(1.42202e-18F),(4.89175e+24F),(-1.98825e-25F),(-8.25809e-22F),(-1.24475e-11F),(-3.69602e-25F)}}}; + static int [][] var_27 = {{(-1449199465),(1561796482),(-1871254310)},{(1845263420),(983728690),(-870729868)}}; + static int var_29 = (2097175590); + static short var_36 = (short)(-29008); + static int var_37 = (-1345106889); + static byte var_38 = (byte)(86); + final static long [][][] var_41 = {{{(8687446987827591988L),(8183050042331208920L),(4525277741121595428L),(-7195058578064536678L)}},{{(8440438572674079026L),(-8991671311670472800L),(8070778345104785093L),(-7592823406259566275L)}}}; + long var_45 = (-1979934987403528192L); + static cl_38 [][][] var_48 = {{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}}}; + boolean var_52 = false; + static byte var_58 = (byte)(-15); + static byte var_59 = (byte)(-78); + static long var_64 = (3149434359261929369L); + static short var_67 = (short)(-7314); + int var_72 = (1205103317); + short var_73 = (short)(842); + int var_75 = (-463973107); + int var_76 = (-936922860); + int [][][] var_78 = {{{(-148856301)},{(1986320307)},{(987543930)},{(52107708)}},{{(-1716211236)},{(-501857499)},{(383949275)},{(-252916666)}}}; + byte var_79 = (byte)(68); + float var_85 = (1.83241e-28F); + short var_90 = (short)(7845); + short var_91 = (short)(-31792); +/*********************************/ +public strictfp void run() +{ + try + { + int var_0 = (-927239616); + for( var_0 = 708 ;(var_0>696);var_0 = (var_0-6) ) + { + int var_2 = (-824555225); + try + { + int [] var_1 = {(-1301604926),(664848274),(-1734777042)}; + double var_4 = (2.37567e+272D); + var_2 = ((var_3++)-var_3) ; + var_5 = func_6() ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_83 ) + { + var_5 = func_6() ; + System.out.println("hello exception 0 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_84 ) + { + int var_86 = (-1297843178); + try + { + var_85 = (var_86--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_87 ) + { + try + { + boolean [][][] var_89 = {{{true,true,true,false,true,false},{true,false,true,true,false,true}}}; + byte var_92 = (byte)(-118); + short var_93 = (short)(-11528); + var_89[((--var_92)&0)][((var_91--)&1)][((var_90++)&5)] = ((((var_93++)-var_72)!=var_36)&&func_28()) ; + } + catch( java.lang.IllegalArgumentException myExp_94 ) + { + cl_9 var_95 = new cl_9(); + System.out.println("hello exception 3 !"); + } + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 1 !"); + } + return ; +} +public strictfp cl_9 func_6() +{ + final cl_9 var_82 = new cl_9(); + if( (!(!(!(!(!(!var_5.var_7))))))) + { + int var_8 = (-874888418); + cl_38 [][] var_71 = {{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}}; + cl_38 var_74 = new cl_38(); + for( var_8 = 690 ;(var_8<754);var_8 = (var_8+16) ) + { + try + { + float [][] var_10 = {{(3.36015e+28F),(1.00198e-36F),(-1.4918e-07F),(381731F),(-4.8965e-33F)}}; + var_3 = (var_9++) ; + var_11 = (((--var_13)-func_14())&var_9) ; + } + catch( java.lang.ArithmeticException myExp_69 ) + { + var_71[((var_73++)&0)][((var_72--)&4)] = var_22 ; + System.out.println("hello exception 4 !"); + } + } + } + else + { + for( var_75 = 666 ;(var_75<671);var_75 = (var_75+5) ) + { + byte var_81 = (byte)(-128); + for( var_76 = 929 ;(var_76<971);var_76 = (var_76+14) ) + { + byte var_80 = (byte)(-13); + var_78[(((--var_81)+(short)(-17106))&1)][((+(var_80--))&3)][((++var_79)&0)] = ((var_81++)&var_22.var_54) ; + } + } + } + return var_82; +} +public static strictfp short func_14() +{ + var_5.var_15 = (var_11--) ; + short var_68 = (short)(-27898); + for( var_16 = 871 ;(var_16<875);var_16 = (var_16+1) ) + { + byte var_20 = (byte)(24); + int var_17 = (657470767); + float [][][] var_19 = {{{(1.55239e-14F),(-1.87897e-32F),(2.62125e-36F),(1.34161e+29F),(-0.000252102F),(9.33828e+33F)},{(8.01129e+36F),(-6.53645e-33F),(-2.10594e-30F),(4.81023e+21F),(-1.04582e-31F),(-8.99897e-14F)},{(-2.70708e-28F),(-1.74251e+27F),(2.73091F),(1.60043e+13F),(-1.0634e-37F),(1.298e-11F)},{(1.85707e-11F),(-3.34667e+25F),(-189.732F),(2.86555e+10F),(7.17774e-35F),(8.44039e-26F)},{(3.20101e-38F),(-3.20781e-30F),(-1.22492e+06F),(-1.47151e+33F),(-7.71931e-31F),(-7.29837e+08F)}},{{(-5.54315e-07F),(-3.70304e-39F),(-1.30949e+34F),(5.44743e-10F),(1.49671e+06F),(-106.9F)},{(3.8271e-24F),(-4.85559e+15F),(5.60199e-33F),(2.36388e-06F),(-9.66998e-16F),(-4.93297e+24F)},{(-8.39475e-39F),(1.46551e-28F),(-3.183e-19F),(-2.02397e+29F),(-8.00055e-19F),(1.84724e+14F)},{(427697F),(4.39403e+21F),(1.8483e-26F),(-1.21584e-31F),(3.46513e-31F),(8.04475e+08F)},{(1.35455e-06F),(0.00032207F),(-2.80209e-36F),(-1.50899e-08F),(3.79774e-38F),(-9.56024e+32F)}},{{(-3.4335e+21F),(1.28873e+19F),(5.62281e+13F),(-2.58298e+20F),(1.00764e-13F),(-3.53748e+06F)},{(-0.000543092F),(0.33945F),(-2.1049e-21F),(2.50713e-17F),(-3.97525e+23F),(-2.8528e+14F)},{(3.65536e-31F),(-0.759776F),(-7.7166e-31F),(-1.83982e+25F),(-3.78825e-25F),(-2.31403e+26F)},{(7.50071e+15F),(5.5054e-12F),(6.62991e+34F),(-3.50666e+11F),(2.28577e-11F),(3.81989e+29F)},{(-9.73936e-37F),(-1.09928e+24F),(-1.36422e+23F),(-3.27167e+13F),(1.27209e-11F),(-5.94027e-17F)}},{{(-6.91117e+32F),(1.53937e+07F),(-1.69336e+13F),(-2.50169e+14F),(4.65331e-30F),(3.83211e+11F)},{(7.73635e+12F),(-623.298F),(-1.96043e-32F),(-5.85369e-23F),(12785.6F),(-8.97469e+15F)},{(-2.67562e+32F),(2.5587e+11F),(-2.91134e-34F),(-1.84119e+09F),(7.36509e+06F),(-2.2733e-30F)},{(0.000255515F),(-5.38913e-17F),(1.17221e-20F),(1296.56F),(-6.30467e+25F),(-1.13216e+07F)},{(5.6306e-31F),(3.66163e+21F),(1.78059e+25F),(5.13864e-26F),(7.37479e+23F),(7.57501e-07F)}}}; + for( var_17 = 878 ;(var_17<895);var_17 = (var_17+17) ) + { + int var_21 = (1427206282); + var_19[((var_21++)&3)][((+(++var_20))&4)][(((++var_20)|var_16)&5)] = ((--var_20)+var_5.var_15) ; + try + { + var_19 = func_24((var_64++)) ; + } + catch( java.lang.ArithmeticException myExp_65 ) + { + var_22.var_66 = ((++var_67)+var_22.var_66) ; + System.out.println("hello exception 5 !"); + } + } + } + return (++var_68); +} +public static strictfp float[][][] func_24(float var_25) +{ + var_5.var_26 = var_27 ; + float [][][] var_57 = {{{(7.28096e-06F),(-2.18878e+32F),(-1.6805e+29F),(-0.00380722F),(4.30521e+20F),(8.04701e+06F)}},{{(-4.47326e-15F),(4.18305e+34F),(3.74492e-06F),(1.65708e+38F),(6.51601e+18F),(-4.81153e+20F)}}}; + if( func_28()) + { + short var_62 = (short)(28441); + try + { + long var_60 = (1436371912401526998L); + try + { + var_57[(((--var_58)+var_22.var_39)&1)][((var_59++)&0)][((-(--var_58))&5)] = (var_60++) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_61 ) + { + var_5.var_43 = ((var_62++)&var_5.var_12) ; + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.ArithmeticException myExp_63 ) + { + var_57[((-(var_9++))&1)][((var_9++)&0)][((++var_37)&5)] = (+((var_11++)*var_58)) ; + System.out.println("hello exception 7 !"); + } + } + return var_23; +} +public static strictfp boolean func_28() +{ + byte var_47 = (byte)(47); + final boolean [][][] var_34 = {{{false},{false},{false},{true},{false},{true}}}; + short var_55 = (short)(-6938); + for( var_29 = 542 ;(var_29<547);var_29 = (var_29+5) ) + { + int var_30 = (-1300022882); + double var_44 = (-2.6459e+191D); + cl_38 [][][] var_49 = {{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}},{{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()},{new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38(),new cl_38()}}}; + short var_42 = (short)(-13734); + for( var_30 = 799 ;(var_30>745);var_30 = (var_30-18) ) + { + boolean [][][] var_33 = {{{true},{true},{false},{true},{false},{true}}}; + byte var_40 = (byte)(82); + int var_31 = (2088612453); + for( var_31 = 778 ;(var_31<786);var_31 = (var_31+8) ) + { + final int var_32 = (2089359583); + long var_35 = (-3120176112799566210L); + var_22 = var_22 ; + var_33[(var_29&0)][(var_30&5)][(var_31&0)] = true ; + var_33 = var_34 ; + var_23[(var_29&3)][(var_30&4)][(var_31&5)] = (var_35++) ; + var_33[0][((var_37--)&5)][((--var_36)&0)] = ((((var_38++)*var_22.var_39)&( ( int )(--var_40) ))>=( ( byte )((var_40--)*( ( int )var_41[1][((-(--var_42))&0)][((var_40--)&3)] )) )) ; + var_33[((var_36++)&0)][((var_3--)&5)][((var_13--)&0)] = (!(!(!(!(((var_40++)-var_5.var_43)==var_36))))) ; + var_42 = (++var_42) ; + var_33[(var_29&0)][(var_30&5)][(var_31&0)] = (!((++var_44)>=var_36)) ; + var_33[(var_29&0)][(var_30&5)][(var_31&0)] = false ; + } + } + try + { + try + { + var_5.var_46 = (((++var_47)*var_9)-var_3) ; + var_48 = var_48 ; + cl_9 var_50 = new cl_9(); + var_5 = var_50 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_51 ) + { + var_3 = (--var_47) ; + System.out.println("hello exception 8 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_53 ) + { + if( ((var_42--)>=var_22.var_54)) + { + var_47 = (--var_3) ; + } + System.out.println("hello exception 9 !"); + } + } + return (!(!(!((var_55++)!=var_36)))); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2030); + CrcCheck.ToByteArray(this.var_3,b,"var_3"); + CrcCheck.ToByteArray(this.var_5.GetChecksum(),b,"var_5.GetChecksum()"); + CrcCheck.ToByteArray(this.var_9,b,"var_9"); + CrcCheck.ToByteArray(this.var_11,b,"var_11"); + CrcCheck.ToByteArray(this.var_13,b,"var_13"); + CrcCheck.ToByteArray(this.var_16,b,"var_16"); + CrcCheck.ToByteArray(this.var_22.GetChecksum(),b,"var_22.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_23[a0][a1][a2],b,"var_23" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_27[a0][a1],b,"var_27" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_29,b,"var_29"); + CrcCheck.ToByteArray(this.var_36,b,"var_36"); + CrcCheck.ToByteArray(this.var_37,b,"var_37"); + CrcCheck.ToByteArray(this.var_38,b,"var_38"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_41[a0][a1][a2],b,"var_41" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_48[a0][a1][a2].GetChecksum(),b,"var_48" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_78[a0][a1][a2],b,"var_78" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_85,b,"var_85"); + CrcCheck.ToByteArray(this.var_90,b,"var_90"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5950_2018110811698/Start.java b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..fcadb60f596f7de98bed1c11cf6b872071357c5e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_38.java cl_9.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/5950_2018110811698/cl_38.java b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/cl_38.java new file mode 100644 index 0000000000000000000000000000000000000000..94d0814fc280fbe23cf6d6f8ef578de3e740bc4c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/cl_38.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1595514112 + +import java.util.zip.CRC32; + +class cl_38 +{ + int var_39 = (2028132604); + short var_54 = (short)(10333); + long var_66 = (8726253284283790042L); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(14); + CrcCheck.ToByteArray(this.var_39,b,"var_39"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5950_2018110811698/cl_9.java b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/cl_9.java new file mode 100644 index 0000000000000000000000000000000000000000..0b99ad7b94055885e3bcc239b02f32160463a650 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5950_2018110811698/cl_9.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1595514112 + +import java.util.zip.CRC32; + +class cl_9 +{ + boolean var_7 = true; + long var_12 = (-2505716261215778601L); + float var_15 = (8.29438e-29F); + int [][] var_26 = {{(978419980),(1316470147),(977113513)},{(-1241433364),(23743312),(-1280934317)}}; + double var_43 = (-4.24576e-165D); + int var_46 = (1635316722); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(49); + CrcCheck.ToByteArray(this.var_7,b,"var_7"); + CrcCheck.ToByteArray(this.var_12,b,"var_12"); + CrcCheck.ToByteArray(this.var_15,b,"var_15"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_26[a0][a1],b,"var_26" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5951_2018110812102/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/5951_2018110812102/MainClass.java b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..473b9522ee8f19ea927657e044763dfb0646bc89 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/MainClass.java @@ -0,0 +1,331 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1786270304 + +import java.util.zip.CRC32; + +class MainClass +{ + static cl_3 var_2 = new cl_3(); + static int var_8 = (-215298204); + static double var_24 = (2.95981e+153D); + static byte var_25 = (byte)(-21); + static cl_40 var_28 = new cl_40(); + static byte var_38 = (byte)(87); + static byte var_42 = (byte)(56); + final static short var_43 = (short)(2720); + static byte var_46 = (byte)(127); + static int [] var_48 = {(-831725548),(230009185),(1667664487),(-1390578724),(-1055581779),(-241327347),(1444653940)}; + static int var_58 = (-185206780); + static cl_40 [][][] var_60 = {{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}},{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}},{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}},{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}},{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}}}; + static short var_64 = (short)(-13579); + static byte var_80 = (byte)(102); + static double var_88 = (9.95974e-300D); + static long [][][] var_92 = {{{(-9128047020008883002L),(7046238216641948686L),(2349789520064049749L)},{(6382646636140020594L),(-2945817097091118154L),(-1663256527524207359L)}},{{(5390785382739852553L),(8487259024187471650L),(-4575042157017727875L)},{(2615624062174450476L),(5231393037408508720L),(4872749008666897550L)}},{{(6508662547004968328L),(-1910429544404874247L),(-6307815564663698275L)},{(1661881033135730108L),(-3879987478304387185L),(-5446982515604544600L)}},{{(-3810317903725677136L),(-8455391063480518984L),(7947144197817354507L)},{(-4200830469639861095L),(8137347122411963109L),(-3358978952280306818L)}},{{(-6120682353112673573L),(5308633318515623361L),(-8498959615193917604L)},{(4929468308821687764L),(3583972714880726292L),(7837031138028048306L)}},{{(5601009079033425212L),(-8294654464244254564L),(4323544640112626122L)},{(9047107958999699292L),(6070726885776531157L),(7206586749867720158L)}},{{(6284467981233970546L),(-525714540812395503L),(725420692986338392L)},{(-6867393492926714994L),(-2018527423026686010L),(-5931706469047675299L)}}}; + static int [][][] var_98 = {{{(407237747),(389175530)},{(890538580),(-616516909)}},{{(-1410813149),(-1532612152)},{(-932189519),(1042294452)}},{{(1718633760),(935790613)},{(556852886),(1359711802)}},{{(-1856638937),(1742642184)},{(796747587),(1445268476)}},{{(1290161077),(328171583)},{(-604088767),(592707349)}}}; + static int var_100 = (1007413326); + static double [] var_102 = {(-2.80507e+236D),(-1.85058e+162D),(3.44837e-241D),(-1.27791e-182D),(-1.73232e-187D)}; + byte var_107 = (byte)(-121); + byte var_112 = (byte)(122); + short var_114 = (short)(-25800); + cl_40 var_116 = new cl_40(); + final float var_118 = (-1.51748e+07F); +/*********************************/ +public strictfp void run() +{ + long var_113 = (-5508786908253018580L); + try + { + cl_3 var_1 = new cl_3(); + var_1 = func_3((++var_107) ,(-916444597) ,(++var_58)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_111 ) + { + try + { + if( ((var_112++)<=func_35((var_113--)))) + { + var_58 = (--var_114) ; + } + } + catch( java.lang.ArithmeticException myExp_115 ) + { + try + { + var_2 = var_2 ; + } + catch( java.lang.IllegalArgumentException myExp_117 ) + { + var_2.var_21 = ((--var_25)*var_118) ; + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 1 !"); + } + System.out.println("hello exception 0 !"); + } + return ; +} +public static strictfp cl_3 func_3(long var_4, int var_5, int var_6) +{ + short var_90 = (short)(27887); + float var_7 = (-1.19453e-08F); + byte var_86 = (byte)(99); + try + { + for( var_8 = 586 ;(var_8>550);var_8 = (var_8-9) ) + { + try + { + var_2 = func_9(((var_86--)+var_28.var_54) ,((+(++var_88))-(byte)(23)) ,(--var_90) ,var_92 ,func_35(((var_90--)-var_2.var_66))) ; + } + catch( java.lang.IllegalArgumentException myExp_96 ) + { + var_28.var_97 = ( ( double )var_98[((--var_5)&4)][((~(--var_86))&1)][(((--var_86)+var_2.var_67)&1)] ) ; + System.out.println("hello exception 3 !"); + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_99 ) + { + try + { + for( var_100 = 145 ;(var_100>143);var_100 = (var_100-1) ) + { + var_102[((var_90++)&4)] = (++var_4) ; + } + } + catch( java.lang.IllegalArgumentException myExp_103 ) + { + int var_104 = (-2010069740); + for( var_104 = 271 ;(var_104<298);var_104 = (var_104+9) ) + { + var_4 = (((var_25++)+func_35(((--var_86)*var_28.var_49)))-var_28.var_106) ; + } + System.out.println("hello exception 5 !"); + } + System.out.println("hello exception 4 !"); + } + return var_2; +} +public static strictfp cl_3 func_9(long var_10, double var_11, long var_12, long[][][] var_13, int var_14) +{ + int var_16 = (830868579); + boolean var_15 = true; + short var_18 = (short)(-32647); + for( var_16 = 229 ;(var_16<274);var_16 = (var_16+9) ) + { + int var_84 = (1211340096); + try + { + try + { + int var_17 = (-735946007); + short var_20 = (short)(18342); + var_13[(((var_20--)-var_8)&6)][(((var_18++)&var_2.var_19)&1)][((var_17++)&2)] = (-1696956739091863875L) ; + var_2.var_21 = func_22() ; + } + catch( java.lang.ArithmeticException myExp_79 ) + { + var_2.var_66 = (var_80--) ; + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_81 ) + { + try + { + var_10 = ((++var_80)+( ( long )(--var_80) )) ; + } + catch( java.lang.IllegalArgumentException myExp_82 ) + { + byte var_85 = (byte)(-122); + var_13[((var_85--)&6)][(((~(var_84--))-( ( int )(~(var_18--)) ))&1)][((((var_64--)|var_2.var_83)-var_64)&2)] = (8680460891867829247L) ; + System.out.println("hello exception 8 !"); + } + System.out.println("hello exception 7 !"); + } + } + return var_2; +} +public static strictfp float func_22() +{ + byte var_62 = (byte)(-1); + byte var_78 = (byte)(0); + cl_3 [][][] var_31 = {{{new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3()}}}; + cl_40 [][][] var_61 = {{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}},{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}},{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}},{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}},{{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()},{new cl_40(),new cl_40(),new cl_40(),new cl_40()}}}; + cl_3 var_51 = new cl_3(); + final cl_40 var_76 = new cl_40(); + try + { + short var_53 = (short)(-27554); + short var_33 = (short)(13260); + int var_23 = (-384177990); + int var_32 = (389336999); + for( var_23 = 616 ;(var_23>578);var_23 = (var_23-19) ) + { + final cl_40 var_70 = new cl_40(); + byte var_34 = (byte)(4); + try + { + cl_40 var_29 = new cl_40(); + float var_52 = (1.0256e-38F); + var_24 = (-(++var_25)) ; + cl_40 var_27 = new cl_40(); + var_27 = var_29 ; + var_31[(((var_34--)*func_35((~(++var_34))))&3)][((++var_33)&1)][((var_32--)&3)] = var_2 ; + var_33 = (var_53++) ; + var_31[((((var_34++)+func_35((((var_25++)&var_28.var_54)*var_43)))|var_25)&3)][(((var_38++)-func_35((var_32--)))&1)][((~((--var_34)&var_28.var_49))&3)] = var_51 ; + var_28.var_55 = (!((++var_34)func_35((var_58--))))) + { + var_28.var_55 = false ; + var_62 = (--var_62) ; + var_31[((++var_64)&3)][((var_62--)&1)][((var_62--)&3)] = var_51 ; + } + try + { + cl_3 var_69 = new cl_3(); + final cl_3 [] var_65 = {new cl_3(),new cl_3(),new cl_3(),new cl_3()}; + cl_3 var_68 = new cl_3(); + var_31[(((--var_38)*var_42)&3)][1][((--var_32)&3)] = var_2 ; + var_2.var_66 = ((--var_34)|var_2.var_67) ; + var_42 = (var_46++) ; + var_46 = (byte)(85) ; + var_61[((--var_32)&4)][((~(--var_62))&3)][((var_64--)&3)] = var_28 ; + var_2 = var_2 ; + var_61[((--var_53)&4)][((var_64--)&3)][((var_32++)&3)] = var_70 ; + var_61[4][((var_62++)&3)][((var_58++)&3)] = var_28 ; + var_61[(((var_62++)&func_35(var_2.var_66))&4)][((++var_62)&3)][((var_33--)&3)] = var_28 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_72 ) + { + var_28 = var_28 ; + System.out.println("hello exception 10 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_73 ) + { + int var_74 = (-1487158304); + for( var_74 = 758 ;(var_74<763);var_74 = (var_74+5) ) + { + try + { + cl_40 var_75 = new cl_40(); + var_28 = var_28 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_77 ) + { + var_28.var_55 = true ; + System.out.println("hello exception 12 !"); + } + } + System.out.println("hello exception 11 !"); + } + return (+(var_78++)); +} +public static strictfp int func_35(long var_36) +{ + short var_40 = (short)(4023); + boolean [][] var_39 = {{true,false,true,true,false,true}}; + int var_37 = (-1526785620); + for( var_37 = 310 ;(var_37>302);var_37 = (var_37-4) ) + { + if( ((++var_38)==( ( int )(var_38++) ))) + { + double [][][] var_45 = {{{(-2.19875e-89D),(2.95216e+301D),(-1.22587e-307D),(2.31607e+34D)},{(-4.57133e+124D),(2.83996e+212D),(1.50686e-103D),(-2.15922e-69D)}},{{(1.51274e-42D),(1.43445e+78D),(-2.2224e-240D),(-2.08892e-246D)},{(2.73905e+272D),(1.31587e+89D),(1.30324e-192D),(2.57438e-64D)}},{{(-4.70605e+82D),(3.16672e+242D),(3.86619e-31D),(5.26761e-73D)},{(-9.86195e+63D),(4.62088e+45D),(5.20366e-43D),(6.72394e-31D)}}}; + byte var_47 = (byte)(125); + if( var_39[((+(--var_40))&0)][5]) + { + var_39[0][((~(var_25--))&5)] = false ; + int var_41 = (-685141453); + var_39[((~(++var_42))&0)][((++var_41)&5)] = (!((var_25--)!=var_43)) ; + } + else + { + var_45[(((++var_47)*var_47)&2)][(((var_46++)|var_8)&1)][3] = (++var_25) ; + } + } + } + return var_48[(((var_38++)*var_28.var_49)&6)]; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1193); + CrcCheck.ToByteArray(this.var_2.GetChecksum(),b,"var_2.GetChecksum()"); + CrcCheck.ToByteArray(this.var_8,b,"var_8"); + CrcCheck.ToByteArray(this.var_24,b,"var_24"); + CrcCheck.ToByteArray(this.var_25,b,"var_25"); + CrcCheck.ToByteArray(this.var_28.GetChecksum(),b,"var_28.GetChecksum()"); + CrcCheck.ToByteArray(this.var_38,b,"var_38"); + CrcCheck.ToByteArray(this.var_42,b,"var_42"); + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_48[a0],b,"var_48" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_60[a0][a1][a2].GetChecksum(),b,"var_60" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + CrcCheck.ToByteArray(this.var_88,b,"var_88"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_92[a0][a1][a2],b,"var_92" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_98[a0][a1][a2],b,"var_98" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_102[a0],b,"var_102" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CrcCheck.ToByteArray(this.var_116.GetChecksum(),b,"var_116.GetChecksum()"); + CrcCheck.ToByteArray(this.var_118,b,"var_118"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5951_2018110812102/Start.java b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..06f1e42306022a821e73ac91d7b3853ae61b6bec --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_40.java cl_3.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/5951_2018110812102/cl_3.java b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/cl_3.java new file mode 100644 index 0000000000000000000000000000000000000000..6cd563706d84b2f1a7305c7bc77c6f726c387949 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/cl_3.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1786270304 + +import java.util.zip.CRC32; + +class cl_3 +{ + int var_19 = (1639914758); + float var_21 = (1.24873e-12F); + boolean var_59 = true; + long var_66 = (-176521258812002281L); + final short var_67 = (short)(19414); + byte var_83 = (byte)(-25); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(20); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + CrcCheck.ToByteArray(this.var_21,b,"var_21"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/5951_2018110812102/cl_40.java b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/cl_40.java new file mode 100644 index 0000000000000000000000000000000000000000..f86c2a6fb8253fc2ae4710ff54ee52e6ca1704f5 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/5951_2018110812102/cl_40.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1786270304 + +import java.util.zip.CRC32; + +class cl_40 +{ + short var_49 = (short)(29150); + long var_54 = (6842624259198515784L); + boolean var_55 = true; + double var_97 = (-1.42623e-78D); + final int var_106 = (578961800); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(23); + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_97,b,"var_97"); + CrcCheck.ToByteArray(this.var_106,b,"var_106"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/621_2018112402662/CRC32.java b/test/testsuite/fuzz_test/fuzz/621_2018112402662/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/621_2018112402662/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/621_2018112402662/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/621_2018112402662/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/621_2018112402662/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/621_2018112402662/MainClass.java b/test/testsuite/fuzz_test/fuzz/621_2018112402662/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..6dc9e843f8deae4fa3595a7cb0548f6e51f5f485 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/621_2018112402662/MainClass.java @@ -0,0 +1,784 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1902118766 + +//import java.util.zip.CRC32; + +class MainClass +{ + static long var_0 = (3090456690853223284L); + static cl_4 var_6 = new cl_4(); + byte var_8 = (byte)(-128); + int var_9 = (174031777); + final static cl_7 var_10 = new cl_7(); + static int var_17 = (128796565); + cl_30 [] var_20 = {new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30(),new cl_30()}; + static short var_21 = (short)(21406); + static byte var_28 = (byte)(-54); + static cl_37 var_139 = new cl_37(); + static int var_141 = (1344405328); + static int var_144 = (-9338251); + static cl_35 var_146 = new cl_35(); + static cl_41 var_148 = new cl_41(); + static cl_30 var_150 = new cl_30(); + final static cl_37 var_151 = new cl_37(); + static double var_154 = (1.78766e-207D); + static float var_156 = (1.64207e+33F); + static int var_161 = (-1676691969); + static byte var_162 = (byte)(92); + static boolean var_163 = true; + final long var_166 = (903604858782718773L); + static byte var_168 = (byte)(-117); + short var_180 = (short)(6575); + final cl_41 var_182 = new cl_41(); + final cl_41 var_183 = new cl_41(); + byte var_186 = (byte)(-55); + int var_195 = (-453307385); + int var_201 = (287343646); + int [][] var_213 = {{(-1374430545),(-2002628924),(-1064094059),(-89724797),(377143067),(928436854)},{(-1256545628),(-1142213357),(669063846),(115417418),(-799090316),(-607370937)}}; + byte var_216 = (byte)(5); + int var_220 = (1255513139); + cl_41 [][][] var_222 = {{{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()}},{{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()}},{{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()}},{{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()}},{{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()},{new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41(),new cl_41()}}}; + double var_231 = (2.5518e+190D); + float var_232 = (1.96842e+18F); + double [][] var_236 = {{(-2.90314e+159D)},{(6.72818e+264D)},{(-2.96066e-297D)},{(-3.67536e+186D)},{(1.61971e+164D)}}; + final double [] var_241 = {(3.7924e+118D)}; + long var_243 = (-563030852424230893L); + cl_7 var_244 = new cl_7(); + int var_254 = (-362869964); + cl_30 var_259 = new cl_30(); + int var_271 = (-1503238627); + final cl_4 var_276 = new cl_4(); + short var_279 = (short)(29776); + int var_303 = (429217669); + cl_35 var_309 = new cl_35(); + cl_35 var_310 = new cl_35(); + int var_317 = (1751869985); +/*********************************/ +public strictfp void run() +{ + short var_302 = (short)(-21244); + int [][][] var_301 = {{{(-620354047),(300927727),(-503923613),(-1404001243),(713618022),(-1337499110),(622630396)},{(-1757336754),(-692911300),(-2048347896),(-1598712052),(-1329244034),(-532495384),(283778889)},{(-530977811),(-486724623),(-2032890274),(2085209297),(1441051453),(-517445081),(-140295940)},{(-143581205),(-1497768097),(-1636907932),(-1739940564),(247397154),(1426254129),(-1133772899)},{(1628536504),(1964331496),(1041376385),(655579424),(652273692),(-758049697),(-1630972941)}},{{(-977329474),(416726382),(-1590113361),(-1247916545),(1427163160),(-1904635515),(-1672483611)},{(1060209992),(2142572103),(-1016825904),(824428989),(-1524786692),(-858351186),(304105879)},{(1297044870),(95421041),(1652753846),(685396963),(-1668671507),(1718010582),(1749358086)},{(-271913200),(3167979),(1410166954),(1674277008),(2111497133),(-1458127256),(849825914)},{(1808933888),(2046444371),(1314016178),(343575356),(-90604408),(1096769310),(753237727)}},{{(-1751873133),(-1284052287),(1437805123),(987421334),(-614845676),(-1933622073),(-195063220)},{(2017380813),(196573599),(-1898184336),(456798488),(-1105912200),(945644973),(1033099197)},{(164948454),(2123879765),(1086423885),(118018178),(-991115164),(511306754),(545605406)},{(235189166),(207818713),(-1744203282),(636185831),(2015913459),(-439516944),(1433433645)},{(-992056515),(-1914675279),(488487746),(-20963326),(1811100970),(-474061657),(-289564734)}},{{(-422167863),(912673456),(1617608704),(-531305395),(566599035),(1203884287),(-1707163409)},{(952580588),(-663618142),(952851971),(1594186189),(543630902),(1262432661),(109078654)},{(-1819002538),(1648351043),(-1185814330),(-250076444),(-2070463075),(-1768620044),(-1362585194)},{(2131255241),(-1258712353),(-1100765478),(2030637613),(-1568034389),(657259937),(1403481537)},{(-2032171979),(-2030950602),(357170499),(409842221),(2099375756),(1719372087),(1664942509)}},{{(552265008),(1413527994),(53766619),(1026744351),(1068590056),(2044250125),(-970544552)},{(-810701519),(1974928610),(-542769184),(-1863775562),(-275967803),(1015016901),(-141834091)},{(-583524250),(-938976031),(-1014579804),(1159269484),(724069001),(1912473874),(1856999590)},{(1613330989),(2076790796),(-332579467),(-105919472),(1954838306),(-754478926),(575512086)},{(-815402134),(-350903618),(1497655367),(-796391674),(1824970517),(528844241),(-1593852873)}}}; + byte var_1 = (byte)(-52); + try + { + cl_41 var_315 = new cl_41(); + cl_4 var_319 = new cl_4(); + try + { + try + { + var_0 = ((var_1--)-func_2(var_276 ,var_236 ,(3.13905e-75D))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_277 ) + { + cl_41 var_280 = new cl_41(); + int var_284 = (1519379605); + if( false) + { + short var_282 = (short)(18137); + cl_4 var_288 = new cl_4(); + try + { + try + { + int var_278 = (-369896298); + var_222[(((var_1--)*( ( int )(--var_1) ))&4)][((++var_279)&5)][((var_278++)&5)] = var_280 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_281 ) + { + var_236[(((var_282++)|var_244.var_283)&4)][((~(var_168++))&0)] = (var_284++) ; + System.out.println("hello exception 1 !"); + } + } + catch( java.lang.ArithmeticException myExp_285 ) + { + if( var_6.var_74) + { + cl_41 [] var_287 = {new cl_41(),new cl_41()}; + var_287[((var_195++)&1)] = var_182 ; + } + else + { + var_213[(((var_28--)|func_2(var_288 ,var_236 ,func_15((-(var_282--)))))&1)][((++var_1)&5)] = (-(--var_1)) ; + } + System.out.println("hello exception 2 !"); + } + } + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_293 ) + { + try + { + cl_35 [][][] var_305 = {{{new cl_35(),new cl_35(),new cl_35(),new cl_35()},{new cl_35(),new cl_35(),new cl_35(),new cl_35()}},{{new cl_35(),new cl_35(),new cl_35(),new cl_35()},{new cl_35(),new cl_35(),new cl_35(),new cl_35()}},{{new cl_35(),new cl_35(),new cl_35(),new cl_35()},{new cl_35(),new cl_35(),new cl_35(),new cl_35()}}}; + int var_308 = (-448227552); + try + { + cl_4 var_297 = new cl_4(); + try + { + final boolean [][][] var_294 = {{{true,false,false,true},{false,false,false,true}},{{false,false,false,true},{true,false,false,false}},{{true,false,true,false},{true,false,false,false}}}; + } + catch( java.lang.ArithmeticException myExp_295 ) + { + short var_298 = (short)(-26935); + if( true) + { + var_10.var_296 = ( ( boolean )((++var_1)>func_2(var_297 ,var_236 ,(~(--var_298)))) ) ; + } + System.out.println("hello exception 4 !"); + } + } + catch( java.lang.ArithmeticException myExp_299 ) + { + cl_35 var_311 = new cl_35(); + final cl_35 [][][] var_314 = {{{new cl_35(),new cl_35(),new cl_35(),new cl_35()},{new cl_35(),new cl_35(),new cl_35(),new cl_35()}},{{new cl_35(),new cl_35(),new cl_35(),new cl_35()},{new cl_35(),new cl_35(),new cl_35(),new cl_35()}},{{new cl_35(),new cl_35(),new cl_35(),new cl_35()},{new cl_35(),new cl_35(),new cl_35(),new cl_35()}}}; + try + { + try + { + var_301[((var_195--)&4)][((var_302--)&4)][(((var_302++)*func_30((var_303++) ,var_305))&6)] = (((var_8++)*( ( int )(--var_1) ))+var_279) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_307 ) + { + var_305[((var_308++)&2)][((var_9++)&1)][((var_28++)&3)] = var_311 ; + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_312 ) + { + try + { + var_301[(((var_186--)*( ( int )(var_302++) ))&4)][(((var_302++)&var_151.var_132)&4)][((var_308--)&6)] = var_301[((-(--var_308))&4)][((~(var_186++))&4)][((var_308++)&6)] ; + } + catch( java.lang.IllegalArgumentException myExp_313 ) + { + var_222[((--var_1)&4)][(((--var_8)|var_180)&5)][(((var_308--)+func_30(var_241[((+(++var_1))&0)] ,var_314))&5)] = var_182 ; + System.out.println("hello exception 8 !"); + } + System.out.println("hello exception 7 !"); + } + System.out.println("hello exception 5 !"); + } + } + catch( java.lang.ArithmeticException myExp_316 ) + { + if( ((var_232--)==var_182.var_50)) + { + try + { + try + { + var_301[(((var_216--)-var_141)&4)][4][((var_317++)&6)] = (-(var_302--)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_318 ) + { + var_6 = var_151.var_36.var_83 ; + System.out.println("hello exception 10 !"); + } + } + catch( java.lang.ArithmeticException myExp_320 ) + { + double [][] var_321 = {{(1.588e-06D)},{(6.04578e-301D)},{(-3.5043e-220D)},{(-6.12313e+76D)},{(-2.19593e-46D)}}; + try + { + var_236 = var_321 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_322 ) + { + var_321[4][(((--var_28)|func_2(var_319 ,var_321 ,(var_302--)))&0)] = (--var_186) ; + System.out.println("hello exception 12 !"); + } + System.out.println("hello exception 11 !"); + } + } + System.out.println("hello exception 9 !"); + } + System.out.println("hello exception 3 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_326 ) + { + var_151.var_36.var_62.var_98 = (((++var_1)|var_0)|var_166) ; + System.out.println("hello exception 13 !"); + } + return ; +} +public strictfp byte func_2(cl_4 var_3, double[][] var_4, double var_5) +{ + byte var_269 = (byte)(-98); + long var_245 = (-6455418392565455104L); + int var_238 = (-24359); + var_6 = var_6 ; + short var_7 = (short)(-23657); + try + { + byte var_12 = (byte)(58); + var_4[(((++var_8)+var_9)&4)][((--var_7)&0)] = (-5.69048e+123D) ; + int var_14 = (67253215); + var_10.var_11 = ((--var_12)-var_10.var_13) ; + for( var_14 = 781 ;(var_14<805);var_14 = (var_14+12) ) + { + cl_37 var_250 = new cl_37(); + final cl_35 var_248 = new cl_35(); + try + { + if( ((var_7--)<=func_15(var_4[(((--var_168)|var_8)&4)][((~(--var_12))&0)]))) + { + try + { + try + { + var_4 = var_236 ; + } + catch( java.lang.ArithmeticException myExp_237 ) + { + var_236[((++var_238)&4)][((var_7++)&0)] = var_4[((+(var_12++))&4)][0] ; + System.out.println("hello exception 14 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_239 ) + { + try + { + var_6.var_240 = var_241 ; + } + catch( java.lang.IllegalArgumentException myExp_242 ) + { + var_183.var_94 = var_139.var_36.var_87 ; + System.out.println("hello exception 16 !"); + } + System.out.println("hello exception 15 !"); + } + } + else + { + if( (((var_12++)*func_15((var_12++)))==func_15((++var_245)))) + { + int var_247 = (-1900948721); + for( var_247 = 819 ;(var_247>810);var_247 = (var_247-9) ) + { + var_20[(var_247&6)] = func_22(var_248 ,var_250 ,(((var_12--)+var_7)+var_6.var_54)) ; + } + } + } + } + catch( java.lang.ArithmeticException myExp_253 ) + { + final cl_30 var_260 = new cl_30(); + try + { + try + { + for( var_254 = 993 ;(var_254<997);var_254 = (var_254+4) ) + { + var_238 = ((+(var_12++))&(byte)(78)) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_255 ) + { + var_4[((~(var_7--))&4)][((var_7++)&0)] = ((var_231++)-var_216) ; + System.out.println("hello exception 18 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_256 ) + { + int var_257 = (1357926496); + for( var_257 = 280 ;(var_257<308);var_257 = (var_257+14) ) + { + int var_258 = (1636843321); + for( var_258 = 755 ;(var_258>665);var_258 = (var_258-18) ) + { + var_139.var_49.var_94 = var_151.var_36.var_87 ; + } + } + System.out.println("hello exception 19 !"); + } + System.out.println("hello exception 17 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_261 ) + { + try + { + int var_262 = (255689917); + for( var_262 = 161 ;(var_262<171);var_262 = (var_262+5) ) + { + if( (!(!(!((--var_154)!=var_216))))) + { + try + { + try + { + int var_263 = (-1512144885); + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_264 ) + { + float var_265 = (4.01136e+11F); + var_4[((var_162++)&4)][(((var_7--)-var_17)&0)] = ((var_21--)*func_30((-(--var_265)) ,var_139.var_49.var_178)) ; + System.out.println("hello exception 21 !"); + } + } + catch( java.lang.ArithmeticException myExp_266 ) + { + int var_267 = (1262421651); + for( var_267 = 886 ;(var_267>801);var_267 = (var_267-17) ) + { + var_6 = var_151.var_36.var_83 ; + } + System.out.println("hello exception 22 !"); + } + } + } + } + catch( java.lang.ArithmeticException myExp_268 ) + { + try + { + var_10.var_29 = ((var_269--)-( ( short )(var_238--) )) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_270 ) + { + for( var_271 = 185 ;(var_271<212);var_271 = (var_271+9) ) + { + try + { + var_238 = (-1438223291) ; + } + catch( java.lang.ArithmeticException myExp_272 ) + { + try + { + double var_273 = (3.35755e+47D); + } + catch( java.lang.ArithmeticException myExp_274 ) + { + final double var_275 = (-1702.71D); + System.out.println("hello exception 26 !"); + } + System.out.println("hello exception 25 !"); + } + } + System.out.println("hello exception 24 !"); + } + System.out.println("hello exception 23 !"); + } + System.out.println("hello exception 20 !"); + } + return (--var_28); +} +public strictfp double func_15(double var_16) +{ + int var_209 = (-402244520); + long var_234 = (2786006304619411657L); + short var_214 = (short)(-32606); + try + { + for( var_17 = 579 ;(var_17<609);var_17 = (var_17+15) ) + { + long var_19 = (-2273577239989304653L); + try + { + byte var_202 = (byte)(-92); + try + { + try + { + try + { + var_6.var_18 = (var_19++) ; + var_20 = var_20 ; + var_20[((-(+(var_21--)))&6)] = func_22(var_139.var_49.var_59 ,var_151 ,((++var_195)-( ( byte )(-(var_21++)) ))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_196 ) + { + var_19 = ((++var_180)+var_150.var_197) ; + System.out.println("hello exception 27 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_198 ) + { + try + { + var_146.var_62 = var_139.var_36.var_62 ; + } + catch( java.lang.IllegalArgumentException myExp_199 ) + { + var_16 = (var_19++) ; + System.out.println("hello exception 29 !"); + } + System.out.println("hello exception 28 !"); + } + } + catch( java.lang.ArithmeticException myExp_200 ) + { + float [][][] var_208 = {{{(-6.69075e-25F),(3.94542e+10F)}},{{(3.94614e+11F),(1.67514e+38F)}},{{(-1.28885e-08F),(2.52075e+10F)}}}; + for( var_201 = 891 ;(var_201>876);var_201 = (var_201-3) ) + { + try + { + var_20[((-(var_202++))&6)] = func_22(var_139.var_49.var_59 ,var_151 ,(++var_19)) ; + } + catch( java.lang.ArithmeticException myExp_206 ) + { + var_208[(((++var_186)*var_146.var_83.var_54)&2)][((++var_209)&0)][(((+(--var_168))&var_141)&1)] = (+(var_209--)) ; + System.out.println("hello exception 31 !"); + } + } + System.out.println("hello exception 30 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_210 ) + { + int var_211 = (-1617876648); + for( var_211 = 348 ;(var_211<368);var_211 = (var_211+10) ) + { + if( (!((+((var_186--)+var_156))759);var_220 = (var_220-17) ) + { + int var_221 = (1478782962); + for( var_221 = 960 ;(var_221>915);var_221 = (var_221-9) ) + { + try + { + int var_223 = (-62678596); + for( var_223 = 443 ;(var_223<452);var_223 = (var_223+9) ) + { + try + { + boolean var_224 = true; + } + catch( java.lang.ArithmeticException myExp_225 ) + { + long var_226 = (-426793247407871989L); + System.out.println("hello exception 35 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_227 ) + { + try + { + var_183.var_73 = var_139.var_36.var_83 ; + } + catch( java.lang.ArithmeticException myExp_228 ) + { + try + { + float [][] var_229 = {{(-1.97848e+32F)},{(-1.19787e-23F)},{(4.47259e-34F)}}; + } + catch( java.lang.ArithmeticException myExp_230 ) + { + byte var_233 = (byte)(70); + var_209 = (+(var_233--)) ; + System.out.println("hello exception 38 !"); + } + System.out.println("hello exception 37 !"); + } + System.out.println("hello exception 36 !"); + } + } + } + System.out.println("hello exception 34 !"); + } + return (+(-(~(++var_234)))); +} +public strictfp cl_30 func_22(cl_35 var_23, cl_37 var_24, float var_25) +{ + cl_41 [][][] var_27 = {{{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()}},{{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()}},{{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()}},{{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()}},{{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()}},{{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()},{new cl_41()}}}; + cl_41 var_193 = new cl_41(); + byte var_191 = (byte)(125); + try + { + final cl_41 var_184 = new cl_41(); + int var_188 = (-758267783); + try + { + final cl_41 var_181 = new cl_41(); + var_27[((var_180--)&5)][((((++var_28)+func_30(((var_0++)*var_0) ,var_151.var_49.var_178))*var_168)&4)][(((var_28--)+var_10.var_29)&0)] = var_182 ; + } + catch( java.lang.IllegalArgumentException myExp_185 ) + { + if( ((--var_8)var_154)) + { + var_150.var_130 = (((--var_28)+var_189)|var_8) ; + } + } + } + System.out.println("hello exception 39 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_190 ) + { + try + { + short var_192 = (short)(17050); + var_27[(((--var_192)&var_17)&5)][((((++var_8)-var_150.var_100)*var_191)&4)][((var_191++)&0)] = var_193 ; + } + catch( java.lang.ArithmeticException myExp_194 ) + { + var_6 = var_151.var_36.var_83 ; + System.out.println("hello exception 41 !"); + } + System.out.println("hello exception 40 !"); + } + return var_139.var_36.var_87; +} +public static strictfp short func_30(double var_31, cl_35[][][] var_32) +{ + if( (!(!((var_31++)119);var_140 = (var_140-4) ) + { + try + { + for( var_141 = 474 ;(var_141<526);var_141 = (var_141+13) ) + { + var_31 = (++var_142) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_143 ) + { + for( var_144 = 325 ;(var_144<336);var_144 = (var_144+11) ) + { + var_142 = (++var_21) ; + } + System.out.println("hello exception 42 !"); + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_145 ) + { + try + { + try + { + var_146.var_83 = var_139.var_36.var_83 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_147 ) + { + if( var_148.var_149) + { + var_150 = var_139.var_36.var_87 ; + } + else + { + var_139 = var_151 ; + } + System.out.println("hello exception 44 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_152 ) + { + if( (!((++var_153)==var_154))) + { + final cl_30 var_158 = new cl_30(); + if( (((var_155--)*var_156)>=var_10.var_29)) + { + var_148.var_59.var_157 = var_151.var_36.var_157 ; + } + else + { + var_150 = var_158 ; + } + } + System.out.println("hello exception 45 !"); + } + System.out.println("hello exception 43 !"); + } + } + } + else + { + try + { + int var_159 = (-1800204042); + } + catch( java.lang.ArithmeticException myExp_160 ) + { + try + { + if( false) + { + for( var_161 = 145 ;(var_161>140);var_161 = (var_161-1) ) + { + if( (((var_162--)>(short)(-8494))!=var_163)) + { + int var_164 = (-1038896433); + } + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_165 ) + { + int var_167 = (-1849763886); + final cl_4 var_175 = new cl_4(); + byte var_171 = (byte)(79); + double [] var_170 = {(5.97508e-189D),(1.7968e+256D)}; + for( var_167 = 125 ;(var_167<134);var_167 = (var_167+9) ) + { + if( (!(!((~(var_168--))95);var_34 = (var_34-10) ) + { + var_35[(var_34&3)] = func_37((~(var_52++)) ,((var_135--)-var_109) ,var_49) ; + } + return (var_138--); +} +public static strictfp cl_35 func_37(long var_38, long var_39, cl_41 var_40) +{ + int var_47 = (-1211937428); + long [][] var_129 = {{(-850509360447731569L),(7071097854544354631L),(-6718563430544831712L),(7726039582888633386L),(6832908740143045903L),(-8180868130270662141L)},{(-1938076527102023829L),(-7544062996386913540L),(7822292441499913359L),(8676178614156531022L),(5279643679103095397L),(7561758968760066590L)},{(-6285790185380065562L),(2834962450086812005L),(-2611659576926443688L),(8475721149180391653L),(-5528135191294466873L),(1503314760713280565L)},{(3211546312435645815L),(-6559802539946932963L),(5932881772637058008L),(-3744117301305926469L),(4557057546478477167L),(-2914150460234320109L)}}; + short var_126 = (short)(29046); + try + { + cl_7 var_64 = new cl_7(); + if( ((--var_41)>var_42.var_43)) + { + int var_44 = (-2042537201); + for( var_44 = 626 ;(var_44<711);var_44 = (var_44+17) ) + { + int var_108 = (-1820954322); + cl_7 var_66 = new cl_7(); + int var_45 = (-723491212); + short [][][] var_84 = {{{(short)(19465),(short)(-20967),(short)(32384),(short)(-1546),(short)(-8695),(short)(26643)},{(short)(-23464),(short)(-11730),(short)(-7896),(short)(-8824),(short)(-11718),(short)(-7150)},{(short)(-5982),(short)(18040),(short)(5137),(short)(8929),(short)(-11784),(short)(31244)},{(short)(5536),(short)(-18658),(short)(12291),(short)(26550),(short)(26602),(short)(11025)},{(short)(11599),(short)(31999),(short)(25867),(short)(10917),(short)(20184),(short)(-18657)},{(short)(-2555),(short)(-31777),(short)(-4245),(short)(-7054),(short)(-18750),(short)(27008)},{(short)(-17652),(short)(-1224),(short)(-729),(short)(11560),(short)(-18396),(short)(18063)}},{{(short)(-17469),(short)(18906),(short)(4692),(short)(28446),(short)(-14716),(short)(19361)},{(short)(-6910),(short)(-14378),(short)(19054),(short)(23365),(short)(-6244),(short)(31465)},{(short)(-2540),(short)(22512),(short)(-19028),(short)(-5011),(short)(10522),(short)(14732)},{(short)(-2723),(short)(16595),(short)(1203),(short)(-31011),(short)(-7519),(short)(16399)},{(short)(-20797),(short)(9556),(short)(26614),(short)(2629),(short)(14689),(short)(-16641)},{(short)(13501),(short)(-8092),(short)(-23524),(short)(-17705),(short)(-8616),(short)(8548)},{(short)(-28378),(short)(-2249),(short)(-18358),(short)(9647),(short)(-27145),(short)(-17196)}}}; + for( var_45 = 644 ;(var_45<680);var_45 = (var_45+9) ) + { + int var_79 = (516387295); + cl_4 var_82 = new cl_4(); + boolean [][][] var_46 = {{{false,false,false,false,false,false},{true,false,false,false,false,false},{false,false,false,false,false,false},{false,true,true,true,true,false},{true,true,false,false,false,true},{true,true,false,true,false,true},{false,true,true,true,true,false}},{{false,false,true,true,true,false},{true,false,false,false,false,true},{false,true,false,false,false,false},{false,false,true,true,false,true},{false,false,true,true,true,false},{false,false,true,true,false,true},{false,true,true,false,false,true}},{{false,true,false,false,true,false},{false,true,true,false,true,false},{true,true,false,true,true,true},{false,false,true,false,true,false},{true,true,false,true,true,false},{false,false,true,true,false,true},{false,true,false,true,false,true}},{{false,true,false,false,false,true},{true,true,false,false,true,false},{false,true,true,true,true,true},{true,false,false,false,false,true},{false,false,true,false,false,true},{true,true,false,true,true,false},{true,false,false,true,true,true}}}; + int var_77 = (2132517050); + byte var_48 = (byte)(69); + if( var_46[((var_47++)&3)][(((--var_48)-var_49.var_50)&6)][((var_47--)&5)]) + { + short var_71 = (short)(-14573); + try + { + var_48 = (var_41--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_51 ) + { + cl_4 var_57 = new cl_4(); + var_46[((var_48++)&3)][((--var_52)&6)][5] = (!((((--var_53)|var_42.var_54)&var_49.var_55)==var_56)) ; + cl_35 var_61 = new cl_35(); + var_58 = var_49.var_59.var_60 ; + var_49.var_59.var_62.var_63 = var_36.var_62.var_63 ; + cl_7 var_65 = new cl_7(); + int [][] var_67 = {{(246091916),(69793044),(1601637360),(-254578780),(-287550544),(2123675729),(-1081864283)}}; + var_49.var_59.var_62 = var_49.var_59.var_62 ; + var_38 = (--var_68) ; + var_36.var_62 = var_49.var_59.var_62 ; + var_47 = ((var_48--)&var_34) ; + var_46[(((++var_41)&var_34)&3)][((++var_71)&6)][5] = (((~(+(--var_71)))>var_70.var_13)&&( ( boolean )var_72 )) ; + System.out.println("hello exception 50 !"); + } + final long [] var_85 = {(-2093212868210612829L),(3494000799735305537L),(6189816595580614308L),(8685488465459486373L),(6747859708701055486L),(-2799208399165277259L),(-7993965146499023599L)}; + if( (!(!(!(!(!(!(!var_49.var_73.var_74)))))))) + { + final long var_81 = (-4320642786235330944L); + int var_75 = (-99310736); + var_46[((+(var_52--))&3)][6][((var_47++)&5)] = (!(!((++var_71)==var_42.var_54))) ; + var_42.var_74 = true ; + var_46[(((var_77++)*var_34)&3)][(((~(var_41--))-(1526662695))&6)][(((++var_71)*var_49.var_76.var_29)&5)] = ((var_79--)=( ( short )(++var_48) )) ; + var_84[((var_71--)&1)][((~(++var_48))&6)][((+(--var_48))&5)] = (short)(-26585) ; + var_58[(((var_41--)&var_52)&2)][((+(var_41++))&1)][((++var_71)&0)] = var_49.var_59.var_62 ; + var_84[((var_108--)&1)][((var_48++)&6)][((~(++var_48))&5)] = (short)(13756) ; + var_58[((--var_53)&2)][((-(++var_48))&1)][((var_48++)&0)] = var_70 ; + var_46[((((++var_48)&( ( byte )(var_77--) ))*(short)(22187))&3)][(((--var_41)|var_41)&6)][((++var_77)&5)] = ( ( boolean )(!((var_68--)>=var_56)) ) ; + var_49 = var_40 ; + var_84[((var_48--)&1)][(((--var_48)-var_34)&6)][(((var_47--)+var_70.var_13)&5)] = (var_48--) ; + var_71 = (var_71++) ; + } + catch( java.lang.ArithmeticException myExp_110 ) + { + var_48 = (--var_48) ; + System.out.println("hello exception 51 !"); + } + } + } + } + } + } + catch( java.lang.ArithmeticException myExp_111 ) + { + byte var_117 = (byte)(82); + try + { + cl_30 var_127 = new cl_30(); + try + { + float [] var_121 = {(-1.87572e-10F),(-1.38192e+09F),(1.20166e-35F),(3.58461e+19F),(-4.1466e-19F),(2.48777e-09F)}; + if( (!(!((var_112++)>( ( double )((var_41--)|var_88.var_113) ))))) + { + try + { + if( (!(!((--var_41)>=var_91)))) + { + var_49 = var_40 ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_114 ) + { + float var_118 = (7.0816e+37F); + try + { + double [][] var_116 = {{(-2.89208e-230D),(6.95362e+145D),(6.73757e-254D),(-2.23507e-194D),(5.55309e+239D),(1.47276e-247D),(3.11152e+171D)}}; + var_116[((var_117--)&0)][((--var_41)&6)] = (+(++var_118)) ; + } + catch( java.lang.ArithmeticException myExp_119 ) + { + var_88.var_120 = var_112 ; + System.out.println("hello exception 54 !"); + } + System.out.println("hello exception 53 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_122 ) + { + cl_30 [][] var_125 = {{new cl_30(),new cl_30()},{new cl_30(),new cl_30()},{new cl_30(),new cl_30()},{new cl_30(),new cl_30()},{new cl_30(),new cl_30()}}; + for( var_123 = 958 ;(var_123<1010);var_123 = (var_123+13) ) + { + try + { + if( var_90[((++var_47)&3)][(((--var_41)+(short)(-18055))&6)][((++var_117)&5)]) + { + var_125[4][((var_126--)&1)] = var_49.var_59.var_87 ; + } + } + catch( java.lang.ArithmeticException myExp_128 ) + { + if( ((++var_117)>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/MainClass.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..d1f76749fc0dcbd87d7cb97f9605aa1af2b74253 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/MainClass.java @@ -0,0 +1,240 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2472495084 + +//import java.util.zip.CRC32; + +class MainClass +{ + int var_8 = (1703286511); + int var_9 = (-731270606); + cl_11 var_11 = new cl_11(); + int var_18 = (-111307164); + byte var_21 = (byte)(-82); + double var_159 = (-0.0582048D); + final cl_26 var_160 = new cl_26(); + short var_165 = (short)(-6893); + cl_60 var_166 = new cl_60(); + byte var_167 = (byte)(45); + cl_97 var_170 = new cl_97(); + short var_172 = (short)(-16986); + byte var_174 = (byte)(-76); + cl_26 var_176 = new cl_26(); + final boolean var_178 = false; + int var_181 = (-71406151); + cl_7 var_184 = new cl_7(); + int [][][] var_194 = {{{(1393852810),(36016257),(-2145812614),(-1542414205),(966154817),(-508952460),(1301649944)},{(-337870473),(-575264241),(1895516185),(1703922929),(1668087278),(443049197),(1978715869)},{(-229771787),(-636703264),(-907549451),(-1571614743),(-1909943800),(1343956806),(-279278334)}}}; + int var_195 = (-1038433825); + final float var_201 = (-2.59601e-18F); + float var_202 = (3.01904e-21F); + cl_60 [][] var_203 = {{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()}}; + cl_60 [][] var_204 = {{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()}}; + byte var_207 = (byte)(-100); +/*********************************/ +public strictfp void run() +{ + cl_26 var_198 = new cl_26(); + float var_186 = (-1.25925e+19F); + int var_0 = (-1646767320); + byte var_210 = (byte)(62); + for( var_0 = 253 ;(var_0>229);var_0 = (var_0-6) ) + { + long var_1 = (8978382151649244079L); + boolean [][][] var_209 = {{{false,true},{false,true}},{{true,false},{false,false}},{{true,false},{false,false}},{{true,false},{false,false}},{{true,false},{true,false}},{{false,true},{false,true}},{{true,false},{false,true}}}; + cl_60 var_218 = new cl_60(); + int var_214 = (-1082809633); + if( ((++var_1)<=func_2(var_184 ,var_186 ,var_176.var_49.var_188 ,var_11))) + { + // if stmt begin,id=1 + int var_191 = (-1000510113); + short var_196 = (short)(-23128); + for( var_191 = 278 ;(var_191>230);var_191 = (var_191-16) ) + { + int var_192 = (1891289567); + for( var_192 = 148 ;(var_192>141);var_192 = (var_192-7) ) + { + var_194[(((var_196--)&var_167)&0)][((++var_165)&2)][((++var_195)&6)] = func_13((var_196++) ,var_198 ,false) ; + } + } + // if stmt end,id=1 + } + else + { + // else stmt begin,id=1 + if( ((var_202--)var_165))) + { + // if stmt begin,id=3 + var_203 = var_184.var_109.var_205 ; + // if stmt end,id=3 + } + // if stmt end,id=2 + } + else + { + // else stmt begin,id=2 + int var_206 = (-1627927774); + for( var_206 = 706 ;(var_206<766);var_206 = (var_206+15) ) + { + short var_208 = (short)(24712); + var_204[(((--var_21)&var_21)&5)][((~(((--var_207)&func_13((-(var_208++)) ,var_184.var_154.var_131 ,var_209[((var_210--)&6)][((var_214++)&1)][(((var_210--)&func_13((-2000814946) ,var_198 ,(!((var_210++)>=var_11.var_130.var_103))))&1)]))|func_13((var_172--) ,var_184.var_154.var_131 ,(((++var_207)+var_170.var_122)<( ( double )var_194[(((--var_165)|(4409685))&0)][((var_172++)&2)][(((var_210++)&var_165)&6)] )))))&5)] = var_184.var_109.var_49 ; + } + // else stmt end,id=2 + } + // else stmt end,id=1 + } + } + return ; +} +public strictfp float func_2(cl_7 var_3, float var_4, float[] var_5, cl_11 var_6) +{ + int var_7 = (248380924); + short var_183 = (short)(17635); + for( var_7 = 925 ;(var_7>840);var_7 = (var_7-17) ) + { + for( var_8 = 692 ;(var_8<704);var_8 = (var_8+4) ) + { + short var_10 = (short)(-23815); + var_9 = ((+(var_10--))-var_11.var_12) ; + try + { + if( (((--var_10)+func_13((var_174--) ,var_176 ,var_178))>=(-1.59627e+08F))) + { + // if stmt begin,id=4 + var_4 = (++var_172) ; + // if stmt end,id=4 + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_180 ) + { + if( (!((!(!(!((var_10++)!=var_166.var_62))))==var_176.var_45))) + { + // if stmt begin,id=5 + long var_182 = (-1681725514263994502L); + var_5[((var_165--)&0)] = (var_182++) ; + // if stmt end,id=5 + } + System.out.println("hello exception 0 !"); + } + } + } + return (var_183++); +} +public strictfp int func_13(int var_14, cl_26 var_15, boolean var_16) +{ + short var_173 = (short)(8924); + try + { + final cl_46 var_162 = new cl_46(); + int var_17 = (-415911188); + for( var_17 = 118 ;(var_17>113);var_17 = (var_17-5) ) + { + long [][][] var_20 = {{{(-7942935554977222686L),(-2650888201433008516L),(-6400663113319784181L)},{(7854461881416420057L),(7448611442288297972L),(2065921159618821104L)},{(9121114433396721872L),(-3786267626916345207L),(2741939534379586722L)}},{{(3386917190936348990L),(-3394850968320990685L),(9042262261822364221L)},{(8493682343398690709L),(-4491040644034540457L),(7774460950291693963L)},{(-2539676807552341068L),(5447151054039048620L),(4071673417265867853L)}}}; + for( var_18 = 228 ;(var_18<296);var_18 = (var_18+17) ) + { + try + { + var_20[1][((--var_21)&2)][((++var_14)&2)] = var_11.func_22((!(!((var_21--)!=var_159))) ,var_160.var_67.var_161 ,var_162) ; + } + catch( java.lang.IllegalArgumentException myExp_163 ) + { + var_160.var_67.var_68 = (1831590104) ; + System.out.println("hello exception 1 !"); + } + } + } + } + catch( java.lang.IllegalArgumentException myExp_164 ) + { + byte var_168 = (byte)(-48); + if( ((--var_165)!=var_166.var_50)) + { + // if stmt begin,id=6 + short var_169 = (short)(-27506); + if( (!(!(((var_167--)*var_166.var_70)<=var_168)))) + { + // if stmt begin,id=7 + if( (!((var_169++)<=var_170.var_90))) + { + // if stmt begin,id=8 + final int var_171 = (-984933489); + // if stmt end,id=8 + } + else + { + // else stmt begin,id=3 + var_169 = (--var_168) ; + // else stmt end,id=3 + } + // if stmt end,id=7 + } + // if stmt end,id=6 + } + System.out.println("hello exception 2 !"); + } + return ((var_172++)&( ( int )(-((var_173++)|var_170.var_68)) )); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(753); + CrcCheck.ToByteArray(this.var_8,b,"var_8"); + CrcCheck.ToByteArray(this.var_9,b,"var_9"); + CrcCheck.ToByteArray(this.var_11.GetChecksum(),b,"var_11.GetChecksum()"); + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + CrcCheck.ToByteArray(this.var_21,b,"var_21"); + CrcCheck.ToByteArray(this.var_159,b,"var_159"); + CrcCheck.ToByteArray(this.var_160.GetChecksum(),b,"var_160.GetChecksum()"); + CrcCheck.ToByteArray(this.var_165,b,"var_165"); + CrcCheck.ToByteArray(this.var_166.GetChecksum(),b,"var_166.GetChecksum()"); + CrcCheck.ToByteArray(this.var_167,b,"var_167"); + CrcCheck.ToByteArray(this.var_170.GetChecksum(),b,"var_170.GetChecksum()"); + CrcCheck.ToByteArray(this.var_172,b,"var_172"); + CrcCheck.ToByteArray(this.var_174,b,"var_174"); + CrcCheck.ToByteArray(this.var_176.GetChecksum(),b,"var_176.GetChecksum()"); + CrcCheck.ToByteArray(this.var_178,b,"var_178"); + CrcCheck.ToByteArray(this.var_181,b,"var_181"); + CrcCheck.ToByteArray(this.var_184.GetChecksum(),b,"var_184.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_194[a0][a1][a2],b,"var_194" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_195,b,"var_195"); + CrcCheck.ToByteArray(this.var_201,b,"var_201"); + CrcCheck.ToByteArray(this.var_202,b,"var_202"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_203[a0][a1].GetChecksum(),b,"var_203" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_204[a0][a1].GetChecksum(),b,"var_204" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_207,b,"var_207"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/Start.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..a7340867d0f0f5913ba2913d8cec6ecee6feff34 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_46.java cl_60.java CRC32.java cl_97.java cl_26.java CrcCheck.java cl_11.java cl_7.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_11.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_11.java new file mode 100644 index 0000000000000000000000000000000000000000..35c881c56951a3628fb8c1d1a44c0e957b1a9cd4 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_11.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2472495084 + +//import java.util.zip.CRC32; + +class cl_11 +{ + short var_12 = (short)(-10474); + cl_7 var_125 = new cl_7(); + byte var_126 = (byte)(-18); + long [] var_127 = {(3067312195741181929L),(-5365055639171591251L),(-4810499107680539658L),(5186041432998772531L),(3676209241845108406L),(4424218253840078406L),(-3505100354285504352L)}; + cl_26 var_129 = new cl_26(); + cl_46 var_130 = new cl_46(); + byte var_133 = (byte)(-55); + cl_60 [][] var_135 = {{new cl_60()}}; + byte var_136 = (byte)(-13); + cl_97 var_138 = new cl_97(); + final cl_60 var_151 = new cl_60(); + int var_153 = (1485821349); + double var_156 = (4.77265e+42D); + int var_157 = (1385862701); +/*********************************/ +public strictfp long func_22(boolean var_23, float var_24, cl_46 var_25) +{ + short var_128 = (short)(14567); + cl_60 var_145 = new cl_60(); + int var_158 = (-564793044); + cl_60 var_147 = new cl_60(); + cl_60 var_148 = new cl_60(); + try + { + byte var_26 = (byte)(12); + if( ((++var_26)>var_125.func_27((+(var_126++)) ,var_127[((var_128--)&6)] ,(++var_12)))) + { + // if stmt begin,id=11 + var_24 = (((-(var_26--))*var_129.var_89)*var_130.var_131.var_49.var_55) ; + // if stmt end,id=11 + } + } + catch( java.lang.ArithmeticException myExp_132 ) + { + cl_26 var_155 = new cl_26(); + cl_60 var_140 = new cl_60(); + final cl_60 var_146 = new cl_60(); + cl_60 var_150 = new cl_60(); + if( (!(!(!(!(!((var_133--)<=( ( short )(--var_133) )))))))) + { + // if stmt begin,id=12 + cl_60 var_141 = new cl_60(); + byte var_137 = (byte)(75); + try + { + cl_60 var_143 = new cl_60(); + cl_60 var_144 = new cl_60(); + final cl_60 var_149 = new cl_60(); + final cl_60 var_139 = new cl_60(); + cl_60 var_142 = new cl_60(); + var_135[(((var_12--)-var_138.var_68)&0)][(((+(var_136--))+( ( int )(var_137--) ))&0)] = var_145 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_152 ) + { + for( var_153 = 717 ;(var_153>697);var_153 = (var_153-4) ) + { + var_129 = var_155 ; + } + System.out.println("hello exception 4 !"); + } + // if stmt end,id=12 + } + else + { + // else stmt begin,id=5 + if( (!(!((-(++var_128))<=var_156)))) + { + // if stmt begin,id=13 + for( var_157 = 468 ;(var_157<478);var_157 = (var_157+5) ) + { + var_127[(var_157&6)] = (~(++var_126)) ; + } + // if stmt end,id=13 + } + // else stmt end,id=5 + } + System.out.println("hello exception 3 !"); + } + return (++var_158); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(125); + CrcCheck.ToByteArray(this.var_12,b,"var_12"); + CrcCheck.ToByteArray(this.var_125.GetChecksum(),b,"var_125.GetChecksum()"); + CrcCheck.ToByteArray(this.var_126,b,"var_126"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_127[a0],b,"var_127" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_129.GetChecksum(),b,"var_129.GetChecksum()"); + CrcCheck.ToByteArray(this.var_130.GetChecksum(),b,"var_130.GetChecksum()"); + CrcCheck.ToByteArray(this.var_133,b,"var_133"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_135[a0][a1].GetChecksum(),b,"var_135" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_136,b,"var_136"); + CrcCheck.ToByteArray(this.var_138.GetChecksum(),b,"var_138.GetChecksum()"); + CrcCheck.ToByteArray(this.var_151.GetChecksum(),b,"var_151.GetChecksum()"); + CrcCheck.ToByteArray(this.var_153,b,"var_153"); + CrcCheck.ToByteArray(this.var_156,b,"var_156"); + CrcCheck.ToByteArray(this.var_157,b,"var_157"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_26.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_26.java new file mode 100644 index 0000000000000000000000000000000000000000..dddb6cafa4f1503b4f0dbb05f12b7717001214ce --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_26.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2472495084 + +//import java.util.zip.CRC32; + +class cl_26 +{ + static int var_44 = (1866917492); + static boolean var_45 = true; + static int var_46 = (-1170284135); + static int var_47 = (-359395503); + static float var_48 = (-1.94893e-34F); + static cl_60 var_49 = new cl_60(); + static float [][] var_53 = {{(-5.51498e-33F),(6.5364e+12F),(1.12948e-37F),(4.28134e+18F)},{(-5.57759e-27F),(2.40967e+31F),(-1.76605e-27F),(-2.20388e-27F)},{(-5.9109e+06F),(2.99165e+26F),(-3.40694e+16F),(1.08602e+14F)},{(3.1912e-20F),(-9.76896e+33F),(-6.28191e+06F),(-8.13559e+09F)}}; + static float [] var_56 = {(-2.52753e+38F),(1.59282e+36F),(2.43497e-05F),(-1.7233e-19F)}; + static short var_60 = (short)(-29286); + static byte var_66 = (byte)(-1); + static cl_97 var_67 = new cl_97(); + static float var_69 = (-3.77505e-37F); + static cl_60 var_72 = new cl_60(); + static long var_78 = (4438513059642848983L); + static long var_79 = (6726022234955618319L); + static long var_89 = (2195705078508872746L); + static double var_91 = (1.18438e-247D); + static int [] var_94 = {(426468322),(-14433354),(958881290),(1526572614)}; + static cl_97 [][] var_99 = {{new cl_97(),new cl_97(),new cl_97(),new cl_97(),new cl_97()},{new cl_97(),new cl_97(),new cl_97(),new cl_97(),new cl_97()},{new cl_97(),new cl_97(),new cl_97(),new cl_97(),new cl_97()},{new cl_97(),new cl_97(),new cl_97(),new cl_97(),new cl_97()}}; + double var_103 = (-1.31994e-132D); + int var_104 = (-1909285558); + int var_105 = (-1681026811); + cl_60 [][] var_205 = {{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()},{new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60(),new cl_60()}}; +/*********************************/ +public static strictfp float[][] func_36(int var_37, boolean[] var_38, boolean var_39, boolean var_40, cl_60 var_41, int[] var_42, double var_43) +{ + cl_97 var_101 = new cl_97(); + int var_54 = (915318593); + double var_71 = (5.0045e-139D); + byte var_61 = (byte)(-93); + long var_82 = (-5307307347744147903L); + for( var_44 = 244 ;(var_44<295);var_44 = (var_44+17) ) + { + byte var_52 = (byte)(31); + short var_86 = (short)(22877); + float var_85 = (-11050.4F); + if( var_45) + { + // if stmt begin,id=14 + for( var_46 = 883 ;(var_46>835);var_46 = (var_46-16) ) + { + byte var_65 = (byte)(117); + var_42[(var_46&3)] = (var_47++) ; + short var_63 = (short)(-18613); + float var_77 = (-9.9785e-27F); + try + { + float [] var_58 = {(-1.94922e+17F),(-5.19209e+33F)}; + byte var_51 = (byte)(-27); + var_49.var_50 = ((++var_51)+( ( short )(--var_52) )) ; + var_48 = ((var_47--)-var_49.var_57) ; + final float var_59 = (2.74692e-32F); + var_53[3][((var_52--)&3)] = ( ( float )(~(--var_52)) ) ; + var_39 = ((++var_60)var_72.var_50)) ; + var_42[((var_47++)&3)] = (var_63++) ; + var_56[((var_63++)&3)] = (+(var_63--)) ; + var_42[(((var_63--)-( ( int )(var_65++) ))&3)] = var_42[(((--var_65)+var_46)&3)] ; + System.out.println("hello exception 5 !"); + } + break; + + } + try + { + var_56[((++var_66)&3)] = ((var_78--)+var_69) ; + float [][][] var_84 = {{{(-0.882614F),(15.0847F),(1.66714e+21F),(2.7174e-22F)},{(-2.51088e+33F),(-2.69599e-38F),(1.01976e-06F),(7.82901e+26F)},{(-6.35939e-36F),(3.49859e+24F),(-8772.88F),(-1.98705e+31F)}},{{(-1.29217e+16F),(-9.72339e+11F),(-341.69F),(-0.0992437F)},{(1.02042e+12F),(-3.65214e+28F),(9.6698e-09F),(-2.0146e+09F)},{(2.08897e+35F),(2.88653e+08F),(6.77559e-11F),(-1.53508e-07F)}},{{(7.20241e+07F),(-2.076e-05F),(1.96765e+36F),(-1.63244e-15F)},{(-3.95402e+37F),(5.59073e+20F),(-4.45611e-36F),(-3.73931e+08F)},{(-3.41538e-31F),(1.67396e-13F),(-3.79344e-33F),(-2.03325e+35F)}},{{(-1.72989e+23F),(4.60877e-27F),(-1.92616e+14F),(-7.76227e-14F)},{(-7.20108e-17F),(-71.1321F),(-1.13015e+32F),(-1.45166e-37F)},{(-1.94341e-17F),(1.43194e+35F),(-1.34741e-37F),(-0.327998F)}},{{(2.78467e-26F),(-5.69001e-26F),(-4.11012e-33F),(1.97705e-20F)},{(1.28612e-22F),(0.0477209F),(-1.6249e-21F),(-2.18353e+16F)},{(6.53018e+19F),(-1.87421e+21F),(-5.07633e+16F),(5.53402e+26F)}}}; + try + { + var_53[((var_52--)&3)][((+(var_66--))&3)] = (var_79++) ; + var_42[((~(++var_52))&3)] = (1922698897) ; + } + catch( java.lang.IllegalArgumentException myExp_80 ) + { + double [] var_93 = {(5.90222e+302D),(6.793e-37D),(2.16885e-253D)}; + float var_83 = (-3.80171e+15F); + var_61 = (var_66++) ; + var_67.var_81 = ((++var_82)-var_66) ; + var_56[((-(++var_52))&3)] = (var_78++) ; + var_69 = (--var_85) ; + var_52 = (++var_52) ; + var_53[((+((var_86--)+var_60))&3)][(((var_61--)+var_72.var_50)&3)] = (((var_86--)-var_48)+var_44) ; + long [][] var_92 = {{(331925756589791634L),(1365242261881326516L)},{(-5821328761359461290L),(-5023990674451462567L)},{(4446992158611225019L),(-5538390937208120707L)}}; + var_84[((var_86++)&4)][((var_66--)&2)][((+((var_61--)-var_67.var_87))&3)] = (((++var_61)|var_72.var_88)*var_85) ; + var_42[((~(++var_86))&3)] = (var_66++) ; + var_71 = (var_91++) ; + var_53[((--var_86)&3)][(((var_86++)&var_67.var_87)&3)] = (-2.75363e+19F) ; + var_53[((var_86++)&3)][((var_60--)&3)] = var_84[(((++var_86)|var_46)&4)][((+(++var_86))&2)][(((--var_66)-(byte)(-40))&3)] ; + var_60 = (var_86++) ; + var_56[3] = ((var_66--)&var_60) ; + var_53[((+(++var_86))&3)][(((-(--var_66))&(short)(29079))&3)] = (var_54--) ; + var_42 = var_94 ; + var_72 = var_49 ; + System.out.println("hello exception 6 !"); + } + if( (!((!((-(var_66--))958);var_107 = (var_107-7) ) + { + var_94[((var_60--)&3)] = (var_66--) ; + } + System.out.println("hello exception 7 !"); + } + // if stmt end,id=14 + } + } + return var_72.var_108; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(640); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_49.GetChecksum(),b,"var_49.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_53[a0][a1],b,"var_53" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_56[a0],b,"var_56" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_60,b,"var_60"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_67.GetChecksum(),b,"var_67.GetChecksum()"); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_72.GetChecksum(),b,"var_72.GetChecksum()"); + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_94[a0],b,"var_94" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_99[a0][a1].GetChecksum(),b,"var_99" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_205[a0][a1].GetChecksum(),b,"var_205" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_46.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_46.java new file mode 100644 index 0000000000000000000000000000000000000000..348de40e3eb51e3e6b617dc97dbd5b9486adf3a7 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_46.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2472495084 + +//import java.util.zip.CRC32; + +class cl_46 extends cl_26 +{ + cl_26 var_131 = new cl_26(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(648); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_49.GetChecksum(),b,"var_49.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_53[a0][a1],b,"var_53" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_56[a0],b,"var_56" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_60,b,"var_60"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_67.GetChecksum(),b,"var_67.GetChecksum()"); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_72.GetChecksum(),b,"var_72.GetChecksum()"); + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + CrcCheck.ToByteArray(this.var_91,b,"var_91"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_94[a0],b,"var_94" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_99[a0][a1].GetChecksum(),b,"var_99" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + CrcCheck.ToByteArray(this.var_131.GetChecksum(),b,"var_131.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_205[a0][a1].GetChecksum(),b,"var_205" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_60.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_60.java new file mode 100644 index 0000000000000000000000000000000000000000..348f2a7b09e34df94908cd0a15684623923cc433 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_60.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2472495084 + +//import java.util.zip.CRC32; + +class cl_60 +{ + int var_50 = (1238006085); + final short var_55 = (short)(-19982); + float var_57 = (101687F); + byte var_62 = (byte)(64); + double var_70 = (-4.9034e-137D); + final long var_88 = (-5398573418839455762L); + int [] var_96 = {(-1516426588),(-437723701),(-1006618566),(479290235)}; + long var_98 = (-5186097583038485892L); + final float [][] var_108 = {{(4.64255e+07F)},{(-3.82713e+19F)},{(8.96726e-27F)},{(-6.68279e+23F)},{(-8.88204e+08F)},{(4.48372e-35F)},{(1.90221e+13F)}}; + float [] var_188 = {(-3.34788e+31F)}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(83); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_57,b,"var_57"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_88,b,"var_88"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_96[a0],b,"var_96" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_108[a0][a1],b,"var_108" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_188[a0],b,"var_188" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_7.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_7.java new file mode 100644 index 0000000000000000000000000000000000000000..78a7839f7540e77a53d6044f0ece8c5d36083939 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_7.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2472495084 + +//import java.util.zip.CRC32; + +class cl_7 +{ + cl_26 var_109 = new cl_26(); + byte var_112 = (byte)(-63); + float var_113 = (-6.41385e-36F); + cl_60 var_114 = new cl_60(); + int [] var_116 = {(-1613408244),(267527823),(301809805),(1853130894)}; + int var_119 = (-952107546); + final cl_97 var_121 = new cl_97(); + final cl_46 var_154 = new cl_46(); +/*********************************/ +public strictfp short func_27(int var_28, long var_29, long var_30) +{ + byte var_31 = (byte)(-38); + if( ((--var_31)>=func_32((!((--var_119)!=var_112))))) + { + // if stmt begin,id=9 + if( (!(!(!(((var_112++)+var_121.var_122)<=var_113))))) + { + // if stmt begin,id=10 + int var_123 = (-1259631241); + for( var_123 = 200 ;(var_123>152);var_123 = (var_123-12) ) + { + var_116[3] = (++var_119) ; + } + // if stmt end,id=10 + } + else + { + // else stmt begin,id=4 + final double var_124 = (-8.23208e-242D); + // else stmt end,id=4 + } + // if stmt end,id=9 + } + return (var_112++); +} +public strictfp byte func_32(boolean var_33) +{ + byte var_117 = (byte)(56); + float [][] var_35 = {{(-3.73261e-05F)},{(1.47399e-11F)},{(-5.01839e+08F)},{(2.12673e+15F)},{(-1.63565e+17F)},{(-30125.2F)},{(-1.51715e+18F)}}; + short var_110 = (short)(-3957); + cl_60 var_115 = new cl_60(); + var_35 = var_109.func_36((+(-(++var_110))) ,var_109.var_67.var_111 ,((var_112++)>=(4.00666e+43D)) ,((++var_113)>=var_114.var_57) ,var_115 ,var_116 ,(var_117--)) ; + byte var_118 = (byte)(27); + return (var_118--); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(57); + CrcCheck.ToByteArray(this.var_109.GetChecksum(),b,"var_109.GetChecksum()"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_114.GetChecksum(),b,"var_114.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_116[a0],b,"var_116" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_119,b,"var_119"); + CrcCheck.ToByteArray(this.var_121.GetChecksum(),b,"var_121.GetChecksum()"); + CrcCheck.ToByteArray(this.var_154.GetChecksum(),b,"var_154.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_97.java b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_97.java new file mode 100644 index 0000000000000000000000000000000000000000..233d1c0dc38d03024def780051b8e57d06eeb0c6 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/633_2019010204574/cl_97.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2472495084 + +//import java.util.zip.CRC32; + +class cl_97 +{ + int var_68 = (829469791); + long var_81 = (7898830884379043813L); + byte var_87 = (byte)(107); + double var_90 = (-6.8113e+305D); + final int [] var_95 = {(-646460076),(-1410654674),(277615202),(-1272521998)}; + boolean [] var_111 = {true,true,true,false,false}; + short var_122 = (short)(14142); + float var_161 = (-4.99135e-29F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(48); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + CrcCheck.ToByteArray(this.var_90,b,"var_90"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_95[a0],b,"var_95" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_111[a0],b,"var_111" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_122,b,"var_122"); + CrcCheck.ToByteArray(this.var_161,b,"var_161"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/6415_2018110810324/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/6415_2018110810324/MainClass.java b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..779e987ab7e165a160a02d94c89933426fe55353 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/MainClass.java @@ -0,0 +1,286 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=598886972 + +import java.util.zip.CRC32; + +class MainClass +{ + int var_14 = (1113133630); + static double [] var_16 = {(-2.59621e-75D),(1.42005e+35D),(-4.85901e-152D),(-6.65394e+66D),(9.48734e-154D)}; + static cl_18 var_17 = new cl_18(); + static int var_36 = (-1164436744); + static short var_42 = (short)(5498); + final static byte var_45 = (byte)(-112); + static long var_46 = (-4067010401978256150L); + static double var_47 = (-9.14698e-117D); + final cl_7 [][] var_49 = {{new cl_7()},{new cl_7()},{new cl_7()}}; + double [][] var_56 = {{(-2.38687e-133D),(-8.19026e+226D),(1.91229e-267D)},{(3.86978e+09D),(5.15107e+250D),(-1.40645e-196D)},{(1.44116e-193D),(-2.92196e+230D),(-5.81507e+144D)},{(1.07225e-122D),(-4.69333e-220D),(-1.27358e+213D)}}; + int var_59 = (30279286); + int var_61 = (490386724); + final cl_7 var_62 = new cl_7(); + float var_66 = (-4.25458e+27F); + cl_7 var_77 = new cl_7(); + int [] var_80 = {(73027156),(-1796192311),(-1107523034),(-544973369),(-692004190),(-1104840907)}; + boolean [][] var_88 = {{true,false,false},{true,false,true}}; + cl_18 var_95 = new cl_18(); + byte var_99 = (byte)(10); + boolean [][] var_118 = {{true,true,false,true,false},{false,false,false,true,true},{true,false,false,true,true}}; + short var_123 = (short)(1292); + short var_129 = (short)(6705); + boolean var_130 = false; + int [][][] var_134 = {{{(-1223047570),(-392034581)},{(1854037805),(1690433691)}},{{(-562763720),(1202538912)},{(1784222108),(-1811853080)}},{{(1367212661),(-1927803160)},{(-2134986739),(-60285793)}},{{(-1890228529),(1098609996)},{(1065561920),(1608398271)}},{{(1381779872),(-712102869)},{(2130313002),(933991020)}},{{(1861758549),(-1711050090)},{(1611295388),(1963794008)}},{{(1552960510),(2111999656)},{(-1466560292),(-1011766880)}}}; + byte var_135 = (byte)(121); + byte var_142 = (byte)(48); +/*********************************/ +public strictfp void run() +{ + byte var_136 = (byte)(-91); + long [][] var_112 = {{(2924940057440534177L)},{(4826269873902409360L)}}; + byte var_116 = (byte)(2); + byte var_114 = (byte)(-39); + short var_108 = (short)(14805); + double var_124 = (-1.33914e-188D); + short var_149 = (short)(16846); + byte var_113 = (byte)(-126); + byte var_119 = (byte)(22); + short var_155 = (short)(-13066); + float [][][] var_1 = {{{(-5.79061e-27F)},{(-2.14614e-37F)},{(-3.7145e+22F)},{(1.1805e-14F)}},{{(1.34589e+36F)},{(-9.76238e+10F)},{(6.42374e-35F)},{(-7.18561e+14F)}},{{(4.15447e-14F)},{(5.93835e-20F)},{(2817.63F)},{(1.92815e-07F)}},{{(-6.23483e-21F)},{(-1.33126e+29F)},{(-2.82585e-38F)},{(-3.83494e+27F)}},{{(2.39336e-11F)},{(-8.95428e+07F)},{(3.6988e+21F)},{(-0.0226932F)}}}; + short var_2 = (short)(10855); + byte var_106 = (byte)(-72); + int var_143 = (1668278531); + short var_128 = (short)(15479); + byte var_122 = (byte)(-81); + int var_144 = (-1211352525); + cl_18 var_110 = new cl_18(); + int var_152 = (-996656559); + byte var_146 = (byte)(-11); + var_1[(((var_122++)+var_61)&4)][((var_61--)&3)][(((var_2--)*func_3((!((++var_106)>( ( float )(~(var_46++)) ))) ,func_8((var_108++) ,var_110 ,var_112[((var_114--)&1)][((((++var_113)-var_99)&var_36)&0)] ,((var_99++)+( ( int )(var_116--) )) ,var_118[((~(var_119++))&2)][((++var_42)&4)])))&0)] = ((var_123++)|func_3(((((var_61++)+func_3((!((var_124--)914);var_6 = (var_6-19) ) + { + int var_7 = (-678054143); + byte var_97 = (byte)(-127); + for( var_7 = 676 ;(var_7>622);var_7 = (var_7-18) ) + { + var_5 = func_8((+(var_42--)) ,var_95 ,(var_97--) ,((var_99--)-(byte)(84)) ,((++var_97)>=( ( byte )(var_61++) ))) ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_102 ) + { + int var_103 = (-2015614377); + short var_104 = (short)(31496); + for( var_103 = 870 ;(var_103>830);var_103 = (var_103-10) ) + { + try + { + var_61 = (((++var_104)&( ( byte )(var_99--) ))*var_61) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_105 ) + { + var_77 = var_77 ; + System.out.println("hello exception 1 !"); + } + } + System.out.println("hello exception 0 !"); + } + return (short)(-709); +} +public strictfp cl_7 func_8(int var_9, cl_18 var_10, long var_11, int var_12, boolean var_13) +{ + float var_85 = (-1.06942e+09F); + double [] var_15 = {(1.33518e+289D),(-7.03159e-28D),(-1.42366e+289D),(7.9386e+63D),(-4.96468e-253D)}; + for( var_14 = 998 ;(var_14<1046);var_14 = (var_14+16) ) + { + var_15[(var_14&4)] = var_15[4] ; + double var_91 = (5.43749e-71D); + short var_92 = (short)(-21522); + var_15 = func_19((+(+(--var_9))) ,(++var_9) ,(var_85++) ,var_10 ,var_88 ,(-732236166) ,((var_91++)-( ( float )(+(var_92--)) ))) ; + } + return var_77; +} +public strictfp double[] func_19(long var_20, double var_21, float var_22, cl_18 var_23, boolean[][] var_24, int var_25, double var_26) +{ + final boolean var_27 = false; + int [] var_52 = {(1970179009),(281012494),(1525339081),(1331303919),(2077168218),(-1623913885)}; + byte var_28 = (byte)(78); + short var_53 = (short)(-4794); + if( ((var_28--)852);var_59 = (var_59-1) ) + { + boolean var_60 = false; + var_62.var_63 = ((var_25++)*var_62.var_64) ; + int var_67 = (2065279138); + var_53 = (short)(-21543) ; + var_52[(var_59&5)] = (1775444970) ; + int [] var_72 = {(676189035),(1438972628),(-539516146),(33723360),(-805779698),(476556372)}; + var_17 = var_17 ; + var_47 = (-((var_61++)-var_66)) ; + var_61 = (~(var_53++)) ; + int var_75 = (1792169197); + var_56 = var_70 ; + var_52 = var_72 ; + var_52[(var_59&5)] = (-23209839) ; + var_16[((--var_53)&4)] = (var_53++) ; + var_70 = var_56 ; + } + } + else + { + try + { + var_17 = var_17 ; + } + catch( java.lang.IllegalArgumentException myExp_76 ) + { + var_26 = (-(var_28++)) ; + System.out.println("hello exception 2 !"); + } + } + } + else + { + if( var_24[((((var_25++)*var_45)-var_45)&1)][(((++var_28)|var_45)&2)]) + { + try + { + var_77 = var_77 ; + } + catch( java.lang.ArithmeticException myExp_78 ) + { + var_52[((var_28++)&5)] = (-(var_28--)) ; + System.out.println("hello exception 3 !"); + } + } + else + { + try + { + var_52 = var_80 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_82 ) + { + var_62.var_63 = (var_47++) ; + System.out.println("hello exception 4 !"); + } + } + } + return var_16; +} +public static strictfp double func_29(cl_7[][] var_30, int var_31, int var_32, long var_33, double[][] var_34) +{ + int var_35 = (21621849); + short var_41 = (short)(-31366); + byte var_40 = (byte)(51); + for( var_35 = 419 ;(var_35>355);var_35 = (var_35-16) ) + { + byte var_43 = (byte)(-43); + for( var_36 = 925 ;(var_36<955);var_36 = (var_36+6) ) + { + var_34[((var_31++)&3)][2] = (6.23006e-278D) ; + try + { + cl_18 var_37 = new cl_18(); + cl_7 var_38 = new cl_7(); + double var_39 = (-3.22347e+119D); + var_17 = var_37 ; + var_16[((-(var_40--))&4)] = ((--var_41)*var_42) ; + var_16[4] = (((((var_43++)-var_17.var_44)&var_45)-var_46)-var_47) ; + } + catch( java.lang.ArithmeticException myExp_48 ) + { + var_47 = (-1.10758e-194D) ; + System.out.println("hello exception 5 !"); + } + } + } + return (--var_42); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(396); + CrcCheck.ToByteArray(this.var_14,b,"var_14"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_16[a0],b,"var_16" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_17.GetChecksum(),b,"var_17.GetChecksum()"); + CrcCheck.ToByteArray(this.var_36,b,"var_36"); + CrcCheck.ToByteArray(this.var_42,b,"var_42"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_49[a0][a1].GetChecksum(),b,"var_49" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_56[a0][a1],b,"var_56" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_61,b,"var_61"); + CrcCheck.ToByteArray(this.var_62.GetChecksum(),b,"var_62.GetChecksum()"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_77.GetChecksum(),b,"var_77.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_80[a0],b,"var_80" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_88[a0][a1],b,"var_88" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_95.GetChecksum(),b,"var_95.GetChecksum()"); + CrcCheck.ToByteArray(this.var_99,b,"var_99"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_118[a0][a1],b,"var_118" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_123,b,"var_123"); + CrcCheck.ToByteArray(this.var_129,b,"var_129"); + CrcCheck.ToByteArray(this.var_130,b,"var_130"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_134[a0][a1][a2],b,"var_134" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_135,b,"var_135"); + CrcCheck.ToByteArray(this.var_142,b,"var_142"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/6415_2018110810324/Start.java b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..95e6390b014611e58895ebb11245ae430595feb3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_18.java CrcCheck.java cl_7.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/6415_2018110810324/cl_18.java b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/cl_18.java new file mode 100644 index 0000000000000000000000000000000000000000..60dde0ba8934b3aba50c061b346a278cdc6f464b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/cl_18.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=598886972 + +import java.util.zip.CRC32; + +class cl_18 +{ + double [] var_18 = {(-5.09019e+117D),(-5.36295e-211D),(-4.97261e-103D),(7.90617e-32D),(-1.2683e+234D)}; + byte var_44 = (byte)(-12); + double [][] var_69 = {{(1.68625e-39D),(-2.69203e+306D),(4.53354e-168D)},{(7.74072e-153D),(1.37772e-08D),(-7.33578e+225D)},{(-4.9939e+256D),(-5.98858e-98D),(-2.38134e+30D)},{(1.14277e-14D),(-5.95112e+57D),(1.0058e-270D)}}; + int var_73 = (1382973826); + double var_74 = (-6.97378e-146D); + int [] var_81 = {(-101442534),(539025601),(563011210),(-1316568772),(996640050),(620269270)}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(173); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_18[a0],b,"var_18" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_69[a0][a1],b,"var_69" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_81[a0],b,"var_81" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/6415_2018110810324/cl_7.java b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/cl_7.java new file mode 100644 index 0000000000000000000000000000000000000000..b0785ee5a7955883686446bd4fb0ab38e6311d9f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/6415_2018110810324/cl_7.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=598886972 + +import java.util.zip.CRC32; + +class cl_7 +{ + double var_63 = (-3.2622e+297D); + float var_64 = (3.28637e+35F); + int var_65 = (201274198); + double [][] var_68 = {{(-3.05417e+221D),(-4.23327e-95D),(-1.39699e-292D)},{(8.74527e+20D),(5.956e+176D),(-1.78067e-298D)},{(-1.72637e-241D),(9.6288e-198D),(-1.74996e-62D)},{(-5.83756e+170D),(-5.48975e-58D),(-1.43195e+29D)}}; + boolean [] var_71 = {true,false,false,false,true,true,true}; + int [] var_79 = {(2102452022),(-1619936519),(-141298168),(-21412265),(597187722),(1774728403)}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(143); + CrcCheck.ToByteArray(this.var_63,b,"var_63"); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_68[a0][a1],b,"var_68" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_71[a0],b,"var_71" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_79[a0],b,"var_79" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/CRC32.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/MainClass.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..97dce7a2334795738ba5e4b99c3b34dc56137e72 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/MainClass.java @@ -0,0 +1,1272 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2981708336 + +//import java.util.zip.CRC32; + +class MainClass +{ + static int var_3 = (1840268226); + static cl_10 [][] var_7 = {{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()}}; + static double var_17 = (-9.52318e-103D); + static short var_18 = (short)(18802); + final static byte var_19 = (byte)(94); + static float [][] var_21 = {{(-2.02718e-30F),(-21.8773F),(-1.90016e-26F),(1.22836e-08F),(-6.9695e-34F),(1.02371e+27F),(3.42854e-35F)},{(-6.94778e-20F),(-123.236F),(-2.8519e+18F),(-2.04942e+24F),(-1.1555e+15F),(-3.14773e+07F),(-5.33514e+10F)},{(-2.04401e-29F),(3.76535e-14F),(-7.0215e-29F),(-1.04597e-19F),(-2.49511e+15F),(-4.67962e-26F),(-2.76111e-21F)}}; + static cl_14 var_31 = new cl_14(); + static byte var_44 = (byte)(-120); + static cl_10 var_45 = new cl_10(); + static byte var_47 = (byte)(-104); + static cl_32 var_49 = new cl_32(); + static int var_53 = (345581166); + static byte var_59 = (byte)(-49); + static cl_91 [][][] var_69 = {{{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()}},{{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()}},{{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()},{new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91(),new cl_91()}}}; + static byte var_70 = (byte)(93); + static cl_80 var_71 = new cl_80(); + static cl_91 var_74 = new cl_91(); + static cl_91 var_78 = new cl_91(); + static cl_91 var_79 = new cl_91(); + final static cl_91 var_80 = new cl_91(); + static cl_91 var_81 = new cl_91(); + static cl_111 [] var_85 = {new cl_111(),new cl_111(),new cl_111(),new cl_111(),new cl_111()}; + static byte var_87 = (byte)(-2); + static cl_111 var_88 = new cl_111(); + final static cl_111 var_91 = new cl_111(); + final static cl_111 var_92 = new cl_111(); + static cl_14 [][][] var_95 = {{{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()}},{{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()}},{{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()}},{{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()}},{{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()}},{{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()},{new cl_14(),new cl_14(),new cl_14(),new cl_14(),new cl_14()}}}; + static byte var_96 = (byte)(-22); + static cl_91 [] var_105 = {new cl_91(),new cl_91(),new cl_91()}; + static double var_118 = (-2.73167e-262D); + final static cl_32 var_119 = new cl_32(); + static cl_111 var_122 = new cl_111(); + static int var_132 = (65363759); + static cl_91 [][][] var_135 = {{{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()}},{{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()}},{{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()}},{{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()}},{{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()}},{{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()}},{{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()},{new cl_91(),new cl_91()}}}; + static long var_137 = (4913081873766920952L); + static cl_32 var_142 = new cl_32(); + static boolean [][] var_144 = {{false,true,false,true,true,false,true},{false,true,false,false,false,true,false},{false,false,false,true,true,true,false},{true,false,false,false,false,false,true},{false,false,false,false,true,false,true},{false,false,false,true,false,false,true}}; + static int var_160 = (-1941300897); + static short var_162 = (short)(15990); + static int var_164 = (-1767107919); + static cl_80 var_172 = new cl_80(); + static float var_178 = (7.28533e+21F); + static int var_188 = (-2093526709); + final static cl_14 var_189 = new cl_14(); + static int var_191 = (-290645818); + long [][][] var_200 = {{{(-2946711217119567579L),(-8986971925189135050L),(136572463063107145L),(-8045961015688141825L),(283673633676214464L)},{(2840938303515653540L),(-8404458216693997292L),(3577159120337082088L),(-5577837474808614394L),(-6452945095879990938L)},{(-2901559192906270993L),(602254964544323465L),(95112782487766867L),(-8896094227061501738L),(3969339860760483186L)},{(3552924128111458001L),(-9219126028639351825L),(-3090806350178617930L),(-3716261989416548849L),(-22463766447260030L)},{(6632287531204185111L),(8636873418142527730L),(2956602942337095074L),(671148169370735045L),(-3876110965077937416L)},{(1396411075467030974L),(-605603223372579950L),(5708386019015829352L),(1123287139195955990L),(8170027954496993405L)}},{{(-7870569058260285642L),(6572428825562358822L),(-180078272587344867L),(3912663884416922224L),(-8661499137119096079L)},{(542779065820231569L),(-2444610225595118565L),(1240361193777066277L),(1826666177734413516L),(1876278421074652201L)},{(5810091065791565857L),(-2596218092866522099L),(-3707513684991875381L),(-8036105341737398675L),(7570818050899761315L)},{(-6649859151632035268L),(6381789820701815952L),(-5030467100139477991L),(2973352510706489768L),(-5409146730174702486L)},{(-8509999698740126615L),(3543859022694274572L),(-3290629145392070976L),(-692481451292299357L),(-7051840593594671532L)},{(-2750721028122067861L),(-5758477659043326559L),(4838357489529284080L),(2771417939479132352L),(1415187289059929143L)}}}; + static int [][] var_207 = {{(983714262),(1499793263),(1375100320),(1590145583),(641538670),(-1148177874)},{(-795675113),(1810914848),(-1002939690),(1125644708),(1186547853),(-1659749752)},{(433622705),(1675122472),(-996810483),(-1576752057),(-2110296589),(-2069441876)}}; + static float var_210 = (-1.18202e+23F); + static float [] var_211 = {(-5.13496e+24F)}; + static cl_80 var_214 = new cl_80(); + static float [][][] var_239 = {{{(2.14496e-27F),(-1.5858e+25F),(-15862.1F),(1.20461e+07F)}},{{(-8.55016e-12F),(-3.50451e-32F),(-5.07549e-17F),(1.90294e-14F)}},{{(-9.4314e+22F),(-9.04018e-26F),(5.95281e-33F),(2.10908e+30F)}},{{(7.41799e-30F),(2.04428e+34F),(-1.52286e+10F),(1.51893e+33F)}},{{(4.42892e-20F),(2.75064e-21F),(1.56761e-23F),(-4.21857e+20F)}},{{(-1.54646e-19F),(1.41269e-08F),(1.11896e+17F),(-1.11094e-32F)}}}; + static int var_305 = (-1044826760); + static long var_316 = (-3136611705703637199L); + static double var_337 = (6.57421e-52D); + static short var_345 = (short)(-28612); + static int var_354 = (-1515035647); + final static cl_32 var_355 = new cl_32(); + static boolean var_357 = false; + static int var_361 = (-1270678575); + static int var_365 = (-218946793); + static byte var_366 = (byte)(91); + static long [] var_378 = {(-2185806721494494522L),(-6662677137194018113L),(1324868259494462894L),(8744731746106274976L),(-4983430417333567228L),(-1231043625361268038L),(-3560983099123115753L)}; + static int [] var_382 = {(-2016090290)}; + static boolean [][][] var_391 = {{{true,false,false,false,false,false,true},{false,false,false,true,true,true,true},{true,true,true,false,true,false,true},{true,true,true,false,true,true,true},{false,true,true,true,false,true,false},{false,true,false,false,true,true,false}}}; + static short var_393 = (short)(-8068); + static int [][][] var_394 = {{{(1263915283),(-1330974368),(1265228753),(-1487851452),(944247768),(678318768),(1197020731)},{(-1948054892),(1705782446),(-1074926328),(-1381014415),(1858966126),(1872456972),(-1513220974)},{(779150362),(-123112129),(2140810085),(1848582545),(-1092359610),(-232058819),(2075291354)},{(1554761870),(-1073035170),(-523603836),(-496952094),(-894206347),(902878680),(382169431)},{(1487345448),(-54832284),(-1936391188),(-548502820),(-1264259433),(-459720486),(1415225352)},{(-555883895),(1611678182),(-1936091625),(-405746440),(669749098),(615423802),(317955208)}},{{(1107940677),(-701778217),(1004756781),(1828892381),(1019263157),(-2051675441),(486033587)},{(1313152965),(-1157676390),(-2083441198),(725945622),(-1515538703),(1725713084),(-848882345)},{(-2073007422),(1172645029),(-1022897578),(1872728887),(-2035050942),(1705237933),(-48175118)},{(1118090904),(1127138062),(-616412212),(613781182),(1674825195),(-1295699650),(398725743)},{(1108430527),(175142882),(1876742605),(1480041750),(-1264093028),(576897054),(1139994663)},{(2086165379),(1812669900),(2073037022),(-496374239),(-681429634),(625818203),(1154213961)}},{{(-1827789433),(-1850997871),(235151240),(-845617973),(-118805675),(1508487847),(-2121340607)},{(-1657973752),(1471750467),(1181508340),(19587535),(-1399484703),(-1046419309),(620915375)},{(-2097980170),(-1605463022),(1094185152),(438045460),(-1067018982),(-731263858),(-246695977)},{(925692477),(-1760080328),(-2140490943),(-1339418282),(-468960192),(-823997990),(888241076)},{(1006604430),(1355386911),(-1808836035),(-940445274),(-1869944255),(556754633),(2146466540)},{(1083683161),(1899122527),(-1827942644),(-1684300187),(1299572804),(-539191704),(469662406)}},{{(676574257),(929440296),(127741869),(1056988510),(-872004959),(2121351778),(30577583)},{(-192979124),(841953166),(-1516901188),(-1393394764),(-1809446489),(-1409917762),(-363797466)},{(-1269084154),(-1702481629),(602292076),(517153382),(929222631),(-1455757059),(1201752630)},{(1928497613),(1386481028),(828446002),(-1660960369),(888697937),(1405070310),(998695063)},{(-1738046236),(-1931618192),(1004293134),(1780833217),(1110685402),(1384933696),(-588762642)},{(756928052),(-1504667825),(-1627958184),(-499160534),(-1904366509),(-526620176),(1544260816)}},{{(705774611),(-1455792272),(1359545646),(-731307572),(1996603877),(-738990147),(-1413352171)},{(663581469),(1306407000),(-557926758),(1877922135),(1566851991),(-1523328628),(1468093929)},{(426141592),(1855302942),(-609655779),(1917208528),(-786325018),(-1395194938),(-554756371)},{(323823160),(-1366229777),(-869391267),(-903916790),(-219982655),(-1933211907),(-2102231732)},{(-909001811),(-1128944136),(1781911837),(1650119947),(1286978732),(-533003736),(-1727491736)},{(-578713152),(1195459000),(1045297118),(-720692844),(1132083889),(-1911192758),(-140067408)}},{{(960949203),(910632392),(2035815655),(-178383218),(-1496443332),(678498263),(528716405)},{(-401132434),(-586433815),(556592273),(-1546936338),(1959718092),(988414289),(1263528781)},{(-1003728893),(-99914139),(-217802632),(1371580481),(-1851127818),(-1687832676),(595920953)},{(1060783206),(-1693978760),(-319925583),(-1295997737),(-794917644),(444596569),(1679865597)},{(-562672584),(-427674859),(1299763749),(-1501225544),(134247223),(-1425975295),(-1518240960)},{(-411613486),(411260926),(-1190542678),(1523365981),(1149617035),(-1822693310),(-1792025632)}}}; + final static cl_32 [][][] var_395 = {{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}}}; + final static int [] var_403 = {(-590083834)}; + static cl_32 [][][] var_415 = {{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}}}; + final static float [][][] var_429 = {{{(-5.03406e-27F),(9.9672e+12F),(8.02146e-16F),(6.73317e+21F)}},{{(-0.0183336F),(125.112F),(4.53443e-27F),(4.5083e-10F)}},{{(-3.92239e-15F),(-0.00762144F),(-5.38805e+29F),(8.16833e-36F)}},{{(1.59857e+27F),(9.71208e+24F),(-1.28268e+11F),(9.48821e-20F)}},{{(2.46436e+06F),(1.55129e-27F),(0.000335731F),(-1.88563e-32F)}},{{(2.67286e+14F),(-15712.9F),(-1.27327e+28F),(2.09425e-33F)}}}; + float [] var_458 = {(1.27573e-26F),(1.83735e-30F),(9.43366e-38F),(-5.96306e+09F),(2.94653e+36F)}; + static int var_461 = (-914746613); + static byte var_478 = (byte)(33); + static short var_480 = (short)(-2290); + static byte var_497 = (byte)(0); + cl_10 var_504 = new cl_10(); + static int var_506 = (-1595538597); + short var_519 = (short)(13328); + float [][][] var_529 = {{{(7.23193e+18F),(1.63488e-37F),(2.35352e+09F),(-1.75294e+21F)}},{{(-3.78892e+31F),(4.69624e-15F),(2.3885e-33F),(-3.93837e+11F)}},{{(2.95455e+26F),(-628.786F),(1.45557e-31F),(-1.13148e-17F)}},{{(-1.58926e-29F),(-2.18309e+33F),(-4.30992e+07F),(-1.0065e+24F)}},{{(5.95582e+10F),(6.1142e+32F),(6.15318e+25F),(-966726F)}},{{(-3.90448e-16F),(6.61176e+16F),(-2.86597F),(5.30865e+17F)}}}; + long var_567 = (-6065759105912749727L); + cl_32 [][][] var_576 = {{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}}}; + boolean [][][] var_582 = {{{false,false,true,true,true,false,false},{false,true,false,true,true,true,false},{false,false,false,false,true,true,false},{true,true,false,true,true,true,false},{false,false,false,true,true,false,true},{false,false,false,true,true,true,false}}}; + float [][][] var_594 = {{{(6.41616e-21F),(1.932e+30F),(-2.39559e+32F)},{(0.000161239F),(2.24625e-23F),(4.01975e-09F)},{(4.22513e+07F),(1.7935e+08F),(7.65178e+18F)},{(1515.01F),(-1.92179e+16F),(-8.48133e-30F)},{(3.96981e-37F),(1.56457e-35F),(-5.93819e-23F)},{(0.00897736F),(3.63476e+21F),(1.32779e+21F)},{(-5.09549e+24F),(2.02322e+31F),(-2.54684e-11F)}},{{(-4.55819e+09F),(-7.75628e+37F),(8.00406e-26F)},{(3.02133e+14F),(1.79353e+26F),(-1.26458e+10F)},{(2.09791e-20F),(-3.99231e-18F),(6.78838e-06F)},{(-6.75689e-06F),(-5.34897e+32F),(-1.65003e+38F)},{(-3.6043e+36F),(0.022324F),(1.41451e-23F)},{(-4.99135e-20F),(1.61813e-37F),(-1.12832e-13F)},{(3.27121e+30F),(-1816.89F),(3.16086e-25F)}},{{(-1.47698e-28F),(-11.8436F),(2.20856e+33F)},{(2.80594e+12F),(2.22631e-07F),(4.6065e+07F)},{(-1.20394e-23F),(-4.39645e+16F),(4.47536e+32F)},{(7.28449e-37F),(5.51606e+22F),(-7.3806e+36F)},{(-1.2471e-36F),(-1.75251e+18F),(0.000471768F)},{(-7.46598e-13F),(0.0142003F),(8.62941e+37F)},{(-3.51157e-21F),(-5.55883e-08F),(-3.3269e+27F)}},{{(-1.44758e-17F),(5.18757e+36F),(-4.45792e+13F)},{(1.07773e+30F),(2.03202e-21F),(-3.21486e+15F)},{(-1.52901e-11F),(-15.0931F),(-9.46791e-24F)},{(1.01949e+37F),(7.92171e-16F),(-8.85273e+32F)},{(-2.76293e+10F),(0.000471478F),(-2.69084e-33F)},{(8.73315e+27F),(-4.17032e+17F),(9.59246e+29F)},{(2.01025e-15F),(2.88114e+25F),(-1.64979e-31F)}}}; + int [] var_598 = {(261833086)}; + long var_604 = (822431962477534550L); + long var_616 = (-1281049312026843682L); + boolean [][][] var_631 = {{{false,true,true,false,true,true,false},{true,true,false,false,false,true,false},{true,true,true,true,true,true,true},{true,false,true,true,false,false,false},{true,true,true,true,true,true,false},{false,false,true,true,true,true,true}}}; + boolean [][][] var_639 = {{{true,false,true,false,false,true,false},{false,true,false,false,false,false,true},{false,true,false,true,true,true,true},{true,false,true,false,true,true,true},{false,false,false,false,true,true,true},{true,true,false,true,true,false,true}}}; + int var_656 = (-1281631768); + short var_657 = (short)(18136); + int var_658 = (-1851191666); + int var_662 = (-1256109991); + double var_671 = (2.55625e+169D); + int [] var_673 = {(1082019252),(822163550),(559929838),(1516889552),(847432026),(-1807273586),(-306228773)}; + int var_674 = (420080778); + boolean [] var_675 = {true,true,false}; + float var_676 = (0.00375727F); + float [][][] var_706 = {{{(1.43478e+20F),(-5.90526e+24F),(-1.29475e-25F),(-9.16407e-12F)}},{{(2.71965e-22F),(-2.18749e-06F),(0.00572363F),(1.09548e-13F)}},{{(129049F),(0.225421F),(5.20119e-23F),(-0.000771368F)}},{{(1.3999e+16F),(-1.84993e-15F),(1.29938e+10F),(-1.18517e+06F)}},{{(18858.9F),(-5.72213e+20F),(-8.12798e+33F),(2.08556e+37F)}},{{(-8.19239e-13F),(-1.51348e+24F),(-2.9214e-26F),(-23.0346F)}}}; +/*********************************/ +public strictfp void run() +{ + final int [] var_686 = {(756086679)}; + cl_80 var_679 = new cl_80(); + short var_667 = (short)(-1628); + long var_0 = (-3596423620506336143L); + double var_660 = (3.96484e+307D); + if( (((var_0++)|func_1((var_658++)))<=var_660)) + { + int [] var_666 = {(-928998996),(252305271),(-937851245),(2029876390),(-1375973420),(-572283620),(-328160153)}; + int var_661 = (1924489588); + for( var_661 = 307 ;(var_661<382);var_661 = (var_661+15) ) + { + byte var_664 = (byte)(-114); + try + { + for( var_662 = 340 ;(var_662>290);var_662 = (var_662-10) ) + { + int var_663 = (-963723490); + for( var_663 = 795 ;(var_663>791);var_663 = (var_663-1) ) + { + try + { + var_357 = ((++var_664)<=var_88.var_467.var_32) ; + } + catch( java.lang.IllegalArgumentException myExp_665 ) + { + var_80.var_375.var_376.var_83 = (+(var_667++)) ; + System.out.println("hello exception 0 !"); + } + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_668 ) + { + int var_669 = (-909425665); + for( var_669 = 207 ;(var_669<229);var_669 = (var_669+11) ) + { + int var_670 = (165059562); + for( var_670 = 409 ;(var_670>375);var_670 = (var_670-17) ) + { + try + { + var_664 = (var_664--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_672 ) + { + var_666 = var_673 ; + System.out.println("hello exception 2 !"); + } + } + } + System.out.println("hello exception 1 !"); + } + } + } + else + { + int var_691 = (-1080549104); + final cl_32 [][][] var_684 = {{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}}}; + byte var_681 = (byte)(-81); + for( var_674 = 310 ;(var_674<343);var_674 = (var_674+11) ) + { + var_675[(var_674&2)] = (!(!(!(!(!(func_60((var_676++) ,((--var_366)==var_676) ,var_679 ,((+((-(++var_681))-var_81.var_109))-var_119.var_230) ,((var_681--)==var_88.var_254.var_113.var_46))!=func_23(var_684 ,var_686 ,((--var_681)!=func_35(((((var_667--)-var_71.var_127.var_206)*var_132)+func_60((-(var_17--)) ,((var_210++)>var_676) ,var_172 ,(-((var_691++)*func_23(var_576 ,var_686 ,var_631[((--var_681)&0)][((+(var_70++))&5)][((var_691--)&6)] ,false ,var_639 ,var_164 ,(-3.03197e+16F)))) ,func_54((var_660++)))) ,((var_681--)+( ( float )var_686[0] )) ,(++var_667) ,var_211 ,var_706 ,(var_660--) ,((++var_18)&var_49.var_148))) ,(!(!((--var_667)>var_19))) ,var_391 ,(var_667--) ,(var_658++)))))))) ; + } + } + return ; +} +public strictfp long func_1(float var_2) +{ + short var_520 = (short)(16645); + byte var_575 = (byte)(127); + final int [] var_619 = {(-999446609)}; + int var_564 = (813159036); + float [] var_607 = {(-2.70192e-36F)}; + try + { + cl_10 var_565 = new cl_10(); + cl_80 var_542 = new cl_80(); + long [][] var_522 = {{(3967840942188445318L),(2599411861765235182L),(767035520876538074L),(2600414431014917200L),(7179421537605788658L),(-8488985484067521962L)},{(7563215921431203905L),(7221834105804872866L),(-165976346250693536L),(-416439685716342793L),(-2003639743220808424L),(-7355366137907607337L)}}; + cl_10 [][] var_8 = {{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()}}; + try + { + double var_518 = (1.67843e-282D); + for( var_3 = 366 ;(var_3>360);var_3 = (var_3-3) ) + { + byte var_6 = (byte)(6); + try + { + try + { + try + { + int var_526 = (629804998); + int var_5 = (1926217514); + int var_532 = (-1461772256); + long [][] var_4 = {{(-1167779435777839228L),(3294649210587496047L)},{(1230871617915319597L),(-5897542192858320741L)},{(-2652756143217910114L),(5674491183960014263L)},{(3151418725929677252L),(1124445320520779871L)},{(-1576111593194920381L),(-1119736377544650895L)}}; + var_2 = (+(var_6--)) ; + var_7 = func_9(var_172.var_98.var_50 ,(++var_393) ,(!((++var_210)var_178)) ,var_542 ,(((--var_556)*( ( long )(var_191++) ))+var_137) ,var_45.var_204) ; + System.out.println("hello exception 4 !"); + } + } + catch( java.lang.ArithmeticException myExp_559 ) + { + try + { + try + { + var_6 = (var_6++) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_560 ) + { + var_207[((var_520--)&2)][((+(var_480++))&5)] = (+(++var_70)) ; + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.ArithmeticException myExp_561 ) + { + try + { + var_2 = (-(--var_366)) ; + } + catch( java.lang.IllegalArgumentException myExp_562 ) + { + var_142 = var_355 ; + System.out.println("hello exception 8 !"); + } + System.out.println("hello exception 7 !"); + } + System.out.println("hello exception 5 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_563 ) + { + var_8[((var_564--)&5)][((-(var_564++))&6)] = var_504 ; + System.out.println("hello exception 9 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_566 ) + { + long var_614 = (-5698839887497327867L); + boolean [][] var_579 = {{true,true,false,true,false},{false,true,true,false,false}}; + int [][] var_611 = {{(652869254),(-36579209),(1910263064),(-2094404022),(1914816223),(823842112)},{(1675514875),(-796915273),(844358181),(6072140),(-924219212),(-2086501875)},{(1400192203),(426215520),(2142960542),(-758416389),(-1089779899),(-886487171)},{(-1893325034),(688378802),(-11909282),(-1193191673),(1262948531),(1942223537)}}; + double [][] var_588 = {{(-1.44079e-105D),(5.02129e+183D),(5.70162e-272D),(1.66754e-165D),(3.31888e-264D),(-5.87244e-13D)}}; + if( ((++var_47)!=func_35((var_567--) ,((~(var_70--))*var_137) ,(var_564++) ,var_211 ,var_88.var_572.var_573 ,((var_575++)&func_23(var_576 ,var_382 ,var_579[(((var_575++)-var_345)&1)][((--var_191)&4)] ,((--var_118)<=var_132) ,var_582 ,(var_575--) ,((var_520--)*func_23(var_122.var_129.var_381 ,var_382 ,(!((++var_575)var_118))))) ,var_80.var_139.var_129 ,(var_614--) ,((((var_575--)&var_520)|var_214.var_127.var_138)==func_60(((var_616++)-var_81.var_111) ,func_54(((~((var_520++)+( ( long )((+(--var_575))+func_23(var_122.var_129.var_381 ,var_619 ,var_189.var_621 ,(!((++var_87)!=func_23(var_91.var_129.var_381 ,var_619 ,true ,true ,var_189.var_591 ,((--var_47)+(-1196968531)) ,(++var_575)))) ,var_631 ,var_142.var_83 ,((+(--var_575))+var_178))) )))*func_23(var_88.var_129.var_381 ,var_619 ,((((var_520++)-var_337)+var_137)>=var_18) ,((var_520--)==var_119.var_230) ,var_639 ,(var_564--) ,( ( float )(var_520--) )))) ,var_79.var_139.var_129 ,(--var_2) ,(!(!((++var_575)!=var_92.var_102))))))) ,(var_70++)))&6)][((var_520++)&2)])))) ,(+(--var_604))))) + { + int var_655 = (-604596143); + for( var_655 = 711 ;(var_655>691);var_655 = (var_655-4) ) + { + for( var_656 = 902 ;(var_656>881);var_656 = (var_656-7) ) + { + var_80.var_139.var_129.var_376 = var_71.var_98.var_50 ; + } + } + } + System.out.println("hello exception 10 !"); + } + return (var_657++); +} +public static strictfp cl_10[][] func_9(cl_14 var_10, float var_11, boolean var_12, long var_13) +{ + int var_492 = (-1790231080); + boolean [][] var_399 = {{false,true,true},{true,true,false},{false,true,false},{false,false,true},{false,true,false},{false,false,false},{false,true,false}}; + final int var_14 = (1771194147); + cl_111 var_513 = new cl_111(); + try + { + short var_469 = (short)(-15514); + try + { + int var_16 = (-998287646); + boolean [][][] var_422 = {{{false,false,true,true,false,false,false},{true,true,false,false,true,true,false},{false,false,true,false,false,true,true},{false,true,true,true,false,true,true},{false,false,false,false,true,false,true},{false,false,true,true,false,false,false}}}; + int var_15 = (1791734240); + for( var_15 = 582 ;(var_15>544);var_15 = (var_15-19) ) + { + if( ((var_16--)>var_17)) + { + byte var_460 = (byte)(21); + short var_401 = (short)(-22513); + try + { + byte var_22 = (byte)(43); + if( (!((var_18++)>=var_19))) + { + short var_400 = (short)(-29642); + cl_32 [][][] var_383 = {{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}}}; + double var_388 = (3.19599e+154D); + var_21[((--var_16)&2)][(((+(var_22++))+func_23(var_91.var_129.var_381 ,var_382 ,((var_47--)>=func_23(var_383 ,var_45.var_385 ,var_355.var_193 ,func_54((--var_388)) ,var_391 ,(((var_393--)|( ( byte )var_394[(((var_401++)&var_53)&5)][(((+(var_401++))-func_60(var_88.var_409 ,(!(!((--var_59)==var_14))) ,var_81.var_139.var_129 ,((~(++var_47))+( ( float )((var_70++)&func_60(((-((~(var_59++))*var_189.var_108))*var_316) ,(!(!((var_22--)<=var_17))) ,var_71 ,((-(var_393--))+func_35((--var_22) ,(--var_13) ,((--var_22)-func_23(var_415 ,var_31.var_417 ,(!((-(++var_22))==var_31.var_232)) ,func_54((+(var_22++))) ,var_422 ,(-1055246160) ,(++var_137))) ,var_91.var_129.var_427 ,var_429 ,(~(var_22++)) ,((++var_401)-var_13))) ,func_54((+((var_401--)+( ( float )(+(var_401--)) )))))) )) ,true))&5)][(((var_22--)|func_23(var_395 ,var_91.var_397 ,var_399[((var_401++)&6)][((-(--var_400))&2)] ,(!((var_22++)<=func_23(var_395 ,var_403 ,(((var_22++)&( ( short )(+(var_22--)) ))>=var_361) ,((var_22++)<=var_79.var_146.var_114) ,var_391 ,(var_16--) ,(((++var_22)-var_49.var_113.var_114)*var_11)))) ,var_122.var_129.var_405 ,(var_22--) ,(-1.96898e+36F)))&6)] ))+(1938509325)) ,var_81.var_375.var_98.var_32)) ,var_422[(((var_345--)-func_60(var_172.var_127.var_451 ,(!(!(((var_96++)*( ( byte )(465418181) ))>=var_17))) ,var_79.var_139.var_129 ,((var_22++)*var_210) ,var_357))&0)][((((((++var_22)|var_366)*func_35(((var_22--)*func_60((((var_13--)*var_45.var_107)-var_210) ,((--var_22)=var_178))) ; + System.out.println("hello exception 13 !"); + } + } + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_464 ) + { + if( func_54((++var_337))) + { + int var_466 = (-1894001289); + for( var_466 = 474 ;(var_466>429);var_466 = (var_466-15) ) + { + try + { + try + { + var_80.var_139.var_467 = var_172.var_98.var_50 ; + } + catch( java.lang.ArithmeticException myExp_468 ) + { + var_382[((var_191++)&0)] = ((var_469--)|var_45.var_114) ; + System.out.println("hello exception 15 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_470 ) + { + int var_471 = (236244519); + for( var_471 = 132 ;(var_471>42);var_471 = (var_471-18) ) + { + cl_10 var_472 = new cl_10(); + } + System.out.println("hello exception 16 !"); + } + } + } + System.out.println("hello exception 14 !"); + } + } + catch( java.lang.ArithmeticException myExp_473 ) + { + cl_10 var_505 = new cl_10(); + if( (!(!((--var_44)>var_92.var_169)))) + { + byte var_508 = (byte)(7); + try + { + byte var_482 = (byte)(104); + try + { + int var_474 = (303940219); + for( var_474 = 105 ;(var_474<108);var_474 = (var_474+3) ) + { + try + { + var_31 = var_214.var_98.var_50 ; + } + catch( java.lang.IllegalArgumentException myExp_475 ) + { + float var_476 = (1.03161e-25F); + System.out.println("hello exception 18 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_477 ) + { + short var_491 = (short)(11867); + try + { + if( var_12) + { + var_399[(((var_478++)&func_35((var_18--) ,(var_480--) ,(-(+(+(--var_482)))) ,var_211 ,var_429 ,((var_482--)-var_337) ,((var_47++)&var_316)))&6)][2] = (!(!((-(var_47--))==( ( float )(((var_13++)*var_316)-(-1.66801e+11F)) )))) ; + } + else + { + long var_488 = (-9163342133103542664L); + } + } + catch( java.lang.IllegalArgumentException myExp_489 ) + { + try + { + var_92.var_254.var_50 = var_172.var_98.var_50 ; + } + catch( java.lang.IllegalArgumentException myExp_490 ) + { + var_399[((var_491++)&6)][((var_482--)&2)] = var_399[((var_162--)&6)][((var_492--)&2)] ; + System.out.println("hello exception 21 !"); + } + System.out.println("hello exception 20 !"); + } + System.out.println("hello exception 19 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_493 ) + { + try + { + if( true) + { + if( ((var_480++)443);var_510 = (var_510-4) ) + { + var_399[(((--var_511)|var_142.var_113.var_114)&6)][((var_511++)&2)] = (!(!((++var_508)var_31.var_32))))) + { + final float [][][] var_226 = {{{(5.37044e+23F),(-1.77363e+15F),(2.66354e-30F),(-5.12405e-26F)}},{{(2.1615e+33F),(7.20371e-13F),(-2.02964e+13F),(2.83812e+14F)}},{{(498741F),(-9.65678e+32F),(-2.40107e-21F),(5.20829e-28F)}},{{(4.76419e-19F),(2.31292e-24F),(-4.19697e+24F),(-2.51455e+14F)}},{{(3.85274e+13F),(2.01177e+13F),(5.28934e+29F),(-5.83055e+35F)}},{{(6.80079e+20F),(4.13521e+24F),(-1.7147e-16F),(-1.18039e+13F)}}}; + byte var_341 = (byte)(-82); + float var_215 = (-5.60152e-39F); + try + { + float [] var_274 = {(-1.84217e+30F)}; + short var_213 = (short)(24923); + byte var_34 = (byte)(32); + try + { + final float var_33 = (4.37018e+16F); + long var_220 = (-1386316060192653852L); + final double [][] var_296 = {{(-1.72183e-287D),(4.76639e+303D),(-2.12836e+237D),(-6.79777e-140D),(-3.1668e+276D),(-1.99185e-230D)},{(-2.37058e+205D),(-7.62045e+154D),(-4.71146e+56D),(-2.37069e+165D),(3.08448e-191D),(2.89321e-272D)},{(-3.43243e+137D),(1.64996e-213D),(-1.30467e-223D),(7.14836e-292D),(6.97196e+45D),(-2.16187e+201D)}}; + if( (!(!(!(!((var_34++)!=func_35((+((var_34--)*func_35(var_209[(((var_29++)|var_70)&6)] ,(var_210--) ,(var_29++) ,var_211 ,var_31.var_212 ,(1.26589e-130D) ,(-(++var_29))))) ,((++var_213)-func_60((var_34++) ,var_28[(((--var_18)&var_29)&0)][((+(--var_34))&5)][(((var_34--)-var_122.var_129.var_72)&6)] ,var_214 ,((var_34++)|func_60((var_215--) ,(((~(~(--var_34)))-var_47)==func_60((-(var_213--)) ,((++var_137)>func_60((-((var_34--)+var_137)) ,((--var_59)==var_178) ,var_81.var_139.var_129 ,((var_191++)-func_60((-(++var_220)) ,var_28[((+(--var_29))&0)][((~(var_18++))&5)][((((((var_34--)+var_132)+( ( byte )func_35((+(var_18++)) ,(++var_191) ,var_137 ,var_211 ,var_226 ,(2.03435e-19D) ,(-(++var_34))) ))-func_60((var_178--) ,((var_191++)>=var_80.var_147.var_230) ,var_80.var_139.var_129 ,(var_29--) ,func_54(((-(var_231--))-var_142.var_50.var_232))))*func_35((var_34--) ,((+((var_162++)+var_191))-( ( short )(var_34--) )) ,(~(var_96++)) ,var_45.var_237 ,var_239 ,((var_29--)*var_17) ,(--var_213)))&6)] ,var_80.var_139.var_129 ,(var_178++) ,true)) ,((--var_44)<=func_35((-2003921902988458725L) ,(var_47--) ,(-6028007279769046290L) ,var_211 ,var_119.var_212 ,(1.21862e-44D) ,((var_29--)|var_79.var_139.var_254.var_83))))) ,var_257 ,(++var_231) ,func_54(((+(var_47++))|func_35((+(var_162--)) ,(var_213--) ,((var_70++)+( ( int )(++var_34) )) ,var_88.var_261 ,var_239 ,(-1.49579e-83D) ,(var_34--)))))) ,var_80.var_139.var_129 ,((var_29++)+(byte)(117)) ,((var_162++)<=( ( float )func_35(var_209[((var_34--)&6)] ,(~((var_213++)&func_35((++var_191) ,(-((--var_34)+( ( short )(++var_34) ))) ,(var_137--) ,var_274 ,var_226 ,(var_96--) ,(-(+(++var_213)))))) ,(var_29++) ,var_211 ,var_226 ,(((--var_213)|var_137)&var_137) ,(var_191++)) )))) ,(!(((var_34--)+var_53)!=func_60((-(var_34--)) ,(!(!(!((var_213--)=var_49.var_232)))) ,true))*var_178) ,(var_191++)))469);var_305 = (var_305-1) ) + { + try + { + var_27 = ((var_162--)>=var_118) ; + } + catch( java.lang.IllegalArgumentException myExp_306 ) + { + long var_307 = (8185373283377059741L); + System.out.println("hello exception 25 !"); + } + } + } + else + { + if( ((var_70--)func_60((var_231++) ,(!(!((++var_343)>var_189.var_32))) ,var_214 ,var_49.var_32 ,var_28[(((var_343++)&var_53)&0)][((++var_191)&5)][((-(((--var_343)*(byte)(115))&( ( int )var_350[((--var_96)&2)] )))&6)]))))) + { + var_142 = var_352 ; + } + } + else + { + var_209[6] = (--var_137) ; + } + } + catch( java.lang.IllegalArgumentException myExp_353 ) + { + short var_356 = (short)(-3158); + for( var_354 = 814 ;(var_354<835);var_354 = (var_354+7) ) + { + if( ((++var_343)>=var_178)) + { + var_49.var_113.var_204 = var_357 ; + } + } + System.out.println("hello exception 30 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_358 ) + { + try + { + byte var_360 = (byte)(40); + int var_359 = (-892872942); + for( var_359 = 102 ;(var_359<118);var_359 = (var_359+8) ) + { + if( ((-((var_360--)+var_30))>=( ( byte )(var_360--) ))) + { + for( var_361 = 379 ;(var_361<414);var_361 = (var_361+7) ) + { + var_29 = (~(var_360++)) ; + } + } + else + { + int var_362 = (-327442432); + for( var_362 = 220 ;(var_362>155);var_362 = (var_362-13) ) + { + short var_363 = (short)(15726); + var_231 = ((--var_363)+var_355.var_50.var_108) ; + } + } + } + } + catch( java.lang.IllegalArgumentException myExp_364 ) + { + byte var_368 = (byte)(-118); + for( var_365 = 542 ;(var_365<606);var_365 = (var_365+16) ) + { + if( ((+((var_366--)+( ( byte )func_35((8392893736296187163L) ,((var_368++)-( ( short )(++var_191) )) ,((var_70--)*var_137) ,var_211 ,var_122.var_254.var_50.var_212 ,(-6.23294e+17D) ,(~((var_29--)&var_96))) )))>var_79.var_375.var_376.var_230)) + { + try + { + var_209 = var_378 ; + } + catch( java.lang.ArithmeticException myExp_379 ) + { + double var_380 = (4.53069e+154D); + System.out.println("hello exception 33 !"); + } + } + } + System.out.println("hello exception 32 !"); + } + System.out.println("hello exception 31 !"); + } + } + return var_96; +} +public static strictfp int func_35(long var_36, float var_37, long var_38, float[] var_39, float[][][] var_40, double var_41, long var_42) +{ + final cl_10 var_184 = new cl_10(); + byte var_43 = (byte)(-86); + byte var_51 = (byte)(-121); + byte var_208 = (byte)(-53); + short var_48 = (short)(11601); + int var_52 = (-582603507); + var_40[((var_47++)&5)][(((var_44--)*( ( short )var_45.var_46 ))&0)][((+(++var_43))&3)] = (((var_48--)+var_49.var_50.var_32)-( ( short )(var_51--) )) ; + for( var_52 = 983 ;(var_52>961);var_52 = (var_52-11) ) + { + try + { + for( var_53 = 403 ;(var_53<445);var_53 = (var_53+14) ) + { + if( func_54((~(++var_70)))) + { + try + { + try + { + cl_111 var_181 = new cl_111(); + } + catch( java.lang.IllegalArgumentException myExp_182 ) + { + var_71.var_127 = var_71.var_98.var_113 ; + System.out.println("hello exception 34 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_183 ) + { + try + { + var_7[((var_51--)&5)][(((--var_51)*var_3)&6)] = var_172.var_98.var_113 ; + } + catch( java.lang.IllegalArgumentException myExp_185 ) + { + var_40[5][0][((~(++var_70))&3)] = ((var_178++)*var_59) ; + System.out.println("hello exception 36 !"); + } + System.out.println("hello exception 35 !"); + } + } + } + } + catch( java.lang.IllegalArgumentException myExp_186 ) + { + cl_91 var_198 = new cl_91(); + try + { + int var_187 = (-1854848574); + for( var_187 = 932 ;(var_187>923);var_187 = (var_187-9) ) + { + for( var_188 = 518 ;(var_188>479);var_188 = (var_188-13) ) + { + try + { + var_31 = var_189 ; + } + catch( java.lang.ArithmeticException myExp_190 ) + { + var_105[(((var_191--)+func_60((var_48++) ,var_49.var_193 ,var_79.var_139.var_129 ,var_40[((var_43++)&5)][((var_51++)&0)][((+(++var_43))&3)] ,(!((var_43++)<=var_41))))&2)] = var_78 ; + System.out.println("hello exception 38 !"); + } + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_199 ) + { + try + { + try + { + int var_201 = (-1918802269); + for( var_201 = 437 ;(var_201<532);var_201 = (var_201+19) ) + { + var_40[((++var_162)&5)][(((--var_43)&( ( short )var_44 ))&0)][(((--var_43)-var_44)&3)] = (1.64718e-16F) ; + } + } + catch( java.lang.IllegalArgumentException myExp_202 ) + { + try + { + var_135[((var_43--)&6)][((++var_48)&3)][(((-(~(+(var_87--))))|var_162)&1)] = var_79 ; + } + catch( java.lang.IllegalArgumentException myExp_203 ) + { + var_45.var_204 = ((--var_70)>( ( int )(var_43--) )) ; + System.out.println("hello exception 41 !"); + } + System.out.println("hello exception 40 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_205 ) + { + var_40[((((var_70++)&( ( byte )(201184458) ))&(1583310217))&5)][((var_44--)&0)][(((--var_43)&var_162)&3)] = ((((--var_51)*var_45.var_206)-var_137)&var_45.var_206) ; + System.out.println("hello exception 42 !"); + } + System.out.println("hello exception 39 !"); + } + System.out.println("hello exception 37 !"); + } + } + return var_207[((-(++var_208))&2)][5]; +} +public static strictfp boolean func_54(double var_55) +{ + boolean [] var_179 = {true,true,true,false,false,true}; + byte var_177 = (byte)(-105); + short var_180 = (short)(-32200); + byte var_174 = (byte)(-115); + int var_58 = (42630704); + int var_166 = (2081254879); + float [][] var_57 = {{(1.12567e-24F),(-3.74883e-36F),(-2.85169e+33F),(-0.00069197F),(-8.18923e-23F),(-1.31953e+32F),(-3.6799e+34F)},{(-6.22363e-17F),(1.3989e+20F),(-8.66523e-07F),(-5.96209e+14F),(1.25767e-27F),(5.19207e-20F),(6.07224e-05F)},{(4.6097e-38F),(-4.50661e+08F),(-133994F),(4.8772e-32F),(4.35462e-36F),(-7.1664e+15F),(5.84223e+29F)},{(7.35442e-26F),(3.1936e+06F),(-3.77104e+26F),(-2.20464e+18F),(1.82126e-36F),(-4.04497e-28F),(1.35882e+14F)},{(-2.2035e+07F),(89.8238F),(-1.9365e-08F),(5.17814e+33F),(-7.58391e-05F),(-5.36865e-11F),(16.3286F)},{(3.02831e-07F),(-8.95772e-10F),(4.12082e-26F),(3.73933e-16F),(1.38585e-11F),(3.62244e-38F),(-8.97163e-05F)},{(-3.82455e-28F),(-6.76469e-07F),(-1.72939e-34F),(4.02263e-34F),(4.92538e-10F),(2.31042e-13F),(1.41022e+32F)}}; + short var_168 = (short)(-30012); + var_57[(((-(++var_59))-func_60(((var_166++)-var_18) ,(((-(+(var_168--)))!=var_80.var_139.var_169)||var_88.var_170) ,var_172 ,((++var_174)+var_45.var_114) ,false))&6)][((var_58--)&6)] = ((var_177--)+var_178) ; + return var_179[((++var_180)&5)]; +} +public static strictfp short func_60(double var_61, boolean var_62, cl_80 var_63, float var_64, boolean var_65) +{ + byte var_97 = (byte)(-112); + try + { + final double var_66 = (-1.8206e+43D); + var_62 = ((var_59--)181);var_67 = (var_67-15) ) + { + cl_91 [] var_104 = {new cl_91(),new cl_91(),new cl_91()}; + cl_91 var_82 = new cl_91(); + try + { + final cl_14 var_99 = new cl_14(); + if( false) + { + short var_86 = (short)(24686); + cl_111 var_93 = new cl_111(); + try + { + short var_76 = (short)(-4921); + var_69[(((++var_76)*var_71.var_77)&2)][(((var_73--)&var_74.var_75)&5)][(((var_70++)-( ( byte )var_71.var_72 ))&5)] = var_81 ; + cl_111 var_90 = new cl_111(); + var_71.var_72 = var_31.var_83 ; + cl_111 var_89 = new cl_111(); + var_85[(((++var_86)-( ( short )(--var_87) ))&4)] = var_92 ; + var_95[(((var_97++)|var_3)&5)][((((var_86--)+var_18)-var_81.var_75)&6)][((++var_96)&4)] = var_71.var_98.var_50 ; + } + catch( java.lang.IllegalArgumentException myExp_100 ) + { + int var_101 = (1416928160); + var_88 = var_88 ; + var_49.var_50 = var_71.var_98.var_50 ; + var_104[((var_97++)&2)] = var_78 ; + var_104 = var_105 ; + System.out.println("hello exception 43 !"); + } + if( (!(!((--var_106)<=var_45.var_107)))) + { + var_62 = (!(!((var_86++)>=(short)(-1949)))) ; + var_71.var_98.var_50.var_108 = ( ( long )((--var_18)*var_18) ) ; + } + else + { + var_104[(((--var_97)&var_3)&2)] = var_79 ; + var_93 = var_88 ; + var_104[(((~(var_97++))+var_59)&2)] = var_78 ; + var_44 = (--var_97) ; + } + int var_110 = (1287428604); + var_79.var_109 = (var_97++) ; + for( var_110 = 678 ;(var_110>659);var_110 = (var_110-19) ) + { + var_74.var_111 = (~(--var_97)) ; + var_104[((var_96++)&2)] = var_74 ; + var_78 = var_80 ; + } + } + else + { + var_79.var_112 = (!(((--var_97)-var_97)==var_71.var_98.var_113.var_114)) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_115 ) + { + var_104[((var_73--)&2)] = var_82 ; + System.out.println("hello exception 44 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_116 ) + { + int var_125 = (2059200401); + float [][][] var_124 = {{{(-8.12733e+07F),(-5.61918e+17F),(4.43669e-23F)},{(-9.39365e-28F),(-0.00121894F),(-1.79806e+16F)},{(-2.26054e-38F),(-7.79661e-23F),(-3.29008e+33F)},{(-3.78685e+18F),(2.11896e-35F),(5.56021e-23F)},{(-1.9438e-19F),(6.45271e-17F),(5.98826e-21F)},{(1.13929e-12F),(-1.00713e-30F),(8.66787e+16F)},{(1.21102e+08F),(1.59819e+32F),(-7.76908e+34F)}},{{(6.71116e+11F),(-7.01744e-35F),(-4.73412e-09F)},{(4.97113e-14F),(-1.07646e-06F),(-0.000117637F)},{(-7.22192e+25F),(-5.52385e+34F),(0.00643858F)},{(1.68341e-12F),(-6.83373e+31F),(-2.61472e-24F)},{(7.36921e+17F),(-2.28104e-16F),(1.71609e-34F)},{(-4.96394e-26F),(-5.00481e+17F),(-3.24921e+07F)},{(5.69134e-37F),(-1.24526e-35F),(-6.69503e-08F)}}}; + try + { + try + { + var_45 = var_71.var_98.var_113 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_117 ) + { + var_49 = var_119 ; + System.out.println("hello exception 46 !"); + } + } + catch( java.lang.ArithmeticException myExp_120 ) + { + try + { + int var_121 = (719152868); + for( var_121 = 823 ;(var_121>807);var_121 = (var_121-8) ) + { + try + { + short var_126 = (short)(-1796); + var_124[(((var_126++)-var_80.var_75)&1)][((+(var_125++))&6)][(((--var_44)*var_78.var_75)&2)] = (-((var_97++)+var_71.var_127.var_46)) ; + } + catch( java.lang.IllegalArgumentException myExp_128 ) + { + cl_10 var_130 = new cl_10(); + var_91.var_129.var_127 = var_71.var_98.var_113 ; + System.out.println("hello exception 48 !"); + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_131 ) + { + for( var_132 = 330 ;(var_132>298);var_132 = (var_132-16) ) + { + try + { + cl_80 [][] var_133 = {{new cl_80(),new cl_80(),new cl_80(),new cl_80()},{new cl_80(),new cl_80(),new cl_80(),new cl_80()},{new cl_80(),new cl_80(),new cl_80(),new cl_80()}}; + } + catch( java.lang.IllegalArgumentException myExp_134 ) + { + var_135 = var_135 ; + System.out.println("hello exception 50 !"); + } + } + System.out.println("hello exception 49 !"); + } + System.out.println("hello exception 47 !"); + } + System.out.println("hello exception 45 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_136 ) + { + boolean var_150 = true; + try + { + if( true) + { + try + { + if( (!(((var_47++)-var_137)==var_45.var_138))) + { + if( ((var_96--)>var_49.var_113.var_138)) + { + var_63 = var_71 ; + } + } + } + catch( java.lang.IllegalArgumentException myExp_140 ) + { + short var_145 = (short)(-10711); + if( (!(!((--var_96)<=var_18)))) + { + if( true) + { + long [][] var_141 = {{(1003134625290710564L)},{(-6717200839864493402L)}}; + } + else + { + var_144[((var_145++)&5)][6] = (((var_18--)-var_71.var_127.var_138)==var_81.var_146.var_107) ; + } + } + System.out.println("hello exception 52 !"); + } + } + else + { + short var_149 = (short)(-15824); + if( ((((--var_18)*var_79.var_147.var_148)-( ( short )(--var_59) ))>=( ( float )(var_149--) ))) + { + if( var_150) + { + int var_151 = (-247751935); + for( var_151 = 101 ;(var_151>29);var_151 = (var_151-18) ) + { + float var_152 = (4.25918e-17F); + } + } + else + { + if( (!(!(!(!(!((var_59--)>( ( double )(var_97++) )))))))) + { + var_150 = (!((--var_97)!=var_45.var_46)) ; + } + } + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_153 ) + { + try + { + int var_154 = (-747894165); + for( var_154 = 538 ;(var_154<556);var_154 = (var_154+6) ) + { + float var_157 = (0.00111832F); + double [] var_156 = {(4.15825e-113D),(2.53697e+72D),(4.8079e+176D),(-3.16294e+39D),(-3.19456e-77D),(3.68572e+146D)}; + if( ((-(--var_97))==var_118)) + { + try + { + var_156[((~(var_97++))&5)] = (++var_157) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_158 ) + { + var_156[((--var_44)&5)] = (-3.41672e+232D) ; + System.out.println("hello exception 54 !"); + } + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_159 ) + { + for( var_160 = 148 ;(var_160<174);var_160 = (var_160+13) ) + { + try + { + try + { + var_96 = (--var_97) ; + } + catch( java.lang.IllegalArgumentException myExp_161 ) + { + var_150 = (((--var_162)-var_71.var_77)==(-2.54676e-121D)) ; + System.out.println("hello exception 56 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_163 ) + { + for( var_164 = 883 ;(var_164<933);var_164 = (var_164+10) ) + { + float var_165 = (8.33137e+27F); + } + System.out.println("hello exception 57 !"); + } + } + System.out.println("hello exception 55 !"); + } + System.out.println("hello exception 53 !"); + } + System.out.println("hello exception 51 !"); + } + return (short)(8574); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(7002); + CrcCheck.ToByteArray(this.var_3,b,"var_3"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_7[a0][a1].GetChecksum(),b,"var_7" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_17,b,"var_17"); + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_21[a0][a1],b,"var_21" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_31.GetChecksum(),b,"var_31.GetChecksum()"); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + CrcCheck.ToByteArray(this.var_45.GetChecksum(),b,"var_45.GetChecksum()"); + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_49.GetChecksum(),b,"var_49.GetChecksum()"); + CrcCheck.ToByteArray(this.var_53,b,"var_53"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_69[a0][a1][a2].GetChecksum(),b,"var_69" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_71.GetChecksum(),b,"var_71.GetChecksum()"); + CrcCheck.ToByteArray(this.var_74.GetChecksum(),b,"var_74.GetChecksum()"); + CrcCheck.ToByteArray(this.var_78.GetChecksum(),b,"var_78.GetChecksum()"); + CrcCheck.ToByteArray(this.var_79.GetChecksum(),b,"var_79.GetChecksum()"); + CrcCheck.ToByteArray(this.var_80.GetChecksum(),b,"var_80.GetChecksum()"); + CrcCheck.ToByteArray(this.var_81.GetChecksum(),b,"var_81.GetChecksum()"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_85[a0].GetChecksum(),b,"var_85" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + CrcCheck.ToByteArray(this.var_88.GetChecksum(),b,"var_88.GetChecksum()"); + CrcCheck.ToByteArray(this.var_91.GetChecksum(),b,"var_91.GetChecksum()"); + CrcCheck.ToByteArray(this.var_92.GetChecksum(),b,"var_92.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_95[a0][a1][a2].GetChecksum(),b,"var_95" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_105[a0].GetChecksum(),b,"var_105" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_118,b,"var_118"); + CrcCheck.ToByteArray(this.var_119.GetChecksum(),b,"var_119.GetChecksum()"); + CrcCheck.ToByteArray(this.var_122.GetChecksum(),b,"var_122.GetChecksum()"); + CrcCheck.ToByteArray(this.var_132,b,"var_132"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_135[a0][a1][a2].GetChecksum(),b,"var_135" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_137,b,"var_137"); + CrcCheck.ToByteArray(this.var_142.GetChecksum(),b,"var_142.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_144[a0][a1],b,"var_144" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_160,b,"var_160"); + CrcCheck.ToByteArray(this.var_162,b,"var_162"); + CrcCheck.ToByteArray(this.var_164,b,"var_164"); + CrcCheck.ToByteArray(this.var_172.GetChecksum(),b,"var_172.GetChecksum()"); + CrcCheck.ToByteArray(this.var_178,b,"var_178"); + CrcCheck.ToByteArray(this.var_188,b,"var_188"); + CrcCheck.ToByteArray(this.var_189.GetChecksum(),b,"var_189.GetChecksum()"); + CrcCheck.ToByteArray(this.var_191,b,"var_191"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_200[a0][a1][a2],b,"var_200" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_207[a0][a1],b,"var_207" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_210,b,"var_210"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_211[a0],b,"var_211" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_214.GetChecksum(),b,"var_214.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_239[a0][a1][a2],b,"var_239" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_305,b,"var_305"); + CrcCheck.ToByteArray(this.var_316,b,"var_316"); + CrcCheck.ToByteArray(this.var_337,b,"var_337"); + CrcCheck.ToByteArray(this.var_345,b,"var_345"); + CrcCheck.ToByteArray(this.var_354,b,"var_354"); + CrcCheck.ToByteArray(this.var_355.GetChecksum(),b,"var_355.GetChecksum()"); + CrcCheck.ToByteArray(this.var_357,b,"var_357"); + CrcCheck.ToByteArray(this.var_361,b,"var_361"); + CrcCheck.ToByteArray(this.var_365,b,"var_365"); + CrcCheck.ToByteArray(this.var_366,b,"var_366"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_378[a0],b,"var_378" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_382[a0],b,"var_382" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_391[a0][a1][a2],b,"var_391" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_393,b,"var_393"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_394[a0][a1][a2],b,"var_394" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_395[a0][a1][a2].GetChecksum(),b,"var_395" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_403[a0],b,"var_403" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_415[a0][a1][a2].GetChecksum(),b,"var_415" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_429[a0][a1][a2],b,"var_429" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_458[a0],b,"var_458" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_461,b,"var_461"); + CrcCheck.ToByteArray(this.var_478,b,"var_478"); + CrcCheck.ToByteArray(this.var_480,b,"var_480"); + CrcCheck.ToByteArray(this.var_497,b,"var_497"); + CrcCheck.ToByteArray(this.var_504.GetChecksum(),b,"var_504.GetChecksum()"); + CrcCheck.ToByteArray(this.var_506,b,"var_506"); + CrcCheck.ToByteArray(this.var_519,b,"var_519"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_529[a0][a1][a2],b,"var_529" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_567,b,"var_567"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_576[a0][a1][a2].GetChecksum(),b,"var_576" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_582[a0][a1][a2],b,"var_582" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_594[a0][a1][a2],b,"var_594" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_598[a0],b,"var_598" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_604,b,"var_604"); + CrcCheck.ToByteArray(this.var_616,b,"var_616"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_631[a0][a1][a2],b,"var_631" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_639[a0][a1][a2],b,"var_639" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_656,b,"var_656"); + CrcCheck.ToByteArray(this.var_657,b,"var_657"); + CrcCheck.ToByteArray(this.var_658,b,"var_658"); + CrcCheck.ToByteArray(this.var_662,b,"var_662"); + CrcCheck.ToByteArray(this.var_671,b,"var_671"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_673[a0],b,"var_673" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_674,b,"var_674"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_675[a0],b,"var_675" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_676,b,"var_676"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_706[a0][a1][a2],b,"var_706" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/Start.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..a0bf4fb1cc6cb81f3063819c378ea993aaa5d513 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_10.java MainClass.java cl_80.java cl_14.java CRC32.java CrcCheck.java cl_91.java cl_111.java cl_32.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_10.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_10.java new file mode 100644 index 0000000000000000000000000000000000000000..28d6e9c6f76babbb33dc012e2f2232ffe8591c79 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_10.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2981708336 + +//import java.util.zip.CRC32; + +class cl_10 +{ + int var_46 = (-1769337376); + float var_107 = (-7.27915e+14F); + byte var_114 = (byte)(11); + short var_138 = (short)(30696); + boolean var_204 = false; + final long var_206 = (-9044540790801569556L); + float [] var_237 = {(1.74002e+09F)}; + int [] var_385 = {(-1428108945)}; + final double var_451 = (3.29145e-211D); + double var_507 = (7.80676e-45D); + long var_514 = (-262882702836080783L); + final float [][][] var_573 = {{{(-1.18149e-36F),(-4.68443e+30F),(1.15372e+25F),(-5.27552e+35F)}},{{(1.29943e+26F),(7.82712e-19F),(2.56408e-13F),(-8.1485e-29F)}},{{(-0.00650665F),(-6995.35F),(-6.17282e-06F),(-1.96634e+36F)}},{{(6.5373e+27F),(2.53003e+09F),(1.83791e+09F),(-0.223272F)}},{{(-1.85045e+11F),(8.4709e-30F),(2.31055e-11F),(4.98957e-22F)}},{{(3.41789e+26F),(58.2988F),(-7.67489e+30F),(4.07451e-20F)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(148); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CrcCheck.ToByteArray(this.var_138,b,"var_138"); + CrcCheck.ToByteArray(this.var_204,b,"var_204"); + CrcCheck.ToByteArray(this.var_206,b,"var_206"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_237[a0],b,"var_237" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_385[a0],b,"var_385" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_451,b,"var_451"); + CrcCheck.ToByteArray(this.var_507,b,"var_507"); + CrcCheck.ToByteArray(this.var_514,b,"var_514"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_573[a0][a1][a2],b,"var_573" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_111.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_111.java new file mode 100644 index 0000000000000000000000000000000000000000..a511b1972663323ec27e4179db2f1ae2b7da3631 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_111.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2981708336 + +//import java.util.zip.CRC32; + +class cl_111 +{ + float var_102 = (-4.24332e-16F); + final cl_80 var_129 = new cl_80(); + short var_169 = (short)(22927); + final boolean var_170 = false; + cl_32 var_254 = new cl_32(); + final float [] var_261 = {(1.2961e+15F)}; + int [] var_397 = {(1921407810)}; + double var_409 = (-3.40989e-151D); + cl_14 var_467 = new cl_14(); + int var_524 = (-735163028); + cl_10 var_572 = new cl_10(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(59); + CrcCheck.ToByteArray(this.var_102,b,"var_102"); + CrcCheck.ToByteArray(this.var_129.GetChecksum(),b,"var_129.GetChecksum()"); + CrcCheck.ToByteArray(this.var_169,b,"var_169"); + CrcCheck.ToByteArray(this.var_170,b,"var_170"); + CrcCheck.ToByteArray(this.var_254.GetChecksum(),b,"var_254.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_261[a0],b,"var_261" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_397[a0],b,"var_397" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_409,b,"var_409"); + CrcCheck.ToByteArray(this.var_467.GetChecksum(),b,"var_467.GetChecksum()"); + CrcCheck.ToByteArray(this.var_524,b,"var_524"); + CrcCheck.ToByteArray(this.var_572.GetChecksum(),b,"var_572.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_14.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_14.java new file mode 100644 index 0000000000000000000000000000000000000000..ce83479cd9e75c9879f4c31352e1178ddd183867 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_14.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2981708336 + +//import java.util.zip.CRC32; + +class cl_14 +{ + float var_32 = (4.42068e-26F); + int var_83 = (-1242087480); + long var_108 = (4722309094298049512L); + final short var_148 = (short)(-22812); + float [][][] var_212 = {{{(5.57749e-08F),(6.02033e+12F),(-7.02594e-29F),(-8091.29F)}},{{(4.56317e-18F),(2.57889e+19F),(-3.84245e-22F),(-3.44177F)}},{{(4.25636e+18F),(-5.06088e-25F),(-3.03057e+22F),(-2.53232e-36F)}},{{(1.82334e-12F),(-1.8829e-28F),(-1.16318e+07F),(-8.04691e+30F)}},{{(7.11838e+25F),(2.64445e-36F),(6.68046e-19F),(1.32471e-20F)}},{{(-8.49903e-36F),(-3.83322e-32F),(-5.1681e+33F),(-2.66656e-17F)}}}; + byte var_230 = (byte)(124); + double var_232 = (-4.10421e-67D); + int [] var_417 = {(-1195526260)}; + boolean [][][] var_591 = {{{false,false,false,true,false,false,true},{false,false,false,true,true,true,true},{false,false,true,false,false,true,false},{false,true,true,false,true,false,false},{true,true,false,false,true,false,true},{true,true,true,false,true,false,false}}}; + boolean var_621 = false; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(170); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_148,b,"var_148"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_212[a0][a1][a2],b,"var_212" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_230,b,"var_230"); + CrcCheck.ToByteArray(this.var_232,b,"var_232"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_417[a0],b,"var_417" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_591[a0][a1][a2],b,"var_591" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_621,b,"var_621"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_32.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_32.java new file mode 100644 index 0000000000000000000000000000000000000000..6ea33a4d5948fe353198066719f460e18d50c98f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_32.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2981708336 + +//import java.util.zip.CRC32; + +class cl_32 extends cl_14 +{ + cl_14 var_50 = new cl_14(); + cl_10 var_113 = new cl_10(); + boolean var_193 = false; + long [] var_377 = {(997407672304979199L),(2104717096730304540L),(7733000571095221454L),(5626803798121845247L),(8570103398066005430L),(5266934066860018096L),(-786859617622926668L)}; + float [] var_446 = {(-98.921F)}; + cl_10 [][] var_517 = {{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()},{new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10(),new cl_10()}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(583); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + CrcCheck.ToByteArray(this.var_50.GetChecksum(),b,"var_50.GetChecksum()"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_113.GetChecksum(),b,"var_113.GetChecksum()"); + CrcCheck.ToByteArray(this.var_148,b,"var_148"); + CrcCheck.ToByteArray(this.var_193,b,"var_193"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_212[a0][a1][a2],b,"var_212" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_230,b,"var_230"); + CrcCheck.ToByteArray(this.var_232,b,"var_232"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_377[a0],b,"var_377" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_417[a0],b,"var_417" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_446[a0],b,"var_446" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_517[a0][a1].GetChecksum(),b,"var_517" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_591[a0][a1][a2],b,"var_591" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_621,b,"var_621"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_80.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_80.java new file mode 100644 index 0000000000000000000000000000000000000000..3a3ecc7a3a8f2059ddfb2472bf65b132473b68ca --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_80.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2981708336 + +//import java.util.zip.CRC32; + +class cl_80 +{ + int var_72 = (2096623525); + short var_77 = (short)(1951); + cl_32 var_98 = new cl_32(); + cl_10 var_127 = new cl_10(); + cl_14 var_376 = new cl_14(); + final cl_32 [][][] var_381 = {{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}},{{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()},{new cl_32()}}}; + boolean [][][] var_405 = {{{true,true,false,true,false,true,true},{true,true,true,true,true,false,true},{false,true,false,true,true,false,false},{true,false,true,true,true,false,false},{true,true,true,false,true,false,true},{true,false,true,true,true,true,true}}}; + float [] var_427 = {(-1.16266e-15F)}; + double var_535 = (-7.58843e-58D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(276); + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_98.GetChecksum(),b,"var_98.GetChecksum()"); + CrcCheck.ToByteArray(this.var_127.GetChecksum(),b,"var_127.GetChecksum()"); + CrcCheck.ToByteArray(this.var_376.GetChecksum(),b,"var_376.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_381[a0][a1][a2].GetChecksum(),b,"var_381" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_405[a0][a1][a2],b,"var_405" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_427[a0],b,"var_427" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_535,b,"var_535"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_91.java b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_91.java new file mode 100644 index 0000000000000000000000000000000000000000..324d364b73ac824e94c42316f55fdc351651f01c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/670_2018112402534/cl_91.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2981708336 + +//import java.util.zip.CRC32; + +class cl_91 +{ + final int var_75 = (61451722); + int var_109 = (467108756); + double var_111 = (-2.3343e+188D); + boolean var_112 = true; + cl_111 var_139 = new cl_111(); + cl_10 var_146 = new cl_10(); + cl_14 var_147 = new cl_14(); + short var_308 = (short)(16803); + cl_80 var_375 = new cl_80(); + cl_32 var_503 = new cl_32(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(59); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + CrcCheck.ToByteArray(this.var_111,b,"var_111"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CrcCheck.ToByteArray(this.var_139.GetChecksum(),b,"var_139.GetChecksum()"); + CrcCheck.ToByteArray(this.var_146.GetChecksum(),b,"var_146.GetChecksum()"); + CrcCheck.ToByteArray(this.var_147.GetChecksum(),b,"var_147.GetChecksum()"); + CrcCheck.ToByteArray(this.var_308,b,"var_308"); + CrcCheck.ToByteArray(this.var_375.GetChecksum(),b,"var_375.GetChecksum()"); + CrcCheck.ToByteArray(this.var_503.GetChecksum(),b,"var_503.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/7194_2018110810324/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/7194_2018110810324/MainClass.java b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..b87c93b3cd9da41fe3f68eabc61821eb8c5708ab --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/MainClass.java @@ -0,0 +1,353 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3292958668 + +import java.util.zip.CRC32; + +class MainClass +{ + double [][][] var_2 = {{{(-2.83086e+67D),(-6.75054e-175D)},{(-1.3231e-170D),(4.51298e-88D)},{(2.0673e-137D),(-2.39845e-261D)},{(1.69497e+159D),(2.34429e-268D)}},{{(-3.03647e-201D),(-1.39811e-213D)},{(-1.38964e-237D),(1.5388e-250D)},{(-2.16273e-160D),(1.67373e-308D)},{(-3.98756e-144D),(-6.77331e+62D)}},{{(-2.99771e-123D),(2.69885e-09D)},{(6.57381e+207D),(8.94945e-293D)},{(-8.68356e-217D),(4.06514e+51D)},{(2.1051e-103D),(1.15418e+87D)}},{{(4.14615e+72D),(5.79167e+59D)},{(8.82224e-81D),(-2.38733e+302D)},{(3.74443e+12D),(-1.2849e+17D)},{(-5.108e+178D),(-3.47732e+131D)}},{{(1.10461e-277D),(9.6009e-183D)},{(-4.46769e-301D),(6.47127e-25D)},{(-4.09548e-244D),(-1.57367e-262D)},{(2.01229e+53D),(1.65602e+256D)}}}; + static int var_3 = (-766604341); + static cl_16 var_30 = new cl_16(); + static cl_14 var_33 = new cl_14(); + static int var_42 = (-366731465); + static short var_46 = (short)(-12544); + final float var_52 = (9.6605e-24F); + static byte var_54 = (byte)(-121); + static int [] var_56 = {(209812775),(538184435),(-1536189489),(923321776),(1423502983),(-1855196506),(1167432493)}; + static int var_62 = (1493632044); + boolean var_63 = true; + static int [] var_68 = {(-335965459),(-1393466979),(1727020454),(1786368725),(841916661),(1485794454),(152014470)}; + int var_83 = (-1772133488); + byte var_87 = (byte)(42); + long var_109 = (1377978715803052563L); + double [][] var_113 = {{(-8.09751e+77D),(2.85448e+49D)}}; + byte var_115 = (byte)(-53); + byte var_116 = (byte)(-30); + short var_122 = (short)(-14524); + double var_124 = (-3.64698e+209D); + byte var_130 = (byte)(76); + long var_131 = (2456144063394122278L); + short var_133 = (short)(-7438); + byte var_149 = (byte)(-10); + byte var_154 = (byte)(-29); + final double var_162 = (-8.8923e-170D); + float var_179 = (-1.04025e-15F); + final long var_181 = (-8165854642021812101L); + cl_14 var_183 = new cl_14(); + float [][][] var_188 = {{{(-4.03169e+29F),(-6.66815e+07F),(3.37823e+14F),(-1.20933e+22F)}},{{(1.31291e+14F),(-3.77142e+11F),(1.37218e-18F),(-2.06563e+30F)}},{{(3.75927e-11F),(-5.5506e+16F),(-3.311e-18F),(-4.01439e-22F)}}}; + double [][] var_189 = {{(4.67539e+88D),(1.2272e+119D),(6.61779e+69D),(-415.497D)}}; + float var_225 = (-2.90937e+10F); +/*********************************/ +public strictfp void run() +{ + short var_194 = (short)(-2306); + cl_14 var_195 = new cl_14(); + boolean [][] var_191 = {{true,true,false,true,true,false,false},{true,true,false,false,true,true,true},{true,true,false,true,true,false,false},{false,true,false,false,true,false,true},{true,true,true,false,true,true,true},{false,true,true,false,false,false,false},{false,true,true,true,false,false,false}}; + byte var_4 = (byte)(-41); + int var_187 = (-503397528); + float [][][] var_209 = {{{(6.72495e+16F),(-0.000404597F),(-0.000400484F),(-9.75636e-19F)}},{{(1.32915e+15F),(5.0307e+34F),(-3.17366e-07F),(-4591.79F)}},{{(2.6516e-08F),(-4.1255e+10F),(2.41145e-09F),(5.25384e-05F)}}}; + try + { + try + { + int var_175 = (597606215); + try + { + double [][] var_178 = {{(8.17893e+41D),(-7.74633e+72D)}}; + final double var_0 = (2.30554e-287D); + int var_5 = (499886474); + final double [][] var_177 = {{(4.09336e-100D),(2.36316e-41D),(2.84959e-129D),(4.97397e+46D)}}; + var_2[(((var_5--)+func_6(((var_133--)+( ( byte )(var_175--) )) ,var_33.var_176 ,var_177 ,var_33 ,var_30 ,func_22(var_33 ,((+(--var_87))=var_30.var_106))))) ,((var_108--)*var_109) ,(+(var_111++)) ,var_113))))))) + { + var_102[((var_20++)&0)][1] = (-(++var_111)) ; + } + return (++var_115); +} +public strictfp float func_22(cl_14 var_23, boolean var_24, boolean var_25, double var_26, long var_27, double[][] var_28) +{ + float [] var_84 = {(-2.49356e-35F),(1.17178e-23F),(-1.11884e+10F),(2.548e-13F),(2.24129e+15F),(2.26051e+07F),(1.47159e-15F)}; + byte var_29 = (byte)(-92); + short var_73 = (short)(9658); + try + { + try + { + byte var_32 = (byte)(-49); + try + { + var_2[((~(+(++var_32)))&4)][((++var_32)&3)][(((++var_29)*var_30.var_31)&1)] = (--var_29) ; + var_33 = var_33 ; + var_28[((var_32++)&0)][((var_32++)&1)] = func_34(var_30.var_71 ,((--var_73)+var_33.var_74)) ; + } + catch( java.lang.ArithmeticException myExp_76 ) + { + float var_77 = (-5.41163e+37F); + var_28[(((--var_54)|var_54)&0)][((+(var_32--))&1)] = ((--var_77)*func_34(((var_46--)*var_33.var_49) ,var_52)) ; + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.ArithmeticException myExp_80 ) + { + int var_81 = (-229132047); + for( var_81 = 843 ;(var_81<852);var_81 = (var_81+3) ) + { + var_73 = (--var_29) ; + } + System.out.println("hello exception 7 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_82 ) + { + for( var_83 = 935 ;(var_83>915);var_83 = (var_83-4) ) + { + var_56[(var_83&6)] = (++var_29) ; + } + System.out.println("hello exception 8 !"); + } + return var_84[((var_46++)&6)]; +} +public static strictfp double func_34(long var_35, float var_36) +{ + final cl_14 var_40 = new cl_14(); + int var_67 = (-7616455); + short var_69 = (short)(-2246); + try + { + byte var_43 = (byte)(-59); + try + { + int [] var_39 = {(-1276949697),(-913669437),(-883895102),(-1985582796),(-1434888584),(335414768),(-1063164281)}; + int var_38 = (-115358474); + long var_37 = (-2369020774300443410L); + for( var_38 = 233 ;(var_38<251);var_38 = (var_38+9) ) + { + var_39[(var_38&6)] = (var_3++) ; + } + cl_16 var_41 = new cl_16(); + short var_55 = (short)(-16685); + var_33 = var_40 ; + for( var_42 = 316 ;(var_42>280);var_42 = (var_42-9) ) + { + boolean var_50 = true; + int var_51 = (-1281860248); + final boolean var_47 = false; + int var_53 = (1660002752); + var_39[((((++var_43)&var_33.var_44)-var_30.var_45)&6)] = (var_46--) ; + var_39[(var_42&6)] = var_39[((++var_3)&6)] ; + var_39[(var_42&6)] = ((++var_43)*var_33.var_49) ; + var_33 = var_40 ; + var_39[(var_42&6)] = (--var_43) ; + float var_59 = (-17467.4F); + final double var_60 = (4.69431e-209D); + var_39[(var_42&6)] = (+(((var_54++)+( ( byte )(var_55++) ))|var_46)) ; + var_39 = var_56 ; + var_33 = var_33 ; + var_39[((~(++var_3))&6)] = ( ( int )(var_55++) ) ; + var_43 = (var_54++) ; + } + try + { + var_39[6] = ((--var_54)+var_33.var_49) ; + var_39 = var_56 ; + } + catch( java.lang.ArithmeticException myExp_61 ) + { + var_33 = var_33 ; + var_39[(((var_54++)+var_54)&6)] = ((var_62++)&( ( short )((var_43--)|var_33.var_44) )) ; + var_39[6] = (var_43--) ; + System.out.println("hello exception 9 !"); + } + } + catch( java.lang.ArithmeticException myExp_64 ) + { + var_33 = var_40 ; + System.out.println("hello exception 10 !"); + } + } + catch( java.lang.ArithmeticException myExp_65 ) + { + byte var_66 = (byte)(46); + if( (((+(++var_66))!=(-2.3484e+47D))|true)) + { + if( (((var_66++)|(short)(2136))>=var_33.var_48)) + { + var_35 = (+((var_67++)|var_3)) ; + } + else + { + var_56 = var_68 ; + } + } + System.out.println("hello exception 11 !"); + } + return ((+(+(--var_69)))+var_30.var_70); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(578); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_2[a0][a1][a2],b,"var_2" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_3,b,"var_3"); + CrcCheck.ToByteArray(this.var_30.GetChecksum(),b,"var_30.GetChecksum()"); + CrcCheck.ToByteArray(this.var_33.GetChecksum(),b,"var_33.GetChecksum()"); + CrcCheck.ToByteArray(this.var_42,b,"var_42"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_56[a0],b,"var_56" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_63,b,"var_63"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_68[a0],b,"var_68" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_113[a0][a1],b,"var_113" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_115,b,"var_115"); + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + CrcCheck.ToByteArray(this.var_122,b,"var_122"); + CrcCheck.ToByteArray(this.var_124,b,"var_124"); + CrcCheck.ToByteArray(this.var_130,b,"var_130"); + CrcCheck.ToByteArray(this.var_131,b,"var_131"); + CrcCheck.ToByteArray(this.var_133,b,"var_133"); + CrcCheck.ToByteArray(this.var_149,b,"var_149"); + CrcCheck.ToByteArray(this.var_154,b,"var_154"); + CrcCheck.ToByteArray(this.var_162,b,"var_162"); + CrcCheck.ToByteArray(this.var_179,b,"var_179"); + CrcCheck.ToByteArray(this.var_181,b,"var_181"); + CrcCheck.ToByteArray(this.var_183.GetChecksum(),b,"var_183.GetChecksum()"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_188[a0][a1][a2],b,"var_188" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_189[a0][a1],b,"var_189" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_225,b,"var_225"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/7194_2018110810324/Start.java b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..2c07ac8e9d1a64b8ac0b608ac505e13f1ecd634d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_16.java cl_14.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/7194_2018110810324/cl_14.java b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/cl_14.java new file mode 100644 index 0000000000000000000000000000000000000000..b5b16ab07ac38adf541cf9458ce21e3049c0a995 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/cl_14.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3292958668 + +import java.util.zip.CRC32; + +class cl_14 +{ + final byte var_44 = (byte)(-47); + int var_48 = (1806542864); + short var_49 = (short)(-1991); + int [] var_58 = {(71153632),(-100256474),(-1636961078),(1211522729),(675021837),(1122974701),(2101825207)}; + long var_74 = (5530017303593813387L); + double var_89 = (1.7851e-291D); + float var_143 = (5.72965e+16F); + float [][][] var_176 = {{{(1.04664e-18F),(-1.5446e+23F),(-0.003603F),(3.33612e+10F)}},{{(-1.41058e+29F),(-1.63989e-19F),(-2.69107e+12F),(-3.22266e+14F)}},{{(-4.10445e+15F),(-1.11868e-27F),(-0.0244894F),(-1.24037e+33F)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(103); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_58[a0],b,"var_58" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + CrcCheck.ToByteArray(this.var_89,b,"var_89"); + CrcCheck.ToByteArray(this.var_143,b,"var_143"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_176[a0][a1][a2],b,"var_176" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/7194_2018110810324/cl_16.java b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/cl_16.java new file mode 100644 index 0000000000000000000000000000000000000000..52d356359e36e649db6fd7b933867e22befa43fd --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/7194_2018110810324/cl_16.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3292958668 + +import java.util.zip.CRC32; + +class cl_16 +{ + int var_31 = (-1255233882); + byte var_45 = (byte)(98); + int [] var_57 = {(-130302125),(451555484),(-868134140),(2086751195),(639120306),(-1475914604),(1641071936)}; + double var_70 = (1.61675e+275D); + long var_71 = (7871318983280659914L); + short var_94 = (short)(22707); + float var_106 = (-3.17688e-13F); + double [][] var_165 = {{(2.04494e+158D),(4.20659e-140D)}}; + final double [][] var_204 = {{(-4.97274e+261D),(-1.53828e-209D),(3.95222e-118D),(7.84205e-221D)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(103); + CrcCheck.ToByteArray(this.var_31,b,"var_31"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_57[a0],b,"var_57" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_71,b,"var_71"); + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_106,b,"var_106"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_165[a0][a1],b,"var_165" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_204[a0][a1],b,"var_204" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/CRC32.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/MainClass.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..686eda880c426487c93af085d6085843049c6baa --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/MainClass.java @@ -0,0 +1,890 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2759125148 + +//import java.util.zip.CRC32; + +class MainClass +{ + static int var_1 = (1497916894); + static short var_7 = (short)(-25258); + static float var_8 = (-1.37689e-37F); + static byte var_10 = (byte)(103); + static cl_22 var_154 = new cl_22(); + static cl_39 var_155 = new cl_39(); + final static cl_95 var_159 = new cl_95(); + static cl_13 var_161 = new cl_13(); + static boolean [][][] var_165 = {{{true,true,false,false,true,false},{false,false,false,false,false,false},{true,true,true,false,false,true},{false,false,true,true,false,true},{true,true,false,false,true,true},{false,true,false,true,false,false},{true,true,true,true,false,false}},{{true,true,true,false,false,true},{false,false,true,false,false,false},{true,true,true,true,false,true},{true,true,false,true,true,true},{false,false,true,false,true,false},{false,true,false,true,false,true},{true,false,true,false,false,true}},{{false,true,false,true,true,false},{false,false,false,false,false,false},{true,true,false,true,true,true},{true,false,true,true,false,true},{false,true,true,true,true,true},{true,false,false,true,false,false},{false,false,false,false,false,false}}}; + final static cl_42 var_166 = new cl_42(); + static boolean [][][] var_171 = {{{false,false,false,true,false,false},{false,true,false,true,true,false},{true,false,true,false,true,false},{true,true,false,false,true,false},{true,false,false,false,false,false},{false,true,true,false,false,false},{false,false,true,false,true,true}},{{false,true,true,true,false,false},{false,false,false,true,false,false},{true,true,false,false,true,false},{false,false,true,true,true,false},{false,false,true,true,false,true},{false,true,false,true,true,true},{false,true,false,true,false,true}},{{false,true,false,true,true,false},{true,false,false,true,true,false},{true,true,false,true,true,false},{false,true,true,true,false,true},{false,false,true,true,true,false},{true,false,false,true,true,false},{true,true,true,true,false,false}}}; + static cl_76 var_175 = new cl_76(); + static int var_179 = (347033875); + static long var_181 = (8162208395469084791L); + static int var_183 = (401568860); + static int var_193 = (-1759216805); + static int var_194 = (-102265762); + final boolean var_197 = false; + static cl_95 var_198 = new cl_95(); + static int var_205 = (478473769); + static byte var_210 = (byte)(-70); + cl_42 var_226 = new cl_42(); + double var_230 = (1.50756e+252D); + int [][][] var_237 = {{{(2001714429),(1457953014),(-2031430184),(-1750626623)},{(-995634980),(1837339889),(1384368751),(-297163549)}},{{(-434724275),(1570379165),(-1928030063),(429131638)},{(917673115),(-802940917),(-693156603),(-1236116291)}}}; + double var_241 = (1.40855e+294D); + cl_95 var_242 = new cl_95(); + double [] var_244 = {(1.3129e-10D),(-1.31088e+102D),(-2.83199e-125D),(2.97701e-61D)}; + int var_247 = (-843599680); + int var_260 = (-1992277919); + long [] var_271 = {(-5191997785800963297L)}; + double [][][] var_280 = {{{(3.84819e+127D),(8.08453e+182D),(8.87637e-300D),(9.2061e-299D)},{(-1.64403e-205D),(-6.77668e+62D),(2.16899e+46D),(-3.69701e+124D)},{(2.77055e-74D),(-1.55141e+271D),(5.02489e-57D),(8.79625e-80D)}},{{(-7.40948e+91D),(1.55504e-168D),(-2.01952e+238D),(-8.99353e-144D)},{(-9.82025e+14D),(-1.54985e+116D),(-2.88737e+175D),(-631.997D)},{(1.15462e+273D),(1.23948e-259D),(-3.72181e+27D),(-1.41515e+71D)}},{{(1.02501e+180D),(2.59379e-19D),(-6.28438e+252D),(3.83715e-306D)},{(2.29298e+138D),(-2.75535e+45D),(-8.81396e-247D),(-9.96949e-186D)},{(-4.55562e+212D),(-3.91275e-143D),(-1.0558e+83D),(3.43637e-242D)}},{{(-1.0803e-206D),(4.51323e+122D),(-4.59666e-119D),(-6.91219e-59D)},{(-6.93732e+57D),(-1.14152e+112D),(-1.21867e+232D),(-6.8625e-122D)},{(1.94499e+176D),(-9.50756e-276D),(2.88211e-288D),(-0.00169964D)}},{{(1.21372e+86D),(1.2393e-151D),(2.6476e-183D),(-8.75349e+123D)},{(-1.26681e-32D),(-5.96611e-295D),(-5.86637e-285D),(-8.49767e+145D)},{(5.15352e+84D),(-7.35501e-14D),(-5.78473e-267D),(2.7734e+270D)}}}; + cl_22 [] var_284 = {new cl_22(),new cl_22(),new cl_22(),new cl_22(),new cl_22()}; + short var_305 = (short)(11177); + short var_306 = (short)(29248); + cl_22 [] var_308 = {new cl_22(),new cl_22(),new cl_22(),new cl_22(),new cl_22()}; + int [][][] var_309 = {{{(-2048713242),(-607150742)},{(-1398751147),(471305850)},{(198390736),(494137481)},{(-237163155),(-1232381935)},{(1012934998),(-298839956)},{(-1547784369),(511891570)}},{{(1095074330),(-344719242)},{(1361306330),(2026384723)},{(2116268279),(-993195457)},{(-870790681),(221052231)},{(-1826506578),(-1929015505)},{(1511509214),(1182677304)}}}; + final boolean var_310 = true; + int [][][] var_311 = {{{(131671491),(2077490923)},{(1502065485),(-1991645196)},{(-1167493870),(-867980123)},{(99196298),(-377119862)},{(808641257),(610897282)},{(516412418),(1429134684)}},{{(1980053110),(921251171)},{(2082402217),(1258821554)},{(706295102),(735440845)},{(2097810990),(-2053416006)},{(894795618),(-757426270)},{(765995412),(-1929466393)}}}; + long var_324 = (-2222865841328399950L); + int var_328 = (-646907403); + byte var_336 = (byte)(34); + boolean [] var_337 = {false,true}; + byte var_352 = (byte)(-48); + int [][][] var_367 = {{{(-475585420),(-1443585544)},{(-1070290533),(1718044046)},{(1825096994),(-817843039)},{(2057225731),(12475349)},{(1899232209),(-553151193)},{(-1979203772),(-75363711)}},{{(25903167),(1355409109)},{(-1372236559),(-1465559808)},{(-1359197854),(-366382038)},{(-571188908),(-1581738440)},{(-1316708527),(2001219335)},{(779630219),(167329206)}}}; + boolean [] var_369 = {true,false}; + cl_22 [] var_382 = {new cl_22(),new cl_22(),new cl_22(),new cl_22(),new cl_22()}; + double var_414 = (8.18761e+171D); + int var_459 = (1506380070); + cl_22 var_467 = new cl_22(); +/*********************************/ +public strictfp void run() +{ + int var_0 = (-1390883701); + long var_359 = (-8579552719165586400L); + int [][][] var_387 = {{{(885840525),(-666900155)},{(-1911543022),(-839477438)},{(1173274200),(-1405621827)},{(-417709490),(-1736675958)},{(1602605855),(-2116173931)},{(-1578913435),(-1969429868)}},{{(-849504271),(971272353)},{(-439155174),(-849823592)},{(-1951343677),(-1612812329)},{(308104769),(1447671288)},{(772390327),(-1864029120)},{(789955780),(783404892)}}}; + double [][] var_347 = {{(1.90818e+264D),(3.96276e+223D),(2.25252e-121D),(1.92922e-280D)},{(5.46756e-123D),(-5.63051e+34D),(4.54186e-166D),(2.15185e-272D)},{(2.55876e+171D),(-7.74078e-73D),(1.61652e+107D),(1.93291e-99D)},{(8.11902e+70D),(-5.33699e+101D),(1.00898e+192D),(1.05235e+95D)},{(1.80783e-23D),(-7.34786e+143D),(-1.007e+89D),(-6.87128e-102D)}}; + for( var_0 = 150 ;(var_0>123);var_0 = (var_0-9) ) + { + short var_350 = (short)(-17840); + int [][][] var_406 = {{{(-1826567931),(1868587173),(-1964882937),(65473128)},{(-1050878368),(-1137507960),(184856720),(768836252)}},{{(1150211787),(-13753022),(665044194),(-1248914570)},{(-62162852),(-287757980),(-1796281085),(-1919085813)}}}; + try + { + for( var_1 = 922 ;(var_1<947);var_1 = (var_1+5) ) + { + cl_13 var_341 = new cl_13(); + if( func_2(var_337 ,var_226.var_55 ,var_161.var_80 ,var_341)) + { + System.out.println(" if stmt begin,id=1 "); + try + { + long var_343 = (-1384403855127916670L); + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_344 ) + { + int var_345 = (-392360831); + byte var_348 = (byte)(-7); + for( var_345 = 443 ;(var_345>425);var_345 = (var_345-18) ) + { + var_347[((var_348--)&4)][((++var_348)&3)] = (-(+(var_181--))) ; + } + System.out.println("hello exception 0 !"); + } + System.out.println(" if stmt end,id=1 "); + } + } + } + catch( java.lang.ArithmeticException myExp_349 ) + { + int var_421 = (-939517440); + cl_22 [] var_394 = {new cl_22(),new cl_22(),new cl_22(),new cl_22(),new cl_22()}; + byte [][] var_461 = {{(byte)(-9),(byte)(85)},{(byte)(127),(byte)(63)},{(byte)(-128),(byte)(-122)},{(byte)(-62),(byte)(112)},{(byte)(84),(byte)(72)}}; + long var_356 = (-6582864478554119458L); + boolean [][][] var_364 = {{{false,false,true,true,false,false},{false,false,false,false,true,true},{false,true,true,true,false,true},{false,true,false,false,true,false},{false,true,true,false,false,true},{true,false,true,true,false,false}},{{true,false,true,false,false,false},{true,true,true,false,false,false},{true,false,true,true,true,true},{false,true,true,true,true,false},{true,false,true,false,true,false},{false,false,false,false,false,false}},{{false,false,true,true,true,false},{false,true,false,true,false,false},{true,true,false,false,false,false},{true,true,false,false,false,false},{true,false,false,false,true,true},{true,true,false,true,false,false}}}; + byte var_361 = (byte)(-58); + if( (((var_350--)+func_13(var_308 ,((var_352++)<=func_11()) ,((-((++var_336)+var_166.var_74))==var_352) ,var_154.var_192.var_289 ,(!(!((+(var_356++))var_8)) + { + System.out.println(" if stmt begin,id=2 "); + final double var_401 = (1.53322e-132D); + try + { + var_350 = (var_361++) ; + } + catch( java.lang.IllegalArgumentException myExp_362 ) + { + float var_376 = (6.47322e-21F); + if( ((!(!((var_210--)!=func_13(var_308 ,var_364[((~(var_350++))&2)][((+(var_361--))&5)][((+(var_361--))&5)] ,(!(!((var_361--)( ( short )(--var_361) )))) ,var_387 ,((++var_361)>var_155.var_64) ,var_161.var_390 ,((+(((var_336--)-func_13(var_308 ,(!(!((~(var_350--))>var_155.var_76))) ,((var_10++)>func_13(var_394 ,true ,((var_350++)<=var_166.var_122) ,var_387 ,var_197 ,var_175.var_292 ,((var_361--)=func_11())))) ,var_406 ,(!(((var_210++)-var_155.var_94)==func_13(var_308 ,func_21((-5.32234e+228D) ,(-(var_361--)) ,(2.57159e-70D) ,func_21((-5.00816e-280D) ,((-(var_361++))|var_352) ,(var_414++) ,var_197 ,(var_8--) ,(var_336++) ,( ( float )var_161.var_131 )) ,(var_421++) ,(+(var_361++)) ,((var_336++)&func_13(var_382 ,((var_361++)>=(-2.24596e-24F)) ,(!(!((var_361--)=var_154.var_437))))))+var_414))>=var_175.var_147)))&2)][((~(++var_10))&6)][(((var_361--)*var_193)&5)] = (!(!(!(!((((-var_242.var_108)-( ( int )var_154.var_192.var_441 ))-func_13(var_308 ,(((var_181++)-( ( long )((var_421--)|func_13(var_308 ,((((((var_336++)|(-473911984))-var_161.var_80)+var_414)+func_11())<=var_155.var_76) ,(!(!(!(!(((var_361++)*var_193)<=var_414))))) ,var_387 ,(!(!(!(((++var_361)-var_352)>=var_154.var_447)))) ,var_237 ,(!(!((+(var_350--))>=var_159.var_160))))) ))<=var_8) ,var_197 ,var_387 ,var_310 ,var_175.var_292 ,(!(!(!((var_361++)>var_155.var_129))))))>=var_194))))) ; + } + catch( java.lang.IllegalArgumentException myExp_457 ) + { + var_161.var_54.var_458 = (~((var_361--)+func_11())) ; + System.out.println("hello exception 4 !"); + } + System.out.println(" if stmt end,id=3 "); + } + System.out.println("hello exception 3 !"); + } + System.out.println(" if stmt end,id=2 "); + } + else + { + System.out.println(" else stmt begin,id=1 "); + try + { + try + { + if( (!(!(!(!((var_7--)>( ( double )var_406[1][((++var_350)&1)][((+(--var_361))&3)] ))))))) + { + System.out.println(" if stmt begin,id=4 "); + var_364[((++var_350)&2)][(((++var_361)|( ( int )var_10 ))&5)][(((var_361--)|var_352)&5)] = true ; + System.out.println(" if stmt end,id=4 "); + } + } + catch( java.lang.IllegalArgumentException myExp_460 ) + { + if( var_364[(((--var_350)+(1301477109))&2)][((-(--var_7))&5)][((var_210--)&5)]) + { + System.out.println(" if stmt begin,id=5 "); + var_361 = (var_336++) ; + System.out.println(" if stmt end,id=5 "); + } + System.out.println("hello exception 7 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_462 ) + { + cl_22 var_469 = new cl_22(); + try + { + try + { + cl_95 var_463 = new cl_95(); + } + catch( java.lang.ArithmeticException myExp_464 ) + { + var_226 = var_166 ; + System.out.println("hello exception 9 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_465 ) + { + int var_466 = (407804018); + for( var_466 = 339 ;(var_466<414);var_466 = (var_466+15) ) + { + cl_22 var_468 = new cl_22(); + var_394[((var_306++)&4)] = var_469 ; + } + System.out.println("hello exception 10 !"); + } + System.out.println("hello exception 8 !"); + } + System.out.println(" else stmt end,id=1 "); + } + System.out.println("hello exception 2 !"); + } + } + return ; +} +public strictfp boolean func_2(boolean[] var_3, float var_4, double var_5, cl_13 var_6) +{ + short var_307 = (short)(-6694); + byte var_335 = (byte)(33); + try + { + try + { + if( (!((--var_7)==var_8))) + { + System.out.println(" if stmt begin,id=6 "); + byte var_275 = (byte)(53); + if( true) + { + System.out.println(" if stmt begin,id=7 "); + long var_9 = (2613685104717094346L); + if( ((var_10++)var_226.var_65) ; + System.out.println("hello exception 11 !"); + } + System.out.println(" if stmt end,id=8 "); + } + System.out.println(" if stmt end,id=7 "); + } + System.out.println(" if stmt end,id=6 "); + } + } + catch( java.lang.IllegalArgumentException myExp_277 ) + { + byte var_281 = (byte)(-5); + int var_282 = (1199141501); + if( ((+(var_260--))263);var_278 = (var_278-2) ) + { + int var_279 = (-1242062918); + for( var_279 = 427 ;(var_279>423);var_279 = (var_279-2) ) + { + var_155.var_76 = (var_282--) ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_283 ) + { + try + { + try + { + var_171[(((--var_281)-var_166.var_65)&2)][((--var_282)&6)][((var_7++)&5)] = func_21((var_194++) ,((var_7++)+func_13(var_284 ,((~(var_286++))>func_11()) ,var_3[1] ,var_166.var_289 ,((var_281++)!=var_242.var_150) ,var_175.var_292 ,((~(--var_286))!=var_7))) ,(var_5--) ,(!((~(var_281++))==var_241)) ,(-(var_281++)) ,(var_210++) ,(1.17812e-37F)) ; + } + catch( java.lang.IllegalArgumentException myExp_295 ) + { + var_3[(((--var_281)&var_155.var_129)&1)] = func_21(((-(var_281++))-var_226.var_296) ,(++var_286) ,var_154.var_239 ,((--var_282)==func_11()) ,(var_286--) ,(~(--var_281)) ,((var_281++)*var_159.var_297)) ; + System.out.println("hello exception 15 !"); + } + } + catch( java.lang.ArithmeticException myExp_298 ) + { + var_281 = (var_210--) ; + System.out.println("hello exception 16 !"); + } + System.out.println("hello exception 14 !"); + } + System.out.println(" if stmt end,id=9 "); + } + else + { + System.out.println(" else stmt begin,id=2 "); + try + { + if( (!(!(!((--var_282)<=var_161.var_84.var_297))))) + { + System.out.println(" if stmt begin,id=10 "); + short var_299 = (short)(23045); + var_4 = (var_299++) ; + System.out.println(" if stmt end,id=10 "); + } + else + { + System.out.println(" else stmt begin,id=3 "); + if( true) + { + System.out.println(" if stmt begin,id=11 "); + double var_300 = (-6.92253e-236D); + System.out.println(" if stmt end,id=11 "); + } + System.out.println(" else stmt end,id=3 "); + } + } + catch( java.lang.IllegalArgumentException myExp_301 ) + { + int [][][] var_312 = {{{(-1305431959),(-1873379430),(-1907998872),(-1937744513)},{(27365607),(-1892674481),(732814525),(924429361)}},{{(-1257688604),(-251342572),(1061443963),(-836716813)},{(1228378385),(-919784488),(1018170164),(1710039047)}}}; + try + { + try + { + var_198 = var_154.var_142.var_84 ; + } + catch( java.lang.IllegalArgumentException myExp_302 ) + { + var_247 = ((--var_281)*func_13(var_284 ,true ,func_21(((var_8++)*( ( int )(var_305++) )) ,(--var_306) ,(+(--var_307)) ,var_3[1] ,( ( double )(--var_281) ) ,(((++var_281)&var_175.var_248)+func_13(var_308 ,var_154.var_144.var_48 ,(!((var_281--)!=(-5.83882e+297D))) ,var_309 ,((--var_210)>func_13(var_284 ,((var_210--)==(-2.57628e-34F)) ,var_310 ,var_311 ,((var_4++)==var_5) ,var_237 ,(((var_10--)<=func_11())!=var_310))) ,var_312 ,(!(!(!((var_8--)<=var_154.var_239)))))) ,(var_307++)) ,var_311 ,(!((--var_281)==var_166.var_65)) ,var_312 ,((var_281++)==var_155.var_76))) ; + System.out.println("hello exception 19 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_318 ) + { + if( ((var_179++)(byte)(88)))) + { + System.out.println(" if stmt begin,id=14 "); + if( ((var_8++)!=var_155.var_94)) + { + System.out.println(" if stmt begin,id=15 "); + var_175.var_248 = (var_305++) ; + System.out.println(" if stmt end,id=15 "); + } + else + { + System.out.println(" else stmt begin,id=4 "); + cl_76 [][] var_326 = {{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()}}; + var_154.var_325 = var_154.var_142.var_327 ; + System.out.println(" else stmt end,id=4 "); + } + System.out.println(" if stmt end,id=14 "); + } + } + System.out.println("hello exception 22 !"); + } + System.out.println(" if stmt end,id=13 "); + } + else + { + System.out.println(" else stmt begin,id=5 "); + for( var_328 = 214 ;(var_328>184);var_328 = (var_328-15) ) + { + try + { + int var_329 = (1300249318); + for( var_329 = 343 ;(var_329<361);var_329 = (var_329+6) ) + { + if( ((var_10--)<=var_161.var_54.var_65)) + { + System.out.println(" if stmt begin,id=16 "); + var_159.var_136 = ((++var_10)94);var_331 = (var_331-14) ) + { + var_4 = (-(--var_332)) ; + } + } + catch( java.lang.ArithmeticException myExp_333 ) + { + int var_334 = (-627134599); + for( var_334 = 539 ;(var_334>529);var_334 = (var_334-2) ) + { + var_161.var_84 = var_154.var_142.var_84 ; + } + System.out.println("hello exception 25 !"); + } + System.out.println("hello exception 24 !"); + } + } + System.out.println(" else stmt end,id=5 "); + } + System.out.println("hello exception 21 !"); + } + return (!(!((~(var_335--))>( ( float )((-(--var_336))*var_175.var_211) )))); +} +public strictfp byte func_11() +{ + byte var_274 = (byte)(60); + final int [][][] var_233 = {{{(-677085615),(-1965152396)},{(1210487541),(1562249115)},{(-1378203528),(-1925238963)},{(-365329097),(1713006941)},{(2089896516),(-661521984)},{(-607212167),(573567897)}},{{(435165800),(-1541436735)},{(1586012696),(253495284)},{(929169136),(-723375380)},{(528748513),(-1905579583)},{(1106338685),(1594539697)},{(-955421019),(395219607)}}}; + if( false) + { + System.out.println(" if stmt begin,id=17 "); + short var_229 = (short)(10769); + double var_243 = (1.01553e-109D); + long [] var_270 = {(5891447077638503254L)}; + try + { + boolean var_261 = true; + byte var_264 = (byte)(74); + try + { + try + { + int var_12 = (-187148847); + try + { + byte var_235 = (byte)(-7); + cl_22 [] var_227 = {new cl_22(),new cl_22(),new cl_22(),new cl_22(),new cl_22()}; + if( (!((~((++var_12)+func_13(var_227 ,((var_229++)var_166.var_55)) ,( ( double )((var_235--)&var_7) ) ,(var_7--) ,(++var_229)) ; + System.out.println(" if stmt end,id=18 "); + } + } + catch( java.lang.IllegalArgumentException myExp_245 ) + { + var_229 = (--var_229) ; + System.out.println("hello exception 26 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_246 ) + { + int var_249 = (-113882095); + try + { + try + { + var_161.var_101.var_248 = (++var_249) ; + } + catch( java.lang.ArithmeticException myExp_250 ) + { + var_229 = (--var_210) ; + System.out.println("hello exception 28 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_251 ) + { + try + { + byte var_252 = (byte)(-93); + var_237[(((++var_210)+var_210)&1)][((~(var_229++))&1)][((var_247--)&3)] = (var_252++) ; + } + catch( java.lang.ArithmeticException myExp_253 ) + { + long var_254 = (8102465411015584305L); + System.out.println("hello exception 30 !"); + } + System.out.println("hello exception 29 !"); + } + System.out.println("hello exception 27 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_255 ) + { + try + { + int var_256 = (1648131721); + for( var_256 = 288 ;(var_256<304);var_256 = (var_256+16) ) + { + int var_257 = (847945560); + for( var_257 = 276 ;(var_257<280);var_257 = (var_257+4) ) + { + var_154.var_146.var_114 = (!((var_10--)<=var_154.var_258)) ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_259 ) + { + double [] var_263 = {(8.0552e-158D),(3.85093e-240D),(-2.04958e+233D),(-3.51714e-193D),(-3.51272e+24D),(-2.25914e+64D),(1.48944e+298D)}; + try + { + if( (!((!((var_260++)<=var_8))&var_261))) + { + System.out.println(" if stmt begin,id=19 "); + var_263[((((++var_264)|var_161.var_61)&var_175.var_213)&6)] = (var_181--) ; + System.out.println(" if stmt end,id=19 "); + } + else + { + System.out.println(" else stmt begin,id=6 "); + double [] var_266 = {(6.32848e-46D),(-1.15427e-61D),(-1.66733e-49D),(-9.30697e+222D),(-1.30239e-22D),(-9.09971e+194D),(-1.49474e+131D)}; + var_263 = var_266 ; + System.out.println(" else stmt end,id=6 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_267 ) + { + try + { + var_7 = (var_264--) ; + } + catch( java.lang.ArithmeticException myExp_268 ) + { + var_154.var_142.var_82.var_269 = var_271 ; + System.out.println("hello exception 34 !"); + } + System.out.println("hello exception 33 !"); + } + System.out.println("hello exception 32 !"); + } + System.out.println("hello exception 31 !"); + } + } + catch( java.lang.ArithmeticException myExp_272 ) + { + int var_273 = (51265921); + System.out.println("hello exception 35 !"); + } + System.out.println(" if stmt end,id=17 "); + } + return (--var_274); +} +public strictfp short func_13(cl_22[] var_14, boolean var_15, boolean var_16, int[][][] var_17, boolean var_18, int[][][] var_19, boolean var_20) +{ + byte var_212 = (byte)(6); + double var_217 = (2.35317e-150D); + try + { + short var_215 = (short)(7196); + if( func_21(((--var_212)+var_175.var_213) ,(var_215--) ,(var_217--) ,(((var_212++)+var_210)var_210))) ; + } + catch( java.lang.IllegalArgumentException myExp_225 ) + { + var_226 = var_154.var_142.var_54 ; + System.out.println("hello exception 38 !"); + } + System.out.println("hello exception 37 !"); + } + return (short)(31043); +} +public static strictfp boolean func_21(double var_22, int var_23, double var_24, boolean var_25, double var_26, int var_27, float var_28) +{ + short var_29 = (short)(-30762); + cl_42 var_156 = new cl_42(); + short var_30 = (short)(11294); + byte var_157 = (byte)(97); + if( ((((var_29++)*var_1)-( ( int )(var_30++) ))!=var_154.func_31(var_154.var_142.var_133 ,var_155.var_64 ,var_156 ,(+(--var_27)) ,(+(var_157++)) ,( ( double )(var_23--) )))) + { + System.out.println(" if stmt begin,id=21 "); + int var_158 = (1001102602); + for( var_158 = 410 ;(var_158<420);var_158 = (var_158+5) ) + { + boolean [] var_169 = {true}; + if( (!((var_157--)!=( ( int )(--var_157) )))) + { + System.out.println(" if stmt begin,id=22 "); + try + { + try + { + if( (!((var_157--)>var_159.var_160))) + { + System.out.println(" if stmt begin,id=23 "); + var_8 = ((-(var_157++))-var_161.var_84.var_150) ; + System.out.println(" if stmt end,id=23 "); + } + } + catch( java.lang.IllegalArgumentException myExp_162 ) + { + int var_163 = (2036002523); + for( var_163 = 808 ;(var_163>778);var_163 = (var_163-15) ) + { + var_165[(((--var_7)*var_166.var_122)&2)][((((~(var_157--))|var_155.var_129)&var_1)&6)][5] = var_165[((var_7++)&2)][((--var_7)&6)][((--var_23)&5)] ; + } + System.out.println("hello exception 39 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_167 ) + { + var_169[((--var_27)&0)] = ((--var_157)==var_10) ; + System.out.println("hello exception 40 !"); + } + System.out.println(" if stmt end,id=22 "); + } + } + System.out.println(" if stmt end,id=21 "); + } + else + { + System.out.println(" else stmt begin,id=7 "); + float [][][] var_178 = {{{(20419.8F),(2.75725e+07F),(-3.46965e+13F),(2.91936e-21F),(-1.12829e-11F),(1.25649e+31F),(-5.52076e+23F)},{(-1.14581e+11F),(6.47688e-09F),(3.96874e+34F),(-5.06969e+17F),(-13.1816F),(3.3157e+22F),(-7.71191e-15F)},{(5.79768e-08F),(-1.06228e+33F),(-2.25988e+30F),(-9.97138e-21F),(8.7452e+31F),(-2.61166e-15F),(1.15953e+14F)},{(-9.17835e+10F),(-2.02802e-18F),(-1.17386e+11F),(-1.43898e-06F),(1.31974e-14F),(9.44707e-32F),(-6.37293e-33F)},{(-220562F),(1.17378e+13F),(-3.49201e+22F),(5.9566e+19F),(5.43276e+30F),(4.08406e+33F),(-4.27532e-31F)}},{{(-0.00104718F),(6.53906e-10F),(-5.67663e-27F),(1.80099e+22F),(-1.47267e-17F),(2.65819e-17F),(-0.339167F)},{(-0.0853604F),(-0.000129916F),(1.98073e-08F),(-7.03578e-29F),(1.13971e+21F),(-1.8611e-36F),(-2.8456e-27F)},{(-2.98425e-34F),(6.97238e-35F),(-5.76189e+23F),(-1.41355e-28F),(-3.05137e+06F),(-3.81414e-24F),(1.7408e+11F)},{(-1.96307e-29F),(-2.41658e+30F),(-6.67893e-16F),(5.06713e+28F),(5.58239e+07F),(-6.63824e-09F),(-3.69576e-09F)},{(-6.13315e+14F),(-3.87009e-19F),(-5.32005e+32F),(2.99545e+27F),(-8.75037e-17F),(1.15051e+15F),(1.65403e-11F)}},{{(3.1452e-35F),(-5.89956e-06F),(1.59373e+38F),(-2.34381e-16F),(-6.07433e+37F),(1.09123e+18F),(3.56515e-19F)},{(2.26473e-36F),(-6.84051e-16F),(-5.48014e-29F),(2.38101e+22F),(4.31232e-09F),(-908.996F),(1.71244e-17F)},{(1.4639e-15F),(7.79593e+20F),(29.1174F),(-2.90699e-28F),(9.97433e-25F),(-6.37851e-28F),(-7.56174e+34F)},{(1.5385e+32F),(2.09846e-34F),(7.23328e-38F),(-3.79305e-10F),(4.0003e+15F),(-28.6438F),(-1.06955e-25F)},{(1.73232e+08F),(2.38491e-12F),(-1.56241e-24F),(-7.79029F),(3.41654e-38F),(8.68816e-16F),(-9.61485e+36F)}}}; + try + { + long var_180 = (691735954529042516L); + try + { + int var_170 = (527463915); + for( var_170 = 172 ;(var_170>157);var_170 = (var_170-3) ) + { + try + { + try + { + var_165 = var_171 ; + } + catch( java.lang.IllegalArgumentException myExp_172 ) + { + long var_173 = (1578461926245900488L); + System.out.println("hello exception 42 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_174 ) + { + try + { + var_171[((var_10--)&2)][((var_30--)&6)][(((++var_30)-( ( byte )((+(++var_7))-(-1981162712)) ))&5)] = (!((var_29--)>=var_175.var_147)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_176 ) + { + var_178[((var_179--)&2)][((var_157--)&4)][((--var_30)&6)] = ((var_180--)*var_181) ; + System.out.println("hello exception 44 !"); + } + System.out.println("hello exception 43 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_182 ) + { + cl_76 [] var_187 = {new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76()}; + cl_76 [] var_189 = {new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76()}; + for( var_183 = 900 ;(var_183<924);var_183 = (var_183+12) ) + { + final cl_76 [] var_188 = {new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76()}; + try + { + try + { + var_29 = ( ( short )(var_10++) ) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_184 ) + { + var_24 = (++var_180) ; + System.out.println("hello exception 46 !"); + } + } + catch( java.lang.ArithmeticException myExp_185 ) + { + if( var_171[((var_179++)&2)][((~(++var_157))&6)][5]) + { + System.out.println(" if stmt begin,id=24 "); + var_154.var_186 = var_154.var_142.var_190 ; + System.out.println(" if stmt end,id=24 "); + } + System.out.println("hello exception 47 !"); + } + } + System.out.println("hello exception 45 !"); + } + } + catch( java.lang.ArithmeticException myExp_191 ) + { + if( (!((--var_157)>var_154.var_192.var_65))) + { + System.out.println(" if stmt begin,id=25 "); + for( var_193 = 109 ;(var_193<121);var_193 = (var_193+3) ) + { + try + { + try + { + final int var_195 = (-843365582); + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_196 ) + { + var_198 = var_154.var_142.var_84 ; + System.out.println("hello exception 49 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_199 ) + { + cl_95 [][] var_203 = {{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()},{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()},{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()}}; + try + { + cl_22 var_200 = new cl_22(); + var_154 = var_200 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_201 ) + { + var_154.var_202 = var_154.var_142.var_204 ; + System.out.println("hello exception 51 !"); + } + System.out.println("hello exception 50 !"); + } + } + System.out.println(" if stmt end,id=25 "); + } + else + { + System.out.println(" else stmt begin,id=8 "); + for( var_205 = 425 ;(var_205<461);var_205 = (var_205+18) ) + { + try + { + try + { + var_159.var_206 = ((--var_27)*var_205) ; + } + catch( java.lang.IllegalArgumentException myExp_207 ) + { + final double var_208 = (-4.54874e+36D); + System.out.println("hello exception 52 !"); + } + } + catch( java.lang.ArithmeticException myExp_209 ) + { + if( ((--var_10)>var_7)) + { + System.out.println(" if stmt begin,id=26 "); + var_198 = var_154.var_142.var_84 ; + System.out.println(" if stmt end,id=26 "); + } + System.out.println("hello exception 53 !"); + } + } + System.out.println(" else stmt end,id=8 "); + } + System.out.println("hello exception 48 !"); + } + System.out.println(" else stmt end,id=7 "); + } + return (!((((var_210--)*var_161.var_82.var_211)*var_194)>=var_7)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1424); + CrcCheck.ToByteArray(this.var_1,b,"var_1"); + CrcCheck.ToByteArray(this.var_7,b,"var_7"); + CrcCheck.ToByteArray(this.var_8,b,"var_8"); + CrcCheck.ToByteArray(this.var_10,b,"var_10"); + CrcCheck.ToByteArray(this.var_154.GetChecksum(),b,"var_154.GetChecksum()"); + CrcCheck.ToByteArray(this.var_155.GetChecksum(),b,"var_155.GetChecksum()"); + CrcCheck.ToByteArray(this.var_159.GetChecksum(),b,"var_159.GetChecksum()"); + CrcCheck.ToByteArray(this.var_161.GetChecksum(),b,"var_161.GetChecksum()"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_165[a0][a1][a2],b,"var_165" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_166.GetChecksum(),b,"var_166.GetChecksum()"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_171[a0][a1][a2],b,"var_171" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_175.GetChecksum(),b,"var_175.GetChecksum()"); + CrcCheck.ToByteArray(this.var_179,b,"var_179"); + CrcCheck.ToByteArray(this.var_181,b,"var_181"); + CrcCheck.ToByteArray(this.var_183,b,"var_183"); + CrcCheck.ToByteArray(this.var_193,b,"var_193"); + CrcCheck.ToByteArray(this.var_194,b,"var_194"); + CrcCheck.ToByteArray(this.var_197,b,"var_197"); + CrcCheck.ToByteArray(this.var_198.GetChecksum(),b,"var_198.GetChecksum()"); + CrcCheck.ToByteArray(this.var_205,b,"var_205"); + CrcCheck.ToByteArray(this.var_210,b,"var_210"); + CrcCheck.ToByteArray(this.var_226.GetChecksum(),b,"var_226.GetChecksum()"); + CrcCheck.ToByteArray(this.var_230,b,"var_230"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_237[a0][a1][a2],b,"var_237" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_241,b,"var_241"); + CrcCheck.ToByteArray(this.var_242.GetChecksum(),b,"var_242.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_244[a0],b,"var_244" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_247,b,"var_247"); + CrcCheck.ToByteArray(this.var_260,b,"var_260"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_271[a0],b,"var_271" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_280[a0][a1][a2],b,"var_280" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_284[a0].GetChecksum(),b,"var_284" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_305,b,"var_305"); + CrcCheck.ToByteArray(this.var_306,b,"var_306"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_308[a0].GetChecksum(),b,"var_308" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_309[a0][a1][a2],b,"var_309" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_310,b,"var_310"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_311[a0][a1][a2],b,"var_311" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_324,b,"var_324"); + CrcCheck.ToByteArray(this.var_328,b,"var_328"); + CrcCheck.ToByteArray(this.var_336,b,"var_336"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_337[a0],b,"var_337" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_352,b,"var_352"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_367[a0][a1][a2],b,"var_367" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_369[a0],b,"var_369" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_382[a0].GetChecksum(),b,"var_382" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_414,b,"var_414"); + CrcCheck.ToByteArray(this.var_459,b,"var_459"); + CrcCheck.ToByteArray(this.var_467.GetChecksum(),b,"var_467.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/Start.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..b9faf4c30d07c6ce13b195e948e2736585c859f5 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_95.java cl_13.java cl_39.java cl_42.java cl_22.java CRC32.java CrcCheck.java cl_76.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_13.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_13.java new file mode 100644 index 0000000000000000000000000000000000000000..aa2a51fe32f176830d50d1292f5c6f7c39a04219 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_13.java @@ -0,0 +1,394 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2759125148 + +//import java.util.zip.CRC32; + +class cl_13 +{ + final static cl_39 var_47 = new cl_39(); + static byte var_51 = (byte)(12); + static cl_42 var_54 = new cl_42(); + final static int var_61 = (92798996); + static double [][] var_68 = {{(-4.86472e+45D),(5.71448e-294D),(-1.11539e-247D),(3.44353e-148D),(5.16732e-162D)}}; + static int var_69 = (559339602); + static int [] var_75 = {(-1164208256)}; + static double var_80 = (8.83314e-146D); + static cl_39 [] var_81 = {new cl_39(),new cl_39(),new cl_39()}; + final static cl_76 var_82 = new cl_76(); + static cl_95 var_84 = new cl_95(); + static short var_86 = (short)(13861); + static int [] var_88 = {(54665448),(-1984910596),(-116904414),(1278853563),(1235424983)}; + float var_95 = (2.97541e-17F); + static cl_42 [] var_99 = {new cl_42(),new cl_42(),new cl_42(),new cl_42(),new cl_42()}; + static cl_76 var_101 = new cl_76(); + int [][] var_105 = {{(652470898),(1772744540),(9561541),(-2006799151),(-827237922),(-997430584),(1220124192)},{(82821352),(-2043417567),(1386788006),(-310767045),(771326788),(983277267),(-617610148)},{(-871163714),(-778160536),(1812225980),(-1395040897),(1337690704),(153981408),(1435509462)},{(1350971778),(-305059575),(-2091534310),(1172846339),(-1376983275),(-386433513),(-1667761806)},{(843045873),(-1303541789),(-1498628189),(1602250323),(-1800247072),(-1862256724),(2039276962)},{(-326260232),(580814800),(-800746417),(1060905535),(-380252544),(-2114966833),(1982136344)}}; + cl_95 [][][] var_109 = {{{new cl_95(),new cl_95()},{new cl_95(),new cl_95()}},{{new cl_95(),new cl_95()},{new cl_95(),new cl_95()}},{{new cl_95(),new cl_95()},{new cl_95(),new cl_95()}},{{new cl_95(),new cl_95()},{new cl_95(),new cl_95()}},{{new cl_95(),new cl_95()},{new cl_95(),new cl_95()}},{{new cl_95(),new cl_95()},{new cl_95(),new cl_95()}},{{new cl_95(),new cl_95()},{new cl_95(),new cl_95()}}}; + static cl_39 var_112 = new cl_39(); + int var_118 = (228469032); + static byte var_121 = (byte)(82); + static boolean [][][] var_124 = {{{false,false,false,false,true,true},{true,true,true,false,true,true},{true,true,true,true,true,true},{false,true,false,true,true,false}},{{false,true,false,true,true,true},{true,true,false,false,false,true},{false,true,false,true,true,true},{true,true,true,false,true,true}},{{true,true,true,true,true,true},{true,true,true,true,false,false},{false,false,true,false,false,true},{true,true,false,false,false,true}}}; + static int var_131 = (423700836); + cl_39 var_132 = new cl_39(); + cl_39 var_133 = new cl_39(); + cl_76 [] var_190 = {new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76()}; + cl_95 [][] var_204 = {{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()},{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()},{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()}}; + cl_76 [][] var_327 = {{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()}}; + int [][][] var_390 = {{{(-2131143986),(-1203811330),(-1374694155),(-2096618124)},{(-1057582956),(2114213018),(-428298704),(975033350)}},{{(-1386453224),(-561488112),(135971476),(1184152908)},{(-1900358632),(518481078),(-838733751),(272497360)}}}; +/*********************************/ +public static strictfp byte func_41(int var_42, long var_43, int var_44, int var_45) +{ + final cl_42 var_58 = new cl_42(); + int [] var_50 = {(-1511765944),(212981359),(1063796158),(-899613571),(1203265946)}; + final boolean [][][] var_115 = {{{true,false},{true,true},{false,true},{false,false},{false,false},{true,false}},{{true,false},{true,false},{true,true},{false,true},{false,false},{true,true}},{{false,true},{true,true},{true,true},{false,false},{false,true},{false,false}},{{false,true},{false,true},{false,true},{true,true},{false,false},{false,false}},{{false,false},{true,true},{false,false},{false,true},{false,true},{false,false}}}; + int var_46 = (1583733760); + for( var_46 = 887 ;(var_46>881);var_46 = (var_46-6) ) + { + cl_39 [] var_116 = {new cl_39(),new cl_39(),new cl_39()}; + short var_79 = (short)(-655); + try + { + final cl_39 var_87 = new cl_39(); + int var_62 = (1495538802); + try + { + byte var_63 = (byte)(-16); + long var_77 = (489570857890012665L); + if( var_47.var_48) + { + System.out.println(" if stmt begin,id=27 "); + int var_52 = (-644781988); + double [][] var_71 = {{(-5.09625e+105D),(2.82503e+188D),(1.21458e-136D),(-3.27063e+63D),(1.64365e-253D)}}; + var_50[(((var_51++)-(short)(8032))&4)] = (-650993995) ; + float var_70 = (-2.99072e-36F); + int var_56 = (1563151507); + for( var_52 = 983 ;(var_52<1013);var_52 = (var_52+15) ) + { + short var_53 = (short)(1401); + int var_78 = (444982555); + if( ((~(--var_53))==var_54.var_55)) + { + System.out.println(" if stmt begin,id=28 "); + var_45 = (++var_53) ; + long var_59 = (-6243605373358591098L); + cl_76 [][][] var_57 = {{{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()}},{{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()}},{{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()}},{{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()}},{{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76()}}}; + byte var_60 = (byte)(125); + boolean var_66 = true; + var_50[((var_53++)&4)] = (var_56--) ; + float var_73 = (5.75279e-18F); + var_54 = var_58 ; + var_50[(((var_60++)+var_61)&4)] = (var_62--) ; + var_42 = (var_62++) ; + var_51 = (var_63--) ; + var_47.var_64 = ((++var_63)|var_54.var_65) ; + var_68[((var_69++)&0)][((var_62++)&4)] = (-(var_70++)) ; + var_68 = var_71 ; + var_54 = var_54 ; + System.out.println(" if stmt end,id=28 "); + } + else + { + System.out.println(" else stmt begin,id=9 "); + var_54.var_74 = (--var_69) ; + var_50[(((var_53--)*var_61)&4)] = ( ( int )(++var_51) ) ; + var_54 = var_54 ; + var_71[((var_69++)&0)][4] = (+(var_77--)) ; + System.out.println(" else stmt end,id=9 "); + } + for( var_78 = 683 ;(var_78>671);var_78 = (var_78-12) ) + { + var_53 = (var_63++) ; + var_45 = (-(var_79--)) ; + var_68[((++var_42)&0)][((var_69++)&4)] = (++var_80) ; + var_81 = var_81 ; + var_71 = var_68 ; + var_81[((~(++var_86))&2)] = var_47 ; + } + } + var_50 = var_88 ; + try + { + cl_95 var_102 = new cl_95(); + try + { + boolean var_90 = false; + var_63 = (--var_51) ; + var_80 = (((+(var_63++))&(byte)(65))-var_80) ; + var_71 = var_68 ; + var_47.var_48 = ((var_51++)=var_80)) + { + System.out.println(" if stmt begin,id=30 "); + var_81 = var_116 ; + System.out.println(" if stmt end,id=30 "); + } + System.out.println(" if stmt end,id=29 "); + } + else + { + System.out.println(" else stmt begin,id=11 "); + if( var_115[((~(--var_63))&4)][((--var_79)&5)][(((--var_63)*var_61)&1)]) + { + System.out.println(" if stmt begin,id=31 "); + long var_117 = (-2557475784570366324L); + System.out.println(" if stmt end,id=31 "); + } + else + { + System.out.println(" else stmt begin,id=12 "); + double var_119 = (-1.31242e+36D); + System.out.println(" else stmt end,id=12 "); + } + System.out.println(" else stmt end,id=11 "); + } + System.out.println(" else stmt end,id=10 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_120 ) + { + if( ((--var_121)==var_54.var_122)) + { + System.out.println(" if stmt begin,id=32 "); + byte var_127 = (byte)(2); + try + { + try + { + var_101.var_123 = var_124 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_125 ) + { + var_50 = var_88 ; + System.out.println("hello exception 60 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_126 ) + { + try + { + var_116[(((var_127--)|( ( byte )(+(var_121--)) ))&2)] = var_87 ; + } + catch( java.lang.ArithmeticException myExp_128 ) + { + var_112.var_129 = (--var_121) ; + System.out.println("hello exception 62 !"); + } + System.out.println("hello exception 61 !"); + } + System.out.println(" if stmt end,id=32 "); + } + System.out.println("hello exception 59 !"); + } + } + catch( java.lang.ArithmeticException myExp_130 ) + { + for( var_131 = 665 ;(var_131>660);var_131 = (var_131-5) ) + { + try + { + final cl_39 var_134 = new cl_39(); + try + { + try + { + var_116[((var_51--)&2)] = var_112 ; + } + catch( java.lang.ArithmeticException myExp_135 ) + { + var_84.var_136 = ((++var_86)>var_86) ; + System.out.println("hello exception 65 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_137 ) + { + if( (!((--var_79)>=var_54.var_74))) + { + System.out.println(" if stmt begin,id=33 "); + var_54 = var_54 ; + System.out.println(" if stmt end,id=33 "); + } + System.out.println("hello exception 66 !"); + } + } + catch( java.lang.ArithmeticException myExp_138 ) + { + int var_139 = (756287734); + for( var_139 = 328 ;(var_139>319);var_139 = (var_139-3) ) + { + try + { + var_68[((var_79++)&0)][((var_42++)&4)] = (var_86--) ; + } + catch( java.lang.IllegalArgumentException myExp_140 ) + { + long var_141 = (-3610178934551194744L); + System.out.println("hello exception 68 !"); + } + } + System.out.println("hello exception 67 !"); + } + } + System.out.println("hello exception 64 !"); + } + } + return (--var_51); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1112); + CrcCheck.ToByteArray(this.var_47.GetChecksum(),b,"var_47.GetChecksum()"); + CrcCheck.ToByteArray(this.var_51,b,"var_51"); + CrcCheck.ToByteArray(this.var_54.GetChecksum(),b,"var_54.GetChecksum()"); + CrcCheck.ToByteArray(this.var_61,b,"var_61"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_68[a0][a1],b,"var_68" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_75[a0],b,"var_75" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_81[a0].GetChecksum(),b,"var_81" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_82.GetChecksum(),b,"var_82.GetChecksum()"); + CrcCheck.ToByteArray(this.var_84.GetChecksum(),b,"var_84.GetChecksum()"); + CrcCheck.ToByteArray(this.var_86,b,"var_86"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_88[a0],b,"var_88" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_95,b,"var_95"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_99[a0].GetChecksum(),b,"var_99" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_101.GetChecksum(),b,"var_101.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_105[a0][a1],b,"var_105" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_109[a0][a1][a2].GetChecksum(),b,"var_109" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_112.GetChecksum(),b,"var_112.GetChecksum()"); + CrcCheck.ToByteArray(this.var_118,b,"var_118"); + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_124[a0][a1][a2],b,"var_124" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_131,b,"var_131"); + CrcCheck.ToByteArray(this.var_132.GetChecksum(),b,"var_132.GetChecksum()"); + CrcCheck.ToByteArray(this.var_133.GetChecksum(),b,"var_133.GetChecksum()"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_190[a0].GetChecksum(),b,"var_190" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_204[a0][a1].GetChecksum(),b,"var_204" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_327[a0][a1].GetChecksum(),b,"var_327" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_390[a0][a1][a2],b,"var_390" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_22.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_22.java new file mode 100644 index 0000000000000000000000000000000000000000..720816f80e2057405ca238225ca69b187beb682f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_22.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2759125148 + +//import java.util.zip.CRC32; + +class cl_22 +{ + static boolean [][] var_39 = {{true,false},{false,false},{false,false},{true,false},{true,false},{true,true},{false,false}}; + static cl_13 var_142 = new cl_13(); + static cl_39 var_144 = new cl_39(); + static cl_76 var_146 = new cl_76(); + static cl_95 var_149 = new cl_95(); + static short var_151 = (short)(-20815); + static short var_153 = (short)(19916); + cl_76 [] var_186 = {new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76(),new cl_76()}; + final cl_42 var_192 = new cl_42(); + cl_95 [][] var_202 = {{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()},{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()},{new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95(),new cl_95()}}; + final double var_239 = (-9.21167e+228D); + float var_258 = (1.64543e+06F); + cl_76 [][] var_325 = {{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()},{new cl_76(),new cl_76(),new cl_76(),new cl_76()}}; + byte var_437 = (byte)(-58); + final int var_447 = (-539514874); +/*********************************/ +public static strictfp int func_31(cl_39 var_32, float var_33, cl_42 var_34, int var_35, long var_36, double var_37) +{ + int var_152 = (101080247); + byte var_148 = (byte)(114); + short var_145 = (short)(-13194); + byte var_143 = (byte)(2); + byte var_40 = (byte)(-126); + var_39[((var_152++)&6)][((((--var_40)|var_142.func_41(((++var_143)-var_144.var_94) ,((var_145++)*var_146.var_147) ,(+((++var_148)|var_149.var_150)) ,(var_35++)))|var_151)&1)] = true ; + return (-(var_153--)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(435); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_39[a0][a1],b,"var_39" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_142.GetChecksum(),b,"var_142.GetChecksum()"); + CrcCheck.ToByteArray(this.var_144.GetChecksum(),b,"var_144.GetChecksum()"); + CrcCheck.ToByteArray(this.var_146.GetChecksum(),b,"var_146.GetChecksum()"); + CrcCheck.ToByteArray(this.var_149.GetChecksum(),b,"var_149.GetChecksum()"); + CrcCheck.ToByteArray(this.var_151,b,"var_151"); + CrcCheck.ToByteArray(this.var_153,b,"var_153"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_186[a0].GetChecksum(),b,"var_186" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_192.GetChecksum(),b,"var_192.GetChecksum()"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_202[a0][a1].GetChecksum(),b,"var_202" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_239,b,"var_239"); + CrcCheck.ToByteArray(this.var_258,b,"var_258"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_325[a0][a1].GetChecksum(),b,"var_325" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_437,b,"var_437"); + CrcCheck.ToByteArray(this.var_447,b,"var_447"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_39.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_39.java new file mode 100644 index 0000000000000000000000000000000000000000..edee7b27b6bfd8c25e1c06f6641997b31f7a014a --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_39.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2759125148 + +//import java.util.zip.CRC32; + +class cl_39 +{ + boolean var_48 = false; + float var_64 = (-0.000233833F); + double var_76 = (2.29126e-08D); + byte var_94 = (byte)(-33); + short var_98 = (short)(25616); + int var_129 = (-1709830416); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(20); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CrcCheck.ToByteArray(this.var_129,b,"var_129"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_42.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_42.java new file mode 100644 index 0000000000000000000000000000000000000000..4ed6a67d630ef38bac8051e2a9b7429583fc2948 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_42.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2759125148 + +//import java.util.zip.CRC32; + +class cl_42 +{ + float var_55 = (0.00875881F); + byte var_65 = (byte)(20); + boolean var_72 = true; + int var_74 = (113637025); + double [][] var_91 = {{(-1.84772e+303D),(-0.0136294D),(1.2429e-253D),(-5.35701e-298D),(-9.58933e-71D)}}; + int [][] var_104 = {{(867829029),(1347184668),(-1000980066),(785583484),(-1164691880),(-2058644283),(-607751749)},{(1689406258),(-1196277350),(-2072090472),(-1924291805),(127676617),(-690849616),(-1687436641)},{(1262112410),(-1563026241),(860122368),(-1694058693),(1715983498),(-1742692168),(-1153883694)},{(576398646),(-236469592),(132359602),(12545199),(1248101735),(-2034438885),(-1372782488)},{(-665253746),(-982894444),(-1816799150),(2136611606),(-2067298822),(-5060743),(-1984238287)},{(1480821032),(-636888972),(435113421),(-2009754530),(1018990697),(1432775870),(1902026019)}}; + final short var_122 = (short)(-10619); + final int [][][] var_289 = {{{(272319218),(400412239)},{(-209766554),(-848648018)},{(-429445965),(1906293632)},{(-315979939),(1257576266)},{(989106170),(-1338008966)},{(-1601771887),(-1846332685)}},{{(-1251708197),(-1831211667)},{(1253934548),(-1116644236)},{(-129835688),(-1793379924)},{(-941149600),(1571910387)},{(-508926485),(-129332165)},{(-1367098227),(-1873105237)}}}; + double var_296 = (2.51095e-13D); + final long var_441 = (1432189517947594669L); + long var_458 = (2497669026784793054L); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(340); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_91[a0][a1],b,"var_91" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_104[a0][a1],b,"var_104" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_122,b,"var_122"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_289[a0][a1][a2],b,"var_289" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_296,b,"var_296"); + CrcCheck.ToByteArray(this.var_441,b,"var_441"); + CrcCheck.ToByteArray(this.var_458,b,"var_458"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_76.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_76.java new file mode 100644 index 0000000000000000000000000000000000000000..032d1d07846f94a44fb33203288fa5708523207d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_76.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2759125148 + +//import java.util.zip.CRC32; + +class cl_76 +{ + final double [][] var_83 = {{(-2.11346e+62D),(-6.71608e+277D),(-1.10554e+15D),(-2.39071e+251D),(4.99166e+29D)}}; + int [] var_89 = {(2044003010),(840966728),(-213211832),(351948512),(477271701)}; + int [][] var_107 = {{(-2049300974),(391809841),(396465155),(-432133906),(-722367138),(1087402515),(-144260173)},{(1642985647),(1344358480),(1275281940),(802376216),(-1721430619),(-1553987845),(-666714824)},{(-1976525269),(1288222157),(-1353508106),(-456731262),(1937509897),(-781486788),(1460779941)},{(-1247996821),(-290843795),(1347247921),(-611797461),(305211111),(-55215344),(-52666297)},{(1018105779),(776737638),(831698496),(1739281895),(1475205026),(1180266936),(-1736734178)},{(1622432858),(-1350200804),(942624357),(1096880757),(-2024017177),(1161592647),(-1807939423)}}; + boolean var_114 = true; + boolean [][][] var_123 = {{{true,false,true,false,false,true},{true,false,true,true,true,false},{true,true,true,true,false,false},{false,false,true,true,true,false}},{{true,true,false,false,true,true},{true,false,false,false,true,false},{false,true,true,true,false,false},{true,true,true,false,false,true}},{{true,true,false,false,true,false},{true,false,false,false,false,true},{true,true,false,false,false,false},{true,false,false,false,false,true}}}; + short var_147 = (short)(12990); + double var_211 = (3.5665e+193D); + final byte var_213 = (byte)(69); + int var_248 = (-2036162129); + double [] var_265 = {(1.37852e-119D),(7.48195e+27D),(-3.41179e+305D),(-3.61286e-26D),(8.28396e+187D),(-1.76685e+246D),(-5.53813e+218D)}; + long [] var_269 = {(-1115114709225623499L)}; + final int [][][] var_292 = {{{(-1759121878),(-550070032),(1715542814),(944069059)},{(1842947169),(-1883009977),(-413394645),(-1002169742)}},{{(709003447),(-2138539485),(-224170741),(1996897380)},{(-663753197),(-104249727),(-1493972988),(28770248)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(444); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_83[a0][a1],b,"var_83" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_89[a0],b,"var_89" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_107[a0][a1],b,"var_107" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_123[a0][a1][a2],b,"var_123" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_147,b,"var_147"); + CrcCheck.ToByteArray(this.var_211,b,"var_211"); + CrcCheck.ToByteArray(this.var_213,b,"var_213"); + CrcCheck.ToByteArray(this.var_248,b,"var_248"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_265[a0],b,"var_265" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_269[a0],b,"var_269" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_292[a0][a1][a2],b,"var_292" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_95.java b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_95.java new file mode 100644 index 0000000000000000000000000000000000000000..02453d504bf723e38221da30e7d926b99d5ea39e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/766_2018120417581/cl_95.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2759125148 + +//import java.util.zip.CRC32; + +class cl_95 +{ + double [][] var_85 = {{(0.196765D),(2.32914e-207D),(1.72286e-177D),(-2.2817e-283D),(-1.3731e-45D)}}; + final double var_92 = (-2.49553e-159D); + double var_103 = (7.39416e+136D); + short var_108 = (short)(-10041); + boolean var_136 = false; + int var_150 = (-1426997677); + final byte var_160 = (byte)(-28); + long var_206 = (-6559537351150230800L); + float var_297 = (-1.93994e-23F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(76); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_85[a0][a1],b,"var_85" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_92,b,"var_92"); + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_136,b,"var_136"); + CrcCheck.ToByteArray(this.var_150,b,"var_150"); + CrcCheck.ToByteArray(this.var_160,b,"var_160"); + CrcCheck.ToByteArray(this.var_206,b,"var_206"); + CrcCheck.ToByteArray(this.var_297,b,"var_297"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/CRC32.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..ef6737ec32b5eee3362ad6583b8f2f8da47c3801 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/MainClass.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..4475c1ce9b83004a8573b0d670636a2201848dcd --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/MainClass.java @@ -0,0 +1,1274 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1217165572 + +//import java.util.zip.CRC32; + +class MainClass +{ + static byte var_1 = (byte)(-90); + static cl_8 var_4 = new cl_8(); + static cl_12 var_7 = new cl_12(); + static byte var_19 = (byte)(-10); + static cl_19 var_20 = new cl_19(); + static int var_30 = (1475916021); + static cl_51 var_135 = new cl_51(); + static int var_136 = (-1883648016); + static cl_59 [][][] var_138 = {{{new cl_59(),new cl_59(),new cl_59(),new cl_59(),new cl_59(),new cl_59()}},{{new cl_59(),new cl_59(),new cl_59(),new cl_59(),new cl_59(),new cl_59()}},{{new cl_59(),new cl_59(),new cl_59(),new cl_59(),new cl_59(),new cl_59()}}}; + static cl_59 var_143 = new cl_59(); + static int var_151 = (-473335846); + static short var_153 = (short)(15919); + static cl_16 var_156 = new cl_16(); + static float var_157 = (-5.152e+17F); + static byte var_168 = (byte)(45); + static cl_51 [] var_170 = {new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51()}; + static short var_178 = (short)(4401); + static int var_185 = (-147691686); + static long var_189 = (7435966006034220371L); + static boolean [] var_193 = {false,true,true}; + static boolean [] var_199 = {false,false,true}; + static double var_203 = (8.96939e-88D); + static boolean var_206 = true; + static cl_59 var_215 = new cl_59(); + static int var_219 = (337868512); + static int var_222 = (1437157695); + static byte var_227 = (byte)(91); + static long [][] var_229 = {{(40728633278240785L),(8431791229365965493L),(2184881938909376272L),(8718050287031115947L),(4136912496669468353L),(2739369628465860324L)},{(-6696905336205662655L),(-4014631466424621323L),(-4932626445443840327L),(-4711267621036431289L),(8193275463316544673L),(-5648552654997676117L)},{(6820989011891694404L),(5557744783189054989L),(-6516010471998371979L),(-3159043136366077669L),(7249489697605698010L),(-1992015212843796801L)},{(-1211271676934283135L),(1249882587796873083L),(-160542624978417809L),(960159096866117567L),(4725683987276764798L),(8909907650018444798L)},{(6856957956850640311L),(4638748002051889662L),(3046411928449759605L),(4885269506966880146L),(4101932734277317923L),(5887266384870635238L)},{(6873972548481558873L),(-6144126052543423259L),(-1215771983980512933L),(2054781523347944808L),(-1255514024215564766L),(8988650365648918087L)}}; + static int var_230 = (-263166402); + static byte var_231 = (byte)(-73); + cl_51 var_240 = new cl_51(); + double [] var_246 = {(1.99725e+73D)}; + byte var_247 = (byte)(65); + byte var_255 = (byte)(-80); + cl_51 [] var_256 = {new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51()}; + final int var_263 = (-2095629784); + byte var_281 = (byte)(64); + short var_284 = (short)(19930); + boolean [] var_291 = {false,false,true}; + int var_298 = (828629212); + int var_305 = (-535983226); + float [][][] var_309 = {{{(-3.93215e+31F),(134.385F),(-2.08955e-30F),(-2.18185e+34F),(-6.8554e+25F),(3.79247e+26F)},{(-388.727F),(6.82075e+13F),(9.17716e-09F),(-5.20399e+27F),(-9.96262e-09F),(-5.98695e+14F)},{(1.05925e+33F),(-1.08325e+25F),(-8.27936e+14F),(9.22986e+11F),(-1.50975e-34F),(3.22469e+32F)},{(7.23494e-25F),(187.143F),(2.30094e-24F),(1.5579e+29F),(0.802517F),(-5777.31F)},{(-4.04508e-23F),(8.0278e-13F),(-4.86265e+11F),(9.02758e-11F),(1.50467e-37F),(30.4886F)},{(7.36571e-28F),(-1.24809e-34F),(8.81661e-36F),(-1.88808e+18F),(1.44493e+22F),(-1.09841e-28F)},{(9.30385e-11F),(2.5717e-39F),(-4.81787e+27F),(1.86141e-11F),(2.0646e-12F),(-4.55258e+15F)}},{{(8.79063e+11F),(71212.1F),(2.16732e-06F),(-12288F),(-1.88236e-32F),(5.73178e+07F)},{(-1.32145e-25F),(3.60269e-37F),(1.9092e+27F),(-9.06498e-14F),(4.18964e+21F),(2.2849e-16F)},{(166521F),(-2.3583e-24F),(-6.95208e+22F),(4.71606e+17F),(-2.58271e-17F),(-1.84997e-24F)},{(-30714.1F),(2.8975e-12F),(9.68884e+25F),(-2.40494e+31F),(2.3494e-32F),(-6.6518e+37F)},{(-4.86969e+23F),(-6.65934e-23F),(5.00545e-13F),(5.23991e+25F),(2.27604e-32F),(-3.19613e+30F)},{(6.07331e+30F),(1.59102e-24F),(4.17657e+11F),(12260.4F),(9.98566e-07F),(2.82574e+13F)},{(-4.43971e+18F),(-7.48049e+28F),(8.43433e-24F),(-1.91017e+26F),(6.08098e-18F),(-1.33759e-22F)}},{{(3.85175e-08F),(-9.23922e+32F),(3.36881e-26F),(-4.72035e+29F),(-2.28338e-17F),(1.08795e-08F)},{(4.1587e+18F),(1.95639e+32F),(2.14988e-16F),(-1.36806e+23F),(3.57125e-38F),(-1.9847e-36F)},{(-1.70385e-36F),(-3.70189e-10F),(1.49142e-13F),(-5.03253e+20F),(-3.84699e+08F),(-1.01952e+15F)},{(0.115076F),(-1.58385e-19F),(4.97942e-23F),(4.51784e+18F),(-2.1153e-15F),(-2.36935e-24F)},{(1.9558e+16F),(1.26146e-15F),(3.62836e-38F),(3.76076e+25F),(0.220225F),(-6.03648e+12F)},{(-2.05641e-17F),(3.08609e-18F),(-3.9781e-32F),(-4.06146e+09F),(2.0525e-07F),(5.72449F)},{(26358.1F),(1.08764e-30F),(2.69138e-33F),(-5.28127e-24F),(9.39567e-11F),(7.25533e+17F)}},{{(79.5585F),(-9.1473e-12F),(-2.63064e+09F),(3.40625e+06F),(-8.43609e-32F),(-6.74881e-23F)},{(-5.24686e-11F),(-577.16F),(-0.000330707F),(2.85766e-30F),(1.12339e-07F),(1.30643e+38F)},{(5.34394e+26F),(1.72334e-18F),(-1.35658e-06F),(4.87796e+07F),(5.61669e-20F),(1.17639e+28F)},{(-3.02184e+22F),(9.88798e-39F),(-2.58483e+29F),(1.83394e+29F),(6.04678e-21F),(8.46775e-19F)},{(4.89521e-27F),(-1.80739e+11F),(-2.00044e+09F),(-1.53401e+13F),(7.8832e+12F),(-5.19162e+28F)},{(4.16143e-25F),(-3.44102e+34F),(-1.14467e-27F),(-4.45952e-05F),(-1.20016e+34F),(-2.60308e+09F)},{(-2.3179e+28F),(-7.01475e+23F),(8.36543e-06F),(-4.87666e+30F),(4.1101e-11F),(4.95631e-21F)}},{{(2.10215e+08F),(14.1244F),(8.63958e-11F),(-904887F),(-3.24019e+06F),(3.12641e+27F)},{(-3.37898e-16F),(3.08537e-31F),(-2.77282e+22F),(87618.3F),(9.56442e-29F),(-8.74519e-18F)},{(-2.14669e-23F),(1.57807e-20F),(-4.72933F),(1.6614e+08F),(1.78581e+07F),(-2.05162e+29F)},{(1.11176e-29F),(2.73001e-08F),(-8.79469e-13F),(-3.80915e-19F),(1.72614e-13F),(1.236e+15F)},{(459584F),(-3.17377e+36F),(2.92206e+09F),(-9.63568e+30F),(-3.51715e-29F),(-21976.4F)},{(3.5832e-10F),(-6.78172e+13F),(5.06306e-16F),(5.10979e-21F),(-3.34138e-33F),(-7.31829e-34F)},{(1.43863e+23F),(-1.13684e+12F),(7.37375e+25F),(12.6921F),(0.000212696F),(1.48145e-36F)}}}; + cl_51 [] var_317 = {new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51()}; + byte var_318 = (byte)(-82); + byte var_320 = (byte)(24); + boolean [] var_324 = {false,true,false}; + float var_326 = (6.44129e+19F); + final int var_335 = (-485999503); + int var_336 = (653052022); + float var_359 = (3.73158e+06F); + byte [][][] var_368 = {{{(byte)(112)},{(byte)(33)},{(byte)(-106)},{(byte)(87)},{(byte)(-125)},{(byte)(-70)},{(byte)(-3)}},{{(byte)(-40)},{(byte)(102)},{(byte)(-96)},{(byte)(35)},{(byte)(109)},{(byte)(-119)},{(byte)(-93)}},{{(byte)(-19)},{(byte)(86)},{(byte)(-20)},{(byte)(76)},{(byte)(-56)},{(byte)(-86)},{(byte)(12)}},{{(byte)(7)},{(byte)(-78)},{(byte)(14)},{(byte)(47)},{(byte)(-46)},{(byte)(-128)},{(byte)(60)}},{{(byte)(33)},{(byte)(-49)},{(byte)(28)},{(byte)(40)},{(byte)(-1)},{(byte)(-28)},{(byte)(43)}},{{(byte)(109)},{(byte)(18)},{(byte)(-67)},{(byte)(-37)},{(byte)(26)},{(byte)(-99)},{(byte)(-128)}},{{(byte)(-113)},{(byte)(-73)},{(byte)(-93)},{(byte)(-72)},{(byte)(83)},{(byte)(-88)},{(byte)(-47)}}}; + final boolean [] var_384 = {false,true,false}; + int var_387 = (996401244); + cl_59 var_388 = new cl_59(); + cl_59 var_389 = new cl_59(); + byte var_391 = (byte)(108); + boolean var_394 = false; + byte var_400 = (byte)(-95); + byte var_401 = (byte)(121); + short var_427 = (short)(7324); + long var_429 = (2692559509145522866L); + byte var_438 = (byte)(-1); + float var_442 = (-3.81559e+15F); + cl_51 [] var_450 = {new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51()}; + int var_469 = (561214014); + cl_8 var_471 = new cl_8(); + int var_484 = (-1784711658); + int var_487 = (-230589158); + float [][][] var_491 = {{{(1.11101e+12F),(-6.67253e-21F)},{(-1.84055e-16F),(-1.93608e+21F)},{(-2.57552e+22F),(1.07241e-34F)}},{{(7.2811e-38F),(9.94571e+31F)},{(-6.59149e+10F),(5.42509e+08F)},{(-30.2528F),(-31.7971F)}},{{(-1.21128e-11F),(-1.34223e+35F)},{(5.59838e+08F),(4.5102e-17F)},{(-9.61145e-16F),(-2.50082e+12F)}},{{(7.24163e-36F),(17207.5F)},{(-4.66694e-29F),(1.03371e+26F)},{(-0.00953037F),(12043.4F)}}}; + final byte [][][] var_497 = {{{(byte)(-61)},{(byte)(23)},{(byte)(12)},{(byte)(105)},{(byte)(-44)},{(byte)(-2)},{(byte)(-67)}},{{(byte)(13)},{(byte)(79)},{(byte)(-115)},{(byte)(71)},{(byte)(65)},{(byte)(48)},{(byte)(38)}},{{(byte)(-124)},{(byte)(82)},{(byte)(-20)},{(byte)(-8)},{(byte)(-33)},{(byte)(-77)},{(byte)(-86)}},{{(byte)(-96)},{(byte)(-45)},{(byte)(-74)},{(byte)(84)},{(byte)(-16)},{(byte)(-87)},{(byte)(-103)}},{{(byte)(115)},{(byte)(113)},{(byte)(-112)},{(byte)(49)},{(byte)(-110)},{(byte)(-55)},{(byte)(4)}},{{(byte)(-40)},{(byte)(-52)},{(byte)(49)},{(byte)(-58)},{(byte)(-115)},{(byte)(116)},{(byte)(-74)}},{{(byte)(39)},{(byte)(23)},{(byte)(54)},{(byte)(-114)},{(byte)(49)},{(byte)(88)},{(byte)(-114)}}}; +/*********************************/ +public strictfp void run() +{ + byte var_0 = (byte)(9); + cl_59 var_476 = new cl_59(); + if( ((~(var_0--))==var_1)) + { + System.out.println(" if stmt begin,id=1 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" if stmt end,id=1 "); + } + else + { + System.out.println(" else stmt begin,id=1 "); + try + { + boolean [] var_480 = {true}; + try + { + if( ((var_0++)!=var_4.var_167)) + { + System.out.println(" if stmt begin,id=4 "); + final long var_477 = (-1232578573480561803L); + System.out.println(" if stmt end,id=4 "); + } + else + { + System.out.println(" else stmt begin,id=2 "); + + System.out.println(" else stmt end,id=2 "); + } + } + catch( java.lang.ArithmeticException myExp_478 ) + { + try + { + if( true) + { + System.out.println(" if stmt begin,id=5 "); + + + + + + + + + + + System.out.println(" if stmt end,id=5 "); + } + } + catch( java.lang.ArithmeticException myExp_483 ) + { + for( var_484 = 830 ;(var_484<848);var_484 = (var_484+18) ) + { + if( false) + { + System.out.println(" if stmt begin,id=6 "); + + System.out.println(" if stmt end,id=6 "); + } + } + System.out.println("hello exception 5 !"); + } + System.out.println("hello exception 2 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_486 ) + { + for( var_487 = 509 ;(var_487<523);var_487 = (var_487+14) ) + { + try + { + try + { + final long var_488 = (-6988042582236234448L); + } + catch( java.lang.IllegalArgumentException myExp_489 ) + { + try + { + var_389.var_490 = var_4.var_492 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_493 ) + { + var_0 = (var_0--) ; + System.out.println("hello exception 8 !"); + } + System.out.println("hello exception 7 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_494 ) + { + try + { + if( (!(((var_230--)|var_156.var_161)850);var_305 = (var_305-15) ) + { + if( var_135.var_62.var_306) + { + System.out.println(" if stmt begin,id=17 "); + + System.out.println(" if stmt end,id=17 "); + } + else + { + System.out.println(" else stmt begin,id=4 "); + + System.out.println(" else stmt end,id=4 "); + } + } + } + System.out.println("hello exception 32 !"); + } + System.out.println("hello exception 25 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_310 ) + { + cl_51 var_329 = new cl_51(); + byte [][][] var_338 = {{{(byte)(57)},{(byte)(1)},{(byte)(-32)},{(byte)(-66)},{(byte)(96)},{(byte)(-71)},{(byte)(41)}},{{(byte)(-79)},{(byte)(59)},{(byte)(6)},{(byte)(49)},{(byte)(-68)},{(byte)(-94)},{(byte)(-28)}},{{(byte)(72)},{(byte)(97)},{(byte)(81)},{(byte)(-98)},{(byte)(56)},{(byte)(14)},{(byte)(-63)}},{{(byte)(106)},{(byte)(-54)},{(byte)(-47)},{(byte)(-14)},{(byte)(57)},{(byte)(25)},{(byte)(-101)}},{{(byte)(-68)},{(byte)(26)},{(byte)(-25)},{(byte)(-78)},{(byte)(37)},{(byte)(89)},{(byte)(95)}},{{(byte)(-25)},{(byte)(105)},{(byte)(58)},{(byte)(-82)},{(byte)(62)},{(byte)(-78)},{(byte)(-37)}},{{(byte)(94)},{(byte)(-11)},{(byte)(80)},{(byte)(40)},{(byte)(-93)},{(byte)(-54)},{(byte)(69)}}}; + byte var_364 = (byte)(103); + try + { + try + { + try + { + if( (((-(var_300++))&var_215.var_60)>=var_203)) + { + System.out.println(" if stmt begin,id=18 "); + + + + + + + + + + System.out.println(" if stmt end,id=18 "); + } + } + catch( java.lang.ArithmeticException myExp_313 ) + { + try + { + final int var_314 = (-1562973874); + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_315 ) + { + var_309[4][(((var_284--)-func_31(var_256 ,((var_153++)+( ( float )func_31(var_317 ,(((var_19++)*var_157)-( ( double )(214455977) )) ,((var_300--)-var_240.var_56) ,( ( long )(var_318--) ) ,var_291) )) ,(-(var_320++)) ,var_20.var_322 ,var_324))&6)][(((var_300--)-var_222)&5)] = (-1.0959F) ; + System.out.println("hello exception 37 !"); + } + System.out.println("hello exception 36 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_327 ) + { + try + { + try + { + int var_328 = (1092374932); + for( var_328 = 229 ;(var_328<257);var_328 = (var_328+7) ) + { + var_256[(var_328&5)] = var_135 ; + } + } + catch( java.lang.IllegalArgumentException myExp_330 ) + { + try + { + int var_331 = (-1686198831); + } + catch( java.lang.IllegalArgumentException myExp_332 ) + { + int var_333 = (-1782856456); + System.out.println("hello exception 40 !"); + } + System.out.println("hello exception 39 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_334 ) + { + for( var_336 = 551 ;(var_336<575);var_336 = (var_336+6) ) + { + byte var_337 = (byte)(126); + double var_340 = (3.292e-219D); + final boolean [] var_354 = {false,true,false}; + float var_345 = (-1.46852e-08F); + if( (!(!(!(((var_1++)|func_16((--var_337)))>=var_203))))) + { + System.out.println(" if stmt begin,id=19 "); + + + System.out.println(" if stmt end,id=19 "); + } + } + System.out.println("hello exception 41 !"); + } + System.out.println("hello exception 38 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_356 ) + { + double var_357 = (2.69979e+247D); + boolean [] var_379 = {true,false,false}; + if( (!(((~(--var_300))+var_357)>var_203))) + { + System.out.println(" if stmt begin,id=20 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" if stmt end,id=20 "); + } + else + { + System.out.println(" else stmt begin,id=5 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" else stmt end,id=5 "); + } + System.out.println("hello exception 42 !"); + } + System.out.println("hello exception 33 !"); + } + return var_384; +} +public strictfp byte func_16(long var_17) +{ + short var_260 = (short)(-10063); + try + { + cl_51 var_241 = new cl_51(); + int var_18 = (304465940); + int var_259 = (1528873124); + for( var_18 = 717 ;(var_18<742);var_18 = (var_18+5) ) + { + byte var_257 = (byte)(-13); + if( ((var_19--)==var_20.var_21)) + { + System.out.println(" if stmt begin,id=23 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" if stmt end,id=23 "); + } + else + { + System.out.println(" else stmt begin,id=8 "); + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" else stmt end,id=8 "); + } + } + } + catch( java.lang.ArithmeticException myExp_265 ) + { + try + { + int var_266 = (-442155902); + for( var_266 = 759 ;(var_266<776);var_266 = (var_266+17) ) + { + cl_51 [] var_267 = {new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51()}; + if( ((var_260++)<=(byte)(6))) + { + System.out.println(" if stmt begin,id=27 "); + + + + + + + + + + + + + + + + + + + + + + System.out.println(" if stmt end,id=27 "); + } + } + } + catch( java.lang.IllegalArgumentException myExp_278 ) + { + int var_279 = (-1854149506); + for( var_279 = 941 ;(var_279<965);var_279 = (var_279+6) ) + { + cl_59 var_280 = new cl_59(); + var_215 = var_215 ; + } + System.out.println("hello exception 58 !"); + } + System.out.println("hello exception 55 !"); + } + return (var_281--); +} +public static strictfp boolean func_22(long var_23) +{ + int var_214 = (1255498373); + byte var_225 = (byte)(98); + short var_212 = (short)(28944); + final float var_223 = (-1.36408e-09F); + try + { + byte var_24 = (byte)(110); + short var_182 = (short)(6025); + int [][] var_29 = {{(-587612506),(-445800556),(-1615512773),(178338241),(-809407755),(-401296445),(875199635)},{(-426571350),(-254572884),(-1244636353),(645963721),(24150517),(272891121),(-2051935695)},{(494064579),(-1596281637),(935124354),(-1763600048),(-113409403),(1615963022),(407948078)},{(2090349425),(-42174328),(-234403325),(-694287812),(1652522541),(-967172378),(881437954)},{(427927454),(980103159),(-716062976),(-435941015),(-2036159953),(-1341038004),(599183728)}}; + if( (!(!((var_24--)==var_4.var_25)))) + { + System.out.println(" if stmt begin,id=29 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" if stmt end,id=29 "); + } + } + catch( java.lang.ArithmeticException myExp_208 ) + { + final cl_12 var_209 = new cl_12(); + byte var_213 = (byte)(62); + try + { + var_7 = var_7 ; + } + catch( java.lang.ArithmeticException myExp_210 ) + { + cl_51 [] var_211 = {new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51(),new cl_51()}; + final cl_59 var_218 = new cl_59(); + if( (!(!((++var_168)>func_31(var_211 ,(-(--var_212)) ,(~(var_23++)) ,(var_23--) ,var_193))))) + { + System.out.println(" if stmt begin,id=31 "); + + + + System.out.println(" if stmt end,id=31 "); + } + else + { + System.out.println(" else stmt begin,id=10 "); + + + + + + + + + + + + + + + + + + + + + + System.out.println(" else stmt end,id=10 "); + } + System.out.println("hello exception 69 !"); + } + System.out.println("hello exception 68 !"); + } + return (!(!(!(!(((-(var_222++))*var_223)<=func_31(var_170 ,(++var_225) ,(+(var_227++)) ,var_229[((+(var_231++))&5)][((var_230++)&5)] ,var_20.var_233)))))); +} +public static strictfp int func_31(cl_51[] var_32, double var_33, float var_34, long var_35, boolean[] var_36) +{ + short var_137 = (short)(-10269); + byte var_141 = (byte)(82); + short var_140 = (short)(9045); + boolean [][][] var_139 = {{{true,true},{true,false},{true,true},{false,false},{true,false},{false,false},{true,true}},{{true,true},{false,true},{false,false},{false,true},{true,false},{true,true},{true,true}},{{false,false},{true,true},{false,true},{false,false},{false,false},{false,false},{true,false}},{{true,false},{false,true},{true,false},{false,true},{true,false},{true,true},{false,false}},{{true,true},{true,false},{true,true},{false,true},{false,true},{true,true},{false,true}}}; + float [] var_169 = {(3.11991e-33F),(-3907.38F),(-9.34478e-33F),(-1.09273e+08F),(6.28196e-27F),(-2.42891e+08F),(-2.3356e-38F)}; + byte var_142 = (byte)(98); + double var_160 = (-6.71772e+21D); + long var_163 = (11366163339587401L); + if( var_135.func_37((!(!(!((--var_34)>=var_136)))) ,(!(!((--var_137)==var_19))) ,var_138 ,var_139[((var_142--)&4)][(((var_141++)|var_30)&6)][(((++var_140)-var_136)&1)] ,var_143.var_60)) + { + System.out.println(" if stmt begin,id=33 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" if stmt end,id=33 "); + } + else + { + System.out.println(" else stmt begin,id=12 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" else stmt end,id=12 "); + } + return ((var_168--)|( ( int )((++var_136)&( ( long )var_169[((+(--var_19))&6)] )) )); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1897); + CrcCheck.ToByteArray(this.var_1,b,"var_1"); + CrcCheck.ToByteArray(this.var_4.GetChecksum(),b,"var_4.GetChecksum()"); + CrcCheck.ToByteArray(this.var_7.GetChecksum(),b,"var_7.GetChecksum()"); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + CrcCheck.ToByteArray(this.var_20.GetChecksum(),b,"var_20.GetChecksum()"); + CrcCheck.ToByteArray(this.var_30,b,"var_30"); + CrcCheck.ToByteArray(this.var_135.GetChecksum(),b,"var_135.GetChecksum()"); + CrcCheck.ToByteArray(this.var_136,b,"var_136"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_138[a0][a1][a2].GetChecksum(),b,"var_138" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_143.GetChecksum(),b,"var_143.GetChecksum()"); + CrcCheck.ToByteArray(this.var_151,b,"var_151"); + CrcCheck.ToByteArray(this.var_153,b,"var_153"); + CrcCheck.ToByteArray(this.var_156.GetChecksum(),b,"var_156.GetChecksum()"); + CrcCheck.ToByteArray(this.var_157,b,"var_157"); + CrcCheck.ToByteArray(this.var_168,b,"var_168"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_170[a0].GetChecksum(),b,"var_170" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_178,b,"var_178"); + CrcCheck.ToByteArray(this.var_185,b,"var_185"); + CrcCheck.ToByteArray(this.var_189,b,"var_189"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_193[a0],b,"var_193" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_199[a0],b,"var_199" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_203,b,"var_203"); + CrcCheck.ToByteArray(this.var_206,b,"var_206"); + CrcCheck.ToByteArray(this.var_215.GetChecksum(),b,"var_215.GetChecksum()"); + CrcCheck.ToByteArray(this.var_219,b,"var_219"); + CrcCheck.ToByteArray(this.var_222,b,"var_222"); + CrcCheck.ToByteArray(this.var_227,b,"var_227"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_229[a0][a1],b,"var_229" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_230,b,"var_230"); + CrcCheck.ToByteArray(this.var_231,b,"var_231"); + CrcCheck.ToByteArray(this.var_240.GetChecksum(),b,"var_240.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_246[a0],b,"var_246" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_247,b,"var_247"); + CrcCheck.ToByteArray(this.var_255,b,"var_255"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_256[a0].GetChecksum(),b,"var_256" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_263,b,"var_263"); + CrcCheck.ToByteArray(this.var_281,b,"var_281"); + CrcCheck.ToByteArray(this.var_284,b,"var_284"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_291[a0],b,"var_291" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_298,b,"var_298"); + CrcCheck.ToByteArray(this.var_305,b,"var_305"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_309[a0][a1][a2],b,"var_309" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_317[a0].GetChecksum(),b,"var_317" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_318,b,"var_318"); + CrcCheck.ToByteArray(this.var_320,b,"var_320"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_324[a0],b,"var_324" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_326,b,"var_326"); + CrcCheck.ToByteArray(this.var_335,b,"var_335"); + CrcCheck.ToByteArray(this.var_336,b,"var_336"); + CrcCheck.ToByteArray(this.var_359,b,"var_359"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_368[a0][a1][a2],b,"var_368" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_384[a0],b,"var_384" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_387,b,"var_387"); + CrcCheck.ToByteArray(this.var_388.GetChecksum(),b,"var_388.GetChecksum()"); + CrcCheck.ToByteArray(this.var_389.GetChecksum(),b,"var_389.GetChecksum()"); + CrcCheck.ToByteArray(this.var_391,b,"var_391"); + CrcCheck.ToByteArray(this.var_394,b,"var_394"); + CrcCheck.ToByteArray(this.var_400,b,"var_400"); + CrcCheck.ToByteArray(this.var_401,b,"var_401"); + CrcCheck.ToByteArray(this.var_427,b,"var_427"); + CrcCheck.ToByteArray(this.var_429,b,"var_429"); + CrcCheck.ToByteArray(this.var_438,b,"var_438"); + CrcCheck.ToByteArray(this.var_442,b,"var_442"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_450[a0].GetChecksum(),b,"var_450" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_469,b,"var_469"); + CrcCheck.ToByteArray(this.var_471.GetChecksum(),b,"var_471.GetChecksum()"); + CrcCheck.ToByteArray(this.var_484,b,"var_484"); + CrcCheck.ToByteArray(this.var_487,b,"var_487"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_491[a0][a1][a2],b,"var_491" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_497[a0][a1][a2],b,"var_497" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/Start.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..026eb24d1dbfd0942160f72ffa61a18151a332e6 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_8.java cl_16.java cl_12.java CRC32.java cl_59.java cl_51.java CrcCheck.java cl_19.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_12.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_12.java new file mode 100644 index 0000000000000000000000000000000000000000..9b31edf967c75d0ddf8627323dd331f51e2f0e58 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_12.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1217165572 + +//import java.util.zip.CRC32; + +class cl_12 +{ + byte var_81 = (byte)(-96); + final float var_112 = (-4.47051e-33F); + final short var_125 = (short)(-5464); + float [][][] var_308 = {{{(3.6722e+14F),(-6.18495F),(8.41524e+07F),(1334.27F),(2.51303e-08F),(3.79881e-22F)},{(-3.86865e-28F),(-2.0147e-23F),(5.21183e-23F),(-1.88301e+10F),(-2.58313e-23F),(-1.67041e-10F)},{(7.96215e+15F),(4.70789e-09F),(-1.36946e-08F),(-1.46485e-32F),(36752.1F),(1.60984e+09F)},{(-1.27426e-13F),(5.67981e+36F),(1.36441e+12F),(2.46904e+11F),(-1.09666e+15F),(1.42691e-35F)},{(2.96039e+06F),(8.22745e-12F),(7.95806e-09F),(-7.87262e+19F),(1.10781e+18F),(-2.52176e+21F)},{(1.86561e-20F),(7.22447F),(1.55892e-24F),(-9.64016e-36F),(-1.74954e+15F),(7.05262e+06F)},{(-5.82789e-08F),(4.09471e-22F),(1.80884e+06F),(2.10745e+31F),(1.14064e+17F),(3.14657e-22F)}},{{(-2.69568e+29F),(2.71819e-07F),(-7.47003e+32F),(718754F),(2.90317e-31F),(4.69874e+29F)},{(3.86665e+37F),(-1.40945e+12F),(-3.20678e+25F),(-2.46068e-34F),(22.0961F),(3.16395e+09F)},{(-0.562878F),(1.8739e+33F),(-1126.25F),(1.44505e-37F),(8.06428e+30F),(3.33435e+06F)},{(6.53116e+08F),(-191.693F),(-1.67371e-09F),(3.17236e-29F),(-3.0746e-32F),(-2.661e-07F)},{(9.36328e-25F),(-5.84908e-28F),(2.05513e+17F),(8.53623e-20F),(6.46776e+33F),(1.87798e+10F)},{(6.48342e+27F),(2.42969e+17F),(7.75273e-32F),(2842.8F),(-2.43237e+22F),(-0.0154266F)},{(-3.39226e-26F),(-1.07023e+19F),(5.76376e-16F),(-77.7716F),(7.04736e+35F),(9.07306e+36F)}},{{(3.98573e-24F),(61.4174F),(3.47498e-34F),(-3.84117e+27F),(2.17924e-07F),(3.88433e-10F)},{(-1.23465e+30F),(2.37674e+38F),(496.397F),(1.19103e+17F),(2.98772e-18F),(1.77332e+10F)},{(-1.36047e-24F),(-2.7774e+28F),(-1.46524e-34F),(-9.56228e-25F),(1.25529e+20F),(1.41911e-38F)},{(6.86917e+10F),(1.01343e-21F),(-1165.09F),(-1.9799e-21F),(-0.224028F),(4.40408e-09F)},{(4.78517e-18F),(-4.37797e+11F),(4.70615e-36F),(6.21309e+06F),(-0.0125678F),(2.47927e-24F)},{(8.17864e+33F),(-2.95535e-16F),(1.34025e-35F),(0.0021568F),(3.31259e+10F),(1.20327e+07F)},{(-169.615F),(-3.77726e+14F),(6.07845e+13F),(-6.25974e+37F),(-2.58637e+17F),(3.23537e-18F)}},{{(-7.89233e-10F),(4.40609e-37F),(-1.19836e-31F),(4.59105e-11F),(1.01835e-18F),(-2.65779e-21F)},{(1.17278e-24F),(-6.77956e+29F),(-6.7007e+31F),(-3.74498e+17F),(-1.15749e-26F),(-8.15094e+33F)},{(-1.90932e+11F),(-6.13397e+20F),(-3.97782e-23F),(3.54847e-26F),(-7.65608e+06F),(4.48708e+17F)},{(-9.02522e+27F),(8.62017e+24F),(2.69081e+26F),(-2.57139e+08F),(9.51327e+30F),(2.51017e+18F)},{(2.39746e-06F),(-0.00180289F),(3.3899e+13F),(-973443F),(13404.9F),(-2.38437e-20F)},{(-1.63544e+32F),(-3.52886e+37F),(8.72558e-07F),(4.48712e+15F),(-9.94669e-18F),(-1.00314e-06F)},{(1.17837e+17F),(-3.81529e-20F),(-7.63611e-23F),(2.38602e-18F),(-8.59437e+13F),(6.63706e-33F)}},{{(6.36659e+29F),(8.29746e+35F),(-1.21759e+18F),(-3.52217e-17F),(-1.83207e+21F),(-1.00677e-34F)},{(-1.74542e-22F),(-1.96945e+31F),(1.81541e-18F),(-121540F),(1.02564e+11F),(3.89465e-32F)},{(5.66148e+12F),(6.11592e+22F),(7.23846e-12F),(-1.69148e+31F),(-1.31538e-07F),(-3.29144e-25F)},{(-8.04905e-22F),(-7.58699e-07F),(1.73071e-16F),(1.50238e+25F),(5.89411e+30F),(-3.11306e+10F)},{(-5.27475e+09F),(-1.17944e-30F),(-4.76207e-35F),(-1.09271e-21F),(6.26504e+33F),(2.59276e+35F)},{(4.08629e+34F),(-3.37733e+11F),(1.15683e+36F),(-6.45448e-20F),(-6.76713e+29F),(-5.13435e+13F)},{(4.76246e+06F),(1.06468e-17F),(0.0469628F),(1.37582e-40F),(8.45312e+11F),(1.76688e-26F)}}}; + byte [][][] var_371 = {{{(byte)(-29)},{(byte)(23)},{(byte)(-114)},{(byte)(-37)},{(byte)(84)},{(byte)(-71)},{(byte)(94)}},{{(byte)(73)},{(byte)(-62)},{(byte)(86)},{(byte)(-33)},{(byte)(-36)},{(byte)(117)},{(byte)(89)}},{{(byte)(-62)},{(byte)(23)},{(byte)(112)},{(byte)(-117)},{(byte)(-103)},{(byte)(-92)},{(byte)(23)}},{{(byte)(108)},{(byte)(6)},{(byte)(25)},{(byte)(31)},{(byte)(-43)},{(byte)(58)},{(byte)(-118)}},{{(byte)(-69)},{(byte)(82)},{(byte)(-14)},{(byte)(101)},{(byte)(-17)},{(byte)(66)},{(byte)(15)}},{{(byte)(-63)},{(byte)(-72)},{(byte)(9)},{(byte)(-37)},{(byte)(-24)},{(byte)(38)},{(byte)(-56)}},{{(byte)(1)},{(byte)(-34)},{(byte)(-84)},{(byte)(17)},{(byte)(-96)},{(byte)(9)},{(byte)(15)}}}; + boolean var_381 = true; + int var_423 = (-1517130329); + long var_448 = (5618607935370727832L); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(909); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_112,b,"var_112"); + CrcCheck.ToByteArray(this.var_125,b,"var_125"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_308[a0][a1][a2],b,"var_308" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_371[a0][a1][a2],b,"var_371" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_381,b,"var_381"); + CrcCheck.ToByteArray(this.var_423,b,"var_423"); + CrcCheck.ToByteArray(this.var_448,b,"var_448"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_16.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_16.java new file mode 100644 index 0000000000000000000000000000000000000000..884cf3ddd0df504d4c144ce813a280cfb9119d93 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_16.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1217165572 + +//import java.util.zip.CRC32; + +class cl_16 +{ + byte var_50 = (byte)(16); + int var_70 = (2060073326); + boolean var_95 = false; + float var_109 = (-4.04952e+31F); + final short var_161 = (short)(-16992); + final boolean [] var_176 = {true,true,true}; + long var_365 = (-8163133472827597963L); + final byte [][][] var_372 = {{{(byte)(119)},{(byte)(-98)},{(byte)(17)},{(byte)(121)},{(byte)(-69)},{(byte)(-80)},{(byte)(48)}},{{(byte)(58)},{(byte)(118)},{(byte)(89)},{(byte)(80)},{(byte)(22)},{(byte)(107)},{(byte)(4)}},{{(byte)(-50)},{(byte)(0)},{(byte)(-103)},{(byte)(-66)},{(byte)(111)},{(byte)(17)},{(byte)(-108)}},{{(byte)(17)},{(byte)(118)},{(byte)(-101)},{(byte)(65)},{(byte)(-28)},{(byte)(-37)},{(byte)(-14)}},{{(byte)(30)},{(byte)(66)},{(byte)(6)},{(byte)(-14)},{(byte)(3)},{(byte)(-120)},{(byte)(84)}},{{(byte)(85)},{(byte)(-31)},{(byte)(41)},{(byte)(57)},{(byte)(120)},{(byte)(-108)},{(byte)(-91)}},{{(byte)(90)},{(byte)(101)},{(byte)(-101)},{(byte)(8)},{(byte)(-125)},{(byte)(48)},{(byte)(-56)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(72); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_95,b,"var_95"); + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + CrcCheck.ToByteArray(this.var_161,b,"var_161"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_176[a0],b,"var_176" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_365,b,"var_365"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_372[a0][a1][a2],b,"var_372" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_19.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_19.java new file mode 100644 index 0000000000000000000000000000000000000000..f6e2e5377521249aaa3e7056174172cef10d176e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_19.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1217165572 + +//import java.util.zip.CRC32; + +class cl_19 +{ + byte var_21 = (byte)(-64); + float var_63 = (-6.11338F); + int var_71 = (-1715378809); + double [] var_82 = {(-1.21331e-51D),(6.08906e-271D),(-1.91733e+250D),(-2.26286e+169D),(-3.37683e-255D)}; + double var_97 = (-4.51619e-263D); + boolean [] var_233 = {true,true,false}; + final boolean var_306 = true; + long var_322 = (6538640244752615634L); + short var_348 = (short)(-10444); + byte [][][] var_369 = {{{(byte)(-52)},{(byte)(-95)},{(byte)(-63)},{(byte)(34)},{(byte)(-7)},{(byte)(-62)},{(byte)(38)}},{{(byte)(-126)},{(byte)(41)},{(byte)(122)},{(byte)(-105)},{(byte)(-50)},{(byte)(76)},{(byte)(-5)}},{{(byte)(-126)},{(byte)(91)},{(byte)(43)},{(byte)(-29)},{(byte)(-15)},{(byte)(81)},{(byte)(-123)}},{{(byte)(83)},{(byte)(-86)},{(byte)(-116)},{(byte)(-71)},{(byte)(56)},{(byte)(108)},{(byte)(-74)}},{{(byte)(49)},{(byte)(-16)},{(byte)(-78)},{(byte)(68)},{(byte)(4)},{(byte)(55)},{(byte)(31)}},{{(byte)(-114)},{(byte)(-11)},{(byte)(-62)},{(byte)(-18)},{(byte)(108)},{(byte)(89)},{(byte)(-22)}},{{(byte)(57)},{(byte)(123)},{(byte)(57)},{(byte)(-8)},{(byte)(-42)},{(byte)(-87)},{(byte)(22)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(120); + CrcCheck.ToByteArray(this.var_21,b,"var_21"); + CrcCheck.ToByteArray(this.var_63,b,"var_63"); + CrcCheck.ToByteArray(this.var_71,b,"var_71"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_82[a0],b,"var_82" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_97,b,"var_97"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_233[a0],b,"var_233" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_306,b,"var_306"); + CrcCheck.ToByteArray(this.var_322,b,"var_322"); + CrcCheck.ToByteArray(this.var_348,b,"var_348"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_369[a0][a1][a2],b,"var_369" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_51.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_51.java new file mode 100644 index 0000000000000000000000000000000000000000..8d55ae197a635be19a825de8a232fe52dcb9dc16 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_51.java @@ -0,0 +1,369 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1217165572 + +//import java.util.zip.CRC32; + +class cl_51 +{ + static int var_43 = (1824443085); + static byte var_45 = (byte)(37); + static cl_8 var_47 = new cl_8(); + static cl_16 var_49 = new cl_16(); + static float var_56 = (-6.20332e-34F); + static cl_59 var_59 = new cl_59(); + static cl_19 var_62 = new cl_19(); + static short var_68 = (short)(8279); + static float var_72 = (-7285.99F); + static cl_12 var_80 = new cl_12(); + static int var_85 = (-1062313940); + static cl_19 [][][] var_91 = {{{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()},{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()},{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()}},{{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()},{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()},{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()}},{{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()},{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()},{new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19(),new cl_19()}}}; + static double [][] var_92 = {{(-5.19837e+250D),(-3.16396e+62D)},{(4.53764e-282D),(7.92634e-247D)},{(3.14412e+140D),(-1.05796e+219D)},{(-1.03641e-277D),(-1.05493e-162D)},{(-1.0929e-226D),(-1.26384e+40D)},{(-1.83286e+66D),(-2.23766e+68D)}}; + static double var_94 = (3.63809e-194D); + cl_16 var_96 = new cl_16(); + static int var_115 = (-184636284); + static cl_16 [][] var_116 = {{new cl_16(),new cl_16()}}; + final cl_16 [][] var_117 = {{new cl_16(),new cl_16()}}; +/*********************************/ +public static strictfp boolean func_37(boolean var_38, boolean var_39, cl_59[][][] var_40, boolean var_41, int var_42) +{ + cl_59 var_87 = new cl_59(); + cl_12 var_126 = new cl_12(); + for( var_43 = 374 ;(var_43<380);var_43 = (var_43+2) ) + { + int var_52 = (-163071080); + int var_78 = (808197840); + byte var_44 = (byte)(27); + if( ((++var_44)>( ( float )(++var_45) ))) + { + System.out.println(" if stmt begin,id=38 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" if stmt end,id=38 "); + } + else + { + System.out.println(" else stmt begin,id=16 "); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.out.println(" else stmt end,id=16 "); + } + } + return ((var_45--)!=( ( int )(--var_45) )); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(639); + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + CrcCheck.ToByteArray(this.var_47.GetChecksum(),b,"var_47.GetChecksum()"); + CrcCheck.ToByteArray(this.var_49.GetChecksum(),b,"var_49.GetChecksum()"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_59.GetChecksum(),b,"var_59.GetChecksum()"); + CrcCheck.ToByteArray(this.var_62.GetChecksum(),b,"var_62.GetChecksum()"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + CrcCheck.ToByteArray(this.var_80.GetChecksum(),b,"var_80.GetChecksum()"); + CrcCheck.ToByteArray(this.var_85,b,"var_85"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_91[a0][a1][a2].GetChecksum(),b,"var_91" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_92[a0][a1],b,"var_92" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_94,b,"var_94"); + CrcCheck.ToByteArray(this.var_96.GetChecksum(),b,"var_96.GetChecksum()"); + CrcCheck.ToByteArray(this.var_115,b,"var_115"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_116[a0][a1].GetChecksum(),b,"var_116" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_117[a0][a1].GetChecksum(),b,"var_117" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_59.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_59.java new file mode 100644 index 0000000000000000000000000000000000000000..4e62ea79d6d3788635800d1d16f5c0ff961c18f3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_59.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1217165572 + +//import java.util.zip.CRC32; + +class cl_59 +{ + int var_60 = (-462113519); + double var_69 = (1.06473e+16D); + short var_76 = (short)(-13584); + byte var_79 = (byte)(-119); + boolean var_93 = true; + float [][][] var_307 = {{{(-2.3377e+21F),(4.13261e+33F),(3.02247e-33F),(-1.20349e+28F),(-6.46887e-16F),(4.94e+34F)},{(-1.30297e-06F),(-5.68722e+06F),(-0.00444716F),(-5.1476e+10F),(-6.97358e-08F),(-2.04436e+07F)},{(4.04423e+12F),(1.0742e-37F),(1.66285e-15F),(5.08968e+37F),(-7.21431e+31F),(-4.33277F)},{(-0.00845369F),(-5.17383e+30F),(-4.50902e+35F),(-4.20422e-13F),(677.538F),(4.80139e-13F)},{(1.08051e-19F),(6.72393e+14F),(-1.50698e-35F),(-5.5308e+16F),(8.23738e+17F),(-2.5773e-18F)},{(-7.16287e-36F),(3.8423e-06F),(2.13644e-33F),(1.45364e-33F),(2.99009e+14F),(-2.92759e+32F)},{(6.20495e+23F),(-47378.6F),(-1.90976e+34F),(-7.43147e+23F),(-4.4901e-16F),(-501882F)}},{{(3.86605e-27F),(12.5868F),(5.55132e-12F),(7.90446F),(-1.34672e-32F),(-1.99276e+11F)},{(-1.09153e+20F),(-2.00276e+25F),(-1.0599e-31F),(1.75084e-33F),(-1.66543e-38F),(-1.36195e+19F)},{(1.57016e+06F),(-1.63165e-17F),(47.0092F),(1.04118e+09F),(-2.37509e+33F),(-1.16627e+26F)},{(-3.41551e-21F),(5.05432e-10F),(4.70029e+34F),(-1.68299e-05F),(2.1682e+23F),(-2.75907e+08F)},{(-2.31283e-19F),(-4.00555e-22F),(-4.71788e-10F),(-2.35178e+09F),(-4.88427e+24F),(-0.0249675F)},{(-1.74446e+29F),(-9.32969e-10F),(-1.60807e-28F),(1.58748e-12F),(-536477F),(-8.35544e+19F)},{(-1.98175e+21F),(4.78293e-35F),(1.50093e+07F),(5.0879e+35F),(-6.13012e-14F),(-1.02113e-29F)}},{{(-1.2951e-15F),(2.82013e-23F),(-1.45936e+18F),(-3.90282F),(-1.41552e+25F),(-1.10285e-19F)},{(-1.6163e-33F),(2.34534e-34F),(-2.19518e+17F),(5.00808e-30F),(-3.34717e+38F),(1.13864e-24F)},{(-1.44191e-14F),(-5.73219e+37F),(-3.37904e+27F),(-6.28456e-22F),(5.56325e-31F),(-7.20992e-21F)},{(-9.13714e+19F),(-3.04224e-30F),(-9.90052e+14F),(-2.73702e+25F),(8.36524e-09F),(8.03909e+29F)},{(-1.40121e-34F),(4.83509e+15F),(-4.37122e-23F),(-1.18473e-08F),(5.74596e+18F),(1.00715e+18F)},{(1.02084e-32F),(1.10729e+32F),(-1.35557e+20F),(5.52111e-37F),(-1.0739e+08F),(-2.65332e-37F)},{(1.8306e-22F),(-4.22281e-12F),(3.72564e-32F),(1.26106e+20F),(1.83862e+13F),(3.33952e-23F)}},{{(-2.36209e+09F),(-2.62778e-33F),(-1.74073e+27F),(8.73553e+13F),(8.70882e+09F),(-7.04326e+34F)},{(6.03277e-10F),(4.75825e-28F),(2.92567e+10F),(-2.83063e+16F),(2.48324e-34F),(-2.74156e-20F)},{(-3.12445e-11F),(9.95865e+11F),(-3.25765e+38F),(-2.85247e+20F),(-1.4241e+25F),(-3.33903e+29F)},{(-4.92853e+33F),(0.00117464F),(-23499.7F),(-1.26643e-11F),(2.36342e-17F),(-0.116922F)},{(-1.17862e+14F),(-9.74876e+28F),(1.54475e-26F),(1.35643e-28F),(3.86822e-19F),(7.12192e+13F)},{(3.17343e-30F),(-1.16969e+19F),(-221207F),(-219624F),(3.25757e+34F),(6.53015e+26F)},{(-0.000906924F),(-1.30069e-12F),(4.64053e+27F),(-1.97702e-23F),(1.03609e+15F),(847.223F)}},{{(6.3779e+32F),(1.93404e-30F),(-5.0393e-39F),(301102F),(4.69092e-37F),(1.89607e+36F)},{(4.69803e-38F),(1.37477e-23F),(2.69608e-16F),(950291F),(-8.01139e-23F),(1.3125e+06F)},{(-1.33771e+19F),(-3.06167e+28F),(-5.35226e-10F),(0.000588124F),(-2.31881e-17F),(7.42443e+14F)},{(2.00966e+37F),(7.16912e-05F),(-1.11896e+26F),(6.7425e+37F),(1.16588e+26F),(-1.05385e-16F)},{(6.40955e+09F),(2.7977e-14F),(-2.84574e-08F),(-3.60561e+23F),(1.64912e-38F),(1.3583e-09F)},{(1.96381e-29F),(-2.36316e-25F),(-2.98848e-38F),(-1.07027e-17F),(45819.5F),(-2.96658e-28F)},{(6.06431e-15F),(-8.07945e-21F),(-4.34771e+32F),(0.000135569F),(9.2433e+37F),(-2.40983e-27F)}}}; + byte [][][] var_370 = {{{(byte)(55)},{(byte)(78)},{(byte)(-117)},{(byte)(14)},{(byte)(-86)},{(byte)(-75)},{(byte)(-17)}},{{(byte)(50)},{(byte)(-49)},{(byte)(-57)},{(byte)(57)},{(byte)(84)},{(byte)(44)},{(byte)(-42)}},{{(byte)(-115)},{(byte)(18)},{(byte)(-46)},{(byte)(-89)},{(byte)(82)},{(byte)(-14)},{(byte)(-88)}},{{(byte)(34)},{(byte)(-2)},{(byte)(12)},{(byte)(-35)},{(byte)(96)},{(byte)(-16)},{(byte)(29)}},{{(byte)(94)},{(byte)(-89)},{(byte)(3)},{(byte)(104)},{(byte)(91)},{(byte)(125)},{(byte)(1)}},{{(byte)(114)},{(byte)(-105)},{(byte)(-2)},{(byte)(96)},{(byte)(53)},{(byte)(-42)},{(byte)(-54)}},{{(byte)(-2)},{(byte)(-9)},{(byte)(-47)},{(byte)(115)},{(byte)(9)},{(byte)(5)},{(byte)(58)}}}; + boolean [] var_417 = {true,true,true}; + float [][][] var_490 = {{{(-7.37783e-09F),(-3.46814e-16F)},{(3.82153e+08F),(2.09587e-38F)},{(-1.04072e-36F),(-3.67064e+20F)}},{{(3.93971e-11F),(3.83761e+18F)},{(-4.3117e+28F),(7.00587e-29F)},{(6.80165e-24F),(-1.02705e+13F)}},{{(1.72757e+28F),(-2.51302e+12F)},{(2.84424e+10F),(-1.34073e+27F)},{(-2.57014e+34F),(2.7946e+32F)}},{{(-8.48193e+12F),(1.04399e+20F)},{(-6.2066e-24F),(-1.10365e-16F)},{(3.56074e+18F),(-3.28487e-25F)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1004); + CrcCheck.ToByteArray(this.var_60,b,"var_60"); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_93,b,"var_93"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_307[a0][a1][a2],b,"var_307" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_370[a0][a1][a2],b,"var_370" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_417[a0],b,"var_417" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_490[a0][a1][a2],b,"var_490" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_8.java b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_8.java new file mode 100644 index 0000000000000000000000000000000000000000..9e906adb811b2dc8fafa2da309af6748060e347e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/800_2018120416411/cl_8.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1217165572 + +//import java.util.zip.CRC32; + +class cl_8 +{ + boolean [] var_8 = {true,false,false}; + byte var_25 = (byte)(18); + double var_51 = (1.70053e-214D); + long var_58 = (7614955000069593042L); + int var_66 = (1010800474); + double [] var_83 = {(-3.11422e+91D),(8.33068e-275D),(-1.97117e-245D),(-1.18694e-117D),(-1.73866e+29D)}; + short var_154 = (short)(5237); + final float var_167 = (1.74644e-13F); + boolean var_205 = false; + byte [][][] var_373 = {{{(byte)(14)},{(byte)(-126)},{(byte)(-122)},{(byte)(38)},{(byte)(110)},{(byte)(-75)},{(byte)(-62)}},{{(byte)(-107)},{(byte)(-87)},{(byte)(-70)},{(byte)(37)},{(byte)(28)},{(byte)(41)},{(byte)(18)}},{{(byte)(38)},{(byte)(-51)},{(byte)(12)},{(byte)(-122)},{(byte)(33)},{(byte)(-35)},{(byte)(-74)}},{{(byte)(-126)},{(byte)(-36)},{(byte)(86)},{(byte)(-74)},{(byte)(-92)},{(byte)(-124)},{(byte)(97)}},{{(byte)(5)},{(byte)(-11)},{(byte)(76)},{(byte)(33)},{(byte)(92)},{(byte)(100)},{(byte)(-12)}},{{(byte)(27)},{(byte)(72)},{(byte)(29)},{(byte)(42)},{(byte)(-104)},{(byte)(85)},{(byte)(-68)}},{{(byte)(-43)},{(byte)(111)},{(byte)(69)},{(byte)(62)},{(byte)(-127)},{(byte)(12)},{(byte)(-125)}}}; + float [][][] var_492 = {{{(-1.70835e-07F),(5.57924e-10F)},{(0.365472F),(2.46394e-19F)},{(1.59439e-09F),(-1.55721e-07F)}},{{(9.87914e-32F),(1.76375e+14F)},{(8.95587e+16F),(3.36658e-18F)},{(3.44704e-38F),(0.0897001F)}},{{(4.74537e+32F),(8.25314e-17F)},{(2.17595e+34F),(1.23368e-18F)},{(-2.84838e-22F),(1.38383e-19F)}},{{(6.96508e-11F),(2.09148e+18F)},{(-1.58819e-24F),(1.11326e+28F)},{(7.46797e-11F),(-2.58108e+32F)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(216); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_8[a0],b,"var_8" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_25,b,"var_25"); + CrcCheck.ToByteArray(this.var_51,b,"var_51"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_83[a0],b,"var_83" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_154,b,"var_154"); + CrcCheck.ToByteArray(this.var_167,b,"var_167"); + CrcCheck.ToByteArray(this.var_205,b,"var_205"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_373[a0][a1][a2],b,"var_373" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_492[a0][a1][a2],b,"var_492" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8068_2018110811698/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/8068_2018110811698/MainClass.java b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..0056114e1768343e4db25a938056f24809f129cc --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/MainClass.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2069637170 + +import java.util.zip.CRC32; + +class MainClass +{ + final boolean var_0 = true; + boolean [] var_2 = {false,false}; + cl_8 var_83 = new cl_8(); + byte var_85 = (byte)(-34); + cl_17 var_86 = new cl_17(); + cl_8 var_99 = new cl_8(); + final cl_34 var_107 = new cl_34(); + cl_8 var_109 = new cl_8(); + double [][][] var_111 = {{{(2.68324e-211D),(-1.63381e-206D)},{(3.06936e+209D),(1.02522e-203D)}},{{(-1.38889e+84D),(2.08644e+270D)},{(2.25298e+282D),(2.52566e-142D)}},{{(2.05177e-294D),(-3.14395e+11D)},{(5.54954e+259D),(-2.40273e-100D)}},{{(-2.15281e+66D),(-9.91158e+266D)},{(5.49126e-90D),(1.40017e-102D)}}}; + int var_114 = (-2096137368); + int var_120 = (389382918); + float var_121 = (-2.24347e-05F); + final short var_122 = (short)(16632); +/*********************************/ +public strictfp void run() +{ + byte var_106 = (byte)(37); + try + { + short var_3 = (short)(18516); + try + { + long var_94 = (-1809437483882687760L); + try + { + cl_8 var_89 = new cl_8(); + long var_92 = (4736856454249014806L); + var_2[(((--var_3)+func_4(var_86.var_25.var_87 ,var_89 ,(-7.84389e+234D) ,var_92 ,(++var_94)))&1)] = var_2[((~(++var_85))&1)] ; + } + catch( java.lang.IllegalArgumentException myExp_96 ) + { + long var_97 = (-5628341308990273530L); + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.ArithmeticException myExp_98 ) + { + var_83 = var_99 ; + System.out.println("hello exception 1 !"); + } + } + catch( java.lang.ArithmeticException myExp_100 ) + { + int var_103 = (651145383); + try + { + short var_116 = (short)(9690); + try + { + int [][][] var_102 = {{{(-1173319625)}},{{(-1808601050)}},{{(2061853429)}}}; + var_102[(((var_106--)+func_4(var_107.var_87 ,var_109 ,var_111[((var_103--)&3)][((var_106++)&1)][(((var_85--)+var_85)&1)] ,(+(var_85++)) ,(var_114++)))&2)][((+(var_106--))&0)][((((((var_103++)-(short)(8645))|(byte)(-86))+var_86.var_38)|var_83.var_104.var_105)&0)] = (--var_116) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_117 ) + { + long var_118 = (-4429543518404253823L); + System.out.println("hello exception 3 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_119 ) + { + for( var_120 = 259 ;(var_120>164);var_120 = (var_120-19) ) + { + var_111[((++var_85)&3)][((var_85++)&1)][(((var_114--)|var_122)&1)] = ( ( double )(--var_103) ) ; + } + System.out.println("hello exception 4 !"); + } + System.out.println("hello exception 2 !"); + } + return ; +} +public strictfp short func_4(double[][] var_5, cl_8 var_6, double var_7, long var_8, long var_9) +{ + byte var_11 = (byte)(1); + float var_84 = (0.000877744F); + byte var_10 = (byte)(-128); + var_5[(((--var_11)|var_83.func_12())&5)][((var_10--)&0)] = (var_84--) ; + return (--var_85); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(186); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_2[a0],b,"var_2" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_83.GetChecksum(),b,"var_83.GetChecksum()"); + CrcCheck.ToByteArray(this.var_85,b,"var_85"); + CrcCheck.ToByteArray(this.var_86.GetChecksum(),b,"var_86.GetChecksum()"); + CrcCheck.ToByteArray(this.var_99.GetChecksum(),b,"var_99.GetChecksum()"); + CrcCheck.ToByteArray(this.var_107.GetChecksum(),b,"var_107.GetChecksum()"); + CrcCheck.ToByteArray(this.var_109.GetChecksum(),b,"var_109.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_111[a0][a1][a2],b,"var_111" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CrcCheck.ToByteArray(this.var_120,b,"var_120"); + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + CrcCheck.ToByteArray(this.var_122,b,"var_122"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8068_2018110811698/Start.java b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..8a773f9c265e874635fb32f1e5323df572d9d37c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_8.java cl_34.java cl_17.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_17.java b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_17.java new file mode 100644 index 0000000000000000000000000000000000000000..fd484ff00b002c201892333bc0193cc652616cfc --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_17.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2069637170 + +import java.util.zip.CRC32; + +class cl_17 +{ + static int var_24 = (-1193360252); + static cl_34 var_25 = new cl_34(); + static short var_37 = (short)(-28007); + static byte var_38 = (byte)(85); + static long var_44 = (2803908987622666433L); + final static boolean [][][] var_45 = {{{false,true,false},{false,true,true},{true,false,false},{false,false,false},{true,true,true},{true,true,false},{false,false,true}}}; + static float var_49 = (-8.09174e-36F); + static boolean [][] var_52 = {{false,false,true,false,false},{false,false,false,true,true}}; + static byte [][][] var_55 = {{{(byte)(-127),(byte)(61),(byte)(-80),(byte)(-128),(byte)(-91),(byte)(71),(byte)(110)},{(byte)(-53),(byte)(-87),(byte)(125),(byte)(-53),(byte)(-76),(byte)(78),(byte)(-65)},{(byte)(-42),(byte)(-41),(byte)(-6),(byte)(-105),(byte)(0),(byte)(-120),(byte)(-91)},{(byte)(-24),(byte)(-40),(byte)(-101),(byte)(91),(byte)(26),(byte)(-92),(byte)(-85)},{(byte)(2),(byte)(79),(byte)(47),(byte)(58),(byte)(-88),(byte)(76),(byte)(-71)}},{{(byte)(-3),(byte)(-86),(byte)(-55),(byte)(42),(byte)(101),(byte)(-44),(byte)(-58)},{(byte)(-50),(byte)(-96),(byte)(60),(byte)(45),(byte)(-106),(byte)(-123),(byte)(77)},{(byte)(117),(byte)(-28),(byte)(-66),(byte)(-71),(byte)(98),(byte)(-9),(byte)(60)},{(byte)(44),(byte)(105),(byte)(-84),(byte)(-102),(byte)(-64),(byte)(124),(byte)(-77)},{(byte)(125),(byte)(77),(byte)(-19),(byte)(-27),(byte)(-86),(byte)(-90),(byte)(9)}},{{(byte)(-14),(byte)(-7),(byte)(39),(byte)(110),(byte)(-119),(byte)(73),(byte)(52)},{(byte)(113),(byte)(-102),(byte)(-118),(byte)(74),(byte)(75),(byte)(19),(byte)(27)},{(byte)(89),(byte)(44),(byte)(86),(byte)(42),(byte)(119),(byte)(-81),(byte)(-46)},{(byte)(-54),(byte)(98),(byte)(-61),(byte)(64),(byte)(31),(byte)(32),(byte)(-63)},{(byte)(-86),(byte)(-6),(byte)(0),(byte)(-63),(byte)(115),(byte)(83),(byte)(98)}},{{(byte)(-2),(byte)(43),(byte)(59),(byte)(85),(byte)(-28),(byte)(10),(byte)(60)},{(byte)(-75),(byte)(-118),(byte)(-4),(byte)(96),(byte)(-71),(byte)(-3),(byte)(-37)},{(byte)(93),(byte)(67),(byte)(73),(byte)(98),(byte)(-114),(byte)(58),(byte)(11)},{(byte)(101),(byte)(-6),(byte)(44),(byte)(-72),(byte)(114),(byte)(-94),(byte)(118)},{(byte)(-76),(byte)(-59),(byte)(-9),(byte)(8),(byte)(-7),(byte)(98),(byte)(-76)}}}; + static int var_58 = (-1783180606); + static int var_65 = (2045911256); +/*********************************/ +public static strictfp int func_22() +{ + byte var_23 = (byte)(-20); + byte var_68 = (byte)(-91); + if( (!(!((var_23--)!=( ( byte )var_24 ))))) + { + try + { + try + { + var_25 = var_25 ; + var_23 = func_27() ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_60 ) + { + var_23 = (var_23--) ; + System.out.println("hello exception 9 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_61 ) + { + try + { + var_23 = (var_38--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_62 ) + { + boolean var_63 = true; + System.out.println("hello exception 11 !"); + } + System.out.println("hello exception 10 !"); + } + } + else + { + short var_64 = (short)(1129); + if( (!((var_64++)>(byte)(113)))) + { + for( var_65 = 454 ;(var_65>394);var_65 = (var_65-15) ) + { + var_55[(((++var_23)|var_24)&3)][((var_64++)&4)][6] = var_55[3][(((--var_23)+( ( int )(var_23--) ))&4)][((-(--var_24))&6)] ; + } + } + else + { + int var_67 = (2099783316); + try + { + var_64 = (var_38++) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_66 ) + { + var_55[((var_67++)&3)][(((++var_38)|func_27())&4)][((var_67++)&6)] = (--var_23) ; + System.out.println("hello exception 12 !"); + } + } + } + return ((--var_68)*var_25.var_26); +} +public static strictfp byte func_27() +{ + boolean [][][] var_36 = {{{false,false,false},{true,true,true},{true,false,false},{false,false,false},{true,false,false},{true,false,true},{true,false,true}}}; + int var_28 = (1360487216); + byte var_59 = (byte)(17); + for( var_28 = 484 ;(var_28>439);var_28 = (var_28-15) ) + { + short var_56 = (short)(5929); + boolean [][] var_30 = {{true,false,true,false,false},{false,false,true,false,true}}; + try + { + byte [][][] var_50 = {{{(byte)(5),(byte)(-53),(byte)(-49),(byte)(67),(byte)(-35),(byte)(-105),(byte)(105)},{(byte)(-13),(byte)(-36),(byte)(-104),(byte)(70),(byte)(-109),(byte)(-80),(byte)(89)},{(byte)(57),(byte)(26),(byte)(22),(byte)(122),(byte)(52),(byte)(-15),(byte)(37)},{(byte)(-20),(byte)(-77),(byte)(-87),(byte)(-53),(byte)(79),(byte)(-90),(byte)(-55)},{(byte)(126),(byte)(-75),(byte)(109),(byte)(-5),(byte)(79),(byte)(0),(byte)(-102)}},{{(byte)(-37),(byte)(-27),(byte)(-113),(byte)(-105),(byte)(-5),(byte)(116),(byte)(76)},{(byte)(-41),(byte)(39),(byte)(10),(byte)(8),(byte)(14),(byte)(24),(byte)(27)},{(byte)(90),(byte)(47),(byte)(-85),(byte)(-68),(byte)(-123),(byte)(-65),(byte)(-42)},{(byte)(-57),(byte)(-114),(byte)(-10),(byte)(-39),(byte)(-24),(byte)(0),(byte)(-88)},{(byte)(-100),(byte)(10),(byte)(-119),(byte)(-98),(byte)(77),(byte)(-17),(byte)(31)}},{{(byte)(-107),(byte)(-49),(byte)(-46),(byte)(-13),(byte)(126),(byte)(-21),(byte)(-24)},{(byte)(20),(byte)(91),(byte)(-29),(byte)(0),(byte)(-107),(byte)(81),(byte)(-78)},{(byte)(75),(byte)(119),(byte)(-70),(byte)(76),(byte)(45),(byte)(-8),(byte)(65)},{(byte)(-76),(byte)(-8),(byte)(-58),(byte)(-74),(byte)(50),(byte)(-43),(byte)(-2)},{(byte)(63),(byte)(-125),(byte)(88),(byte)(104),(byte)(-32),(byte)(29),(byte)(99)}},{{(byte)(-109),(byte)(-111),(byte)(-85),(byte)(-82),(byte)(-3),(byte)(-12),(byte)(-111)},{(byte)(27),(byte)(67),(byte)(-71),(byte)(-70),(byte)(109),(byte)(-94),(byte)(66)},{(byte)(102),(byte)(-103),(byte)(-20),(byte)(69),(byte)(-84),(byte)(17),(byte)(-38)},{(byte)(-42),(byte)(-123),(byte)(28),(byte)(-98),(byte)(-91),(byte)(-16),(byte)(-74)},{(byte)(27),(byte)(-75),(byte)(11),(byte)(-97),(byte)(3),(byte)(66),(byte)(-88)}}}; + int var_40 = (-1956790666); + double [] var_47 = {(-3.64796e+67D),(-3.24289e-307D)}; + int var_51 = (1709069334); + byte var_48 = (byte)(-48); + try + { + float var_33 = (-1.42272e+16F); + boolean [][] var_31 = {{true,true,false,false,false},{false,false,true,true,false}}; + cl_34 var_32 = new cl_34(); + var_30 = var_31 ; + var_25 = var_32 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_34 ) + { + byte var_39 = (byte)(103); + var_36[((var_38++)&0)][6][((var_37++)&2)] = ((++var_39)713);var_40 = (var_40-1) ) + { + boolean var_41 = true; + short var_42 = (short)(23427); + var_24 = (((var_42--)-var_25.var_43)&( ( int )var_44 )) ; + var_36 = var_45 ; + var_47[(var_40&1)] = (~(var_48--)) ; + var_48 = (var_38--) ; + var_49 = (var_51--) ; + var_30 = var_52 ; + var_51 = (var_48++) ; + var_47[(var_40&1)] = ((++var_48)-var_25.var_54) ; + var_50 = var_55 ; + var_52[((--var_48)&1)][((+(--var_38))&4)] = ((++var_56)!=var_24) ; + var_38 = (--var_48) ; + } + } + catch( java.lang.IllegalArgumentException myExp_57 ) + { + for( var_58 = 228 ;(var_58<276);var_58 = (var_58+16) ) + { + var_30 = var_52 ; + } + System.out.println("hello exception 14 !"); + } + } + return (--var_59); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(206); + CrcCheck.ToByteArray(this.var_24,b,"var_24"); + CrcCheck.ToByteArray(this.var_25.GetChecksum(),b,"var_25.GetChecksum()"); + CrcCheck.ToByteArray(this.var_37,b,"var_37"); + CrcCheck.ToByteArray(this.var_38,b,"var_38"); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_45[a0][a1][a2],b,"var_45" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_52[a0][a1],b,"var_52" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<7;++a2){ + CrcCheck.ToByteArray(this.var_55[a0][a1][a2],b,"var_55" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_34.java b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_34.java new file mode 100644 index 0000000000000000000000000000000000000000..35fc6d2ee64405f8d5f58c18ad659c7601a07f6a --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_34.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2069637170 + +import java.util.zip.CRC32; + +class cl_34 +{ + byte var_26 = (byte)(-6); + short var_43 = (short)(25942); + boolean [][][] var_46 = {{{true,true,true},{false,true,false},{true,false,true},{true,false,false},{false,false,false},{true,true,true},{false,false,false}}}; + boolean [][] var_53 = {{true,true,true,false,false},{false,true,false,false,true}}; + final double var_54 = (1.07083e-237D); + final double [][] var_87 = {{(-3.28007e-17D)},{(3.24734e-212D)},{(3.58298e-132D)},{(1.31852e-42D)},{(-2.83527e+293D)},{(-3.45904e+158D)}}; + final int var_105 = (310558442); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(94); + CrcCheck.ToByteArray(this.var_26,b,"var_26"); + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_46[a0][a1][a2],b,"var_46" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_53[a0][a1],b,"var_53" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_87[a0][a1],b,"var_87" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_8.java b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_8.java new file mode 100644 index 0000000000000000000000000000000000000000..fcafaed9da2f616e1bc5b1e91dcd5459a180fe2f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8068_2018110811698/cl_8.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2069637170 + +import java.util.zip.CRC32; + +class cl_8 +{ + cl_17 var_13 = new cl_17(); + cl_17 var_15 = new cl_17(); + int var_19 = (-762497677); + byte var_20 = (byte)(49); + boolean [][] var_75 = {{false,false,true,true,false}}; + boolean [] var_78 = {true}; + float var_81 = (-118.892F); + cl_34 var_104 = new cl_34(); +/*********************************/ +public strictfp byte func_12() +{ + short var_76 = (short)(31106); + try + { + byte var_21 = (byte)(89); + cl_17 var_16 = new cl_17(); + try + { + float [][][] var_18 = {{{(-1.34507e+36F),(-9.05176e+20F)}},{{(-3.07299e-22F),(1.70958e-23F)}}}; + try + { + var_15 = var_16 ; + var_18[((+(var_21++))&1)][((-(var_20--))&0)][((++var_19)&1)] = var_18[((+(var_20++))&1)][(((var_21--)|var_15.func_22())&0)][1] ; + } + catch( java.lang.ArithmeticException myExp_69 ) + { + var_16 = var_13 ; + System.out.println("hello exception 5 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_70 ) + { + final boolean [] var_71 = {true,false,true,false,false,false,false}; + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_72 ) + { + try + { + int var_73 = (-1810976236); + for( var_73 = 353 ;(var_73>344);var_73 = (var_73-3) ) + { + var_75[((-((--var_20)&var_15.func_22()))&0)][((var_76--)&4)] = (!((~(var_76--))>=var_15.var_38)) ; + } + } + catch( java.lang.IllegalArgumentException myExp_77 ) + { + double [] var_80 = {(-4.91994e+218D)}; + if( false) + { + var_80[((++var_20)&0)] = (var_81--) ; + } + else + { + byte var_82 = (byte)(24); + var_76 = (++var_82) ; + } + System.out.println("hello exception 8 !"); + } + System.out.println("hello exception 7 !"); + } + return (++var_20); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(39); + CrcCheck.ToByteArray(this.var_13.GetChecksum(),b,"var_13.GetChecksum()"); + CrcCheck.ToByteArray(this.var_15.GetChecksum(),b,"var_15.GetChecksum()"); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + CrcCheck.ToByteArray(this.var_20,b,"var_20"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_75[a0][a1],b,"var_75" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_78[a0],b,"var_78" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_104.GetChecksum(),b,"var_104.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8555_2018110812102/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/8555_2018110812102/MainClass.java b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..64585f3bfd671d833da4637437561cd9a47ca013 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/MainClass.java @@ -0,0 +1,287 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4141941138 + +import java.util.zip.CRC32; + +class MainClass +{ + boolean var_2 = false; + static long [] var_4 = {(-3773717197363638352L)}; + static byte var_5 = (byte)(-115); + static long var_10 = (-4377553331259553286L); + static short var_12 = (short)(-20583); + static cl_28 var_18 = new cl_28(); + static int var_25 = (-1230583093); + static cl_33 var_31 = new cl_33(); + static int var_33 = (434354797); + static cl_33 [][] var_37 = {{new cl_33(),new cl_33(),new cl_33()},{new cl_33(),new cl_33(),new cl_33()},{new cl_33(),new cl_33(),new cl_33()},{new cl_33(),new cl_33(),new cl_33()}}; + final float [] var_47 = {(-4.24882e+15F)}; + static cl_28 var_49 = new cl_28(); + static double var_64 = (-8.58758e+43D); + static short var_66 = (short)(31009); + static int var_73 = (-440029876); + static float var_76 = (-7.26355e+26F); + static short var_79 = (short)(-18347); + byte var_97 = (byte)(78); + byte var_107 = (byte)(62); + byte var_111 = (byte)(-14); + int var_113 = (1727448661); + long var_116 = (8261368454954444315L); +/*********************************/ +public strictfp void run() +{ + int var_0 = (-1235210439); + for( var_0 = 552 ;(var_0<616);var_0 = (var_0+16) ) + { + double [][][] var_8 = {{{(5.51568e+92D),(-5.38274e-50D),(4.01597e-202D),(4.87622e+132D),(8.6048e+113D)},{(-1.11186e+31D),(-7.22853e-134D),(6.38033e+223D),(-8.27642e-278D),(2.70882e+130D)},{(2.75463e+275D),(1.31328e-48D),(-2.85659e+24D),(4.44091e+163D),(-6.56109e-278D)},{(-9.12656e-307D),(-4.13967e-99D),(5.50813e-101D),(1.3431e+135D),(1.37577e-21D)},{(4.28697e-290D),(5.69343e+244D),(-1.28304e+293D),(7.64871e+290D),(2.83616e+132D)},{(9.82131e-48D),(-7.79422e+40D),(3.50814e-31D),(1.08861e+198D),(1.51336e-226D)},{(-2.84842e-176D),(-1.52797e+220D),(1.72186e+92D),(-6.23288e-284D),(2.0932e+232D)}},{{(1.27521e+277D),(-9.27397e-157D),(-1.32298e+77D),(-5.8806e+300D),(3.02262e+33D)},{(-1.03648e+155D),(-2.17472e-228D),(1.07497e+297D),(1.18992e-173D),(-1.1904e+194D)},{(4.45214e+151D),(-4.03845e+120D),(-3.52934e+252D),(-9.99633e+294D),(1.17157e-285D)},{(-1.27071e-50D),(1.53401e-39D),(-1.9649e-80D),(8.04822e-189D),(9.52044e+70D)},{(2.49973e+293D),(2.33587e+271D),(9.05078e+305D),(6.06646e-304D),(4.34685e+137D)},{(3.48884e-172D),(1.8682e+293D),(3.4868e-261D),(-2.96896e+22D),(-1.92214e-109D)},{(-1.86824e-164D),(-1.02341e+124D),(-5.65343e-243D),(-2.42396e-26D),(-2.13756e+20D)}},{{(-3.77922e+183D),(-2.04315e-178D),(5.83422e-215D),(5.3315e-262D),(-5.48778e-270D)},{(-0.00206655D),(-5.10173e+193D),(-3.23732D),(-4.83344e-08D),(-1.94308e-145D)},{(1.05131e+128D),(2.17573e+86D),(4.26417e-178D),(-1.67155e+65D),(-4.44444e-54D)},{(2.84398e-85D),(-1.68755e+48D),(-2.56244e-207D),(-5.72905e-211D),(-1.58595e-283D)},{(-5.66179e-103D),(7.75251e-228D),(2.89468e+25D),(1.3123e-253D),(1.40907e-286D)},{(-1.95704e+213D),(4.7351e+156D),(-2.38355e+101D),(-7.90601e-270D),(8.1047e+221D)},{(8.70978e+20D),(1.42522e-254D),(2286.62D),(5.48269e+253D),(4.16228e-255D)}},{{(1.03758e+283D),(-1.93518e-16D),(3.24218e+249D),(-1.77299e+16D),(-2.26087e+114D)},{(-2.34803e-179D),(1.47904e-25D),(1.61591e-87D),(3.91275e+257D),(-0.00750717D)},{(-4.99273e+240D),(-5.66726e+64D),(2.74941e-197D),(1.48101e+230D),(2.23354e-23D)},{(-1.61379e-195D),(3.16873e+130D),(-1.1537e-127D),(-1.05285e+253D),(4.78199e+123D)},{(2.14803e-220D),(-4.7969e+66D),(5.1791e-36D),(7.21787e-71D),(-3.30708e+51D)},{(2.01522e-249D),(1.62205e-93D),(4.28187e-288D),(1.82592e+100D),(-5.43085e+48D)},{(1.25709e-64D),(-1.23168e-94D),(-1.13588e+09D),(-1.58199e+270D),(-4.44033e+120D)}},{{(-5.42525e+62D),(-7.56824e-59D),(-1.10686e-107D),(-8.75376e-238D),(7.2204e-176D)},{(-1.32263e-151D),(4.25955e+217D),(-14680.6D),(-1.07178e-167D),(-1.38068e-152D)},{(-1.29163e+198D),(-4.50729e-106D),(-1.23734e-275D),(-1.3236e-05D),(1.30886e-247D)},{(-3.92234e-192D),(9.97808e+296D),(-1.33535e+51D),(-2.70177e+59D),(3.25081e+183D)},{(-6.98617e-170D),(1.08954e-251D),(3.07489e+72D),(-9.23661e+17D),(-2.49942e-104D)},{(6.59857e+204D),(8.53248e+297D),(1.23095e-18D),(7.2117e-273D),(3.98244e-261D)},{(-9.29777e-214D),(-2.39709e-202D),(4.32093e+09D),(-4.43285e-237D),(1.29859e+162D)}},{{(-1.57371e-204D),(-2.56299e-217D),(-9.0761e-112D),(-1.01596e+132D),(8.0639e+13D)},{(6.92208e-232D),(-26.6094D),(1.73072e+65D),(2.7845e+121D),(-3.77836e-93D)},{(-9.41798e+14D),(5.44654e-63D),(-4.80239e-80D),(-1.37785e+290D),(3.35999e+212D)},{(-8.30931e-279D),(3.91342e+270D),(2.84195e-96D),(-4.20345e+290D),(-2.15647e+83D)},{(-6.2449e-205D),(1.9891e-74D),(1.64714e-144D),(1.02059e+207D),(-1.15603e+128D)},{(6.01745e+181D),(1.36183e+25D),(-7.59864e+306D),(6.33709e+164D),(-4.96183e+66D)},{(-3.08432e+204D),(-5.64084e-289D),(4.44068e+165D),(2.39097e+201D),(7.77976e-147D)}},{{(-5.27008e+129D),(4.72321e-265D),(2.07521e-06D),(3.45049e-29D),(-2.214e-23D)},{(-8.74176e+136D),(1.94859e-229D),(-8.06551e+137D),(-9.99969e-260D),(-2.03684e+279D)},{(-2.94077e-262D),(-8.88558e-203D),(-6.87383e-113D),(-6.77276e-154D),(-2.6584e+111D)},{(-4.20369e-250D),(-1.04177e+83D),(2.49957e-214D),(-1.25083e+58D),(-6.20462e-114D)},{(-12.8981D),(6.34274e-198D),(7.74182e-106D),(-6.40677e+90D),(4.06522e+263D)},{(8.68331e-37D),(-2.76257e+16D),(1.92818e+101D),(-2.38642e-87D),(4.93785e-293D)},{(5.26056e+253D),(-1.49283e+108D),(-1.01603e-297D),(3.36598e+156D),(6.54228e-23D)}}}; + int var_1 = (910098915); + for( var_1 = 902 ;(var_1>887);var_1 = (var_1-5) ) + { + cl_33 var_122 = new cl_33(); + double [][][] var_9 = {{{(-1.16496e+282D),(8.77772e+17D),(-4.09236e+149D),(2.83198e-74D),(-3.18443e+53D)},{(-6.93099e-308D),(-2.27222e-76D),(-1.3292e-05D),(2.63265e-303D),(-1.23874e+72D)},{(1.44351e+93D),(-6.8425e+118D),(5.3275e+281D),(1.33461e-211D),(4.93503e-232D)},{(6.30349e+202D),(-1.45816e-272D),(-4.3068e-86D),(1.33002e-65D),(2.84782e+202D)},{(4.22369e-20D),(-3.13324e+158D),(4.22965e-36D),(1.85574e-64D),(-2.74438e-114D)},{(2.26578e-117D),(-4.06948e+52D),(1.10884e-126D),(-2.60177e+306D),(-1.85978e+207D)},{(-3.93014e+303D),(-7.54611e+248D),(1.41901e+179D),(6.30568e-150D),(-3.77393e+65D)}},{{(-6.33674e+36D),(5.45273e-116D),(-2.61384e-168D),(-4.31577e-268D),(-4.16899e-260D)},{(-1.83612e+96D),(2.6013e+257D),(1.58032e+136D),(1.48026e-266D),(-2.17905e+264D)},{(2.25145e+90D),(-2.24689e+15D),(9.584e+75D),(4.48863e-55D),(-1.20441e+94D)},{(-1.13247e-294D),(2.87023e+230D),(-3.6204e-243D),(-1.09712e+204D),(2.65437e+244D)},{(2.39343e+92D),(2.17772e+13D),(3.83057e-53D),(-1.89754e-84D),(7.05949e+137D)},{(-1.35682e-36D),(30574.1D),(-5.3752e+19D),(-2.17346e+252D),(-1.03261e+68D)},{(7.32485e+126D),(2.09216e-115D),(4.52289e+113D),(1.74721e+304D),(2.45157e-19D)}},{{(3.41804e-175D),(5.48284e+281D),(5.914e-101D),(-1.39198e-99D),(1.30654e-225D)},{(2.15868e+10D),(-1.7893e-120D),(2.52997e+210D),(-8.98425e-08D),(-2.42507e+63D)},{(1.12557e+196D),(-3.81426e-181D),(5.70444e+112D),(4.48383e+263D),(-3.35362e-91D)},{(-1.60803e-96D),(-2.93228e+212D),(2.48574e+248D),(-7.11244e+79D),(-3.42539e+216D)},{(1.82104e-156D),(1.48902e+299D),(-1.7146e-297D),(10994.9D),(-9.53057e+301D)},{(7.59703e-67D),(-2.56505e-67D),(3.57368e-257D),(-4.00728e-224D),(-2.12782e-161D)},{(8.30515e-133D),(4.37718e-27D),(-1.01992e+06D),(-2.07333e+99D),(3.33821e-70D)}},{{(1.70811e-290D),(-2.02061e+07D),(-1.61962e-40D),(-1.41357e-302D),(-2.94708e-256D)},{(-1.64181e+191D),(-1.197e-117D),(-1.30857e+135D),(4.57856e-204D),(6.73139e+168D)},{(6.61629e+65D),(4.38039e+54D),(1.54864e-288D),(-2.97146e+280D),(-1.82757e+189D)},{(-4.36358e-179D),(-5.66655e+143D),(3.44945e+201D),(-6.5424e-193D),(2.63402e+216D)},{(1.80713e+161D),(-5.87073e-159D),(-1.46925e-235D),(3.84262e-23D),(3.40639e-12D)},{(-1.3541e+247D),(1.35478e-263D),(-3.18029e+191D),(-3.27218e-06D),(6.86267e-170D)},{(-1.57579e+285D),(-2.10529e-233D),(1.65454e-12D),(-4.65281e+31D),(1.20352e+235D)}},{{(-3.0588e+243D),(4.52463e-120D),(6.87896e+79D),(-1.14086e+241D),(-7.92814e-135D)},{(-1.84575e-144D),(-1.07464e-260D),(5.00213e+132D),(2.07317e-207D),(1.03001e-223D)},{(3.10893e-07D),(3.96148e-224D),(1.80507e-216D),(-7.47844e+101D),(-7.05152e+164D)},{(-3.37177e+78D),(-7.96233e-306D),(6.44505e-189D),(-4.67288e+33D),(-8.23037e+275D)},{(7.14445e-41D),(1.24896e+298D),(1.98244e-216D),(4.17737e+227D),(4.87176e+231D)},{(-2.00909e-107D),(-2.65357e-25D),(2.60118e+141D),(-7.79067e-219D),(0.0299727D)},{(-1.12842e-289D),(-1.10718e+80D),(2.06746e-236D),(8.15854e-228D),(6.37274e-140D)}},{{(-4.01122e-199D),(-7.35263e-152D),(-4.39956e-119D),(-2.81081e-83D),(8.82135e+247D)},{(-8.32707e+300D),(-2.51279e+255D),(1.34842e+228D),(-7.50769e-184D),(-9.49466e+119D)},{(-3.20694e+32D),(2.17506e-20D),(-3.77916e-191D),(2.83201e+253D),(1.55911e-149D)},{(-8.58629e+127D),(-2.12312e-261D),(-6.48035e+262D),(1.85821e-162D),(-1.02828e+237D)},{(-3.46379e-170D),(-6.34382e+92D),(2.69015e+103D),(1.29347e+239D),(-3.22069e-227D)},{(4.07253e-191D),(-3.36681e+209D),(2.90512e+272D),(6.16326e-205D),(2.83839e+141D)},{(2.65619e-239D),(-6.05446e+26D),(-2.53294e-180D),(1.8948e+127D),(-1.73169e-204D)}},{{(-2.39569e+230D),(-5.99064e-306D),(-1.53449e+51D),(2.30216e-297D),(3.62427e+168D)},{(1.46693e-298D),(-4.368e-66D),(-2.23509e+10D),(-15.951D),(1.29763e-25D)},{(-3.83691e-277D),(2.06804e+160D),(1.76943e-84D),(1.79323e+160D),(-1.40306e-182D)},{(-1.43179e-07D),(-3.08995e+107D),(2.42891e+207D),(-7.83727e+216D),(3.5436e-277D)},{(2.26364e-75D),(4.86177e+246D),(-2.91577e-63D),(4.08994e+300D),(2.37932e+207D)},{(-2.50053e+44D),(2.27394e+182D),(-3.35997e+100D),(-3.45457e-199D),(2.945e+216D)},{(-2.07499e+83D),(5.13207e-207D),(5.07781e+234D),(-5.43284e-27D),(-2.41732e+72D)}}}; + byte var_11 = (byte)(-113); + try + { + var_2 = true ; + var_4[((--var_5)&0)] = (-6942942139031839986L) ; + float var_119 = (1.85112e+36F); + long var_6 = (-3144904360231079563L); + var_4[((var_5++)&0)] = (--var_6) ; + var_8 = var_9 ; + var_4[((+(var_11--))&0)] = ((--var_12)&func_13(((--var_113)*var_18.var_114) ,((+((var_116++)*var_33))!=var_66) ,var_49 ,(var_119--))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_121 ) + { + var_31 = var_31 ; + System.out.println("hello exception 0 !"); + } + } + } + return ; +} +public strictfp int func_13(long var_14, boolean var_15, cl_28 var_16, double var_17) +{ + byte var_112 = (byte)(6); + try + { + cl_33 var_105 = new cl_33(); + if( var_18.var_19) + { + long var_90 = (8350688230254759092L); + try + { + int var_92 = (2067200394); + var_16 = func_20(var_31 ,(var_90++) ,func_20(var_31 ,(var_90--) ,func_20(var_31 ,(var_92--) ,var_18))) ; + } + catch( java.lang.IllegalArgumentException myExp_95 ) + { + var_49.var_96 = func_34((~(var_97++)) ,var_37) ; + System.out.println("hello exception 1 !"); + } + } + else + { + short var_102 = (short)(-13999); + cl_33 [][][] var_101 = {{{new cl_33(),new cl_33()}},{{new cl_33(),new cl_33()}},{{new cl_33(),new cl_33()}},{{new cl_33(),new cl_33()}},{{new cl_33(),new cl_33()}},{{new cl_33(),new cl_33()}},{{new cl_33(),new cl_33()}}}; + int var_103 = (700400655); + cl_33 var_104 = new cl_33(); + var_101[((++var_33)&6)][((var_103++)&0)][((++var_102)&1)] = var_31 ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_106 ) + { + float [][] var_110 = {{(-1.38016e-12F)}}; + if( (((++var_5)&( ( byte )((+(var_107--))+( ( short )var_25 )) ))==var_31.var_67)) + { + short var_108 = (short)(-6810); + if( (!((var_108++)<(-4.78614e-108D)))) + { + var_110[((+(--var_111))&0)][((var_66--)&0)] = func_34((++var_108) ,var_37) ; + } + } + System.out.println("hello exception 2 !"); + } + return ((++var_112)&var_31.var_61); +} +public strictfp cl_28 func_20(cl_33 var_21, long var_22, cl_28 var_23) +{ + int var_24 = (-2024360757); + for( var_24 = 612 ;(var_24>610);var_24 = (var_24-2) ) + { + float [] var_28 = {(3.51417e+13F),(3.47909e+23F),(6.8113e+24F),(-4.84916e+14F)}; + for( var_25 = 625 ;(var_25>571);var_25 = (var_25-18) ) + { + try + { + var_18 = var_18 ; + } + catch( java.lang.IllegalArgumentException myExp_26 ) + { + byte var_30 = (byte)(-48); + byte var_29 = (byte)(66); + byte var_87 = (byte)(-107); + var_28[((-(var_29--))&3)] = ((~(--var_30))+var_31.var_32) ; + var_28[((var_5--)&3)] = ((var_33++)*func_34((var_87++) ,var_37)) ; + System.out.println("hello exception 3 !"); + } + } + } + return var_49; +} +public static strictfp float func_34(int var_35, cl_33[][] var_36) +{ + byte var_86 = (byte)(1); + short var_85 = (short)(-22599); + if( true) + { + try + { + int var_78 = (-293382118); + try + { + byte var_77 = (byte)(-94); + var_36 = func_38((-(var_5--)) ,(-2.81458e+11F) ,(+(+(++var_77))) ,(var_78--) ,(var_78--) ,var_31 ,((var_78++)*( ( long )(((var_79--)|var_31.var_67)*var_18.var_80) ))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_81 ) + { + int var_82 = (-1293045806); + System.out.println("hello exception 4 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_83 ) + { + cl_28 var_84 = new cl_28(); + if( (!((((var_33--)+var_73)+var_76)!=var_31.var_67))) + { + var_49 = var_49 ; + } + System.out.println("hello exception 5 !"); + } + } + return ((var_85--)&( ( long )(++var_86) )); +} +public static strictfp cl_33[][] func_38(double var_39, float var_40, long var_41, long var_42, int var_43, cl_33 var_44, double var_45) +{ + int var_46 = (1451201338); + for( var_46 = 614 ;(var_46<634);var_46 = (var_46+10) ) + { + byte var_57 = (byte)(-21); + try + { + int var_68 = (-71561429); + double [] var_54 = {(-3.25364e-167D),(-4.51562e-100D),(4.33886e+92D),(-1.34758e-92D),(-9.24429e-262D)}; + short var_48 = (short)(-26748); + double [] var_53 = {(1.20256e-287D),(7.22488e+216D),(-7.13519e-55D),(-9.16196e-128D),(4.54712e+251D)}; + try + { + boolean var_50 = true; + cl_33 var_51 = new cl_33(); + var_40 = (var_40--) ; + var_42 = (var_48--) ; + double var_58 = (-1.29585e-227D); + var_18 = var_49 ; + var_31.var_52 = var_31.var_52 ; + var_53[((++var_48)&4)] = (var_43--) ; + var_54[((++var_5)&4)] = (((var_43++)*var_31.var_32)*(-1.04169e-21F)) ; + var_4[(((~(--var_12))*var_31.var_32)&0)] = ((var_5++)-var_10) ; + var_37[((-(--var_57))&3)][((+(var_5++))&2)] = var_44 ; + var_43 = ((--var_48)+var_57) ; + var_54[((++var_48)&4)] = (~(var_57--)) ; + var_5 = (var_57--) ; + var_33 = (var_33--) ; + var_54 = var_53 ; + var_37[((~((--var_5)&var_31.var_61))&3)][((-(var_5++))&2)] = var_31 ; + var_37[((++var_33)&3)][((++var_43)&2)] = var_44 ; + var_53[((++var_57)&4)] = (--var_43) ; + } + catch( java.lang.IllegalArgumentException myExp_63 ) + { + long [][][] var_65 = {{{(8734469071125837128L),(-1351673785233412940L),(8049343498723729025L),(3339987279724491992L)},{(4931121848580060006L),(-5301306916616560804L),(858110039946609044L),(-5465735453774958664L)},{(-45802511687071992L),(-950972062584725685L),(3956035764591472225L),(-3501073663694822279L)},{(1684792055525020453L),(2181231052935856183L),(-6781704228661742737L),(1816865605540862798L)}},{{(-6400198097310973645L),(-190237274788437023L),(2448043193845270141L),(8101793379229278562L)},{(-7011044554561666182L),(9219143105249212060L),(-1096374003147709587L),(-6122263249106451217L)},{(-5438746260045875842L),(6262658948909640990L),(-4481011280488803589L),(65458221028654527L)},{(8004323767006072858L),(-8641376737585357342L),(5499532412721417838L),(6735199680970006865L)}},{{(326164385338391880L),(-7684465728355526736L),(1683080266049969662L),(3653558163926043692L)},{(-3075888109757470871L),(7845892565195718747L),(1766781261476563738L),(-857506479970591659L)},{(-6136922777487110291L),(-953283172847902661L),(-7175217242122948618L),(-9098220465591450851L)},{(-5944246596827374479L),(-5671322431454107091L),(6299160030640627874L),(-6542408280051751380L)}},{{(-2675595851804446464L),(-884928926648138906L),(111519854620215261L),(-853475838385561329L)},{(-344888028714128218L),(-3566808614071986089L),(7973746517562817239L),(7077532020207282301L)},{(-3292760363761025777L),(3753536365820389604L),(476059839510667369L),(-7847084441072480307L)},{(-4930841740673789114L),(-1272952000311975550L),(6907217372280107381L),(6840881654705358934L)}},{{(4610726852231563018L),(-8858628127927981328L),(-91734374221701814L),(-7094039840999263067L)},{(-5835364866117123887L),(-3018733816576816202L),(-8971505536119727081L),(319561400702152272L)},{(3511395542150368061L),(-605838012463268916L),(7131721985522623812L),(-4052939799401221447L)},{(2664971360758618077L),(-6134876106838181394L),(-8770502749907683815L),(5486633008714717204L)}}}; + var_54[4] = (((var_5++)&var_25)-var_64) ; + var_45 = ((++var_57)-var_31.var_61) ; + System.out.println("hello exception 6 !"); + } + var_37[((((++var_66)-var_31.var_67)-var_31.var_67)&3)][((var_66++)&2)] = var_31 ; + for( var_68 = 795 ;(var_68>779);var_68 = (var_68-4) ) + { + cl_33 var_69 = new cl_33(); + int var_71 = (-172876165); + short [][] var_70 = {{(short)(23604),(short)(31219),(short)(21285)},{(short)(27001),(short)(-11128),(short)(14666)},{(short)(-27392),(short)(29448),(short)(17081)},{(short)(-6875),(short)(29497),(short)(-10607)},{(short)(-16517),(short)(30249),(short)(-26298)},{(short)(-21746),(short)(31538),(short)(917)},{(short)(23913),(short)(-512),(short)(-26530)}}; + var_48 = (var_5--) ; + var_37[(((++var_57)+var_57)&3)][((var_5++)&2)] = var_31 ; + var_53[(var_68&4)] = ((var_42--)*var_49.var_72) ; + var_4[(var_68&0)] = ((++var_57)+var_5) ; + var_53[((var_48++)&4)] = (2.68065e-98D) ; + } + } + catch( java.lang.ArithmeticException myExp_74 ) + { + short var_75 = (short)(25285); + if( ((var_75++)>var_76)) + { + var_31 = var_31 ; + } + else + { + var_31 = var_31 ; + } + System.out.println("hello exception 7 !"); + } + } + return var_37; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(187); + CrcCheck.ToByteArray(this.var_2,b,"var_2"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_4[a0],b,"var_4" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_5,b,"var_5"); + CrcCheck.ToByteArray(this.var_10,b,"var_10"); + CrcCheck.ToByteArray(this.var_12,b,"var_12"); + CrcCheck.ToByteArray(this.var_18.GetChecksum(),b,"var_18.GetChecksum()"); + CrcCheck.ToByteArray(this.var_25,b,"var_25"); + CrcCheck.ToByteArray(this.var_31.GetChecksum(),b,"var_31.GetChecksum()"); + CrcCheck.ToByteArray(this.var_33,b,"var_33"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_37[a0][a1].GetChecksum(),b,"var_37" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_47[a0],b,"var_47" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_49.GetChecksum(),b,"var_49.GetChecksum()"); + CrcCheck.ToByteArray(this.var_64,b,"var_64"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_76,b,"var_76"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_97,b,"var_97"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_111,b,"var_111"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8555_2018110812102/Start.java b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..dd142c2d46c08d787ea8355f4fca96c6c4f63818 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_33.java cl_28.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/8555_2018110812102/cl_28.java b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/cl_28.java new file mode 100644 index 0000000000000000000000000000000000000000..5b997d2418395e478da5ca8f0e7bb0dd464472e7 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/cl_28.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4141941138 + +import java.util.zip.CRC32; + +class cl_28 +{ + boolean var_19 = true; + double [][][] var_56 = {{{(-1.63417e+63D)},{(1.52418e-251D)},{(-1.81258e+42D)},{(1.31837e-208D)},{(1.64817e-239D)},{(1.49748e+90D)},{(-4.72892e+69D)}},{{(5.39435e+155D)},{(1.2016e-273D)},{(-1.04007e+11D)},{(-2.4968e-285D)},{(1.30268e+97D)},{(1.40824e-210D)},{(5.61839e+298D)}},{{(-5.46396e+256D)},{(1.39066e+90D)},{(1.6934e+35D)},{(4.32071e+146D)},{(-1.18897e+76D)},{(-3.41942e+164D)},{(-2.51729e-217D)}},{{(3.97199e-201D)},{(-3.3392e+204D)},{(7.17124e-212D)},{(8.51059e-256D)},{(-3.12981e+141D)},{(-3.83934e-167D)},{(-5.9858e-257D)}},{{(2.0348e+144D)},{(-4.94591e+269D)},{(-3.82731e+250D)},{(-1.62349e+105D)},{(1.12306e+133D)},{(2.27424e-160D)},{(-4.21582e-155D)}},{{(1.64864e+124D)},{(-1.02045e-118D)},{(-2.7091e+108D)},{(5.92263e-28D)},{(-6.80011e+82D)},{(-1.4795e+211D)},{(-1.19197e-85D)}},{{(-1.246e-188D)},{(7.16091e+113D)},{(-9.95699e+126D)},{(9.35603e+225D)},{(-1.00886e+22D)},{(3.00308e-44D)},{(-1.23339e+97D)}}}; + final long var_72 = (1544053462124303389L); + short var_80 = (short)(3570); + float var_96 = (2.27692e-34F); + byte var_114 = (byte)(-114); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(408); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_56[a0][a1][a2],b,"var_56" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_72,b,"var_72"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8555_2018110812102/cl_33.java b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/cl_33.java new file mode 100644 index 0000000000000000000000000000000000000000..0527c128f2f25d9621ef58124337909e3e6c4660 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8555_2018110812102/cl_33.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4141941138 + +import java.util.zip.CRC32; + +class cl_33 +{ + int var_32 = (-1756798); + double [] var_52 = {(-2.10879e+294D),(2.83231e-198D),(-3.75486e-109D),(2.30186e-79D),(1.08115e+18D)}; + float var_55 = (0.0236935F); + long var_59 = (-5304892024847098383L); + boolean [][] var_60 = {{true,true,true,false},{true,true,false,true},{true,true,true,true},{true,true,false,true},{false,false,true,false},{false,true,false,true},{true,true,true,true}}; + byte var_61 = (byte)(37); + boolean var_62 = true; + short var_67 = (short)(-6058); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(88); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_52[a0],b,"var_52" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_60[a0][a1],b,"var_60" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_61,b,"var_61"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8663_2018110810324/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/8663_2018110810324/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8663_2018110810324/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/8663_2018110810324/MainClass.java b/test/testsuite/fuzz_test/fuzz/8663_2018110810324/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..529dc0029cb5e8ea73beee3c0c615050d973f0c1 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8663_2018110810324/MainClass.java @@ -0,0 +1,286 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=545827268 + +import java.util.zip.CRC32; + +class MainClass +{ + static cl_13 var_17 = new cl_13(); + static int var_27 = (-1559931757); + final static byte var_34 = (byte)(126); + static cl_6 var_35 = new cl_6(); + static long [] var_37 = {(-8503316212177794370L),(-5843154379120371941L),(198361331194138866L),(4115412298270078632L),(-3573012914934232013L)}; + static long var_42 = (-3902798307686869860L); + static short var_43 = (short)(-19497); + static double var_51 = (-2.81808e+185D); + static int var_58 = (-906622403); + static byte var_60 = (byte)(-122); + static cl_6 var_65 = new cl_6(); + static byte var_73 = (byte)(88); + static boolean [][] var_79 = {{false,false,true,false},{true,true,false,true},{true,true,true,false},{true,true,true,true}}; + final static long [][] var_81 = {{(-2006865345407024481L),(5830404925571484284L),(844281139934353519L),(2505335391700231897L)},{(4506549627412173784L),(3523386714083908365L),(-7241357122311182229L),(2403086419315049976L)},{(-5183342577277894892L),(6136520366646409383L),(-6758743028263679786L),(1482770287035482553L)},{(7425413533913795715L),(2301407337203777195L),(-5387611955335943493L),(8336349535539593487L)},{(-8926020574536231701L),(8495005990352596567L),(5011709031945484844L),(-2542592618536538232L)},{(7039737571503281658L),(-7543776257858128027L),(4009945630993681283L),(4569710075059738044L)}}; + static int var_82 = (-338653402); + int var_84 = (890552992); + int var_85 = (-774745221); + static short var_88 = (short)(-12747); + final long [][][] var_89 = {{{(-9089890488251829888L),(-7922514558646929248L),(-5149062916208141961L),(4361532427017818403L),(-5035595899114058233L),(-4864529132930726085L)},{(4920880240842297306L),(-1235952441029838552L),(8961217296938461620L),(8304420195797870757L),(3841382211840017117L),(-1589559649476281435L)},{(6010430844236230024L),(1130443012829553219L),(-4264550123229658606L),(-2476268262286178393L),(5182837713103533882L),(-1528059995511392990L)},{(-3402655163923696159L),(6301120279184498297L),(-3922116486372661840L),(4785683139262736757L),(7961917225638926096L),(8554326916411305958L)}},{{(3616090790732782823L),(-8357529911838675598L),(6736844526243266427L),(-6984980548606202087L),(-4213930174722079899L),(-6003068270396744226L)},{(542862640158051396L),(198353709812785148L),(-996214744570656526L),(7945019011170017201L),(8711933980117812640L),(-1735972275523449526L)},{(-6854453473510866852L),(-3093368582588115969L),(5674862277954515259L),(8616542066962359460L),(-8947913712597542385L),(554048117293931591L)},{(5586326587751666329L),(-7181866668845716972L),(2260397090267904904L),(-3620251886770403503L),(8354071643787691972L),(-8685512668514764826L)}},{{(-3801662899545471614L),(7041835730429703408L),(7813900587101094062L),(-6974093847705283907L),(-3360834529228868555L),(-8518705469850268068L)},{(7892360735361875142L),(370620847356946408L),(-6147681804162694149L),(-8701694842297631968L),(8660298249762450209L),(9103923046542917324L)},{(-7602011561764529887L),(-5108000765293752917L),(1994120148494237901L),(1995309057614543507L),(3897002563515538897L),(-7001082815218876630L)},{(-842892545657671362L),(-1911440960828887893L),(-1269867988618705585L),(-3292424322352607829L),(8686591102632078491L),(-6125220120588340571L)}}}; + cl_6 [] var_92 = {new cl_6(),new cl_6(),new cl_6()}; + int [][][] var_95 = {{{(-115008679),(955193997),(758223589),(-1245103223),(-547387994)},{(598970311),(-1768187332),(1011870159),(1193982577),(-277940624)},{(-1990979683),(1273964871),(1331010768),(1764356988),(1098814148)},{(369225705),(-2035311506),(2061027049),(1663556669),(94124563)},{(2053915058),(-1533712196),(-146474911),(-1625467751),(-1231638554)}},{{(1127645161),(1851725793),(-514958189),(-2073471777),(156219512)},{(-1287921900),(2049358214),(852551878),(1710720743),(-1459882531)},{(-80536208),(807644335),(2119415640),(-49241410),(-564321702)},{(-511683623),(-1775264088),(-47975081),(-2129731817),(2132199113)},{(1887609693),(625329998),(1254595367),(-1873463944),(2145729731)}}}; + final float var_98 = (8.81945e-26F); + int var_108 = (-1058625239); + boolean [][] var_109 = {{true,false,true,false}}; + boolean [][] var_132 = {{true,false,true,true},{false,true,false,false},{true,true,false,true},{true,false,true,false}}; + int var_138 = (-1389124604); +/*********************************/ +public strictfp void run() +{ + byte var_90 = (byte)(-62); + int [][][] var_91 = {{{(-1774919368),(1826833632),(2048939098),(-229766709),(-1821940958)},{(1042284912),(1259780159),(-1066792050),(-1359427862),(-1273849435)},{(999599030),(-729471192),(-1061546223),(1951967361),(-620569510)},{(-305574705),(1300308532),(1311317859),(1280039133),(-1221115070)},{(-901309739),(-922002169),(-548116226),(-369728356),(-2026980460)}},{{(1954293258),(-1671241881),(1709511549),(1667823596),(1043190712)},{(67357854),(-1092105416),(1217810822),(91055659),(1623482514)},{(1867754942),(1685706794),(504164897),(847136467),(1849095568)},{(-45672551),(1633859014),(-1644423649),(-653880763),(-828788078)},{(178437505),(1294489910),(2136640465),(859881270),(772540457)}}}; + short var_97 = (short)(-16208); + long [] var_131 = {(5701045687675622802L),(-5384833712928480633L),(-2156290387341247661L),(-8016170233629457957L),(-2572045646075694761L),(-5592722975517043290L)}; + long [][] var_134 = {{(-7148363802776039933L),(7997980508486718934L),(-9081099092670822137L),(3729431618813779484L)},{(3945662073312818974L),(4629149719357916345L),(-4611704535997127610L),(-2099707737744610740L)},{(-1056514437784796504L),(2160717191313021694L),(2352675214744900921L),(-6375420152643107143L)},{(8184330904003304746L),(-3584486763858444936L),(6567768714218744626L),(4768055159512841768L)},{(7508364379200914437L),(9121024906266663469L),(3311095649549659571L),(6429930767217451240L)},{(-5582228679390384936L),(-3908635904031238844L),(-3291374366268908984L),(-6390917841017438707L)}}; + try + { + float var_119 = (-1.4501e-06F); + if( func_0(var_89 ,(-(++var_90)) ,var_91 ,false ,var_92 ,func_28(func_0(var_89 ,(--var_90) ,var_95 ,((var_97--)var_43)) + { + var_79[(((++var_88)*var_17.var_80)&3)][((~(var_43++))&3)] = ((--var_90)>=func_28(( ( boolean )var_109[((((var_90--)&func_8((var_97--) ,(((--var_60)-func_8(((--var_90)-var_17.var_111) ,((++var_60)<=var_98) ,var_79 ,var_17 ,(+(++var_73)) ,(-(var_97--)) ,var_81))>func_8((-2.01762e-37F) ,(!((var_119--)>=var_98)) ,var_79 ,var_17 ,(var_120++) ,((--var_97)+( ( short )(--var_90) )) ,var_65.var_121)) ,var_79 ,var_17 ,((++var_60)*( ( float )(--var_90) )) ,(var_120--) ,var_65.var_121))-var_108)&0)][((var_108++)&3)] ) ,((--var_90)*var_58))) ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_128 ) + { + cl_6 var_133 = new cl_6(); + try + { + float var_129 = (-8.81137e+10F); + } + catch( java.lang.ArithmeticException myExp_130 ) + { + float var_136 = (-1.1132e-08F); + try + { + long var_135 = (9127133308041586122L); + var_17 = func_18(((var_90++)-func_8(((var_90--)-var_35.var_102) ,((var_43--)<=( ( int )var_131[(((++var_90)-( ( int )((-(++var_60))*( ( int )var_73 )) ))&5)] )) ,var_132 ,func_18((var_97--) ,((var_73++)-var_43) ,var_133 ,var_133 ,(4026546803216547129L) ,((--var_90)&( ( int )(var_90++) )) ,var_17) ,(var_97++) ,(-(--var_90)) ,var_134)) ,(++var_135) ,var_35 ,var_35 ,(++var_90) ,(++var_136) ,var_17) ; + } + catch( java.lang.ArithmeticException myExp_137 ) + { + var_91[((-(var_90--))&1)][((var_138++)&4)][(((var_138++)*( ( short )(++var_90) ))&4)] = (var_73++) ; + System.out.println("hello exception 2 !"); + } + System.out.println("hello exception 1 !"); + } + System.out.println("hello exception 0 !"); + } + return ; +} +public static strictfp boolean func_0(long[][][] var_1, long var_2, int[][][] var_3, boolean var_4, cl_6[] var_5, float var_6) +{ + byte var_77 = (byte)(16); + double var_7 = (-9.45833e-15D); + byte var_78 = (byte)(-20); + int var_86 = (-1171342033); + int var_87 = (-1431886010); + if( (!(!((var_7--)>=func_8(func_28(((++var_60)!=var_51) ,(--var_77)) ,((--var_78)>( ( byte )var_58 )) ,var_79 ,var_17 ,((var_27++)-var_17.var_80) ,(--var_42) ,var_81))))) + { + var_77 = (var_78++) ; + } + else + { + for( var_82 = 413 ;(var_82>401);var_82 = (var_82-12) ) + { + boolean [][] var_83 = {{true,false,false,true,false,true,true},{false,false,false,true,true,true,false},{true,false,false,true,false,false,false}}; + if( var_83[((--var_78)&2)][((~(var_78--))&6)]) + { + var_37[((~(var_60--))&4)] = (var_2--) ; + } + } + } + return var_79[((-(var_88++))&3)][(((--var_43)&( ( short )var_3[((var_87--)&1)][4][(((var_86++)+var_73)&4)] ))&3)]; +} +public static strictfp byte func_8(float var_9, boolean var_10, boolean[][] var_11, cl_13 var_12, float var_13, float var_14, long[][] var_15) +{ + int [][][] var_67 = {{{(-1236804228),(-1669115054),(1625729620),(204912754)},{(1782595902),(169895481),(-1115321271),(337118057)}},{{(-451077744),(1316069445),(1232048057),(-1086114074)},{(-1244887796),(967756753),(-1480688506),(172374615)}},{{(762803220),(1800931308),(-895195577),(-1506709471)},{(-346386793),(1896668693),(-1969080590),(1242228439)}}}; + byte var_76 = (byte)(-13); + int var_16 = (1780840993); + for( var_16 = 566 ;(var_16<581);var_16 = (var_16+5) ) + { + try + { + short var_71 = (short)(-3970); + int var_70 = (2059979149); + short var_72 = (short)(-4619); + cl_6 var_66 = new cl_6(); + byte var_68 = (byte)(-38); + var_12 = func_18((1991366212) ,var_17.var_63 ,var_65 ,var_66 ,(~(++var_60)) ,(-0.848951F) ,func_18(var_67[((var_70--)&2)][(((--var_68)+var_17.var_69)&1)][((var_43--)&3)] ,(var_71++) ,var_35 ,var_35 ,(((var_72++)|( ( short )(++var_73) ))&var_58) ,(-(var_58++)) ,var_17)) ; + } + catch( java.lang.IllegalArgumentException myExp_74 ) + { + int var_75 = (-143170055); + for( var_75 = 223 ;(var_75>138);var_75 = (var_75-17) ) + { + var_37[4] = ((var_73--)|var_17.var_69) ; + } + System.out.println("hello exception 3 !"); + } + } + return (var_76--); +} +public static strictfp cl_13 func_18(int var_19, long var_20, cl_6 var_21, cl_6 var_22, long var_23, float var_24, cl_13 var_25) +{ + short var_46 = (short)(18869); + byte var_47 = (byte)(-80); + int var_26 = (1202817490); + if( (!(!(((var_26++)+var_27)!=func_28(var_17.var_44 ,((var_46--)-( ( short )(--var_47) ))))))) + { + byte [] var_56 = {(byte)(-39),(byte)(127)}; + int [][] var_54 = {{(-411748099),(1605066198)}}; + double var_49 = (-1.33756e-139D); + byte var_50 = (byte)(-53); + if( ((+(~(++var_50)))>=var_51)) + { + try + { + int [] var_55 = {(363113146)}; + byte [] var_52 = {(byte)(-56),(byte)(-128),(byte)(9),(byte)(-4)}; + final float var_57 = (7.77326e+31F); + var_50 = (var_47++) ; + var_54[((++var_46)&0)][((var_46--)&1)] = var_55[((~((var_26--)|( ( short )var_56[((++var_46)&1)] )))&0)] ; + var_37[(((--var_50)*var_46)&4)] = (var_46--) ; + var_35.var_59 = (+((var_60--)*(byte)(63))) ; + } + catch( java.lang.IllegalArgumentException myExp_61 ) + { + boolean var_62 = false; + System.out.println("hello exception 4 !"); + } + } + else + { + try + { + var_42 = ((var_46--)|var_42) ; + } + catch( java.lang.ArithmeticException myExp_64 ) + { + var_26 = (-(var_60++)) ; + System.out.println("hello exception 5 !"); + } + } + } + return var_25; +} +public static strictfp float func_28(boolean var_29, int var_30) +{ + int var_31 = (-655314954); + for( var_31 = 145 ;(var_31>135);var_31 = (var_31-10) ) + { + cl_13 var_33 = new cl_13(); + int var_32 = (1120976417); + for( var_32 = 662 ;(var_32>644);var_32 = (var_32-6) ) + { + byte var_39 = (byte)(-48); + int [] var_40 = {(-2062973922),(1995314235),(1688675668),(-1715170173)}; + try + { + short var_38 = (short)(-22728); + var_17 = var_17 ; + var_29 = (!(!(!((var_27--)>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/8944_2018110810324/MainClass.java b/test/testsuite/fuzz_test/fuzz/8944_2018110810324/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..cd6192ddc01ce02a01139c6204e8ffdbcf762ddd --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8944_2018110810324/MainClass.java @@ -0,0 +1,306 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2002426344 + +import java.util.zip.CRC32; + +class MainClass +{ + static cl_2 var_1 = new cl_2(); + static cl_2 var_2 = new cl_2(); + static int var_3 = (333648145); + static double var_12 = (-8.01884e-140D); + static byte var_18 = (byte)(16); + final long [] var_30 = {(-8306415565639052903L),(-8750857744365446173L),(1124471224410538715L),(-4563655822082909676L)}; + static cl_10 var_33 = new cl_10(); + static short var_35 = (short)(9081); + static boolean [][] var_37 = {{true,true,false},{true,false,true},{false,true,false}}; + static float var_40 = (3.46914e-30F); + final static boolean var_41 = true; + long var_54 = (-1303474052206478137L); + static int var_59 = (-2132565010); + static int var_78 = (734878208); + static cl_2 [][][] var_92 = {{{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()}},{{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()}},{{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()}}}; + static int [][][] var_97 = {{{(-1996841036),(1682162541),(1694421445),(-1656637224),(1785761570),(-1967585133)},{(-814496838),(1548450553),(1276847687),(-603369307),(-1181895422),(-875937341)},{(-1751290116),(-864518100),(152863723),(-2096852261),(345284270),(1189421896)},{(1367828498),(-1005415094),(-955405998),(-962684536),(1655217869),(-271109327)}}}; + static int var_111 = (-2116679273); + float [] var_119 = {(722.945F),(1.12796e+16F),(0.000156758F),(1.17821e-18F),(-1.33455e+26F),(2.69297e+22F)}; + short var_122 = (short)(-21363); +/*********************************/ +public strictfp void run() +{ + final cl_10 var_115 = new cl_10(); + long [][][] var_117 = {{{(-6084022055136749225L),(-1279636613982570331L),(-1699646355600600447L)},{(-5995237768878678659L),(326593026039316981L),(4355856968102184411L)},{(5765875033404991681L),(-1673052792277277004L),(-5613482593714816937L)},{(-7738476978076246434L),(-3526282309696974521L),(4817730912006752082L)},{(2853998065370956961L),(-2745204712012921354L),(-1229010471639296569L)},{(-2009607430391842220L),(-2283729011956170997L),(5182739257977212675L)}},{{(-5083835827047623411L),(1129877540455345815L),(-6820250237971324946L)},{(9002172804776747238L),(-3836298036546058124L),(7197551874827684191L)},{(-5904056875174851687L),(7401145168642799035L),(5157383851778338828L)},{(923405149411227888L),(6271929720618163161L),(4690152963011115369L)},{(1756295037530599950L),(-8817566566215261930L),(-7800751299147138589L)},{(3822650931889974796L),(-6415144445627251062L),(3386285189191467459L)}},{{(-1801337416841978848L),(-5892830195748549632L),(-8936630264048249464L)},{(8810871493569942244L),(8447630892980647349L),(-4221594758330290290L)},{(-5118560568192140961L),(3892186659528114784L),(-3116535631881792873L)},{(-8035899593113585326L),(-5049207636010208034L),(7758336123677192508L)},{(-8401317260377757211L),(-4355721435473656621L),(8698249179877946809L)},{(7801122328880136742L),(-4711377504320716497L),(677242220991631664L)}},{{(7528122001453172863L),(2271395452473937316L),(-7553156625379083883L)},{(-2393854353264269047L),(-92891810115266524L),(-6073792026906452716L)},{(4343756497910391099L),(-2784607880872582919L),(-1927828067167307733L)},{(-193277656516566162L),(-6630723365599025545L),(-2678250737395130707L)},{(1131970244179948485L),(6581220122358629836L),(272968078795875817L)},{(-8159955817952621682L),(-1425470977189324448L),(2427505435676795006L)}},{{(-6223762477484168906L),(3744365144542947409L),(1681966907289273273L)},{(4569560894213753020L),(1579489029440782188L),(748721301749145366L)},{(2056976262462063316L),(6881769537249036296L),(4989457950206906964L)},{(515633679611586476L),(-6267226226976874446L),(122383746215253149L)},{(2434583832604201444L),(2835168510742746339L),(7152744432012276383L)},{(4070483083612510054L),(-8251404614651786496L),(5917173808175061433L)}}}; + long var_0 = (8324323117721256923L); + byte var_125 = (byte)(94); + var_1 = var_2 ; + try + { + try + { + long [] var_116 = {(-6507960923686659467L)}; + for( var_3 = 200 ;(var_3<214);var_3 = (var_3+14) ) + { + byte var_120 = (byte)(106); + var_1 = func_4(var_115 ,var_116 ,var_117 ,func_4(var_33 ,var_116 ,var_2.var_118 ,var_1 ,var_2 ,( ( float )(var_18--) )) ,var_2 ,var_119[((+(--var_120))&5)]) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_121 ) + { + short var_124 = (short)(-12341); + try + { + var_97[((~(var_122--))&0)][((var_35++)&3)][5] = (~(var_18++)) ; + } + catch( java.lang.IllegalArgumentException myExp_123 ) + { + var_0 = ((var_18--)*var_54) ; + System.out.println("hello exception 1 !"); + } + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_127 ) + { + try + { + long [][][] var_128 = {{{(2320739936098934894L),(2746122979037564481L),(4332154683645741435L)},{(7532864240500350107L),(-3535895933052208507L),(5247128342954917759L)},{(5971709435096783328L),(8577452209414043901L),(689301008139182250L)},{(108505299137284677L),(2125794742518521817L),(8315568805832033424L)},{(5761062640015584504L),(-4912166826622041142L),(8239740435959367L)},{(8490684985162315671L),(-3798302800760711751L),(-1542070387930947276L)}},{{(-6758652422412482567L),(-2289744798483933243L),(-3811634552833818481L)},{(3719482441165195585L),(-4721303665981703826L),(2110348750393161958L)},{(3339651209837630985L),(-7935535288253043488L),(-553551879206244970L)},{(-3633198862296274006L),(-4863066346802076379L),(-1355556148831288446L)},{(2608486000092176692L),(7547764753413079981L),(-1404148416055714222L)},{(5335054534622822214L),(-596855620229977036L),(-358947670514004556L)}},{{(1986338044659143043L),(-6934563255270595901L),(7566368798689190890L)},{(1375702532404073685L),(4743735741128280335L),(3532362212445589080L)},{(-651382582062167553L),(-6395626453058259916L),(3362703830529153781L)},{(1936219265395664198L),(-6771621295471354079L),(7850070973078192694L)},{(3052232362319519488L),(7454939537074885267L),(-5099773457821282730L)},{(3102246104398426903L),(5884054877214480063L),(4516139807491500091L)}},{{(-118457092815887274L),(-4755825476308117225L),(8734533394179997610L)},{(-6305745636019253940L),(-7650245308935101186L),(-2666239911342460851L)},{(-4083765701177707747L),(-9047937545140339707L),(868239598160428750L)},{(-289289734490561951L),(4111788340173155426L),(-2704118699129918055L)},{(3445366528892363343L),(-6378556463864981745L),(4418344790965725244L)},{(1318991166877517296L),(243887682205211458L),(2169745009351254042L)}},{{(-3027761697697080801L),(3305971517438792441L),(379812264487840115L)},{(-6632694712089970386L),(-7879494293561358036L),(3026615587496797937L)},{(-2416777859369757732L),(3707830885755773456L),(-8783985708251153478L)},{(8939118009494228013L),(9032501705928286166L),(-6819044386885608408L)},{(2717421726314012578L),(-2022047399308236032L),(-2810971321438321314L)},{(6839298259260966598L),(6878022111388865302L),(6528872471928318385L)}}}; + try + { + var_117 = var_128 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_129 ) + { + var_18 = (++var_125) ; + System.out.println("hello exception 3 !"); + } + } + catch( java.lang.ArithmeticException myExp_130 ) + { + try + { + var_54 = (~(--var_125)) ; + } + catch( java.lang.IllegalArgumentException myExp_131 ) + { + cl_2 [][][] var_132 = {{{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()}},{{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()}},{{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()}}}; + var_117[(((--var_125)&var_78)&4)][((var_59--)&5)][(((var_18++)-func_19(var_132))&2)] = ((++var_125)|var_18) ; + System.out.println("hello exception 5 !"); + } + System.out.println("hello exception 4 !"); + } + System.out.println("hello exception 2 !"); + } + return ; +} +public static strictfp cl_2 func_4(cl_10 var_5, long[] var_6, long[][][] var_7, cl_2 var_8, cl_2 var_9, float var_10) +{ + int var_11 = (-1458209315); + for( var_11 = 299 ;(var_11>291);var_11 = (var_11-8) ) + { + short var_108 = (short)(11139); + byte var_113 = (byte)(27); + if( (!((++var_12)>func_13(var_33.var_106)))) + { + if( ((var_108++)!=var_2.var_44)) + { + long var_109 = (5640402367743072521L); + } + } + else + { + int var_110 = (748944298); + for( var_110 = 932 ;(var_110<950);var_110 = (var_110+18) ) + { + int var_112 = (-1807064319); + var_7[((((++var_113)-func_19(var_92))&(-624249582))&4)][((var_112--)&5)][((var_111++)&2)] = (-(var_18++)) ; + } + } + } + return var_9; +} +public static strictfp byte func_13(float[][][] var_14) +{ + int var_15 = (-1511209846); + byte var_99 = (byte)(69); + byte var_105 = (byte)(-13); + for( var_15 = 226 ;(var_15>218);var_15 = (var_15-8) ) + { + byte var_94 = (byte)(-119); + short var_103 = (short)(22715); + double [][][] var_17 = {{{(-9.59183e-145D),(-8.68889e+21D),(2.65359e-64D)},{(-4.32174e+175D),(-1.26245e+08D),(-1.34967e-189D)},{(2.53785e+85D),(6.60157e-07D),(6.39449e+164D)},{(5.25727e-103D),(2.18694e+215D),(2.85431e+116D)}}}; + short var_98 = (short)(-5992); + var_17[((var_94--)&0)][(((var_18++)*func_19(var_92))&3)][(((-(var_18--))-(895240963))&2)] = func_23(var_33 ,(+(var_35--)) ,var_97[((var_99--)&0)][3][(((var_98--)+var_59)&5)] ,(-6.62102e-31F) ,var_33.var_46 ,(!((var_103++)<=var_1.var_44))) ; + } + return (--var_105); +} +public static strictfp int func_19(cl_2[][][] var_20) +{ + short var_73 = (short)(5934); + double var_91 = (9.07285e+52D); + try + { + int var_21 = (-873776232); + byte var_66 = (byte)(114); + for( var_21 = 420 ;(var_21>402);var_21 = (var_21-9) ) + { + float var_80 = (-9.10023e-12F); + boolean [][][] var_88 = {{{false,true,true,false},{true,true,true,true},{true,true,false,false},{false,false,true,false},{true,false,true,true},{false,true,false,true},{false,true,false,false}},{{true,false,true,true},{true,false,true,true},{true,false,false,true},{false,false,false,false},{false,false,true,true},{true,true,false,true},{true,true,true,true}},{{false,true,false,true},{true,true,false,true},{true,false,false,true},{true,true,true,false},{true,true,false,false},{true,false,true,true},{true,true,true,false}},{{true,false,false,false},{true,true,true,true},{false,true,false,true},{true,true,true,true},{false,true,false,true},{false,true,true,false},{true,false,false,true}},{{false,true,true,true},{true,true,false,true},{false,false,false,true},{true,true,false,true},{true,true,true,true},{false,true,false,true},{false,false,true,true}},{{false,true,false,false},{true,true,false,false},{true,false,false,false},{false,false,true,true},{false,true,false,false},{false,true,false,true},{true,false,false,true}},{{true,true,false,true},{false,false,true,false},{true,false,false,true},{true,false,false,true},{false,true,true,true},{false,false,true,true},{false,true,true,true}}}; + int var_70 = (56455574); + cl_10 var_75 = new cl_10(); + cl_10 var_68 = new cl_10(); + short var_22 = (short)(30373); + cl_10 var_65 = new cl_10(); + short var_67 = (short)(-27163); + if( (!(((+(var_22++))*func_23(var_65 ,(2381912450882758538L) ,(+(--var_66)) ,(var_18--) ,false ,((var_67--)>func_23(var_68 ,(--var_70) ,(--var_18) ,(+(var_73--)) ,(!(!(!((++var_18)>=func_23(var_75 ,(var_18--) ,(var_78--) ,((++var_80)*var_21) ,(!((++var_73)<=var_33.var_42)) ,(!(((--var_66)&var_73)<=( ( float )(-(var_73--)) )))))))) ,(!((((var_66++)*var_33.var_85)-var_12)>=var_35))))))<=var_33.var_87))) + { + var_37[((-(var_70--))&2)][((((var_59--)*var_78)-var_78)&2)] = var_88[(((--var_66)+(-28389283))&6)][((var_73--)&6)][((+(var_18--))&3)] ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_89 ) + { + if( var_41) + { + var_2.var_90 = (var_91++) ; + } + System.out.println("hello exception 6 !"); + } + return (1826561976); +} +public static strictfp double func_23(cl_10 var_24, long var_25, int var_26, float var_27, boolean var_28, boolean var_29) +{ + int var_38 = (513666673); + byte var_31 = (byte)(-93); + short var_62 = (short)(-18182); + try + { + short var_39 = (short)(-7805); + try + { + cl_2 var_51 = new cl_2(); + cl_2 var_32 = new cl_2(); + double [] var_48 = {(-4.53001e-250D),(-1.39817e+177D)}; + try + { + var_25 = (var_31++) ; + var_2 = var_32 ; + var_2 = var_2 ; + var_1 = var_32 ; + var_33.var_34 = (-((var_35--)*var_3)) ; + var_37[2][((var_38--)&2)] = (!((var_25++)>( ( byte )(+(var_39++)) ))) ; + var_37[((var_38++)&2)][((-(var_38++))&2)] = ((var_18++)>var_40) ; + var_27 = (var_27--) ; + float var_45 = (5.02862e-36F); + var_37[((+(--var_31))&2)][(((~(var_31++))*var_1.var_44)&2)] = (!(!((++var_39)!=(byte)(72)))) ; + var_37[((+(var_31++))&2)][(((++var_31)*var_3)&2)] = ((-(~(--var_31)))!=var_3) ; + var_48[((~(++var_39))&1)] = (((~(--var_18))|var_3)-var_2.var_43) ; + var_18 = (var_31++) ; + } + catch( java.lang.ArithmeticException myExp_49 ) + { + boolean var_50 = true; + var_1 = var_32 ; + System.out.println("hello exception 7 !"); + } + var_38 = (var_39--) ; + try + { + boolean var_55 = true; + final int [] var_53 = {(-1241153879),(312403728)}; + var_27 = (-2.89887e+07F) ; + var_39 = (--var_31) ; + } + catch( java.lang.ArithmeticException myExp_56 ) + { + var_27 = (-6.01795e+27F) ; + System.out.println("hello exception 8 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_57 ) + { + var_1.var_58 = ((++var_31)<=( ( double )(++var_59) )) ; + System.out.println("hello exception 9 !"); + } + } + catch( java.lang.ArithmeticException myExp_60 ) + { + int var_61 = (-868552018); + for( var_61 = 1023 ;(var_61<1033);var_61 = (var_61+10) ) + { + try + { + var_29 = (!(!(!(!((((--var_31)-var_18)-var_62)>=var_35))))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_63 ) + { + int var_64 = (2102229013); + System.out.println("hello exception 11 !"); + } + } + System.out.println("hello exception 10 !"); + } + return (+(var_27++)); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1235); + CrcCheck.ToByteArray(this.var_1.GetChecksum(),b,"var_1.GetChecksum()"); + CrcCheck.ToByteArray(this.var_2.GetChecksum(),b,"var_2.GetChecksum()"); + CrcCheck.ToByteArray(this.var_3,b,"var_3"); + CrcCheck.ToByteArray(this.var_12,b,"var_12"); + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_30[a0],b,"var_30" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_33.GetChecksum(),b,"var_33.GetChecksum()"); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_37[a0][a1],b,"var_37" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + CrcCheck.ToByteArray(this.var_41,b,"var_41"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + CrcCheck.ToByteArray(this.var_78,b,"var_78"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_92[a0][a1][a2].GetChecksum(),b,"var_92" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_97[a0][a1][a2],b,"var_97" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_111,b,"var_111"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_119[a0],b,"var_119" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_122,b,"var_122"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8944_2018110810324/Start.java b/test/testsuite/fuzz_test/fuzz/8944_2018110810324/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..a536235fa732183c22c490ffbd57360128327fad --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8944_2018110810324/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_10.java MainClass.java CrcCheck.java cl_2.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/8944_2018110810324/cl_10.java b/test/testsuite/fuzz_test/fuzz/8944_2018110810324/cl_10.java new file mode 100644 index 0000000000000000000000000000000000000000..c99df210abb78d418c252db4f04e2db9b4358b5e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8944_2018110810324/cl_10.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2002426344 + +import java.util.zip.CRC32; + +class cl_10 +{ + long var_34 = (2768219394864161365L); + int var_42 = (685153109); + boolean var_46 = true; + float var_52 = (-4038.78F); + final short var_85 = (short)(13491); + double var_87 = (-6.23532e+202D); + float [][][] var_106 = {{{(6.97381e+13F),(1.46382e-23F),(1.00329e+37F),(0.000108035F),(1.59997e-33F)},{(4.7029e+26F),(-6.4641e+19F),(1.43542e-37F),(0.311861F),(-8.88366e-07F)},{(1.33507e-31F),(-3.13803e-37F),(1.93645e+36F),(1.41674e-34F),(2.68865e-19F)},{(29.5316F),(-16.0588F),(-1.80835e+15F),(1.36302e-12F),(-1.06439e+06F)},{(0.406416F),(-6.77269e+36F),(1.10315e-35F),(2.75015e-36F),(2.18242e+15F)},{(-6.52303e+15F),(-4.06075e-06F),(-9.98246e+14F),(-2.27419e-20F),(2.33271e-31F)},{(-1.70146e-13F),(1.60371e-17F),(-2.30829e+32F),(-1.27981e+14F),(4.62482e-35F)}},{{(-7.80563F),(3.07024e+18F),(-241.709F),(1.24653e-32F),(-5.14992e-18F)},{(-2.8307e-24F),(3.76612e+32F),(7.75555e-20F),(2.42234e+27F),(-2.98765e-22F)},{(-3.1835e+09F),(-0.000121631F),(391.854F),(4.28112e-10F),(-9.85535e+16F)},{(2.23645e+20F),(0.93546F),(-8.06951e+28F),(-4.12815e+24F),(-1.60942e-33F)},{(-8.93193e-37F),(-1.08249e-21F),(1.86596e+26F),(1.09918e+27F),(1.4722e-15F)},{(1677.81F),(-4.27381e-37F),(3.77992e-11F),(-3.73502e+15F),(-3.98109e+14F)},{(3.66725e+20F),(4.99423e-27F),(-1.14326e-11F),(-1.30115e-06F),(7.14156e+07F)}},{{(2.14927e+11F),(1.09572e+31F),(0.00380762F),(2.34444e-18F),(1.09949e+37F)},{(1.676e-23F),(-5.84408e-27F),(-0.0633172F),(6.91108e-37F),(0.00249128F)},{(-3.15531e+13F),(5.34266e+37F),(2.70704e+27F),(-1.2216e+09F),(4.42402e-25F)},{(1.35437e+10F),(5.03317e+15F),(3.01424e-33F),(-3.59152e-06F),(-4.25559e+22F)},{(-1.49647e+07F),(7.76757e-26F),(2.26376e-07F),(4.84116e+08F),(-1.35703e-05F)},{(-1.39455e-38F),(-4.62784e-16F),(4.85102e-08F),(-8.07823e-29F),(-1.22982e-37F)},{(7.03776e-23F),(2.844e-06F),(-2.54869e+10F),(-2.25162e-07F),(656523F)}},{{(1.88992e+10F),(-1.81938e+31F),(-2.40171e-22F),(4.64624e+14F),(-1.57732e+17F)},{(2.28713e-34F),(2.41515e-33F),(2.39198e+27F),(2.04282e-37F),(1.87632e-10F)},{(-1.86083e-38F),(0.00281926F),(1.16883e+33F),(-4.1733e+22F),(-1.63595e+33F)},{(-4.65272e+10F),(3.0113e-28F),(-1.41037e+10F),(-3.21504e+20F),(-4.44763e-31F)},{(-2.58449e+22F),(-3.19765e+13F),(-1.31052e+29F),(-9.37062e-25F),(-9.69698e-08F)},{(-2.96439e+29F),(-7.85585e+21F),(-3.58504e+25F),(-1.9789e+29F),(-1.03382e-10F)},{(6.33382e+32F),(-2.18153e-07F),(-1.40454e-09F),(-9.65384e+08F),(-0.000427121F)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(587); + CrcCheck.ToByteArray(this.var_34,b,"var_34"); + CrcCheck.ToByteArray(this.var_42,b,"var_42"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_85,b,"var_85"); + CrcCheck.ToByteArray(this.var_87,b,"var_87"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_106[a0][a1][a2],b,"var_106" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/8944_2018110810324/cl_2.java b/test/testsuite/fuzz_test/fuzz/8944_2018110810324/cl_2.java new file mode 100644 index 0000000000000000000000000000000000000000..7d7df4bb36d7b94f2d4d6397d17e42bc9cdc54d3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/8944_2018110810324/cl_2.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=2002426344 + +import java.util.zip.CRC32; + +class cl_2 +{ + float var_43 = (0.00705635F); + short var_44 = (short)(28144); + boolean var_58 = false; + double var_90 = (-3.77577e+205D); + final long [][][] var_118 = {{{(-6835776911851970080L),(-7661766885307476979L),(7021108031236460354L)},{(-6717785316482534446L),(-2265487533673328013L),(3364730149395946703L)},{(-4086475557411249506L),(-7416825003383244322L),(-4281615386564610135L)},{(-8660135832382636921L),(7236722198954494165L),(666941446079777434L)},{(374524784315870121L),(2132060753071684399L),(-1722455106601114443L)},{(-1280300172955717585L),(64089930367028102L),(7899753253608523805L)}},{{(3804863160405632741L),(6146305579954534356L),(1272990792812914038L)},{(-362368250757313350L),(6912735447711992388L),(4108195234829810151L)},{(1318783314927363881L),(-2927785868745455805L),(5220306522505201242L)},{(3772012397437563301L),(4700779475346385300L),(5683112914609773719L)},{(-1852553249563618256L),(-2324306643831475883L),(1556101157159922391L)},{(1499543002832531491L),(7194901346931790026L),(-3599370033965436218L)}},{{(-403395892309007855L),(2780708331439117030L),(-4585651141878630016L)},{(-3194119004308184142L),(1120698158214047641L),(-5035790387167817916L)},{(-783621040011359683L),(2841826912945615757L),(1843091826797114220L)},{(5139604196448419315L),(-4091180761144564431L),(6051706170818322689L)},{(-6981154019223164760L),(-5786649948724538889L),(1330136224383842293L)},{(-3215695306954815581L),(-6371758387553150993L),(-7421034414194525079L)}},{{(-7788060738474515640L),(-5750277191085742612L),(2338184996020860587L)},{(6676355613225309810L),(-1627398256240383494L),(-5177700454906734611L)},{(4721773593932996573L),(1590132903331587961L),(5688216003394157558L)},{(1250041497324082894L),(1584756171324664788L),(4946451282291678579L)},{(120401343215744295L),(2863175398576648157L),(-958126065286781797L)},{(7359227404680140123L),(2995970353143586125L),(5204054584326916698L)}},{{(179752694919684922L),(1071156200504952304L),(6995143219733328042L)},{(-3869633867592758609L),(-5461949420766899424L),(-1538456673726926971L)},{(7763558764734385606L),(7252984783280110310L),(1806606513403541257L)},{(-6236176372067325717L),(2827514839675564820L),(8042244296472378620L)},{(-7302334697544476581L),(1672323277197073068L),(-2478103552548090080L)},{(-8673657381812486571L),(4291451784522550211L),(-2430754418800340915L)}}}; + long var_126 = (-2006042794509629037L); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(743); + CrcCheck.ToByteArray(this.var_43,b,"var_43"); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_90,b,"var_90"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_118[a0][a1][a2],b,"var_118" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_126,b,"var_126"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/CRC32.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/MainClass.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..5793fc844998db2527ed836d2bc1d27d2f4a1960 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/MainClass.java @@ -0,0 +1,417 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=562055798 + +//import java.util.zip.CRC32; + +class MainClass +{ + static cl_2 var_0 = new cl_2(); + int var_1 = (1122004019); + int var_11 = (-1002746498); + static int var_18 = (-1139912679); + static cl_36 [][][] var_22 = {{{new cl_36(),new cl_36(),new cl_36(),new cl_36(),new cl_36()},{new cl_36(),new cl_36(),new cl_36(),new cl_36(),new cl_36()},{new cl_36(),new cl_36(),new cl_36(),new cl_36(),new cl_36()},{new cl_36(),new cl_36(),new cl_36(),new cl_36(),new cl_36()},{new cl_36(),new cl_36(),new cl_36(),new cl_36(),new cl_36()},{new cl_36(),new cl_36(),new cl_36(),new cl_36(),new cl_36()},{new cl_36(),new cl_36(),new cl_36(),new cl_36(),new cl_36()}}}; + final static cl_36 var_88 = new cl_36(); + static cl_13 var_90 = new cl_13(); + static cl_90 var_91 = new cl_90(); + static double var_93 = (8.22911e+252D); + static long var_100 = (4503122085632155345L); + static cl_62 var_102 = new cl_62(); + static cl_54 var_103 = new cl_54(); + static int var_105 = (303198530); + static cl_13 [][][] var_111 = {{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}}}; + static int [] var_115 = {(-1571690185),(-970759882),(1991652120),(-669696234),(318268464),(1584053388),(413856125)}; + static double [][] var_116 = {{(2.52062e+160D),(-2.80349e-202D),(3.59411e+89D),(-1.04177e+158D),(-5.41562e-224D),(-1.30688e+85D)},{(-7.68155e-68D),(1.47923e-68D),(-2.66936e-195D),(4.54103e+42D),(-9.05878e+291D),(-8.35753e-13D)},{(-6.2019e+38D),(-2.80802e+139D),(2.73551e+57D),(7.35506e-49D),(1.0241e+102D),(6.4823e-160D)},{(2.00766e-44D),(-2.86711e-301D),(1.93441e-140D),(6.68322e+283D),(9.37107e+46D),(3.88929e+218D)},{(4.61023e+111D),(-5.28637e+198D),(-3.35273e-252D),(1.98096e-27D),(3.00333e-24D),(-390.51D)}}; + static short var_119 = (short)(711); + final static byte var_120 = (byte)(-93); + static float var_121 = (3.42748e-28F); + final cl_54 var_125 = new cl_54(); + static byte var_129 = (byte)(-77); + static byte var_133 = (byte)(-58); + static int [] var_146 = {(213681225),(917797468),(1703453099),(1975514187),(100324112),(859933663),(1105757930)}; + static cl_62 var_147 = new cl_62(); + byte var_150 = (byte)(-21); + byte var_157 = (byte)(38); + byte var_162 = (byte)(-77); + int var_166 = (1223194493); + boolean var_167 = false; + short var_186 = (short)(-16910); + long [][][] var_188 = {{{(251040175034142166L),(-1017838624896470823L),(8640183682441677996L)}},{{(-2346112031823275046L),(5717276985776911329L),(8209669736685574147L)}},{{(8460774121584454195L),(3599693839145174068L),(-1046932533146966805L)}}}; + final float [] var_201 = {(-1.8097e-34F),(3.43253e-29F),(-4.1478e-14F)}; + long [][] var_206 = {{(-7145671397784527040L),(-5027498359169005871L),(5515161228774217428L),(3035702808192712251L),(2194494319632750036L),(-7502851778525650002L),(-1520259254864457675L)},{(-6520243583538802188L),(-5687335895287053861L),(-7474244967595992695L),(6110400113532353123L),(1975375249134133440L),(9032331772705449942L),(-119376929282400358L)},{(-2438769712612079726L),(-7656869317174821101L),(3758470692260150946L),(5485373376446729263L),(8811846896379394517L),(5890619851931364143L),(4296490875179000727L)},{(1531906342554827838L),(-1456982423573236724L),(548210755332485415L),(-3252561297374455064L),(3716703693783842563L),(-7723660947173797416L),(-5137530956868450325L)}}; + byte var_211 = (byte)(-56); + boolean [] var_223 = {false,false,false,false,true,false,false}; + boolean var_225 = true; +/*********************************/ +public strictfp void run() +{ + cl_13 [][][] var_183 = {{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}}}; + int var_217 = (1227149212); + long [][] var_185 = {{(-1964917947140095547L),(-6252139511761656837L),(2923727817940921792L),(1126670586500292949L),(1600305000746561643L),(-8397128416659110153L),(1241696697424712513L)},{(1165287087420308212L),(7475404362845392482L),(4743674113055699216L),(6451349393610889394L),(-3981237494141580743L),(7964571968683554941L),(1972212015705355446L)},{(-7908235873304355788L),(-360897741297600212L),(4126888831220363559L),(-7550704559153904759L),(370587249266359070L),(7905273400709641305L),(3994501914618960985L)},{(6856620705903451409L),(-981994771951375776L),(5758108375893793467L),(-2093617019608793249L),(7944035047795988588L),(-8923748386753549694L),(-938586372749885273L)},{(4758149816482233606L),(-492671370423861126L),(-4431032207190537842L),(4797048608040770285L),(3295735311593990652L),(-4847493282698209047L),(5482885486295549908L)}}; + long [][][] var_191 = {{{(6011558292446441006L),(-8382947076583808184L),(-32560175039113664L)}},{{(-5802686623747381769L),(6106104163182044765L),(6180063868567813524L)}},{{(-5657714566540278080L),(-2743501546538924405L),(-3464290881039743223L)}}}; + cl_13 var_236 = new cl_13(); + byte var_212 = (byte)(-57); + try + { + float [][] var_193 = {{(4.34528e+29F),(-1.42554e+13F),(-8.27832e+06F),(4.81371e+17F),(8.61658e+19F)},{(3.53531e-36F),(-6.95574e-25F),(5.31847e+11F),(0.000945329F),(-1.62035e+09F)},{(9.49715e-34F),(-2.84867F),(-5.53908e+26F),(-4.63579e+14F),(-7.30271e-28F)},{(8.31676e-23F),(0.0457945F),(0.004954F),(-2.51226e-05F),(15014.3F)},{(9.45593e-15F),(-6.11493e-21F),(8.78175e+11F),(-2.07188e-26F),(-1.58087e+09F)},{(1.37494e+29F),(1.71276e-37F),(6.2811e-06F),(13.1385F),(7.80296e-24F)}}; + for( var_1 = 852 ;(var_1>804);var_1 = (var_1-16) ) + { + float var_181 = (-9.64058e+27F); + byte var_190 = (byte)(21); + short var_189 = (short)(-24181); + int var_2 = (-2067582894); + int var_187 = (-1202468623); + final cl_13 var_209 = new cl_13(); + for( var_2 = 557 ;(var_2>467);var_2 = (var_2-18) ) + { + double var_197 = (-2.61492e+53D); + if( func_3((var_181--) ,var_183 ,var_185[(((--var_187)-( ( short )((++var_150)|func_14(((-(var_18++))>=func_19(func_23((var_186--) ,(var_119--) ,var_188 ,((var_150--)|( ( long )(var_18--) )) ,(!(!(!((var_189--)>=func_19(func_23((-(var_162--)) ,(+(+(var_190++))) ,var_191 ,(var_189++) ,var_88.var_192 ,(+(--var_187)) ,var_193[(((var_190--)*(875965952))&5)][(((var_129--)-var_91.var_92)&4)]) ,(!(!(!(!((var_189--)>var_150)))))))))) ,(var_18--) ,var_193[((var_18--)&5)][((var_190++)&4)]) ,((+(var_181--))>var_197))) ,(-1430862048846470904L) ,var_201)) ))&4)][((var_186++)&6)] ,var_103.var_204 ,var_206 ,(!((var_119++)<=var_90.var_67)))) + { + // if stmt begin,id=1 + var_90 = var_90 ; + // if stmt end,id=1 + } + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_210 ) + { + short var_213 = (short)(-22459); + final float [] var_229 = {(1.50557e-30F),(8.41871e-34F),(-1.22235e-33F)}; + if( ((++var_211)var_93)))) ,(~(++var_213)) ,var_229))&2)][(((--var_212)|func_14(var_0.var_226 ,((--var_217)-var_88.var_80) ,var_229))&6)] = var_236 ; + // if stmt end,id=2 + } + System.out.println("hello exception 0 !"); + } + return ; +} +public strictfp boolean func_3(float var_4, cl_13[][][] var_5, long var_6, float var_7, long[][] var_8, boolean var_9) +{ + byte var_179 = (byte)(-74); + int var_10 = (-1307589248); + byte var_180 = (byte)(34); + for( var_10 = 540 ;(var_10>524);var_10 = (var_10-16) ) + { + final cl_13 var_178 = new cl_13(); + for( var_11 = 896 ;(var_11>881);var_11 = (var_11-5) ) + { + int var_12 = (-1127823822); + for( var_12 = 882 ;(var_12<894);var_12 = (var_12+12) ) + { + short var_13 = (short)(-6996); + byte var_172 = (byte)(-82); + try + { + var_6 = ((var_13--)+func_14((!(!(!(!(!(!(!(((var_172--)*( ( float )((--var_172)-(short)(10597)) ))==var_0.var_69)))))))) ,(var_100--) ,var_0.var_175)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_177 ) + { + var_5[((+((--var_150)-var_172))&6)][2][((~(var_13--))&6)] = var_178 ; + System.out.println("hello exception 1 !"); + } + } + } + } + return ((-(var_179++))<=func_19(var_22 ,((~(var_180--))!=var_88.var_56))); +} +public strictfp int func_14(boolean var_15, long var_16, float[] var_17) +{ + byte var_163 = (byte)(39); + short var_171 = (short)(-18535); + if( ((var_18--)>=func_19(var_22 ,(!((((var_162--)-( ( byte )(+(+(var_163--))) ))+var_0.var_164)900);var_166 = (var_166-10) ) + { + try + { + if( var_167) + { + // if stmt begin,id=4 + double var_168 = (1.53401e+260D); + // if stmt end,id=4 + } + } + catch( java.lang.ArithmeticException myExp_169 ) + { + final double var_170 = (1.68787e-15D); + System.out.println("hello exception 2 !"); + } + } + // else stmt end,id=1 + } + return ((++var_171)&var_11); +} +public strictfp double func_19(cl_36[][][] var_20, boolean var_21) +{ + byte var_155 = (byte)(103); + short var_161 = (short)(-15585); + int var_159 = (893161623); + var_20 = func_23((var_121++) ,(-(++var_150)) ,var_147.var_152 ,(1919832956875528966L) ,(!((var_155--)<=var_121)) ,((-(++var_157))*var_18) ,(var_159--)) ; + return (var_161--); +} +public static strictfp cl_36[][][] func_23(double var_24, long var_25, long[][][] var_26, long var_27, boolean var_28, long var_29, float var_30) +{ + short var_113 = (short)(-12806); + byte var_134 = (byte)(101); + try + { + byte var_127 = (byte)(19); + int var_118 = (-71419698); + byte var_126 = (byte)(107); + try + { + int var_31 = (-976086289); + cl_54 var_117 = new cl_54(); + for( var_31 = 562 ;(var_31>532);var_31 = (var_31-6) ) + { + byte var_114 = (byte)(-48); + if( func_32((((--var_113)*var_90.var_67)*( ( float )((var_114++)*( ( double )(--var_113) )) )) ,var_115[6] ,var_116 ,var_117 ,(((+((var_118++)|var_119))*var_120)-var_121) ,(-9.39773e+201D) ,(var_118--))) + { + // if stmt begin,id=5 + var_115[((~(+(+(var_119--))))&6)] = (var_114--) ; + // if stmt end,id=5 + } + } + } + catch( java.lang.IllegalArgumentException myExp_122 ) + { + int var_123 = (-285951642); + for( var_123 = 123 ;(var_123<167);var_123 = (var_123+11) ) + { + if( var_103.var_124) + { + // if stmt begin,id=6 + var_26[((var_126--)&2)][((var_129--)&0)][(((var_126++)*( ( short )((-((+(var_127++))-var_120))|var_0.var_128) ))&2)] = (++var_129) ; + // if stmt end,id=6 + } + else + { + // else stmt begin,id=2 + var_129 = (++var_129) ; + // else stmt end,id=2 + } + } + System.out.println("hello exception 3 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_130 ) + { + int var_131 = (-809014070); + for( var_131 = 375 ;(var_131<420);var_131 = (var_131+9) ) + { + int var_132 = (-45793922); + try + { + try + { + var_26[(((--var_133)+( ( byte )(--var_113) ))&2)][((var_132++)&0)][((--var_129)&2)] = (var_134++) ; + } + catch( java.lang.IllegalArgumentException myExp_135 ) + { + var_91 = var_91 ; + System.out.println("hello exception 5 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_136 ) + { + cl_62 var_148 = new cl_62(); + if( func_32((~(var_134--)) ,(~(--var_113)) ,var_116 ,var_103 ,(+(var_132--)) ,(~(--var_113)) ,(var_132++))) + { + // if stmt begin,id=7 + var_115 = var_146 ; + // if stmt end,id=7 + } + else + { + // else stmt begin,id=3 + var_102 = var_147 ; + // else stmt end,id=3 + } + System.out.println("hello exception 6 !"); + } + } + System.out.println("hello exception 4 !"); + } + return var_22; +} +public static strictfp boolean func_32(double var_33, int var_34, double[][] var_35, cl_54 var_36, float var_37, double var_38, float var_39) +{ + short var_89 = (short)(26302); + try + { + byte var_40 = (byte)(-63); + cl_36 var_99 = new cl_36(); + if( ((var_40--)>=var_88.func_41((((var_89--)%var_90.var_67)-var_91.var_92) ,(var_34++) ,var_93))) + { + // if stmt begin,id=8 + byte var_98 = (byte)(100); + long var_94 = (1991724884086878635L); + if( (!((++var_94)==var_93))) + { + // if stmt begin,id=9 + var_33 = (var_34++) ; + var_35[((var_40--)&4)][((++var_34)&5)] = (2.10614e-294D) ; + int var_95 = (1937430938); + var_0.var_84 = ((var_40--)|var_18) ; + for( var_95 = 1018 ;(var_95<1060);var_95 = (var_95+14) ) + { + long var_96 = (-1761468709165761613L); + byte var_97 = (byte)(-107); + var_90 = var_90 ; + long var_101 = (3523956801908826148L); + var_89 = (--var_97) ; + var_35[((((var_18++)-var_98)+var_18)&4)][5] = (2.59389e+107D) ; + var_34 = (--var_89) ; + var_22[(((--var_40)&var_98)&0)][((var_18--)&6)][((+(++var_89))&4)] = var_99 ; + var_98 = (--var_40) ; + var_35[((var_40++)&4)][((++var_98)&5)] = (-((var_94++)*var_100)) ; + } + if( ((var_98--)>var_102.var_70)) + { + // if stmt begin,id=10 + var_36 = var_103 ; + var_103 = var_103 ; + // if stmt end,id=10 + } + else + { + // else stmt begin,id=4 + boolean [][][] var_104 = {{{true,false,true},{true,true,true}},{{true,true,true},{false,false,false}},{{false,false,true},{true,true,true}},{{false,true,false},{true,false,false}},{{false,false,true},{true,true,false}},{{false,true,true},{false,false,true}},{{true,true,true},{true,false,false}}}; + // else stmt end,id=4 + } + // if stmt end,id=9 + } + // if stmt end,id=8 + } + else + { + // else stmt begin,id=5 + for( var_105 = 414 ;(var_105<423);var_105 = (var_105+3) ) + { + byte var_107 = (byte)(30); + try + { + var_37 = (+(++var_107)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_108 ) + { + boolean var_109 = false; + System.out.println("hello exception 7 !"); + } + } + // else stmt end,id=5 + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_110 ) + { + final cl_13 [][][] var_112 = {{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}},{{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()},{new cl_13(),new cl_13(),new cl_13(),new cl_13(),new cl_13()}}}; + var_111 = var_111 ; + System.out.println("hello exception 8 !"); + } + return false; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2128); + CrcCheck.ToByteArray(this.var_0.GetChecksum(),b,"var_0.GetChecksum()"); + CrcCheck.ToByteArray(this.var_1,b,"var_1"); + CrcCheck.ToByteArray(this.var_11,b,"var_11"); + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_22[a0][a1][a2].GetChecksum(),b,"var_22" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_88.GetChecksum(),b,"var_88.GetChecksum()"); + CrcCheck.ToByteArray(this.var_90.GetChecksum(),b,"var_90.GetChecksum()"); + CrcCheck.ToByteArray(this.var_91.GetChecksum(),b,"var_91.GetChecksum()"); + CrcCheck.ToByteArray(this.var_93,b,"var_93"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + CrcCheck.ToByteArray(this.var_102.GetChecksum(),b,"var_102.GetChecksum()"); + CrcCheck.ToByteArray(this.var_103.GetChecksum(),b,"var_103.GetChecksum()"); + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_111[a0][a1][a2].GetChecksum(),b,"var_111" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_115[a0],b,"var_115" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_116[a0][a1],b,"var_116" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_119,b,"var_119"); + CrcCheck.ToByteArray(this.var_120,b,"var_120"); + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + CrcCheck.ToByteArray(this.var_125.GetChecksum(),b,"var_125.GetChecksum()"); + CrcCheck.ToByteArray(this.var_129,b,"var_129"); + CrcCheck.ToByteArray(this.var_133,b,"var_133"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_146[a0],b,"var_146" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_147.GetChecksum(),b,"var_147.GetChecksum()"); + CrcCheck.ToByteArray(this.var_150,b,"var_150"); + CrcCheck.ToByteArray(this.var_157,b,"var_157"); + CrcCheck.ToByteArray(this.var_162,b,"var_162"); + CrcCheck.ToByteArray(this.var_166,b,"var_166"); + CrcCheck.ToByteArray(this.var_167,b,"var_167"); + CrcCheck.ToByteArray(this.var_186,b,"var_186"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_188[a0][a1][a2],b,"var_188" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_201[a0],b,"var_201" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_206[a0][a1],b,"var_206" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_211,b,"var_211"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_223[a0],b,"var_223" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_225,b,"var_225"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/Start.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..926b8dae49a6b635dcd50f850a1150c2fc65598e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_90.java cl_13.java CRC32.java cl_54.java CrcCheck.java cl_2.java cl_36.java cl_62.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_13.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_13.java new file mode 100644 index 0000000000000000000000000000000000000000..98d2717914119f0320a268361ba3213ffbb5c050 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_13.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=562055798 + +//import java.util.zip.CRC32; + +class cl_13 +{ + int var_51 = (521886791); + short var_67 = (short)(-24192); + float var_106 = (-5.33762e+13F); + int [] var_144 = {(255938857),(571133095),(2055296712),(-874156808),(-922067068),(-991268056),(2041932737)}; + double var_165 = (-4.83364e-221D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(46); + CrcCheck.ToByteArray(this.var_51,b,"var_51"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_106,b,"var_106"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_144[a0],b,"var_144" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_165,b,"var_165"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_2.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_2.java new file mode 100644 index 0000000000000000000000000000000000000000..f2889a46fafdd54a6d501605033785e57ac59cd4 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_2.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=562055798 + +//import java.util.zip.CRC32; + +class cl_2 +{ + double var_69 = (2.54755e+77D); + int var_84 = (-2144056568); + final short var_128 = (short)(-22137); + float var_164 = (-4.33295e+32F); + final float [] var_175 = {(-2.10171e+09F),(-8.40217e+21F),(35003.4F)}; + boolean var_226 = false; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(31); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + CrcCheck.ToByteArray(this.var_128,b,"var_128"); + CrcCheck.ToByteArray(this.var_164,b,"var_164"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_175[a0],b,"var_175" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_226,b,"var_226"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_36.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_36.java new file mode 100644 index 0000000000000000000000000000000000000000..ddff1f644aa3f3049b27f9875f81131695e3d4f1 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_36.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=562055798 + +//import java.util.zip.CRC32; + +class cl_36 +{ + static cl_62 var_45 = new cl_62(); + static cl_62 var_46 = new cl_62(); + static byte var_49 = (byte)(118); + static cl_13 var_50 = new cl_13(); + static short var_55 = (short)(17501); + static byte var_56 = (byte)(25); + static float var_58 = (8.26229e-23F); + final static int var_59 = (1837781307); + static boolean [][] var_61 = {{true,false,false,true,false,false,true},{true,false,false,false,false,false,true}}; + static cl_90 [] var_63 = {new cl_90(),new cl_90(),new cl_90(),new cl_90(),new cl_90(),new cl_90(),new cl_90()}; + static cl_2 var_68 = new cl_2(); + static cl_90 var_72 = new cl_90(); + cl_54 var_77 = new cl_54(); + static long var_80 = (-8262623291482743395L); + static cl_90 [][][] var_85 = {{{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()}},{{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()}},{{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()}},{{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()}},{{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()}},{{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()}},{{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()},{new cl_90()}}}; + boolean var_192 = false; +/*********************************/ +public static strictfp double func_41(double var_42, int var_43, double var_44) +{ + cl_62 var_48 = new cl_62(); + final cl_62 var_47 = new cl_62(); + long var_71 = (-4788488930917280969L); + var_45 = var_45 ; + try + { + int var_52 = (-1708290202); + long [][] var_54 = {{(-6439977511481605073L),(204169792377164169L),(4264860963100523580L),(-6594282010483217515L),(1746090773575480056L),(-1725169554061938793L)},{(1028114363963694798L),(-3727112267505007076L),(-6466961320828199640L),(-5633731504916805457L),(7223848039868116531L),(6691711377299466364L)},{(-4484739099686920597L),(8363234525886361145L),(6840632644817413684L),(555543424487400466L),(4367475543088006272L),(-7640285056295658529L)},{(1856355051434501000L),(4485729909746370028L),(5693136440840199232L),(-4216823176677630405L),(4074315525800633891L),(8440532654940915080L)},{(743735206775877524L),(4327866582946608453L),(-9005912035171288156L),(-2225285242338284485L),(1917872863795100539L),(-9025872264880270333L)}}; + long var_66 = (7727455565855199924L); + boolean [][] var_79 = {{false,false,true,true,true,true,false},{true,false,false,false,true,true,true}}; + var_43 = (((--var_49)-var_50.var_51)*var_50.var_51) ; + for( var_52 = 409 ;(var_52>352);var_52 = (var_52-19) ) + { + byte var_65 = (byte)(-21); + short var_57 = (short)(-21511); + var_54[(((var_55++)*( ( short )(++var_56) ))&4)][5] = (++var_57) ; + int var_75 = (1113916789); + cl_90 var_76 = new cl_90(); + if( (!((--var_58)( ( byte )(~(--var_62)) )))) ; + var_54[((var_57++)&4)][((var_65++)&5)] = ((var_66--)|var_50.var_67) ; + var_68.var_69 = (9.03785e+185D) ; + var_54[((++var_55)&4)][5] = (var_71--) ; + var_43 = (var_56++) ; + // if stmt end,id=12 + } + else + { + // else stmt begin,id=6 + final double [] var_74 = {(-2.89252e+230D),(-1.46179e-131D),(3.00718e-295D),(1.78586e+220D)}; + var_72.var_73 = (-((var_49++)|var_59)) ; + var_43 = ((var_65--)|( ( byte )(1084964685) )) ; + var_72 = var_76 ; + double var_81 = (3.95381e-153D); + var_61 = var_79 ; + var_72 = var_72 ; + var_75 = ((var_65++)-var_59) ; + var_63[(((var_56--)|var_59)&6)] = var_72 ; + var_54[(((var_65--)-( ( short )(--var_65) ))&4)][((+(++var_57))&5)] = ((++var_57)+var_55) ; + var_48 = var_47 ; + var_80 = (-(var_65--)) ; + var_63[((~(++var_49))&6)] = var_72 ; + var_46 = var_48 ; + var_61[((+(--var_65))&1)][(((--var_65)&( ( byte )(414342103) ))&6)] = ( ( boolean )var_46.var_82 ) ; + var_44 = (~(var_65--)) ; + var_54[((var_75--)&4)][((+(var_57--))&5)] = (~(~(var_65--))) ; + // else stmt end,id=6 + } + for( var_83 = 766 ;(var_83>722);var_83 = (var_83-11) ) + { + var_63[(var_83&6)] = var_76 ; + } + // if stmt end,id=11 + } + else + { + // else stmt begin,id=7 + if( (!(!(((++var_65)>( ( int )(-(var_71++)) ))!=( ( boolean )(!(!((var_56--)!=var_58))) ))))) + { + // if stmt begin,id=13 + var_75 = ((var_65--)+( ( byte )(~(var_55--)) )) ; + // if stmt end,id=13 + } + else + { + // else stmt begin,id=8 + var_85 = var_85 ; + // else stmt end,id=8 + } + // else stmt end,id=7 + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_86 ) + { + float var_87 = (-4.88188e-11F); + var_44 = (++var_87) ; + System.out.println("hello exception 9 !"); + } + return (5.79157e-303D); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(419); + CrcCheck.ToByteArray(this.var_45.GetChecksum(),b,"var_45.GetChecksum()"); + CrcCheck.ToByteArray(this.var_46.GetChecksum(),b,"var_46.GetChecksum()"); + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + CrcCheck.ToByteArray(this.var_50.GetChecksum(),b,"var_50.GetChecksum()"); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_59,b,"var_59"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_61[a0][a1],b,"var_61" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_63[a0].GetChecksum(),b,"var_63" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_68.GetChecksum(),b,"var_68.GetChecksum()"); + CrcCheck.ToByteArray(this.var_72.GetChecksum(),b,"var_72.GetChecksum()"); + CrcCheck.ToByteArray(this.var_77.GetChecksum(),b,"var_77.GetChecksum()"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_85[a0][a1][a2].GetChecksum(),b,"var_85" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_192,b,"var_192"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_54.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_54.java new file mode 100644 index 0000000000000000000000000000000000000000..93cc0741618d98320e120553725dc891610224df --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_54.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=562055798 + +//import java.util.zip.CRC32; + +class cl_54 +{ + boolean [][] var_78 = {{true,false,false,true,true,false,true},{false,true,true,true,false,true,true}}; + boolean var_124 = true; + float var_204 = (7.74887e+24F); + short var_224 = (short)(-18056); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(21); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_78[a0][a1],b,"var_78" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_124,b,"var_124"); + CrcCheck.ToByteArray(this.var_204,b,"var_204"); + CrcCheck.ToByteArray(this.var_224,b,"var_224"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_62.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_62.java new file mode 100644 index 0000000000000000000000000000000000000000..249c2ea9a1254c461bf027083136879f60d69731 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_62.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=562055798 + +//import java.util.zip.CRC32; + +class cl_62 +{ + int var_70 = (-1276667820); + boolean var_82 = true; + long [][][] var_152 = {{{(-898702243760780436L),(5876736178110465074L),(-6519475233774475400L)}},{{(-851705288654769878L),(1031812173926028730L),(-3046868964285581010L)}},{{(-759969941149653280L),(-7237429914075822952L),(-8823324555111280352L)}}}; + byte var_219 = (byte)(28); + short var_234 = (short)(25807); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(80); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_82,b,"var_82"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_152[a0][a1][a2],b,"var_152" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_219,b,"var_219"); + CrcCheck.ToByteArray(this.var_234,b,"var_234"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_90.java b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_90.java new file mode 100644 index 0000000000000000000000000000000000000000..46ed85ec31d5fb2756d49814364cf606e678e7e3 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/901_2019010205106/cl_90.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=562055798 + +//import java.util.zip.CRC32; + +class cl_90 +{ + double var_73 = (2.55812e-290D); + byte var_92 = (byte)(-106); + final int [] var_145 = {(-798421850),(793534968),(-1990461087),(-136012755),(515092830),(-186787448),(646139024)}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(37); + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_92,b,"var_92"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_145[a0],b,"var_145" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/9218_2018110810324/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/9218_2018110810324/MainClass.java b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..09ed6092f148610c0bbff02792e5e531a8e96f77 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/MainClass.java @@ -0,0 +1,255 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1739368500 + +import java.util.zip.CRC32; + +class MainClass +{ + final static cl_2 var_0 = new cl_2(); + static cl_11 var_3 = new cl_11(); + static short var_18 = (short)(10565); + static byte var_24 = (byte)(54); + final static float var_25 = (8.8844e-12F); + static int [][][] var_29 = {{{(-1968663982),(614935130),(961448905),(239482967),(-750963999)},{(1453152981),(1631690095),(670147969),(32316332),(860515859)},{(1181641314),(213494698),(667809056),(1521482244),(2112890416)}}}; + static byte var_32 = (byte)(-74); + static boolean [][] var_35 = {{true,false},{false,false}}; + static boolean var_37 = true; + static cl_2 var_38 = new cl_2(); + final boolean var_40 = false; + static float var_44 = (-4.61208e-08F); + static double var_45 = (1.61515e-74D); + final static float [] var_51 = {(9.67231e-34F),(-1.56436e+34F),(0.000202185F),(5.54593e+35F)}; + int var_53 = (142818200); + static short var_55 = (short)(-3845); + static cl_2 [][] var_60 = {{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()},{new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()}}; + static byte var_61 = (byte)(-50); + static byte var_67 = (byte)(108); + static byte var_68 = (byte)(115); + static byte var_74 = (byte)(-11); + short var_81 = (short)(-9784); + short var_83 = (short)(-20876); + byte var_84 = (byte)(56); + int var_85 = (876489128); +/*********************************/ +public strictfp void run() +{ + int var_1 = (-1645778340); + for( var_1 = 779 ;(var_1>719);var_1 = (var_1-15) ) + { + int var_2 = (1465215761); + for( var_2 = 503 ;(var_2>484);var_2 = (var_2-19) ) + { + var_3 = func_4((~(--var_68)) ,var_3 ,(+(--var_84)) ,(var_85++)) ; + } + } + return ; +} +public strictfp cl_11 func_4(int var_5, cl_11 var_6, int var_7, double var_8) +{ + var_3 = var_3 ; + short var_82 = (short)(29976); + byte var_80 = (byte)(-68); + var_3 = func_9((~(-((var_67++)-var_68))) ,(!((--var_80)!=( ( float )(var_44--) ))) ,func_19((-6.03897e-35F) ,(((-(var_81++))|var_68)==( ( float )(+(var_82--)) )) ,(++var_44)) ,(var_83++) ,(var_53--) ,var_3) ; + return var_6; +} +public static strictfp cl_11 func_9(int var_10, boolean var_11, cl_2 var_12, int var_13, int var_14, cl_11 var_15) +{ + try + { + cl_2 [] var_17 = {new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2(),new cl_2()}; + try + { + short var_69 = (short)(2424); + var_17[(((++var_18)|var_18)&5)] = func_19((var_67++) ,(!((--var_68)!=( ( byte )((--var_68)|var_14) ))) ,((var_69++)|var_18)) ; + } + catch( java.lang.ArithmeticException myExp_70 ) + { + int var_71 = (-1890393280); + byte var_72 = (byte)(49); + for( var_71 = 773 ;(var_71<806);var_71 = (var_71+11) ) + { + var_14 = (var_72--) ; + } + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.ArithmeticException myExp_73 ) + { + try + { + try + { + var_68 = (var_74--) ; + } + catch( java.lang.IllegalArgumentException myExp_75 ) + { + long var_76 = (3162276562421140997L); + System.out.println("hello exception 2 !"); + } + } + catch( java.lang.ArithmeticException myExp_77 ) + { + try + { + boolean var_78 = true; + } + catch( java.lang.ArithmeticException myExp_79 ) + { + var_14 = (var_10++) ; + System.out.println("hello exception 4 !"); + } + System.out.println("hello exception 3 !"); + } + System.out.println("hello exception 1 !"); + } + return var_15; +} +public static strictfp cl_2 func_19(float var_20, boolean var_21, float var_22) +{ + if( ((var_22++)==func_23())) + { + try + { + var_22 = func_23() ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_57 ) + { + var_38 = var_0 ; + System.out.println("hello exception 5 !"); + } + } + else + { + int var_58 = (797637041); + cl_2 var_62 = new cl_2(); + for( var_58 = 121 ;(var_58>70);var_58 = (var_58-17) ) + { + float [] var_65 = {(-2.03567e-21F),(-4.35866e-13F),(-5.09731e+06F),(1.97471e+26F),(9.37763e-27F)}; + long var_66 = (-9105122984094177637L); + try + { + var_60[2][((var_61++)&4)] = var_38 ; + } + catch( java.lang.ArithmeticException myExp_63 ) + { + var_65[((var_55--)&4)] = (var_66--) ; + System.out.println("hello exception 6 !"); + } + } + } + return var_38; +} +public static strictfp float func_23() +{ + float [] var_48 = {(-1.26907e-17F),(-2.81854e+10F),(1.26185e-28F),(-5.70073e+08F)}; + if( ((++var_24)!=var_25)) + { + int var_26 = (-1989184580); + byte var_42 = (byte)(95); + cl_11 var_41 = new cl_11(); + int var_31 = (287015190); + for( var_26 = 614 ;(var_26>572);var_26 = (var_26-14) ) + { + final int [][][] var_30 = {{{(-281125114),(422201905),(-1338304073),(-1648216153),(-889168997)},{(961116953),(-896954515),(-2108678955),(1178504231),(1613522552)},{(-497994352),(953058846),(-583631065),(-1768719686),(2071522112)}}}; + boolean [][] var_34 = {{false,false},{false,true}}; + long var_36 = (-8491334862745215890L); + short var_43 = (short)(23232); + if( (!(!(!(!(((++var_24)&var_3.var_27)==var_18)))))) + { + var_29 = var_30 ; + var_29[0][((var_31++)&2)][((~(var_18--))&4)] = ((--var_32)-( ( int )(~(~(++var_32))) )) ; + var_31 = (-(++var_24)) ; + } + else + { + var_0.var_33 = var_35 ; + } + if( var_37) + { + int var_39 = (-1221532258); + var_38 = var_0 ; + var_3 = var_41 ; + var_41 = var_3 ; + int var_46 = (1485435813); + var_34[((var_43++)&1)][((var_42++)&1)] = (!(!((var_44++)>var_45))) ; + var_0.var_47 = (++var_42) ; + var_32 = (++var_42) ; + var_36 = ( ( long )((var_42--)&( ( int )((var_24++)|var_38.var_49) )) ) ; + var_34[((++var_31)&1)][((--var_42)&1)] = var_34[((var_31++)&1)][1] ; + var_31 = (var_18++) ; + } + else + { + var_48 = var_51 ; + var_34[((++var_43)&1)][((~(var_31--))&1)] = (!(!((-(+(~(var_24++))))>( ( double )var_3.var_54 )))) ; + } + } + } + return ((--var_55)*var_0.var_56); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(265); + CrcCheck.ToByteArray(this.var_0.GetChecksum(),b,"var_0.GetChecksum()"); + CrcCheck.ToByteArray(this.var_3.GetChecksum(),b,"var_3.GetChecksum()"); + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + CrcCheck.ToByteArray(this.var_24,b,"var_24"); + CrcCheck.ToByteArray(this.var_25,b,"var_25"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<5;++a2){ + CrcCheck.ToByteArray(this.var_29[a0][a1][a2],b,"var_29" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_35[a0][a1],b,"var_35" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_37,b,"var_37"); + CrcCheck.ToByteArray(this.var_38.GetChecksum(),b,"var_38.GetChecksum()"); + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_51[a0],b,"var_51" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_53,b,"var_53"); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<5;++a1){ + CrcCheck.ToByteArray(this.var_60[a0][a1].GetChecksum(),b,"var_60" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_61,b,"var_61"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + CrcCheck.ToByteArray(this.var_81,b,"var_81"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + CrcCheck.ToByteArray(this.var_85,b,"var_85"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/9218_2018110810324/Start.java b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..95cf66d6aea49dbd4eb70db2c56a84c35109d796 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java CrcCheck.java cl_2.java cl_11.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/9218_2018110810324/cl_11.java b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/cl_11.java new file mode 100644 index 0000000000000000000000000000000000000000..3904ba2e30515836776dd8682a5b46621dab31ed --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/cl_11.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1739368500 + +import java.util.zip.CRC32; + +class cl_11 +{ + byte var_27 = (byte)(17); + final float [] var_52 = {(423.15F),(2.82571e-30F),(-2.91327e-07F),(-1.73488e+14F)}; + final int var_54 = (-735128114); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(21); + CrcCheck.ToByteArray(this.var_27,b,"var_27"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_52[a0],b,"var_52" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/9218_2018110810324/cl_2.java b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/cl_2.java new file mode 100644 index 0000000000000000000000000000000000000000..f3392a951ee637eddefe2abf12ee488f70171f42 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9218_2018110810324/cl_2.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1739368500 + +import java.util.zip.CRC32; + +class cl_2 +{ + boolean [][] var_33 = {{false,false},{false,false}}; + float var_47 = (-1.43591e+38F); + final long var_49 = (5016591342775283226L); + float [] var_50 = {(-2.18702e-05F),(5.93315e+18F),(-2.69541e+15F),(-1.33626e-13F)}; + short var_56 = (short)(-9910); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(34); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_33[a0][a1],b,"var_33" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_47,b,"var_47"); + CrcCheck.ToByteArray(this.var_49,b,"var_49"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_50[a0],b,"var_50" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/9432_2018110810324/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..3cc1d5c532bb6175de1e1afce7d059d0c2a65620 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/CrcCheck.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.util.zip.CRC32; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + System.out.printf("Buffer-Counter=%d\tLength=%d\n",buffer_counter,size); + } +} + +public class CrcCheck{ + /**************************************************************/ + public static void ToByteArray(byte args,CrcBuffer b,String var_name){ + b.buffer[b.i] = args; + b.i++; + //System.out.printf("Index=%d\tByte-Value=0x%x\n",b.i-1,args); + System.out.printf("Index=%d\tVarName=%s\tByte-Value=%d\n",b.i-1,var_name,args); + } + + public static void ToByteArray(short args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tShort-Value=0x%x\n",b.i-2,args); + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tInt-Value=0x%x\n",b.i-4,args); + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + //System.out.printf("Index=%d\tLong-Value=0x%x\n",b.i-8,args); + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + //System.out.printf("Index=%d\tFloat-Value=0x%x\n",b.i-4,iargs); + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + //System.out.printf("Index=%d\tDouble-Value=0x%x\n",b.i-8,largs); + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/9432_2018110810324/MainClass.java b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..0d369710c3a8387ced9e2e80f3973148e9f5d472 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/MainClass.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4207841504 + +import java.util.zip.CRC32; + +class MainClass +{ + int var_0 = (-1476218996); + byte var_1 = (byte)(-14); + float var_2 = (-120380F); + cl_10 var_129 = new cl_10(); + final short var_130 = (short)(17519); + short var_132 = (short)(-26979); + final cl_30 var_135 = new cl_30(); + cl_30 var_136 = new cl_30(); + float [] var_140 = {(-831121F),(-1.73252e-28F),(-1.86107e+26F),(-0.0273218F),(-340.879F),(-4.05017e-12F)}; + byte var_144 = (byte)(-22); +/*********************************/ +public strictfp void run() +{ + long var_141 = (-7811991078010770292L); + try + { + cl_10 [][][] var_7 = {{{new cl_10()},{new cl_10()},{new cl_10()},{new cl_10()}},{{new cl_10()},{new cl_10()},{new cl_10()},{new cl_10()}},{{new cl_10()},{new cl_10()},{new cl_10()},{new cl_10()}},{{new cl_10()},{new cl_10()},{new cl_10()},{new cl_10()}},{{new cl_10()},{new cl_10()},{new cl_10()},{new cl_10()}}}; + float [] var_3 = {(2.74098e+26F),(2.78115e-23F),(-1.12842e-29F),(1.07519e-35F),(7.15578e-31F),(-4.77547e-13F)}; + final cl_10 var_133 = new cl_10(); + byte var_138 = (byte)(-31); + try + { + short var_4 = (short)(-31368); + byte var_5 = (byte)(-128); + try + { + int var_131 = (-323860893); + var_0 = (var_1++) ; + var_2 = ((var_5--)-var_2) ; + var_7[(((++var_132)+( ( short )(+((++var_132)&var_130)) ))&4)][(((((var_5--)|var_129.func_8((++var_5) ,( ( boolean )((++var_4)>=(1916790553)) ) ,(var_1++)))*var_130)-( ( short )((--var_4)|var_131) ))&3)][0] = var_129 ; + } + catch( java.lang.IllegalArgumentException myExp_134 ) + { + var_136 = var_135 ; + System.out.println("hello exception 0 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_137 ) + { + if( ((--var_138)>var_1)) + { + var_140[(((++var_138)*( ( byte )(-(var_138++)) ))&5)] = (+(var_141--)) ; + } + System.out.println("hello exception 1 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_142 ) + { + int var_143 = (718878022); + for( var_143 = 173 ;(var_143>165);var_143 = (var_143-8) ) + { + try + { + var_141 = (var_144--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_145 ) + { + var_129.var_20 = var_136 ; + System.out.println("hello exception 3 !"); + } + } + System.out.println("hello exception 2 !"); + } + return ; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(62); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + CrcCheck.ToByteArray(this.var_1,b,"var_1"); + CrcCheck.ToByteArray(this.var_2,b,"var_2"); + CrcCheck.ToByteArray(this.var_129.GetChecksum(),b,"var_129.GetChecksum()"); + CrcCheck.ToByteArray(this.var_130,b,"var_130"); + CrcCheck.ToByteArray(this.var_132,b,"var_132"); + CrcCheck.ToByteArray(this.var_135.GetChecksum(),b,"var_135.GetChecksum()"); + CrcCheck.ToByteArray(this.var_136.GetChecksum(),b,"var_136.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_140[a0],b,"var_140" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_144,b,"var_144"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/9432_2018110810324/Start.java b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..af8dad5ff25cf3b42f4b8fd8252a5affee6933cb --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_10.java MainClass.java cl_30.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/9432_2018110810324/cl_10.java b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/cl_10.java new file mode 100644 index 0000000000000000000000000000000000000000..adc1069d2ce46016deac4d6dbd30956fec87f35c --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/cl_10.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4207841504 + +import java.util.zip.CRC32; + +class cl_10 +{ + static int var_15 = (1665282460); + int var_16 = (-1654816327); + long var_17 = (5164870651219311796L); + static byte var_18 = (byte)(8); + static cl_30 var_20 = new cl_30(); + static int var_39 = (-273882084); + static int var_40 = (-1124863236); + cl_30 [][] var_44 = {{new cl_30()}}; + int var_58 = (1228919859); + static float var_61 = (-8.95408e+14F); + short var_68 = (short)(26091); + short var_74 = (short)(-4230); + float var_75 = (-2.05739e+25F); + long [] var_76 = {(6216371109292698274L),(1083216293425525304L),(-7711913302944774631L),(4887362854401116592L),(1892156091706649854L),(6257962724691345859L)}; + float var_83 = (2.12552e-27F); + float var_93 = (-5.96993e+26F); + final double var_108 = (4.06709e+190D); + double [] var_113 = {(8.54411e-170D),(1.34894e-135D),(-1.19318e-246D)}; +/*********************************/ +public strictfp byte func_8(int var_9, boolean var_10, float var_11) +{ + double var_106 = (2.43432e+263D); + long var_14 = (-4967187714338565040L); + boolean [] var_110 = {false,false,true,false,true,true,true}; + long [] var_124 = {(6263709230429457362L),(-7426963152490145243L),(-1867635141918166348L),(1364718037576828918L),(340142574785680097L),(-360726570658698105L)}; + int var_12 = (867440107); + for( var_12 = 121 ;(var_12>99);var_12 = (var_12-11) ) + { + long [] var_13 = {(424432210488087587L),(6046928171780071687L),(-7929155055923452298L)}; + var_13[(var_12&2)] = (var_15--) ; + byte var_95 = (byte)(-98); + try + { + short var_100 = (short)(9361); + long [] var_118 = {(-4426359037331995190L),(-5215729288702026152L),(5749466905524955170L),(-4909458354772763198L),(-1477991171984591916L),(-5374007476797301397L)}; + try + { + double var_19 = (6.27768e+239D); + var_13[((-(var_18++))&2)] = (-(--var_18)) ; + var_20 = func_21((~(--var_95)) ,(((++var_18)&( ( short )func_37(var_76) ))!=var_20.var_60) ,func_21(((var_9--)+var_20.var_98) ,(!(!((((~var_17)*func_37(var_76))*var_20.var_53)!=var_20.var_53))) ,var_20 ,(var_100--)) ,(1309267245)) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_103 ) + { + var_20 = func_21((-1.69039e+202D) ,func_28(((var_95--)==var_18) ,(var_9++) ,(var_106--) ,(!((var_18++)==var_108)) ,( ( boolean )var_110[((var_16++)&6)] ) ,(--var_100) ,var_113[((var_9++)&2)]) ,func_21((var_18++) ,false ,var_20 ,((--var_18)*func_37(var_118))) ,(-951630709)) ; + System.out.println("hello exception 4 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_120 ) + { + int var_121 = (1073128126); + for( var_121 = 572 ;(var_121<588);var_121 = (var_121+4) ) + { + var_44[((var_95++)&0)][((--var_9)&0)] = func_21((var_15--) ,func_28(((~(((--var_95)-var_39)+var_20.var_60))!=( ( byte )var_16 )) ,(var_95++) ,(var_9++) ,(((var_95++)&var_18)>=var_16) ,(((~(--var_95))*( ( byte )(var_9--) ))>=func_37(var_20.var_79)) ,(((--var_95)-func_37(var_124))-( ( int )(++var_95) )) ,var_20.var_98) ,var_20 ,(var_95--)) ; + } + System.out.println("hello exception 5 !"); + } + } + return (byte)(-55); +} +public strictfp cl_30 func_21(double var_22, boolean var_23, cl_30 var_24, int var_25) +{ + int var_26 = (-266163421); + boolean [] var_69 = {true}; + short var_81 = (short)(-24160); + for( var_26 = 913 ;(var_26>888);var_26 = (var_26-5) ) + { + byte var_70 = (byte)(-65); + float var_94 = (1.93526e-35F); + int var_27 = (-1341182215); + for( var_27 = 149 ;(var_27<169);var_27 = (var_27+4) ) + { + long var_87 = (-5083949310354351351L); + if( (!(!(!(!(!(!(!func_28(((((--var_68)|( ( short )(var_18++) ))var_20.var_67)); +} +public static strictfp int func_37(long[] var_38) +{ + short var_49 = (short)(15213); + cl_30 var_50 = new cl_30(); + float [][] var_54 = {{(-1.69525e+33F),(-0.0151553F),(2.97713e-34F),(-9.9794e-12F),(-1.20694e-36F),(3.16958e-16F)},{(2.00451e+33F),(-5.57333e+12F),(-9762.86F),(0.000104696F),(6.28072e+30F),(4.55586e-28F)},{(1.74617e+08F),(3.98413e-36F),(-0.00111256F),(-1.73723e-16F),(2.04626e-11F),(-1.72911e+35F)},{(0.0169271F),(-2.83528e+37F),(-1.29531e-33F),(2.69125e-15F),(0.00682841F),(1.83245e+17F)},{(-7.61392e-29F),(-1.04757e+11F),(-1.93383e+34F),(-7.44056e-24F),(1.33943e+27F),(2.34731e-16F)},{(6.14987e-37F),(3.40208e+20F),(1.66222e+37F),(-3.69803e-31F),(8.61004e+14F),(3.37854e+27F)},{(-1.7142e+16F),(4.35777e+14F),(6.69628e+07F),(-1.47556e+06F),(-5.14456e+20F),(-3.84215e+12F)}}; + short var_52 = (short)(-1417); + for( var_39 = 722 ;(var_39>688);var_39 = (var_39-17) ) + { + int var_43 = (1473760079); + byte var_42 = (byte)(63); + long var_45 = (-2342694371417114213L); + boolean [][][] var_41 = {{{false,true,true,true},{false,true,false,true},{true,true,false,true}},{{true,false,true,true},{true,true,false,false},{true,false,true,true}},{{false,false,false,false},{true,false,false,false},{true,true,true,false}},{{true,false,true,true},{false,false,false,false},{false,true,true,false}}}; + for( var_40 = 755 ;(var_40<771);var_40 = (var_40+8) ) + { + short var_47 = (short)(27493); + float var_55 = (0.000648431F); + if( var_41[((var_43++)&3)][((var_42++)&2)][((~(++var_42))&3)]) + { + var_20 = var_20 ; + long [][] var_48 = {{(-9177000120553669461L),(-8253218339243082426L),(-8175911463019101460L),(5422198958313843271L),(-2203575790063572879L)},{(1617578896941092384L),(-2357694639469549838L),(6809714430953322647L),(-2300559944743649402L),(2112109360063773035L)}}; + final float var_46 = (2.09964e+26F); + var_38[5] = (var_45++) ; + var_38[((var_47--)&5)] = var_48[((-((var_42--)-var_40))&1)][(((--var_49)+var_15)&4)] ; + var_20 = var_50 ; + var_41[(((var_42++)|var_20.var_51)&3)][((var_42--)&2)][(((var_42++)*var_18)&3)] = (!((++var_52)<=var_40)) ; + } + else + { + cl_30 var_56 = new cl_30(); + final double var_57 = (-5.01492e+93D); + long var_59 = (2206821409489407498L); + var_20.var_53 = (++var_55) ; + var_54[((-(var_42++))&6)][((--var_43)&5)] = (-(++var_47)) ; + var_20 = var_20 ; + var_54[((var_43--)&6)][(((var_42++)&var_20.var_60)&5)] = (((var_45++)-var_20.var_51)-var_61) ; + } + } + } + return (1470562575); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(145); + CrcCheck.ToByteArray(this.var_15,b,"var_15"); + CrcCheck.ToByteArray(this.var_16,b,"var_16"); + CrcCheck.ToByteArray(this.var_17,b,"var_17"); + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + CrcCheck.ToByteArray(this.var_20.GetChecksum(),b,"var_20.GetChecksum()"); + CrcCheck.ToByteArray(this.var_39,b,"var_39"); + CrcCheck.ToByteArray(this.var_40,b,"var_40"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_44[a0][a1].GetChecksum(),b,"var_44" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_61,b,"var_61"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_74,b,"var_74"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_76[a0],b,"var_76" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + CrcCheck.ToByteArray(this.var_93,b,"var_93"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_113[a0],b,"var_113" + "["+ Integer.toString(a0)+"]"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/9432_2018110810324/cl_30.java b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/cl_30.java new file mode 100644 index 0000000000000000000000000000000000000000..a590225411c12159a4a5f24cdc41a3e0d5b59183 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/9432_2018110810324/cl_30.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4207841504 + +import java.util.zip.CRC32; + +class cl_30 +{ + byte var_51 = (byte)(-60); + float var_53 = (-0.000238842F); + int var_60 = (-1180599096); + short var_67 = (short)(-24652); + final long [] var_79 = {(6923186734960061747L),(8998571473782451298L),(481779532784134326L),(2945776523141392048L),(958507896735344602L),(3002565063472025662L)}; + final double var_98 = (2.75558e+130D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(67); + CrcCheck.ToByteArray(this.var_51,b,"var_51"); + CrcCheck.ToByteArray(this.var_53,b,"var_53"); + CrcCheck.ToByteArray(this.var_60,b,"var_60"); + CrcCheck.ToByteArray(this.var_67,b,"var_67"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_79[a0],b,"var_79" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/CRC32.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..ef6737ec32b5eee3362ad6583b8f2f8da47c3801 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/MainClass.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..85bb1dd1784c6e3afcd090032b2e524fc978da0b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/MainClass.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=891913062 + +//import java.util.zip.CRC32; + +class MainClass +{ + int var_2 = (2146229479); + byte var_6 = (byte)(-65); + byte var_7 = (byte)(2); + cl_16 var_269 = new cl_16(); + cl_22 var_271 = new cl_22(); + byte var_272 = (byte)(-44); + byte var_274 = (byte)(89); +/*********************************/ +public strictfp void run() +{ + cl_16 [][] var_5 = {{new cl_16(),new cl_16(),new cl_16(),new cl_16(),new cl_16()},{new cl_16(),new cl_16(),new cl_16(),new cl_16(),new cl_16()}}; + int var_0 = (-402150138); + int var_1 = (899471717); + float [][] var_273 = {{(0.000661089F),(-7.57298e+19F),(1.14346e+22F),(1.8068e+15F),(-9.76507e-22F),(17.7746F),(-7.60457e+35F)},{(-0.00717972F),(5.68144e+19F),(-0.000197248F),(3.0041e+16F),(3.43892e-11F),(-1.98188e+18F),(-2.09758e-31F)},{(-2.17942e+37F),(-8.98393e-35F),(6.14997e-19F),(2.33687e+10F),(759.761F),(-2.20643e+26F),(1.78145e-30F)},{(6.07886e-05F),(6.05346e-12F),(-3.10547e-26F),(8.00567F),(1.59597e+29F),(2.54163e+18F),(5.60818e+26F)},{(-13.7298F),(0.00890299F),(-3.28114e+29F),(3.8621e+10F),(4.52111e+14F),(-0.00757979F),(-20111.2F)},{(-2.88573e+38F),(4.37368e-33F),(0.000477598F),(-2.98987e-19F),(727.092F),(6.48941e+19F),(-2.1691e+35F)}}; + for( var_0 = 814 ;(var_0>798);var_0 = (var_0-8) ) + { + var_1 = (var_1--) ; + cl_22 var_270 = new cl_22(); + for( var_2 = 126 ;(var_2>70);var_2 = (var_2-14) ) + { + int var_3 = (1253864195); + for( var_3 = 853 ;(var_3<861);var_3 = (var_3+2) ) + { + cl_16 var_276 = new cl_16(); + try + { + cl_16 var_275 = new cl_16(); + var_5[((((var_7--)+var_269.func_8(var_270 ,( ( double )var_271.var_105 ) ,((var_6++)-var_271.var_70) ,var_269.var_112.var_113 ,(~(var_272--)) ,var_273[(((-(var_274--))+var_269.var_173)&5)][((var_1--)&6)]))&var_271.var_98)&1)][((var_6--)&4)] = var_276 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_277 ) + { + float [][][] var_278 = {{{(5.4814e+23F),(2.3889e+27F),(-1.61564e-23F),(5.26907e-32F),(1.46714e+38F),(5.48471e-27F)},{(5.65326e-12F),(-5.7253e+07F),(3.77543e-26F),(9.07915e+31F),(28.9343F),(-1.33793e+36F)},{(1.17083e-30F),(2.61508e+26F),(-1.23743e+36F),(-0.00182486F),(-9.44175e-29F),(-6.35386e-16F)},{(-4.57474e+34F),(-5.78743e+24F),(-4.17356e+27F),(1.02571e-17F),(5.83021e-20F),(1.16245e-24F)},{(2.81907e-14F),(-5.56676e+33F),(3.10777e-34F),(-3.51015e+31F),(-8.53833e-13F),(1.90719e+16F)}}}; + System.out.println("hello exception 0 !"); + } + } + } + } + return ; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(24); + CrcCheck.ToByteArray(this.var_2,b,"var_2"); + CrcCheck.ToByteArray(this.var_6,b,"var_6"); + CrcCheck.ToByteArray(this.var_7,b,"var_7"); + CrcCheck.ToByteArray(this.var_269.GetChecksum(),b,"var_269.GetChecksum()"); + CrcCheck.ToByteArray(this.var_271.GetChecksum(),b,"var_271.GetChecksum()"); + CrcCheck.ToByteArray(this.var_272,b,"var_272"); + CrcCheck.ToByteArray(this.var_274,b,"var_274"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/Start.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..4a5c55087ad184da95c5a7b0cddbaa8789f8a837 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_47.java MainClass.java cl_16.java cl_22.java CRC32.java cl_38.java cl_75.java cl_26.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_16.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_16.java new file mode 100644 index 0000000000000000000000000000000000000000..0f59b2e10f0e9cd153247bb1c280e0dd91a33255 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_16.java @@ -0,0 +1,504 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=891913062 + +//import java.util.zip.CRC32; + +class cl_16 +{ + byte var_26 = (byte)(-104); + byte var_28 = (byte)(99); + cl_47 var_112 = new cl_47(); + cl_26 var_115 = new cl_26(); + cl_22 var_123 = new cl_22(); + cl_75 var_125 = new cl_75(); + short var_127 = (short)(28958); + double var_129 = (-4.53417e-292D); + cl_38 var_130 = new cl_38(); + int var_134 = (-1790372161); + boolean var_135 = false; + final cl_22 var_137 = new cl_22(); + byte var_144 = (byte)(-21); + byte var_150 = (byte)(13); + short var_152 = (short)(17317); + double [][][] var_159 = {{{(-4.61695e-08D)},{(-4.29539e-77D)}}}; + byte var_164 = (byte)(36); + float [][] var_172 = {{(-5.365e-20F),(3.277e-11F)}}; + byte var_173 = (byte)(-73); + float var_182 = (-0.232778F); + long var_188 = (-674257538108763575L); + cl_26 var_202 = new cl_26(); + int var_204 = (-1450227658); + int [][] var_210 = {{(1483094535)},{(1612377117)},{(-658585493)},{(-467969445)},{(264611748)},{(-435592747)}}; + int [][] var_215 = {{(-1056170149),(-1628610274),(1788605485),(724810104),(890772629),(1155505994)},{(-1541536030),(1949236545),(819396064),(-2102034557),(950865426),(-152790901)},{(-311735275),(1177570259),(-2125619074),(4029879),(1518800835),(244609645)},{(1906918185),(-778475969),(1242590706),(1185911583),(188021746),(866142095)},{(130915987),(-1215300988),(-1363373085),(-1977491025),(13717996),(599084883)},{(-1178901147),(255561778),(467935495),(-795500103),(1732423224),(-826377315)}}; + float [][] var_222 = {{(3.3064e+13F),(-7.45402e+25F),(3.39178e-18F),(-8.34002e+06F),(459981F),(-3.27802e-07F)},{(-0.0572016F),(-1.39689e-26F),(-2.55714e-15F),(2.05135e-25F),(-2.99971e+09F),(4.84731e-35F)},{(9.60557e+36F),(4.32286e+14F),(1.80246e-06F),(1.85387e-16F),(4.35572e+06F),(-7.58282e-35F)},{(-1.36109e-23F),(-1725.87F),(3.7144e+33F),(7.69269e-24F),(-5.16538e-05F),(1.45025e+29F)},{(5.8746e-24F),(-4.3697e+10F),(-7.41471e+15F),(3.24344e+25F),(-8.29162e-18F),(-9.44667e+18F)}}; + final long [][] var_226 = {{(2760847932034566150L),(-3288020988750547996L),(2164229170932754194L),(-2386905526470459110L),(357645196812601363L),(5737379582358870733L),(-3202895124863977017L)}}; + int var_230 = (794794087); + int [][] var_234 = {{(1800150459)},{(-1366696909)},{(-1852878197)},{(2080490533)},{(-1767903692)},{(1242300358)}}; + cl_47 var_235 = new cl_47(); + short var_239 = (short)(27735); + int var_248 = (522350573); + byte var_256 = (byte)(-55); +/*********************************/ +public strictfp byte func_8(cl_22 var_9, double var_10, long var_11, cl_26 var_12, float var_13, float var_14) +{ + short var_15 = (short)(-13867); + int var_240 = (-2028765789); + boolean [] var_260 = {true,false,false}; + short var_250 = (short)(25564); + short var_246 = (short)(10023); + short var_237 = (short)(-11676); + int var_253 = (112736963); + double var_241 = (-1.14221e+277D); + byte var_252 = (byte)(70); + double [][][] var_242 = {{{(-6.30889e+77D),(-3.48211e-57D)},{(4.71625e-147D),(-7.35665e+18D)}},{{(-3.99636e+125D),(-2.02745e+95D)},{(1.25479e-176D),(-9.45439e+299D)}}}; + int var_243 = (-556142757); + if( ((var_15++)>=func_16((++var_237) ,(((var_239--)|func_16((var_240++) ,(var_241++) ,(((var_28--)+var_150)+func_16(var_242[((var_248--)&1)][(((var_243++)-func_16((var_129++) ,(~(--var_144)) ,(~(var_246++))))&1)][((++var_239)&1)] ,(--var_250) ,func_16((--var_14) ,(--var_252) ,((var_152--)*func_16((+(++var_253)) ,(-4.91697e-200D) ,(2122119049))))))))+var_125.var_105) ,(~((+(var_256++))+var_130.var_98))))) + { + // if stmt begin,id=1 + var_235.var_50.var_51.var_105 = ((--var_252)*( ( int )(byte)(72) )) ; + // if stmt end,id=1 + } + else + { + // else stmt begin,id=1 + int var_258 = (923894227); + for( var_258 = 149 ;(var_258<181);var_258 = (var_258+16) ) + { + if( true) + { + // if stmt begin,id=2 + int var_259 = (-234793802); + for( var_259 = 831 ;(var_259<834);var_259 = (var_259+3) ) + { + var_260[(var_259&2)] = ((var_241--)<=var_202.var_50.var_83) ; + } + // if stmt end,id=2 + } + else + { + // else stmt begin,id=2 + double [][][] var_263 = {{{(-2.22235e-13D)},{(-2.51732e-261D)}}}; + try + { + var_240 = ((-(-((--var_250)+var_235.var_63.var_70)))-func_29((-4.18649e+229D) ,var_235 ,var_263 ,(~(~(var_252--))) ,var_130.var_105)) ; + } + catch( java.lang.IllegalArgumentException myExp_267 ) + { + final double var_268 = (1.46981e-199D); + System.out.println("hello exception 1 !"); + } + // else stmt end,id=2 + } + } + // else stmt end,id=1 + } + return (++var_26); +} +public strictfp int func_16(double var_17, double var_18, int var_19) +{ + byte var_214 = (byte)(66); + long [][] var_208 = {{(5914844855026414659L),(1123064348323412315L),(-104768638287438716L),(-6617819226020809327L),(3300735520088549170L),(160589059526008435L),(-331361302381217589L)}}; + int var_217 = (-264520748); + long var_206 = (103477175518298158L); + final double [][][] var_229 = {{{(-5.99785e+259D)},{(-5.55311e-106D)}}}; + if( func_20((--var_206) ,var_208 ,var_210 ,var_130 ,(-((--var_173)&var_19)))) + { + // if stmt begin,id=3 + short var_219 = (short)(-7295); + int var_216 = (777386629); + if( (!((~((++var_214)&(6306611006825434458L)))>func_37(var_215[(((++var_150)-func_29((var_214++) ,var_112 ,var_159 ,(~(var_217--)) ,(var_214++)))&5)][((var_216--)&5)] ,(var_219--) ,(var_217--))))) + { + // if stmt begin,id=4 + try + { + try + { + final boolean var_223 = true; + } + catch( java.lang.IllegalArgumentException myExp_224 ) + { + var_208[((var_214--)&0)][(((var_214++)&var_137.var_105)&6)] = (var_217--) ; + System.out.println("hello exception 2 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_225 ) + { + if( ((var_214++)<=var_115.func_41())) + { + // if stmt begin,id=5 + var_208 = var_226 ; + // if stmt end,id=5 + } + else + { + // else stmt begin,id=3 + var_159 = var_229 ; + // else stmt end,id=3 + } + System.out.println("hello exception 3 !"); + } + // if stmt end,id=4 + } + else + { + // else stmt begin,id=4 + for( var_230 = 786 ;(var_230<806);var_230 = (var_230+5) ) + { + if( ((+(++var_214))>var_112.var_113.var_66)) + { + // if stmt begin,id=6 + var_217 = ((++var_214)-var_134) ; + // if stmt end,id=6 + } + } + // else stmt end,id=4 + } + // if stmt end,id=3 + } + else + { + // else stmt begin,id=5 + if( ((var_214++)>var_202.var_100)) + { + // if stmt begin,id=7 + int var_231 = (1148536602); + for( var_231 = 157 ;(var_231<217);var_231 = (var_231+12) ) + { + int var_232 = (-345744927); + for( var_232 = 615 ;(var_232<619);var_232 = (var_232+1) ) + { + var_159 = var_229 ; + } + } + // if stmt end,id=7 + } + else + { + // else stmt begin,id=6 + if( (!(!(((var_214++)!=var_182)&func_20(((var_152++)|( ( long )(var_144--) )) ,var_112.var_63.var_233 ,var_234 ,var_130 ,((~(var_214--))-var_112.var_66)))))) + { + // if stmt begin,id=8 + int var_236 = (2087855895); + for( var_236 = 950 ;(var_236>930);var_236 = (var_236-4) ) + { + var_208[(((var_173++)-var_125.var_105)&0)][((var_217--)&6)] = (+(+(var_214++))) ; + } + // if stmt end,id=8 + } + // else stmt end,id=6 + } + // else stmt end,id=5 + } + return (1082897994); +} +public strictfp boolean func_20(long var_21, long[][] var_22, int[][] var_23, cl_38 var_24, double var_25) +{ + final float [][][] var_161 = {{{(3.25187e-12F),(1.28857e+25F),(1.0385e-21F),(136.598F),(-9.13195e+07F)},{(-2.25499e-38F),(-1.19313e+22F),(-3.23017e-24F),(3.00607e+35F),(0.0077986F)},{(4.7491e+24F),(-1.11404e+23F),(1.07313e+18F),(-9.11351e-36F),(-9.30753e-31F)},{(615.818F),(-0.000384097F),(-8.72975e-12F),(-4.59537e+11F),(-1.93696e-10F)},{(-4.33991e+27F),(1.22856e-31F),(-5.94313e+26F),(2.34321e+27F),(-1.22046e+36F)},{(-1.37043e+15F),(6.7402e+24F),(4.80208e+35F),(3.1309e+18F),(-2.21892e+09F)},{(-0.152379F),(5.53616e+36F),(-2.7747e+21F),(9.27215e+24F),(2.91685e-14F)}},{{(-3.98476e+15F),(8.1303e-24F),(3.84874e-22F),(-1.75835e-23F),(1.68462e+11F)},{(-6.85367e+17F),(-1.4972e+34F),(-4.89047e-34F),(4.45747e-17F),(7.03458e-25F)},{(-478387F),(-2.61272e-11F),(3.12372e-06F),(0.000201491F),(2.60597e-35F)},{(-1.29181e-20F),(-2.85913e+32F),(-3.93823e+36F),(-6.67657e-18F),(-3.21466e-31F)},{(-2.12415e+14F),(1.23139e-23F),(-1.35664e-07F),(-17870.7F),(-3.73021e+11F)},{(0.00087479F),(967086F),(-9.99443e-17F),(-7167.62F),(1.25636e-34F)},{(6.1495e-13F),(3.49101e+28F),(6.5565e-25F),(0.0147998F),(-9.3105e+36F)}},{{(-1.43052e+34F),(-3.47502e-09F),(-0.0089634F),(-1.4175e-19F),(-1.77892e-16F)},{(-2.30051e-05F),(-2.53938e-31F),(8.72229e-18F),(-7.1202e-09F),(3.69095e+11F)},{(0.00170407F),(114558F),(3.55364e+37F),(1.33829e+30F),(-2.76611e+07F)},{(4.23163e-34F),(-1.39392e+28F),(1.33262e-34F),(1.22697e+09F),(4.99828e-23F)},{(1.87221e+26F),(57.1988F),(1.05154e-23F),(-2.06185e+08F),(-4.64469e+22F)},{(-7.43461e+07F),(-1.03683e+29F),(-7.11289e-07F),(-1.52133e-16F),(-2.13136e+07F)},{(-5.7477e+26F),(-2.81042e+24F),(2.39523e+18F),(1.61561e-10F),(1.64968e+30F)}},{{(-3.22238e-18F),(3.21581e+10F),(-1.66931e-28F),(-9.07619e-26F),(-2.05655e+18F)},{(6.75408e+15F),(3.78883e+10F),(-7.54418e+08F),(61237.3F),(-3.68108e+22F)},{(-8.83739e-36F),(-1.37609e+11F),(-7.09081e+29F),(-7.73223e-33F),(-3.44553e-33F)},{(5.71638e-31F),(-1.2424e+18F),(3.04803e+34F),(-4.40497e-35F),(-4.18975e-25F)},{(1.2653e+07F),(2.09149e+23F),(1.50728e+27F),(-1.81284e-23F),(-8.72772e-10F)},{(-4.26619e+11F),(1.72969e-19F),(-2.88993e-10F),(-1.23267e+17F),(1.30615e-13F)},{(1.13414e+36F),(-8.23731e+26F),(1.33577e+06F),(-1.20233e+26F),(1.67552e-14F)}},{{(-2.7446e+31F),(-4.58987e+14F),(8.36744e-08F),(1.66754e+27F),(1.86214e-17F)},{(-2.14247e+15F),(-1.82425e-25F),(3.91474e+26F),(-0.0496652F),(3.99383e-05F)},{(-3.64362e+21F),(-4.52354e-22F),(5.25816e-36F),(-2.57072e+29F),(-2.36145e+35F)},{(-6.15559e+08F),(-1.63685e-24F),(6.79978e-35F),(-7.25486e+27F),(0.036405F)},{(-1.48978e+37F),(1.73355e+23F),(1.54712e+15F),(7.95076e+06F),(-1.36069e+06F)},{(-1.00051e-28F),(98627F),(2.67728e-36F),(3.21083e-26F),(7.3284e-22F)},{(-492.809F),(1.6875e+34F),(0.00684456F),(1.96173e+27F),(-1.39023e-13F)}},{{(3.82708e+21F),(-3797.05F),(2.93575e-17F),(-6.13862e-34F),(-0.00247761F)},{(-1.13011e-27F),(-93.5623F),(1.19268e-10F),(-4.76665e+10F),(9.16841e+21F)},{(1.20804e+07F),(5.21149e-37F),(-1.52376e+28F),(4.20305e+21F),(1.10971e-37F)},{(-8.25806e+37F),(2.20403e+10F),(-1.01352e-16F),(4.07753e+13F),(-4.39178e+27F)},{(-1.14642e-32F),(7.56785e+30F),(3.05501e-13F),(-3.72302e+12F),(-1.02988e+37F)},{(-4.94947e-25F),(-9.69239e-15F),(-2.53656e-13F),(6.48996e-13F),(-4.37876e+06F)},{(-1.1443e-16F),(2.45088e-22F),(-5.3779e-09F),(-1.92538F),(8.13838e-26F)}}}; + short var_175 = (short)(7035); + final double [][] var_143 = {{(-1.84164e+53D),(-2.03695e-176D),(-6.83831e+96D),(-3.89027e+84D),(8.66901e+103D)},{(7.92068e+217D),(8.31732e-253D),(5.85447e+264D),(1.05077e+194D),(1.73091e+278D)},{(2.64885e+235D),(-9.07487e-179D),(7.17201e+20D),(1.0216e-08D),(1.9656e-283D)},{(1.77851e-36D),(2.2865e-308D),(4.10836e-218D),(-1.16629e-11D),(0.021784D)},{(3.0183e+59D),(1.71256e+307D),(-7.69838e+198D),(2.95426e+302D),(-1.13577e+144D)},{(2.75028e-74D),(-9.86555e-167D),(5.38674e-254D),(-5.25033e-32D),(-4.74178e-160D)}}; + byte var_174 = (byte)(-31); + double [][][] var_147 = {{{(-1.02398e-161D)},{(5.83636e+51D)}}}; + int var_151 = (-200776647); + byte var_27 = (byte)(34); + byte var_153 = (byte)(-37); + short var_169 = (short)(-15158); + var_22[((var_26--)&0)][((--var_26)&6)] = (var_27++) ; + if( (!(!(((~(var_28++))+func_29(var_143[5][((-(++var_144))&4)] ,var_112 ,var_147 ,(-7.1488e+26F) ,((-(++var_150))&func_37((-(var_127++)) ,(var_151++) ,(((--var_152)*func_37(((+(~(var_153++)))*var_152) ,(var_152++) ,(var_21++)))|( ( int )func_29((var_25++) ,var_112 ,var_159 ,var_161[((++var_28)&5)][(((var_175++)&var_130.var_59.var_70)&6)][(((((++var_127)|func_37(var_134 ,var_125.var_83 ,((++var_164)+func_29(var_125.var_52 ,var_112 ,var_159 ,(~(var_26++)) ,((--var_169)|var_130.var_105)))))*var_134)|func_37((--var_152) ,var_172[0][((var_173++)&1)] ,((++var_174)*var_137.var_83)))&4)] ,(~(var_127++))) ))))))>=var_115.var_44)))) + { + // if stmt begin,id=9 + final cl_22 var_201 = new cl_22(); + if( ((--var_164)>var_134)) + { + // if stmt begin,id=10 + cl_47 var_190 = new cl_47(); + cl_22 var_185 = new cl_22(); + try + { + if( (!(!((var_21++)>func_29(( ( double )((++var_164)&var_115.var_100) ) ,var_112 ,var_159 ,(var_182++) ,(++var_175)))))) + { + // if stmt begin,id=11 + var_112.var_63 = var_112.var_113.var_63 ; + // if stmt end,id=11 + } + else + { + // else stmt begin,id=7 + int var_186 = (-2100799775); + // else stmt end,id=7 + } + } + catch( java.lang.ArithmeticException myExp_187 ) + { + if( ((++var_173)>=func_29((var_188--) ,var_190 ,var_159 ,( ( float )var_159[((((--var_174)&( ( int )var_188 ))|var_151)&0)][(((--var_144)-var_137.var_105)&1)][(((++var_28)-( ( byte )((++var_26)|var_123.var_98) ))&0)] ) ,(2054889229)))) + { + // if stmt begin,id=12 + var_159[((var_152--)&0)][((var_151++)&1)][((+((var_175++)&var_134))&0)] = (var_174++) ; + // if stmt end,id=12 + } + else + { + // else stmt begin,id=8 + double [] var_195 = {(5.80736e+213D),(4.85627e+188D),(-7.00751e-24D),(2.10707e+207D),(-5.20039e+220D),(4.44413e-117D),(2.16904e+272D)}; + // else stmt end,id=8 + } + System.out.println("hello exception 4 !"); + } + // if stmt end,id=10 + } + else + { + // else stmt begin,id=9 + if( (!((+(var_144--))==(2.88987e-35F)))) + { + // if stmt begin,id=13 + int var_196 = (-1690948266); + try + { + var_159[((-(var_196--))&0)][(((var_153++)+var_134)&1)][((var_174++)&0)] = (+((var_175++)|func_37((var_28++) ,var_172[(((var_175++)*var_130.var_69.var_105)&0)][((++var_27)&1)] ,(var_21++)))) ; + } + catch( java.lang.IllegalArgumentException myExp_200 ) + { + var_125.var_51 = var_112.var_113.var_63 ; + System.out.println("hello exception 5 !"); + } + // if stmt end,id=13 + } + // else stmt end,id=9 + } + // if stmt end,id=9 + } + else + { + // else stmt begin,id=10 + if( (!((--var_175)140);var_203 = (var_203-18) ) + { + for( var_204 = 183 ;(var_204<228);var_204 = (var_204+9) ) + { + cl_26 var_205 = new cl_26(); + } + } + // if stmt end,id=14 + } + // else stmt end,id=10 + } + return ((((var_26--)-( ( int )(var_144++) ))+func_37((736956335) ,(var_21--) ,(-2.14564e+09F)))==var_112.var_100); +} +public strictfp byte func_29(double var_30, cl_47 var_31, double[][][] var_32, float var_33, int var_34) +{ + byte var_142 = (byte)(-38); + int var_35 = (-1104075113); + short var_36 = (short)(19975); + for( var_35 = 720 ;(var_35>664);var_35 = (var_35-14) ) + { + byte var_132 = (byte)(-8); + if( (!(((--var_36)+func_37(var_115.var_62 ,(((var_36++)+( ( float )var_129 ))+var_130.var_77) ,(~(+(~(++var_132))))))313);var_134 = (var_134-18) ) + { + var_132 = (++var_26) ; + } + // if stmt end,id=16 + } + else + { + // else stmt begin,id=11 + if( (!((--var_132)!=( ( byte )(((var_28++)*var_132)*var_28) )))) + { + // if stmt begin,id=17 + cl_22 var_136 = new cl_22(); + var_112.var_113.var_63 = var_112.var_113.var_63 ; + // if stmt end,id=17 + } + else + { + // else stmt begin,id=12 + final boolean var_138 = false; + // else stmt end,id=12 + } + // else stmt end,id=11 + } + // if stmt end,id=15 + } + else + { + // else stmt begin,id=13 + int var_139 = (-1389258979); + try + { + var_32[((++var_139)&0)][((-(var_132--))&1)][((var_132--)&0)] = (var_132++) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_140 ) + { + final double var_141 = (1.31476e+232D); + System.out.println("hello exception 6 !"); + } + // else stmt end,id=13 + } + } + return (--var_142); +} +public strictfp short func_37(int var_38, float var_39, float var_40) +{ + try + { + byte var_119 = (byte)(65); + try + { + try + { + var_39 = (var_38++) ; + if( true) + { + // if stmt begin,id=18 + var_39 = var_112.var_113.func_41() ; + // if stmt end,id=18 + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_114 ) + { + cl_22 var_116 = new cl_22(); + var_115.var_47.var_72 = var_112.var_113.var_63 ; + System.out.println("hello exception 7 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_117 ) + { + int var_118 = (79052931); + for( var_118 = 952 ;(var_118>892);var_118 = (var_118-15) ) + { + var_112.var_113.var_63.var_79 = (((var_119--)+var_118)>var_115.var_100) ; + } + System.out.println("hello exception 8 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_120 ) + { + int var_121 = (-1264351428); + byte var_126 = (byte)(-98); + for( var_121 = 559 ;(var_121>551);var_121 = (var_121-8) ) + { + try + { + int var_122 = (-360770454); + for( var_122 = 438 ;(var_122<473);var_122 = (var_122+7) ) + { + var_123.var_52 = (-4.9514e+155D) ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_124 ) + { + if( var_125.var_79) + { + // if stmt begin,id=19 + var_125.var_51.var_83 = ((--var_126)-var_125.var_83) ; + // if stmt end,id=19 + } + else + { + // else stmt begin,id=14 + var_112.var_113.var_57.var_51 = var_112.var_113.var_63 ; + // else stmt end,id=14 + } + System.out.println("hello exception 10 !"); + } + } + System.out.println("hello exception 9 !"); + } + return var_127; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(506); + CrcCheck.ToByteArray(this.var_26,b,"var_26"); + CrcCheck.ToByteArray(this.var_28,b,"var_28"); + CrcCheck.ToByteArray(this.var_112.GetChecksum(),b,"var_112.GetChecksum()"); + CrcCheck.ToByteArray(this.var_115.GetChecksum(),b,"var_115.GetChecksum()"); + CrcCheck.ToByteArray(this.var_123.GetChecksum(),b,"var_123.GetChecksum()"); + CrcCheck.ToByteArray(this.var_125.GetChecksum(),b,"var_125.GetChecksum()"); + CrcCheck.ToByteArray(this.var_127,b,"var_127"); + CrcCheck.ToByteArray(this.var_129,b,"var_129"); + CrcCheck.ToByteArray(this.var_130.GetChecksum(),b,"var_130.GetChecksum()"); + CrcCheck.ToByteArray(this.var_134,b,"var_134"); + CrcCheck.ToByteArray(this.var_135,b,"var_135"); + CrcCheck.ToByteArray(this.var_137.GetChecksum(),b,"var_137.GetChecksum()"); + CrcCheck.ToByteArray(this.var_144,b,"var_144"); + CrcCheck.ToByteArray(this.var_150,b,"var_150"); + CrcCheck.ToByteArray(this.var_152,b,"var_152"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_159[a0][a1][a2],b,"var_159" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_164,b,"var_164"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_172[a0][a1],b,"var_172" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_173,b,"var_173"); + CrcCheck.ToByteArray(this.var_182,b,"var_182"); + CrcCheck.ToByteArray(this.var_188,b,"var_188"); + CrcCheck.ToByteArray(this.var_202.GetChecksum(),b,"var_202.GetChecksum()"); + CrcCheck.ToByteArray(this.var_204,b,"var_204"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_210[a0][a1],b,"var_210" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_215[a0][a1],b,"var_215" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_222[a0][a1],b,"var_222" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_226[a0][a1],b,"var_226" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_230,b,"var_230"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_234[a0][a1],b,"var_234" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_235.GetChecksum(),b,"var_235.GetChecksum()"); + CrcCheck.ToByteArray(this.var_239,b,"var_239"); + CrcCheck.ToByteArray(this.var_248,b,"var_248"); + CrcCheck.ToByteArray(this.var_256,b,"var_256"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_22.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_22.java new file mode 100644 index 0000000000000000000000000000000000000000..2282cb2caa979c187cf4875867ad24c79424a1ab --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_22.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=891913062 + +//import java.util.zip.CRC32; + +class cl_22 +{ + double var_52 = (-1.58283e-192D); + double [][] var_60 = {{(-1.13623e-26D),(1.15295e-95D)}}; + short var_70 = (short)(-20606); + long var_77 = (-9162618765334925357L); + boolean var_79 = true; + float var_83 = (-0.117283F); + int [][] var_85 = {{(1140900208),(-522518081),(1900805229),(1015796998),(-2054220036),(-153393417)},{(395530235),(-1092253506),(1059035801),(665929193),(-1161333663),(677400860)},{(322830173),(-180777288),(-1662218550),(-1791945529),(-1064377892),(-1107136883)},{(73233250),(-1541850910),(1946448617),(979927403),(623189034),(-202989021)},{(924605819),(1237579029),(-1456378024),(1248684531),(1318820020),(953459018)},{(-617757103),(-1756645354),(972588626),(859275119),(297054422),(53630449)},{(1800019048),(493799041),(1190037418),(760063388),(-1696223875),(-1724590965)}}; + byte var_98 = (byte)(-52); + float [][] var_104 = {{(-6.37308e-08F),(9.56346e-24F),(3.08358e-06F)},{(1.76707e-34F),(-3.83178e-32F),(-1.27352e+15F)},{(-4.32066e+24F),(-26.8362F),(-5.65954e-32F)},{(-1.90993e-08F),(1.08427e+26F),(-7.70627e-29F)},{(-1.79774e+10F),(-2.98281e+14F),(-5.8771e-17F)}}; + int var_105 = (281811251); + double [][][] var_228 = {{{(-4.26121e-270D)},{(3.96918e+24D)}}}; + long [][] var_233 = {{(3919675492134171771L),(7134998223499946416L),(1086193755178154353L),(-7075046952229330319L),(-2224761736025093518L),(-2274217576803292097L),(-3609729031079425131L)}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(344); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_60[a0][a1],b,"var_60" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_85[a0][a1],b,"var_85" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_104[a0][a1],b,"var_104" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_228[a0][a1][a2],b,"var_228" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_233[a0][a1],b,"var_233" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_26.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_26.java new file mode 100644 index 0000000000000000000000000000000000000000..adc3239ca2de5d0e1582ef918d56568c0ebf7ed5 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_26.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=891913062 + +//import java.util.zip.CRC32; + +class cl_26 +{ + double var_44 = (-2.18692e+133D); + cl_38 var_47 = new cl_38(); + cl_75 var_50 = new cl_75(); + short var_56 = (short)(-20913); + cl_75 var_57 = new cl_75(); + double [][] var_58 = {{(-3.96934e+269D),(-2.65052e+262D)}}; + cl_38 var_61 = new cl_38(); + int var_62 = (-733316110); + cl_22 var_63 = new cl_22(); + double var_66 = (-1.54056e+66D); + int var_68 = (635066393); + float var_80 = (-1.54752e+09F); + float var_84 = (-6.68475F); + final boolean [][] var_89 = {{false},{true},{true},{true},{true}}; + long [][][] var_91 = {{{(6208186973101825044L)},{(-547032690359480598L)},{(1659723907201866196L)},{(7924908436440505966L)},{(-850205436110835297L)},{(-8943228311262123540L)},{(6798597861561015916L)}},{{(1417257901741659515L)},{(-4279784671703280395L)},{(-1100837155507463990L)},{(-6933053955199695580L)},{(-1132359590297152248L)},{(3539926019281996517L)},{(-957608882347919556L)}}}; + float var_97 = (-7.08534e+37F); + byte var_100 = (byte)(-46); + long var_108 = (-7652666787860857524L); +/*********************************/ +public strictfp float func_41() +{ + short var_111 = (short)(-7863); + int var_42 = (1951259652); + byte var_43 = (byte)(-111); + float [][][] var_110 = {{{(3.08477e+22F),(-4.10046e-06F),(1.2971e-14F),(-0.00109818F),(5.35384e-37F)},{(-2.07571e-20F),(-6.06164e+17F),(-8.81794e-36F),(-2.22865e-09F),(4.6607e-11F)}},{{(1.42413e+35F),(-2.00228e+26F),(1.72966e+18F),(4.58727e+18F),(-3.58198e-35F)},{(-1.31302e-20F),(-13.513F),(-4.87348e-23F),(4.64192e-16F),(-1.06893e-26F)}},{{(-1.20701e+18F),(1.33142e-11F),(0.0460559F),(-1.67927e+24F),(-6.75184e+23F)},{(0.186206F),(6.33669e+27F),(1.48287e+38F),(-3.48719e+14F),(2.48282e+25F)}},{{(-5.88651e-37F),(-6.94587e+07F),(3.55706e-29F),(0.0334136F),(-4.12419e+24F)},{(2.00565e+11F),(1.70234e+06F),(5.40766e+11F),(1.14719e+19F),(108.456F)}},{{(1.66461e-26F),(-0.721477F),(-7.88709e-35F),(8.26479e-19F),(6.32095e-36F)},{(-4.29315F),(-6.68818e-12F),(3.57786e-21F),(4.53103e+11F),(-9.73089e+27F)}},{{(0.00104732F),(1.55147e-11F),(-3.827e-22F),(1.46534e-26F),(2.04726e-33F)},{(3.77811e+24F),(1.05489e+26F),(690.187F),(5.08429e-07F),(-14.7061F)}}}; + for( var_42 = 928 ;(var_42>876);var_42 = (var_42-13) ) + { + final cl_22 var_82 = new cl_22(); + cl_38 var_88 = new cl_38(); + float [] var_74 = {(9.54565e-12F),(8.66154e-16F),(-6.76024e+08F),(2.4836e+20F)}; + cl_38 [] var_86 = {new cl_38(),new cl_38(),new cl_38(),new cl_38()}; + short var_54 = (short)(11481); + if( ((var_43--)==var_44)) + { + // if stmt begin,id=20 + double [][] var_53 = {{(-1.629e-192D),(-1.92892e-37D)}}; + try + { + int var_55 = (370444248); + int var_45 = (-1286352111); + int var_67 = (-1437646064); + for( var_45 = 815 ;(var_45<828);var_45 = (var_45+13) ) + { + cl_75 var_49 = new cl_75(); + byte var_46 = (byte)(16); + var_44 = ((var_46++)+var_47.var_48) ; + var_50.var_51.var_52 = ((--var_56)*var_56) ; + var_50 = var_57 ; + var_44 = (var_54--) ; + var_53 = var_58 ; + } + int var_65 = (-1357336641); + byte var_90 = (byte)(53); + var_47 = var_61 ; + byte var_95 = (byte)(35); + long var_71 = (-8674232458972100281L); + short [][] var_92 = {{(short)(-14212),(short)(-30581),(short)(23542),(short)(-3841),(short)(22130),(short)(28497),(short)(16601)},{(short)(-21467),(short)(18501),(short)(31008),(short)(12829),(short)(14782),(short)(-23036),(short)(-10044)},{(short)(-1742),(short)(-17735),(short)(-30938),(short)(12748),(short)(5905),(short)(15271),(short)(11279)},{(short)(21702),(short)(-5464),(short)(3630),(short)(13579),(short)(5187),(short)(4812),(short)(32190)},{(short)(-23403),(short)(6460),(short)(13221),(short)(-18415),(short)(28332),(short)(-7322),(short)(-19839)},{(short)(21289),(short)(-7506),(short)(19665),(short)(12524),(short)(18488),(short)(-13075),(short)(20828)},{(short)(-20363),(short)(-23426),(short)(5544),(short)(-16994),(short)(-28881),(short)(-30631),(short)(7045)}}; + for( var_62 = 881 ;(var_62>875);var_62 = (var_62-3) ) + { + byte var_64 = (byte)(-72); + var_53[((var_64--)&0)][((var_56++)&1)] = (var_65++) ; + var_63.var_52 = (var_66++) ; + } + int var_93 = (-648769856); + for( var_67 = 899 ;(var_67<908);var_67 = (var_67+3) ) + { + long var_73 = (3723468944858729208L); + var_58[(((++var_68)|var_61.var_69.var_70)&0)][((++var_55)&1)] = (--var_71) ; + var_47.var_72 = var_47.var_59.var_51 ; + boolean [][][] var_75 = {{{false,false,false,true,false,true,false},{false,false,true,true,false,false,true}},{{true,true,true,true,true,true,false},{false,true,false,false,true,false,true}},{{false,false,true,false,true,false,false},{true,true,true,true,false,false,true}},{{true,true,true,false,true,true,true},{true,false,true,false,true,false,true}}}; + float var_76 = (-30.6388F); + var_74[(var_67&3)] = ((--var_71)+var_56) ; + boolean var_78 = true; + var_58 = var_53 ; + var_71 = ((var_43++)+var_47.var_77) ; + var_47.var_59.var_51.var_79 = ((var_56--)>=var_56) ; + final cl_38 var_87 = new cl_38(); + int var_81 = (-971284005); + var_74[(var_67&3)] = (var_68--) ; + var_63 = var_82 ; + var_47.var_72.var_83 = (var_84--) ; + var_86[(var_67&3)] = var_61 ; + var_58[((++var_56)&0)][((~(+(--var_90)))&1)] = ((var_43--)|var_61.var_70) ; + var_56 = (var_54++) ; + var_74[(var_67&3)] = (var_54++) ; + } + for( var_93 = 771 ;(var_93<811);var_93 = (var_93+10) ) + { + var_74[(var_93&3)] = (-(var_90++)) ; + final cl_75 var_102 = new cl_75(); + final boolean var_96 = true; + long var_94 = (412874238921031467L); + double var_101 = (-2.59482e-141D); + var_58 = var_53 ; + var_57.var_51.var_52 = ((+(++var_95))*var_71) ; + byte var_99 = (byte)(3); + var_61 = var_88 ; + final float var_103 = (-85502.3F); + var_58[(((++var_43)*var_43)&0)][((~(var_55++))&1)] = ((var_97--)-var_63.var_98) ; + var_63 = var_47.var_59.var_51 ; + var_92[(((--var_99)+var_57.var_98)&6)][(((++var_90)-var_57.var_98)&6)] = var_92[((var_100--)&6)][(((+(++var_56))|var_100)&6)] ; + var_91[((++var_55)&1)][((var_68--)&6)][((var_65++)&0)] = (var_54++) ; + var_86[((+(var_65--))&3)] = var_88 ; + var_53[0][((var_54--)&1)] = (var_71--) ; + var_63.var_105 = ((--var_100)&( ( byte )(+((var_90++)*var_61.var_105)) )) ; + } + } + catch( java.lang.ArithmeticException myExp_106 ) + { + var_88 = var_61 ; + System.out.println("hello exception 11 !"); + } + // if stmt end,id=20 + } + else + { + // else stmt begin,id=15 + int var_107 = (1383292840); + for( var_107 = 938 ;(var_107>906);var_107 = (var_107-8) ) + { + if( (!((--var_43)>(byte)(32)))) + { + // if stmt begin,id=21 + var_63.var_77 = ((var_43++)*var_108) ; + // if stmt end,id=21 + } + else + { + // else stmt begin,id=16 + int var_109 = (1951305913); + var_91[((var_56--)&1)][((var_109--)&6)][(((var_56++)|(-724663924))&0)] = ((var_43++)&var_108) ; + // else stmt end,id=16 + } + } + // else stmt end,id=15 + } + } + return var_110[((var_68++)&5)][((var_111--)&1)][(((var_68--)+var_63.var_70)&4)]; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(220); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + CrcCheck.ToByteArray(this.var_47.GetChecksum(),b,"var_47.GetChecksum()"); + CrcCheck.ToByteArray(this.var_50.GetChecksum(),b,"var_50.GetChecksum()"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_57.GetChecksum(),b,"var_57.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_58[a0][a1],b,"var_58" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_61.GetChecksum(),b,"var_61.GetChecksum()"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_63.GetChecksum(),b,"var_63.GetChecksum()"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_89[a0][a1],b,"var_89" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_91[a0][a1][a2],b,"var_91" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_97,b,"var_97"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_38.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_38.java new file mode 100644 index 0000000000000000000000000000000000000000..ba5b43488747ced2c26b2132b7d836812ff56b23 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_38.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=891913062 + +//import java.util.zip.CRC32; + +class cl_38 extends cl_22 +{ + double var_48 = (6.30766e-294D); + cl_75 var_59 = new cl_75(); + final cl_22 var_69 = new cl_22(); + cl_22 var_72 = new cl_22(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(376); + CrcCheck.ToByteArray(this.var_48,b,"var_48"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_59.GetChecksum(),b,"var_59.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_60[a0][a1],b,"var_60" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_69.GetChecksum(),b,"var_69.GetChecksum()"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_72.GetChecksum(),b,"var_72.GetChecksum()"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_85[a0][a1],b,"var_85" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_104[a0][a1],b,"var_104" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_228[a0][a1][a2],b,"var_228" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_233[a0][a1],b,"var_233" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_47.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_47.java new file mode 100644 index 0000000000000000000000000000000000000000..5aa0a1d29eb614ee6963c17454d4f21c5267743f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_47.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=891913062 + +//import java.util.zip.CRC32; + +class cl_47 extends cl_26 +{ + cl_26 var_113 = new cl_26(); + final double [][][] var_227 = {{{(1.69356e-68D)},{(-1.8527e-37D)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(244); + CrcCheck.ToByteArray(this.var_44,b,"var_44"); + CrcCheck.ToByteArray(this.var_47.GetChecksum(),b,"var_47.GetChecksum()"); + CrcCheck.ToByteArray(this.var_50.GetChecksum(),b,"var_50.GetChecksum()"); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_57.GetChecksum(),b,"var_57.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_58[a0][a1],b,"var_58" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_61.GetChecksum(),b,"var_61.GetChecksum()"); + CrcCheck.ToByteArray(this.var_62,b,"var_62"); + CrcCheck.ToByteArray(this.var_63.GetChecksum(),b,"var_63.GetChecksum()"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + CrcCheck.ToByteArray(this.var_80,b,"var_80"); + CrcCheck.ToByteArray(this.var_84,b,"var_84"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<1;++a1){ + CrcCheck.ToByteArray(this.var_89[a0][a1],b,"var_89" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_91[a0][a1][a2],b,"var_91" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_97,b,"var_97"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_113.GetChecksum(),b,"var_113.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_227[a0][a1][a2],b,"var_227" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_75.java b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_75.java new file mode 100644 index 0000000000000000000000000000000000000000..eb824e7f314afec6fa2db7364cf3b979bd6c25de --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/950_2019010201019/cl_75.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=891913062 + +//import java.util.zip.CRC32; + +class cl_75 extends cl_22 +{ + cl_22 var_51 = new cl_22(); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(352); + CrcCheck.ToByteArray(this.var_51.GetChecksum(),b,"var_51.GetChecksum()"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_60[a0][a1],b,"var_60" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_83,b,"var_83"); + for(int a0=0;a0<7;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_85[a0][a1],b,"var_85" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_98,b,"var_98"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_104[a0][a1],b,"var_104" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_228[a0][a1][a2],b,"var_228" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_233[a0][a1],b,"var_233" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/969_2019010200702/CRC32.java b/test/testsuite/fuzz_test/fuzz/969_2019010200702/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/969_2019010200702/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/969_2019010200702/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/969_2019010200702/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..ef6737ec32b5eee3362ad6583b8f2f8da47c3801 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/969_2019010200702/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/969_2019010200702/MainClass.java b/test/testsuite/fuzz_test/fuzz/969_2019010200702/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..51df869a504358b7725317cbead7621c6140858b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/969_2019010200702/MainClass.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3943380884 + +//import java.util.zip.CRC32; + +class MainClass +{ + int var_0 = (990960553); + cl_6 var_1 = new cl_6(); + int var_4 = (433035202); + float var_195 = (-2.99246e-23F); + cl_28 var_197 = new cl_28(); + byte var_204 = (byte)(-86); + final cl_80 var_205 = new cl_80(); +/*********************************/ +public strictfp void run() +{ + final cl_28 var_208 = new cl_28(); + final byte [][] var_203 = {{(byte)(106)},{(byte)(-45)},{(byte)(-44)},{(byte)(-110)},{(byte)(35)},{(byte)(35)}}; + short var_196 = (short)(-18680); + for( var_0 = 490 ;(var_0>452);var_0 = (var_0-19) ) + { + int var_2 = (1244243894); + for( var_2 = 725 ;(var_2>645);var_2 = (var_2-16) ) + { + long var_200 = (-388186498224503690L); + try + { + byte var_202 = (byte)(-78); + int var_3 = (60790528); + byte var_201 = (byte)(-72); + short var_198 = (short)(-1302); + for( var_3 = 378 ;(var_3>339);var_3 = (var_3-13) ) + { + short var_199 = (short)(-21352); + var_4 = var_1.func_5((var_195--) ,(-2.41051e-166D) ,((var_196--)-var_197.var_32) ,(var_198++) ,var_1.func_5(((++var_199)*(-7318209345340836280L)) ,(var_200--) ,((--var_201)-( ( byte )((--var_202)|( ( int )var_203[(((var_204--)&var_205.var_93)&5)][(((var_201--)+(1377829721))&0)] )) )) ,(var_204--) ,(var_202--))) ; + } + } + catch( java.lang.IllegalArgumentException myExp_206 ) + { + try + { + var_196 = (var_196--) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_207 ) + { + var_197 = var_197 ; + System.out.println("hello exception 1 !"); + } + System.out.println("hello exception 0 !"); + } + } + } + return ; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(37); + CrcCheck.ToByteArray(this.var_0,b,"var_0"); + CrcCheck.ToByteArray(this.var_1.GetChecksum(),b,"var_1.GetChecksum()"); + CrcCheck.ToByteArray(this.var_4,b,"var_4"); + CrcCheck.ToByteArray(this.var_195,b,"var_195"); + CrcCheck.ToByteArray(this.var_197.GetChecksum(),b,"var_197.GetChecksum()"); + CrcCheck.ToByteArray(this.var_204,b,"var_204"); + CrcCheck.ToByteArray(this.var_205.GetChecksum(),b,"var_205.GetChecksum()"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/969_2019010200702/Start.java b/test/testsuite/fuzz_test/fuzz/969_2019010200702/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..6e3b30db1d69e7d10361f505ee052561ddc90023 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/969_2019010200702/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: MainClass.java cl_80.java cl_69.java cl_73.java cl_6.java CRC32.java cl_28.java cl_31.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so \ No newline at end of file diff --git a/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_28.java b/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_28.java new file mode 100644 index 0000000000000000000000000000000000000000..6c4f48da3e7ba9d00ddaee9d454672f71a3cff7d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_28.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3943380884 + +//import java.util.zip.CRC32; + +class cl_28 +{ + final int var_32 = (-730855324); + double var_95 = (3.57741e-133D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(12); + CrcCheck.ToByteArray(this.var_32,b,"var_32"); + CrcCheck.ToByteArray(this.var_95,b,"var_95"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_31.java b/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_31.java new file mode 100644 index 0000000000000000000000000000000000000000..d89fb26b1a085f0284aa66deffdb0f2f89bd932e --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_31.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3943380884 + +//import java.util.zip.CRC32; + +class cl_31 +{ + int var_65 = (541337861); + final long [] var_75 = {(4936014631523461438L)}; + short var_107 = (short)(-14235); + float var_149 = (5.04368e-34F); + double var_168 = (9.27178e-303D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(26); + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_75[a0],b,"var_75" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_149,b,"var_149"); + CrcCheck.ToByteArray(this.var_168,b,"var_168"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_6.java b/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_6.java new file mode 100644 index 0000000000000000000000000000000000000000..3981dff053db66a566af1a07fe9180d266b50126 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/969_2019010200702/cl_6.java @@ -0,0 +1,410 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=3943380884 + +//import java.util.zip.CRC32; + +class cl_6 +{ + static int var_11 = (-250599279); + boolean var_12 = true; + static long var_23 = (8581773895958866525L); + static cl_31 var_24 = new cl_31(); + final static cl_28 var_31 = new cl_28(); + final static byte var_41 = (byte)(0); + static byte var_50 = (byte)(56); + static cl_73 var_51 = new cl_73(); + static cl_80 var_61 = new cl_80(); + static int var_63 = (291598719); + static long [][][] var_64 = {{{(-4806378656565775649L),(4594395055550936787L),(-3288107330306727708L),(-7583628056140847772L),(-4973624515455335944L),(559432055561104668L),(-861697743303948117L)},{(6673742086503436038L),(-2874096722379171734L),(6945002984707814160L),(3748349072345496472L),(-8252585242969569226L),(4292817509770469940L),(7419638726891197042L)},{(8326796046368545764L),(8480556765060912297L),(-673134275243058704L),(-3567016448939176386L),(-3120265642919573021L),(-2438937835138620365L),(-4346553507079259826L)}}}; + static cl_69 var_68 = new cl_69(); + static cl_73 [] var_77 = {new cl_73(),new cl_73(),new cl_73(),new cl_73(),new cl_73()}; + static float var_85 = (-4.19172e-33F); + static cl_28 var_88 = new cl_28(); + static int var_91 = (-1846433592); + static int var_92 = (-647272708); + static short var_98 = (short)(-16437); + final long [][][] var_101 = {{{(988057476256991677L),(-2591159960670313149L),(662806970302956979L),(3434116744893686699L),(-2765095125741872489L),(481291611275514317L),(8868400657951119089L)},{(-5031140547170509276L),(6930771428530304294L),(1879065926779125402L),(-5446293687129623050L),(612585348456955954L),(8678755357232562982L),(-4791669693904764470L)},{(-8049268675314404404L),(-3846799262961997244L),(-5682032979142500326L),(-4848078449784287517L),(-3258537412244742706L),(-105574209770321206L),(7469486923914569439L)},{(-4989208513626246380L),(-1911650268439835926L),(-2165016049128762607L),(1843056345058044094L),(-3605039698534193783L),(-8040300472979169711L),(-8591258110158307608L)},{(4231637774940638448L),(6435861251291968685L),(-5136740409915039642L),(-8473800133565093289L),(-1170369003478837418L),(-8279185377610592540L),(-2589134555882026622L)},{(-4348660101390323075L),(-5423363726152923854L),(2441306846938320773L),(98577360035129575L),(-229720184023178536L),(2344347404263941945L),(5905951475614947988L)},{(-5841441580563286906L),(-6102724134762062198L),(-9203894069804545733L),(3152123200818992071L),(-7105502391330836338L),(-6244409259364837420L),(-8988475299519724739L)}},{{(5350647042500991584L),(-8142517576485662984L),(-7311312386311943323L),(1226503117423578457L),(-1948568728644045024L),(3602534016402324688L),(2002159135447278852L)},{(-1814480790414152333L),(3945026731141865755L),(-8903826941344812992L),(-175935457332586642L),(3354594700616099421L),(3673748177575042391L),(-6097317013880610414L)},{(6387464637732447260L),(9004522767818647404L),(2919134935123043608L),(8769446513248555858L),(910117191262997923L),(-714101018885943145L),(-2764827742304532808L)},{(-6093273794572254700L),(7584551362503181778L),(-4886794960283342271L),(-8625815911549331668L),(-8777647569509664777L),(-716599616676428445L),(3059162759499984662L)},{(4150845343220844834L),(1421593458917903700L),(4450971869863038263L),(5885429862500419797L),(754143448353965881L),(2131692014813766091L),(843194309580753313L)},{(-8537371441164040756L),(4484629242059391267L),(8981678378147169694L),(-2451461928076942834L),(-2820245932818314889L),(9206091270389929002L),(3692792216053114235L)},{(-3113186958054789127L),(-1226453754863303180L),(519647930629560512L),(-2668323428617415835L),(2254989381146094011L),(-562018670499688585L),(-3612538627298843239L)}}}; + static int var_103 = (-1084331229); + float [] var_106 = {(-3.49721e-29F),(-2.76321e+16F),(3.07826e-37F),(-0.000180021F),(1.40813e+20F)}; + static int var_118 = (-1294887687); + static short var_120 = (short)(-22999); + static long [][][] var_121 = {{{(-1929333895705308272L),(6324313361256743923L)},{(-505769966401353113L),(7862737844126372632L)}},{{(736539889447465984L),(6091143620202636186L)},{(8498586460788516266L),(-1753275906397461801L)}},{{(6204279817933489222L),(-5578997760456934536L)},{(-8883983729246197791L),(-3005033958150370055L)}},{{(-3563056957172458970L),(-674675788804003822L)},{(2430735537742335444L),(-2861374488252997645L)}},{{(-6110509692392838867L),(-5118379681112423873L)},{(-1540569654530816199L),(-1865312934859682356L)}}}; + static cl_80 [][] var_133 = {{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()}}; + static byte var_135 = (byte)(-1); + final float [] var_160 = {(3.46838e-11F),(8.24567e-38F)}; + short var_177 = (short)(-2153); +/*********************************/ +public strictfp int func_5(double var_6, double var_7, int var_8, double var_9, int var_10) +{ + cl_28 [] var_14 = {new cl_28(),new cl_28(),new cl_28(),new cl_28(),new cl_28(),new cl_28(),new cl_28()}; + if( var_12) + { + // if stmt begin,id=1 + short var_182 = (short)(19506); + byte var_180 = (byte)(59); + long var_192 = (-7851458533824329654L); + if( var_12) + { + // if stmt begin,id=2 + int var_13 = (2110503198); + int [][] var_174 = {{(158059786),(-2086521188)},{(1737727368),(-2073809441)},{(-785070192),(-465475104)},{(-508168738),(250250549)},{(882915802),(-1227631360)},{(1482925546),(965727982)}}; + for( var_13 = 406 ;(var_13>405);var_13 = (var_13-1) ) + { + float [] var_189 = {(-3.37494e+26F),(-7.39545e-20F),(2.22637e-08F),(4.70257e+30F)}; + var_14[(var_13&6)] = func_15(var_24 ,( ( float )var_174[(((var_180--)*var_50)&5)][(((var_50--)|func_33((+(++var_120)) ,(-((++var_120)+func_33(var_85 ,((-(~(--var_177)))|var_51.var_178) ,( ( int )((var_180--)+var_24.var_107) ) ,((-(--var_182))|var_68.var_183)))) ,(var_10++) ,(-(+(var_180++)))))&1)] ) ,var_189 ,((var_85--)-var_24.var_65) ,(+(var_192--))) ; + } + // if stmt end,id=2 + } + // if stmt end,id=1 + } + else + { + // else stmt begin,id=1 + boolean var_194 = false; + // else stmt end,id=1 + } + return (1636657518); +} +public strictfp cl_28 func_15(cl_31 var_16, float var_17, float[] var_18, double var_19, float var_20) +{ + byte var_21 = (byte)(-24); + if( ((var_21--)<=(-3.35883e+186D))) + { + // if stmt begin,id=3 + int var_22 = (-281815000); + cl_80 [][] var_155 = {{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()}}; + short var_151 = (short)(-4784); + for( var_22 = 819 ;(var_22>780);var_22 = (var_22-13) ) + { + try + { + var_18[((+(var_21++))&3)] = (-4.19629e-32F) ; + var_16 = func_25((var_23--) ,(+((-(--var_151))|var_98)) ,func_53((var_151++) ,(+(~(var_135++))) ,var_155 ,var_12 ,var_68) ,var_160) ; + } + catch( java.lang.ArithmeticException myExp_162 ) + { + int var_163 = (-1850210606); + long var_165 = (2084436967303723981L); + if( false) + { + // if stmt begin,id=4 + var_64[(((var_120++)*func_53((-(--var_163)) ,var_165 ,var_155 ,((var_21--)=func_33((+(++var_140)) ,(--var_92) ,var_118 ,var_68.var_87))) + { + // if stmt begin,id=5 + int var_145 = (1196493463); + for( var_145 = 655 ;(var_145>587);var_145 = (var_145-17) ) + { + int var_146 = (1521292164); + for( var_146 = 483 ;(var_146>427);var_146 = (var_146-14) ) + { + if( false) + { + // if stmt begin,id=6 + var_51.var_147 = ((var_148++)+var_24.var_149) ; + // if stmt end,id=6 + } + else + { + // else stmt begin,id=4 + var_24 = var_24 ; + // else stmt end,id=4 + } + } + } + // if stmt end,id=5 + } + return var_24; +} +public static strictfp int func_33(float var_34, long var_35, int var_36, long var_37) +{ + final cl_69 var_138 = new cl_69(); + short var_126 = (short)(16213); + float var_40 = (3.99382e+07F); + int var_39 = (105090212); + byte var_38 = (byte)(-82); + var_35 = (var_38--) ; + for( var_39 = 851 ;(var_39<873);var_39 = (var_39+11) ) + { + try + { + double [][] var_119 = {{(-2.24907e-113D)},{(4.05631e+67D)},{(-8.78622e+274D)},{(-2.46181e-291D)},{(2.02868e-166D)},{(-5.99831e-237D)},{(4.58898e+173D)}}; + cl_80 [][] var_122 = {{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()}}; + double var_125 = (-2.01369e-181D); + if( ((!((var_40++)==var_41))|( ( boolean )false ))) + { + // if stmt begin,id=7 + if( func_42(((var_92--)!=( ( float )var_119[(((var_38--)+var_91)&6)][(((var_120--)+func_53((var_37--) ,var_121[((~(var_50--))&4)][((var_38++)&1)][(((--var_38)+var_50)&1)] ,var_122 ,((var_38++)>var_61.var_94) ,var_68))&0)] )) ,(var_98++) ,(!((var_50--)>( ( float )(-1.23405e+298D) ))) ,var_68 ,var_61.var_123 ,(-(--var_34)) ,var_51)) + { + // if stmt begin,id=8 + var_35 = (--var_120) ; + // if stmt end,id=8 + } + else + { + // else stmt begin,id=5 + boolean var_124 = false; + // else stmt end,id=5 + } + // if stmt end,id=7 + } + else + { + // else stmt begin,id=6 + cl_73 var_127 = new cl_73(); + if( ((var_125++)==( ( double )(var_126--) ))) + { + // if stmt begin,id=9 + var_77[((var_120++)&4)] = var_51 ; + // if stmt end,id=9 + } + // else stmt end,id=6 + } + } + catch( java.lang.ArithmeticException myExp_128 ) + { + int var_129 = (-1224084972); + for( var_129 = 328 ;(var_129>258);var_129 = (var_129-14) ) + { + var_51.var_67 = (var_23--) ; + } + System.out.println("hello exception 3 !"); + } + } + byte var_130 = (byte)(-17); + return func_53((((--var_130)+var_50)&var_61.var_84) ,(var_36++) ,var_133 ,(((--var_135)*var_61.var_136)<(-0.143374F)) ,var_138); +} +public static strictfp boolean func_42(boolean var_43, float var_44, boolean var_45, cl_69 var_46, boolean[][] var_47, float var_48, cl_73 var_49) +{ + byte var_113 = (byte)(50); + short var_110 = (short)(8459); + byte var_111 = (byte)(22); + cl_80 [][] var_112 = {{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()},{new cl_80(),new cl_80()}}; + if( (((var_50--)*var_51.var_52)>=func_53((--var_110) ,((var_111--)|( ( long )(+(var_50++)) )) ,var_112 ,(!((--var_113)>(short)(27498))) ,var_68))) + { + // if stmt begin,id=10 + int var_114 = (118447026); + double var_117 = (-1.57151e-205D); + for( var_114 = 396 ;(var_114<448);var_114 = (var_114+13) ) + { + int var_115 = (1015800524); + for( var_115 = 1000 ;(var_115>997);var_115 = (var_115-3) ) + { + int var_116 = (-1682778294); + for( var_116 = 223 ;(var_116<271);var_116 = (var_116+12) ) + { + var_68.var_70 = ((~(var_110--))*var_61.var_94) ; + } + } + } + // if stmt end,id=10 + } + return ((--var_118)<=var_68.var_69); +} +public static strictfp int func_53(long var_54, long var_55, cl_80[][] var_56, boolean var_57, cl_69 var_58) +{ + short var_59 = (short)(-14546); + int var_99 = (-1231335548); + cl_80 var_60 = new cl_80(); + cl_73 [] var_80 = {new cl_73(),new cl_73(),new cl_73(),new cl_73(),new cl_73()}; + var_24 = var_24 ; + if( (!((++var_59)==(3.89102e-14F)))) + { + // if stmt begin,id=11 + int var_62 = (-1149796751); + long [] var_74 = {(2354533979258932699L)}; + cl_73 var_82 = new cl_73(); + final long [] var_76 = {(-4136608562010561383L)}; + var_56[((var_59--)&4)][((~(var_50++))&1)] = var_60 ; + for( var_62 = 706 ;(var_62>649);var_62 = (var_62-19) ) + { + byte var_71 = (byte)(-79); + short var_97 = (short)(26615); + if( true) + { + // if stmt begin,id=12 + short var_86 = (short)(-12625); + int var_73 = (479709366); + for( var_63 = 222 ;(var_63>218);var_63 = (var_63-4) ) + { + final double var_72 = (3.20703e+239D); + cl_80 var_66 = new cl_80(); + var_24.var_65 = (++var_59) ; + var_56[((var_71--)&4)][((var_59++)&1)] = var_60 ; + continue; + + } + for( var_73 = 489 ;(var_73>449);var_73 = (var_73-10) ) + { + cl_73 [] var_79 = {new cl_73(),new cl_73(),new cl_73(),new cl_73(),new cl_73()}; + var_74[(var_73&0)] = ((var_59--)-var_23) ; + cl_73 [] var_78 = {new cl_73(),new cl_73(),new cl_73(),new cl_73(),new cl_73()}; + float [][] var_81 = {{(1.4366e-24F),(-1.80896e-38F),(-1.40676e-36F),(-1.64611e+37F),(1.89029e+08F)}}; + var_74[(var_73&0)] = (-(++var_71)) ; + var_74 = var_76 ; + var_77 = var_77 ; + var_77[4] = var_51 ; + continue; + + } + if( (((((var_50++)*var_51.var_83)*var_61.var_84)+var_85)>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/MainClass.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..af9c0d8e669151912f640df8ff65a0799be0383d --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/MainClass.java @@ -0,0 +1,1277 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4271641260 + +//import java.util.zip.CRC32; + +class MainClass +{ + cl_6 var_5 = new cl_6(); + float [][] var_11 = {{(-523.302F),(-4.84883e-27F)}}; + short var_12 = (short)(-3739); + byte var_13 = (byte)(87); + short var_14 = (short)(-5876); + byte var_18 = (byte)(-52); + cl_24 var_217 = new cl_24(); + cl_10 var_218 = new cl_10(); + cl_68 var_221 = new cl_68(); + boolean [] var_224 = {false,false,false,false,true,false}; + cl_10 var_226 = new cl_10(); + cl_54 var_228 = new cl_54(); + double var_232 = (1.59141e+291D); + int var_238 = (-43590052); + byte var_240 = (byte)(49); + cl_3 var_242 = new cl_3(); + byte var_254 = (byte)(-120); + int var_261 = (-1286178561); + byte var_268 = (byte)(-32); + int var_273 = (1465723643); + int var_275 = (104384090); + cl_3 var_279 = new cl_3(); + byte var_291 = (byte)(41); + int var_292 = (-475472287); + byte var_297 = (byte)(115); + boolean var_299 = true; + float var_300 = (-7.82827e-07F); + byte var_309 = (byte)(69); + int var_318 = (166131635); + double [][][] var_320 = {{{(-7.25851e+151D),(1.46169e-208D),(5.66384e-225D),(-9.54084e-202D),(2.82717e+84D),(-1.06107e+134D)},{(5.48598e-55D),(-9.16695e-180D),(2.82139e+07D),(-6.98733e+286D),(-5.01323e-194D),(-4.15204e+268D)},{(-2.66045e+37D),(-2.15141e-203D),(-1.54128e-263D),(5.11663e-225D),(1.3769e+138D),(-2.10789e-144D)},{(4.83998e-265D),(2.40119e-213D),(-1.29779e+149D),(-4.15791e+300D),(-9.2887e+193D),(1.87939e-128D)},{(6.20584e-187D),(2.32594e+211D),(1.26703e-253D),(2.27194e+06D),(7.46668e+279D),(-1.57625e+56D)},{(4.54343e+18D),(9.29696e-94D),(-1.12791e-222D),(-1.53886e-180D),(-4.59512e+108D),(3.20477e+241D)},{(-1.86382e+58D),(8.00367e+79D),(1.02611e+98D),(1.20122e+182D),(-3.49026e+40D),(4.87335e+221D)}},{{(-5.19413e+176D),(-2.55293e-74D),(-7.04291e-43D),(1.92061e+304D),(4.95227e-45D),(2.61402e+78D)},{(-7.17833e+162D),(1.58673e+288D),(-4.45273e+135D),(6.68104e+279D),(-3.96438e-203D),(-8.79101e+305D)},{(5.63575e+105D),(-1.24986e-32D),(-2.41358e-102D),(-4.553e+116D),(4.05005e-232D),(-4.54598e-15D)},{(-4.45361e-21D),(-5.51417e+20D),(-4.72283e-43D),(5.04485e+266D),(-4.16202e-256D),(3.31891e+71D)},{(1.10877e+179D),(2.13946e-141D),(-9.68638e+215D),(1.46895e-111D),(-6.41578e-245D),(-1.94882e+46D)},{(-5.72217e+148D),(-2.34912e-18D),(9.14636e-209D),(-2.57677e+134D),(3.42896e-171D),(2.57018e-242D)},{(-6.25463e+31D),(-4.97844e+54D),(1.73918e+227D),(1.22346e+74D),(2.70659e+154D),(-3.05603e+74D)}},{{(-7.69556e-107D),(1.32101e+16D),(3.40172e+113D),(1.77014e+300D),(5.25322e+42D),(4.83609e+303D)},{(1.44245e+137D),(7.56965e-224D),(-1.76359e-118D),(8.61231e-262D),(1.43382e+130D),(-5.37227e+257D)},{(6.50564e+40D),(-3.56343e+264D),(-3.22512e-41D),(3.00721e-127D),(-1.77412e+288D),(-9.00629e-262D)},{(1.1355e-129D),(-5.7168e+226D),(-2.16552e-279D),(-2.44805e+137D),(9.97744e-21D),(-1.90024e+165D)},{(-3.77007e-253D),(-4.05126e+58D),(1.03958e-173D),(-1.29912e+134D),(-2.20835e+182D),(1.00143e-17D)},{(-1.10464e+262D),(4.86721e-122D),(-4.62427e-116D),(-2.82517e+90D),(1.67632e-170D),(-2.64194e+97D)},{(1.96179e+50D),(-2.7254e+185D),(-7.32764e-26D),(-2.94975e+151D),(1.13316e+101D),(-8.23032e-67D)}},{{(-3.62201e-215D),(-2.50148e-146D),(-3.00872e-08D),(1.27738e-36D),(-2.49593e+89D),(1.38616e-204D)},{(1.36929e+208D),(-3.49451e+177D),(4.34599e-169D),(6.89242e-230D),(-2.91753e+07D),(-2.58796e+277D)},{(-1.79301e-38D),(-1.01737e+40D),(-9.77128e+08D),(6.30932e+286D),(1.84831e-131D),(-6.30929e+223D)},{(-4.61112e+229D),(-1.3263e-171D),(1.04891e+197D),(-2.08491e-227D),(-1.03102e-114D),(1.03634e+249D)},{(-1.12657e+200D),(-9.76621e+120D),(1.3674e+40D),(-3.56574e-141D),(7.54469e-169D),(1.09169e+71D)},{(1.17581e-189D),(1.11871e-234D),(-3.80282e+245D),(-3.06201e-214D),(-3.93936e-165D),(3.78405e-158D)},{(-2.11665e+263D),(-2.00722e-46D),(-7.0234e-38D),(-2.10768e+10D),(1.21833e-229D),(-2.6852e-239D)}},{{(-1.56274e-30D),(2.04387e-92D),(3.11758e-54D),(-3.5423e-86D),(-1.5848e-283D),(-1.3024e+214D)},{(1.27701e-212D),(-9.47427e+17D),(-1.26027e-141D),(-2.76764e+233D),(2.14044e+106D),(-6.50855e-215D)},{(-2.13197e-18D),(7.51688e+169D),(6.47669e-146D),(5.87227e-149D),(4.14537e-299D),(-4.24065e-158D)},{(4.48233e+244D),(-1.62659e+250D),(1.58609e-169D),(1.01834e+278D),(3.85307e-53D),(5.27515e-252D)},{(-3.53054e+230D),(-1.22758e-221D),(1.19832e+191D),(-3.81688e+25D),(-2.11427e-171D),(-1.44262e+274D)},{(3.52588e-127D),(-3.63946e+157D),(-9.0216e-66D),(-1.08351e+29D),(7.5832e-221D),(-3.20212e-267D)},{(-1.44423e+42D),(-1.2962e+302D),(1.3694e-258D),(2.38985e-94D),(-9.67309e+135D),(-4.68957e+92D)}},{{(-4.61741e+76D),(1.03918e+96D),(7.02304e-297D),(-1.1482e-07D),(5.44806e+65D),(1.11057e-174D)},{(9.56614e+131D),(-3.67099e-215D),(2.70278e-135D),(-7.84962e-36D),(1.76352e-267D),(-2.44455e-295D)},{(1.62077e-239D),(6.46472e+87D),(-6.77443e+109D),(-5.7961e+86D),(-8.17449e-32D),(9.62689e+197D)},{(-8.43639e-210D),(2.06591e-139D),(9.49551e+216D),(-1.41019e-08D),(1.56652e-172D),(5.2845e+72D)},{(1.66589e+71D),(-1.04615e-100D),(1.39183e+257D),(-9.01367e+129D),(-5.05289e-296D),(-1.66372e+283D)},{(5.78625e-205D),(4.1045e-175D),(-5.74727e-259D),(-4.75414e-246D),(-8.18542e+223D),(-1.48996e+259D)},{(1.61454e-229D),(-4.51809e+21D),(1.91665e-14D),(-3.0244e-233D),(1.70193e-152D),(2.09062e+114D)}}}; + int var_325 = (2106381607); + int var_326 = (-1787901740); + int var_328 = (-643759938); + double [] var_331 = {(6.65452e+13D),(-3.29012e+212D),(1.83925e-114D),(-5.46323e-166D)}; + boolean [][][] var_332 = {{{true,true,false,true},{false,false,false,false},{false,false,true,true},{false,true,true,false},{false,false,true,false},{true,false,true,false}},{{true,false,true,false},{false,true,true,false},{false,false,true,false},{false,false,true,true},{true,false,true,true},{true,true,false,false}}}; + long [] var_339 = {(1631499468454365287L)}; + float [][][] var_341 = {{{(-5.39056e-32F)},{(-5.61132e+27F)}},{{(1.44548e+22F)},{(-7.26131e-06F)}},{{(-1.41035e-05F)},{(2.12896e+37F)}},{{(-2.12329e+18F)},{(9.90055e-08F)}},{{(-1.83168e+27F)},{(1.13427e+19F)}}}; + int var_353 = (1414110879); + long var_354 = (7101142864864015997L); + int var_356 = (-211764814); + boolean [][] var_359 = {{false,false,false,false},{false,false,true,true},{false,false,true,false},{false,true,true,false},{false,false,false,true}}; + int var_366 = (893374597); + byte var_373 = (byte)(122); + int var_376 = (-1763675283); + int var_378 = (272060782); + final cl_6 var_380 = new cl_6(); + cl_10 var_381 = new cl_10(); + cl_68 var_384 = new cl_68(); + byte var_388 = (byte)(9); + final float var_394 = (1.52891e+20F); + short var_398 = (short)(12345); + boolean [][][] var_406 = {{{false,true,false},{false,true,false},{true,false,true},{false,false,false},{true,true,true}},{{false,true,false},{true,false,true},{true,true,true},{false,false,false},{true,true,true}}}; + final boolean [][] var_407 = {{true,true,true},{true,true,true},{true,false,false},{false,true,true}}; + long var_412 = (-665010424971226033L); + int var_416 = (-321928255); + short var_419 = (short)(32535); + int var_420 = (-1836729211); + int var_424 = (-1959436580); + int var_428 = (-1002057909); + int var_435 = (1788769358); + int var_436 = (355190637); + int var_437 = (-1631680606); + boolean [][] var_446 = {{true,true,false,true}}; + int var_448 = (951156680); + int var_456 = (660069327); + int var_459 = (1016972706); + short var_460 = (short)(-26136); + int var_462 = (-336241642); + float var_469 = (-3.21218F); + long var_475 = (-9218030949913010727L); + int var_481 = (25059603); + int var_482 = (1547685641); + float var_484 = (6.82365e+13F); +/*********************************/ +public strictfp void run() +{ + long var_449 = (2779941694233189244L); + byte var_0 = (byte)(5); + cl_3 var_429 = new cl_3(); + short var_464 = (short)(-6075); + try + { + final double var_418 = (4.33806e+273D); + if( ((var_0++)!=func_1(var_228.var_44.var_53 ,(!((~(var_291++))!=var_418)) ,((--var_0)*var_5.var_30)))) + { + System.out.println(" if stmt begin,id=1 "); + try + { + cl_3 var_426 = new cl_3(); + short var_422 = (short)(-8327); + if( ((-((var_419++)&func_16((!(!(!(!(!(((var_14--)+var_13)>( ( float )var_232 ))))))))))<=var_279.var_137)) + { + System.out.println(" if stmt begin,id=2 "); + if( ((+(var_0++))>=var_232)) + { + System.out.println(" if stmt begin,id=3 "); + for( var_420 = 537 ;(var_420>517);var_420 = (var_420-4) ) + { + var_5.var_193.var_421 = var_228.var_44.var_315 ; + } + System.out.println(" if stmt end,id=3 "); + } + else + { + System.out.println(" else stmt begin,id=1 "); + var_380.var_401.var_45 = ((--var_422)*func_16(((var_422++)>var_398))) ; + System.out.println(" else stmt end,id=1 "); + } + System.out.println(" if stmt end,id=2 "); + } + else + { + System.out.println(" else stmt begin,id=2 "); + for( var_424 = 1001 ;(var_424>987);var_424 = (var_424-14) ) + { + try + { + var_5.var_52.var_32.var_170 = ((var_0--)&var_221.var_78.var_130) ; + } + catch( java.lang.IllegalArgumentException myExp_425 ) + { + var_242 = var_228.var_44.var_53 ; + System.out.println("hello exception 0 !"); + } + } + System.out.println(" else stmt end,id=2 "); + } + } + catch( java.lang.ArithmeticException myExp_427 ) + { + try + { + try + { + for( var_428 = 680 ;(var_428<724);var_428 = (var_428+11) ) + { + var_5.var_197.var_103 = var_228.var_44.var_53 ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_430 ) + { + try + { + short var_431 = (short)(-1891); + var_217.var_42.var_139 = (+(+(--var_431))) ; + } + catch( java.lang.IllegalArgumentException myExp_432 ) + { + int var_433 = (-1092539184); + System.out.println("hello exception 3 !"); + } + System.out.println("hello exception 2 !"); + } + } + catch( java.lang.ArithmeticException myExp_434 ) + { + var_331[((var_435--)&3)] = (++var_436) ; + System.out.println("hello exception 4 !"); + } + System.out.println("hello exception 1 !"); + } + System.out.println(" if stmt end,id=1 "); + } + else + { + System.out.println(" else stmt begin,id=3 "); + for( var_437 = 980 ;(var_437>962);var_437 = (var_437-6) ) + { + boolean [][] var_439 = {{false,false,false,false}}; + short var_443 = (short)(-2487); + if( (!(!((var_0++)==( ( short )(((var_0--)-( ( int )(++var_0) ))-var_217.var_60) ))))) + { + System.out.println(" if stmt begin,id=4 "); + try + { + try + { + var_439[(((var_0--)-var_5.var_43.var_44.var_29)&0)][((-(var_0--))&3)] = (!(!(!(!(!((--var_0)>func_1(var_429 ,((--var_254)==func_16((((((var_388++)&var_218.var_79)-var_221.var_92)-var_232)>var_380.var_441))) ,(-(var_443++))))))))) ; + } + catch( java.lang.ArithmeticException myExp_445 ) + { + var_439 = var_446 ; + System.out.println("hello exception 6 !"); + } + } + catch( java.lang.ArithmeticException myExp_447 ) + { + for( var_448 = 644 ;(var_448<647);var_448 = (var_448+1) ) + { + var_439[((var_0--)&0)][(((+((var_388--)+func_16(((!((var_449++)!=var_13))&&var_299))))*var_268)&3)] = ((var_449++)!=var_232) ; + } + System.out.println("hello exception 7 !"); + } + System.out.println(" if stmt end,id=4 "); + } + else + { + System.out.println(" else stmt begin,id=4 "); + try + { + int var_450 = (707111030); + for( var_450 = 703 ;(var_450<735);var_450 = (var_450+8) ) + { + var_439 = var_446 ; + } + } + catch( java.lang.ArithmeticException myExp_451 ) + { + try + { + var_242.var_54 = (var_354--) ; + } + catch( java.lang.ArithmeticException myExp_452 ) + { + int var_453 = (-805032397); + System.out.println("hello exception 10 !"); + } + System.out.println("hello exception 9 !"); + } + System.out.println(" else stmt end,id=4 "); + } + } + System.out.println(" else stmt end,id=3 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_454 ) + { + try + { + int var_455 = (-951726701); + for( var_455 = 587 ;(var_455<641);var_455 = (var_455+18) ) + { + try + { + for( var_456 = 189 ;(var_456>156);var_456 = (var_456-11) ) + { + int var_457 = (-1691516235); + for( var_457 = 354 ;(var_457<370);var_457 = (var_457+16) ) + { + var_228.var_44.var_53 = var_228.var_44.var_53 ; + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_458 ) + { + try + { + for( var_459 = 632 ;(var_459>598);var_459 = (var_459-17) ) + { + var_11[(((--var_398)*var_228.var_205)&0)][((var_460--)&1)] = (--var_449) ; + } + } + catch( java.lang.ArithmeticException myExp_461 ) + { + for( var_462 = 782 ;(var_462>758);var_462 = (var_462-6) ) + { + var_228.var_153.var_170 = (--var_460) ; + } + System.out.println("hello exception 13 !"); + } + System.out.println("hello exception 12 !"); + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_463 ) + { + try + { + if( ((--var_464)<=var_232)) + { + System.out.println(" if stmt begin,id=5 "); + byte [][] var_465 = {{(byte)(-28)}}; + try + { + try + { + var_446[(((++var_0)+( ( int )var_465[(((--var_12)+func_16(var_299))&0)][0] ))&0)][((var_464--)&3)] = ((((--var_268)-var_381.var_79)<=var_419)|var_299) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_467 ) + { + var_5.var_43.var_262 = var_228.var_44.var_42 ; + System.out.println("hello exception 15 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_468 ) + { + if( ((-(++var_469))<=func_1(var_279 ,(!(((--var_464)-( ( short )(var_0++) ))>=var_228.var_471)) ,(var_449++)))) + { + System.out.println(" if stmt begin,id=6 "); + var_0 = (var_0--) ; + System.out.println(" if stmt end,id=6 "); + } + else + { + System.out.println(" else stmt begin,id=5 "); + var_465[((~(var_464--))&0)][(((--var_0)|(byte)(16))&0)] = (++var_0) ; + System.out.println(" else stmt end,id=5 "); + } + System.out.println("hello exception 16 !"); + } + System.out.println(" if stmt end,id=5 "); + } + } + catch( java.lang.IllegalArgumentException myExp_474 ) + { + try + { + try + { + int var_476 = (1841101073); + for( var_476 = 784 ;(var_476<806);var_476 = (var_476+11) ) + { + var_449 = (var_464++) ; + } + } + catch( java.lang.IllegalArgumentException myExp_477 ) + { + try + { + var_217.var_53.var_104 = (~(-(((var_0--)|var_217.var_53.var_75)&func_16(((++var_0)==var_309))))) ; + } + catch( java.lang.ArithmeticException myExp_479 ) + { + var_226 = var_228.var_44.var_32 ; + System.out.println("hello exception 20 !"); + } + System.out.println("hello exception 19 !"); + } + } + catch( java.lang.ArithmeticException myExp_480 ) + { + try + { + for( var_481 = 112 ;(var_481>27);var_481 = (var_481-17) ) + { + var_228.var_153.var_170 = (var_464--) ; + } + } + catch( java.lang.ArithmeticException myExp_483 ) + { + var_380.var_43.var_44.var_32.var_95 = ((var_484++)!=var_232) ; + System.out.println("hello exception 22 !"); + } + System.out.println("hello exception 21 !"); + } + System.out.println("hello exception 18 !"); + } + System.out.println("hello exception 14 !"); + } + System.out.println("hello exception 11 !"); + } + return ; +} +public strictfp float func_1(cl_3 var_2, boolean var_3, long var_4) +{ + final cl_10 var_382 = new cl_10(); + byte var_395 = (byte)(-83); + try + { + short var_368 = (short)(30294); + try + { + cl_10 var_350 = new cl_10(); + byte var_360 = (byte)(-55); + try + { + try + { + try + { + try + { + var_5 = func_6((!(((--var_12)-var_232)>var_12)) ,var_350 ,true) ; + } + catch( java.lang.IllegalArgumentException myExp_351 ) + { + var_350 = var_226 ; + System.out.println("hello exception 23 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_352 ) + { + for( var_353 = 831 ;(var_353>798);var_353 = (var_353-11) ) + { + var_3 = false ; + } + System.out.println("hello exception 24 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_355 ) + { + for( var_356 = 107 ;(var_356>85);var_356 = (var_356-11) ) + { + int var_357 = (-454695374); + for( var_357 = 442 ;(var_357<481);var_357 = (var_357+13) ) + { + var_359[((+((+(--var_360))&var_242.var_60))&4)][((--var_13)&3)] = (!(!(!((var_360--)!=var_5.var_201)))) ; + } + } + System.out.println("hello exception 25 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_361 ) + { + if( (!((--var_291)==var_300))) + { + System.out.println(" if stmt begin,id=7 "); + if( ((++var_360)==var_221.var_145.var_137)) + { + System.out.println(" if stmt begin,id=8 "); + try + { + var_2 = var_279 ; + } + catch( java.lang.IllegalArgumentException myExp_362 ) + { + float var_363 = (-2.43917e+19F); + System.out.println("hello exception 27 !"); + } + System.out.println(" if stmt end,id=8 "); + } + System.out.println(" if stmt end,id=7 "); + } + System.out.println("hello exception 26 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_364 ) + { + int var_365 = (542560321); + for( var_365 = 878 ;(var_365<932);var_365 = (var_365+18) ) + { + byte var_367 = (byte)(-100); + for( var_366 = 843 ;(var_366<855);var_366 = (var_366+3) ) + { + var_332[(((var_268--)-( ( byte )((--var_368)-func_16(false)) ))&1)][((++var_13)&5)][((var_367--)&3)] = ((!(!((var_367--)>var_14)))!=var_299) ; + } + } + System.out.println("hello exception 29 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_370 ) + { + try + { + try + { + final boolean [][][] var_375 = {{{false,false},{false,true},{true,true}},{{false,true},{false,false},{true,true}},{{false,false},{true,false},{false,false}},{{true,false},{false,true},{false,true}},{{false,true},{false,false},{false,true}},{{false,false},{false,true},{false,true}}}; + try + { + int var_371 = (1244121197); + for( var_371 = 151 ;(var_371>145);var_371 = (var_371-2) ) + { + try + { + var_242.var_281 = var_217.var_281 ; + } + catch( java.lang.IllegalArgumentException myExp_372 ) + { + var_228.var_153.var_170 = (((var_373--)*func_16(true))|var_242.var_29) ; + System.out.println("hello exception 31 !"); + } + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_374 ) + { + byte var_377 = (byte)(79); + if( ( ( boolean )var_375[((--var_377)&5)][((-(var_254++))&2)][((var_376--)&1)] )) + { + System.out.println(" if stmt begin,id=9 "); + try + { + var_4 = (var_378++) ; + } + catch( java.lang.ArithmeticException myExp_379 ) + { + var_228.var_262 = var_228.var_44.var_32 ; + System.out.println("hello exception 33 !"); + } + System.out.println(" if stmt end,id=9 "); + } + else + { + System.out.println(" else stmt begin,id=6 "); + if( (!((++var_377)>=var_221.var_58))) + { + System.out.println(" if stmt begin,id=10 "); + final boolean var_383 = false; + System.out.println(" if stmt end,id=10 "); + } + else + { + System.out.println(" else stmt begin,id=7 "); + int var_385 = (-63452506); + System.out.println(" else stmt end,id=7 "); + } + System.out.println(" else stmt end,id=6 "); + } + System.out.println("hello exception 32 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_386 ) + { + try + { + int var_387 = (-1296880752); + for( var_387 = 493 ;(var_387<529);var_387 = (var_387+18) ) + { + try + { + var_3 = ((+(--var_388))==var_232) ; + } + catch( java.lang.IllegalArgumentException myExp_389 ) + { + var_217.var_390 = var_228.var_44.var_390 ; + System.out.println("hello exception 36 !"); + } + } + } + catch( java.lang.IllegalArgumentException myExp_391 ) + { + int var_392 = (-372874970); + for( var_392 = 134 ;(var_392<164);var_392 = (var_392+10) ) + { + var_380.var_193.var_78.var_170 = (-8167536281922299999L) ; + } + System.out.println("hello exception 37 !"); + } + System.out.println("hello exception 35 !"); + } + } + catch( java.lang.ArithmeticException myExp_393 ) + { + float var_409 = (0.0494126F); + try + { + int var_399 = (-2146479193); + if( ((++var_12)!=func_16(((-(var_309++))var_217.var_32.var_266))))))) + { + System.out.println(" if stmt begin,id=12 "); + var_5.var_401 = var_228.var_44.var_32 ; + System.out.println(" if stmt end,id=12 "); + } + } + catch( java.lang.IllegalArgumentException myExp_402 ) + { + try + { + boolean var_403 = true; + } + catch( java.lang.IllegalArgumentException myExp_404 ) + { + var_406[((var_399--)&1)][((-(var_254--))&4)][((var_395--)&2)] = var_407[((~(--var_395))&3)][((++var_395)&2)] ; + System.out.println("hello exception 40 !"); + } + System.out.println("hello exception 39 !"); + } + System.out.println(" else stmt end,id=8 "); + } + } + catch( java.lang.IllegalArgumentException myExp_408 ) + { + if( (!((var_409--)>=var_394))) + { + System.out.println(" if stmt begin,id=13 "); + try + { + int var_410 = (-2043595650); + for( var_410 = 120 ;(var_410<205);var_410 = (var_410+17) ) + { + var_217.var_53 = var_228.var_44.var_53 ; + } + } + catch( java.lang.ArithmeticException myExp_411 ) + { + try + { + var_5.var_31.var_42.var_45 = var_325 ; + } + catch( java.lang.IllegalArgumentException myExp_413 ) + { + var_242 = var_228.var_44.var_53 ; + System.out.println("hello exception 43 !"); + } + System.out.println("hello exception 42 !"); + } + System.out.println(" if stmt end,id=13 "); + } + else + { + System.out.println(" else stmt begin,id=9 "); + try + { + try + { + var_218.var_139 = (++var_409) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_414 ) + { + var_4 = (+(var_395++)) ; + System.out.println("hello exception 45 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_415 ) + { + for( var_416 = 261 ;(var_416>241);var_416 = (var_416-4) ) + { + boolean var_417 = false; + } + System.out.println("hello exception 46 !"); + } + System.out.println(" else stmt end,id=9 "); + } + System.out.println("hello exception 41 !"); + } + System.out.println("hello exception 38 !"); + } + System.out.println("hello exception 30 !"); + } + return (-1.24155e-22F); +} +public strictfp cl_6 func_6(boolean var_7, cl_10 var_8, boolean var_9) +{ + short var_289 = (short)(-22528); + float var_294 = (-3.55834e-23F); + try + { + long var_270 = (-7545467521335324630L); + final int [][] var_290 = {{(-1108322970),(366135494),(434617956),(1078828053),(-1981882976)},{(364318446),(1358698538),(-1082983855),(-1878168614),(-1190901721)},{(1196783001),(1734418341),(823978409),(-1884279435),(-356606970)},{(-1984096239),(1800595256),(-855385599),(-1628718504),(1921394569)},{(-1506622383),(-1236667395),(-893897056),(1860023234),(1783667754)},{(-2137286806),(2139303215),(-414015124),(1279447870),(-493096827)}}; + int var_301 = (-821612046); + byte var_298 = (byte)(68); + try + { + float [][][] var_267 = {{{(-6.01577e+24F),(-0.00677781F),(4.8377e-34F),(-1.30668e-23F),(-2.97555e-20F)},{(5.00199e-17F),(-7.11565e-33F),(3.39188e-05F),(-9.36534e-20F),(4.96794e-34F)},{(-4.94711e-07F),(-1.48008e-13F),(8.86768e+16F),(-6440.79F),(-1.86255e+26F)},{(-0.00646479F),(-0.00685966F),(-5.07524e-12F),(-3.13656e+13F),(-3.84229e+25F)},{(2.35224e-14F),(3.28756e+34F),(1.77548e+16F),(-2.91551e-26F),(7.18532e+16F)},{(145.273F),(9.9628e+07F),(3.76379e+26F),(-7.81553e-24F),(-1.06936e+18F)}},{{(-3.74357e-38F),(8.91519e+11F),(3.28789e+27F),(1.91045e-31F),(1.00272e-11F)},{(-1.1252e+11F),(-0.00275367F),(-0.000143998F),(-7.53883e-24F),(-3.08696e+33F)},{(-1.06084e+33F),(-8.7026e-29F),(-1.13256e+33F),(4.33186e+19F),(-1.15056e+17F)},{(-1.73581e+12F),(-3.69088e+32F),(-3.54483e-09F),(9.79431e-18F),(-4.93306e-09F)},{(-9.71907e-18F),(-1.04779e+17F),(-5.82784e-13F),(5.07946e-12F),(-4680.62F)},{(2.37504e+33F),(3.30244e-29F),(4.81439e+24F),(2.00304e+33F),(3.20638e+38F)}},{{(1.35483e-05F),(5.94062e+23F),(5.06038e-12F),(-2.01135F),(27.2853F)},{(5.54345e-29F),(3.32081e-05F),(-6.75021e-33F),(-1.4515e+17F),(1.01979e-17F)},{(-1.76834e+22F),(5.37372e-11F),(-9.24728e+20F),(-3.19938e+27F),(-6.54885e+31F)},{(4.34401e-07F),(2.28617e-13F),(-2.49614e+25F),(5.61353e-05F),(1.25681e+24F)},{(5.49694e+31F),(5.9485e-26F),(1.53948e-05F),(4.83307e+26F),(6.38967e-09F)},{(-1.17009e+11F),(-4.31286e-16F),(-5.7821e-19F),(-0.000105934F),(8.7701e-30F)}},{{(2.51677e-31F),(1.01878e-21F),(-7.81615e-31F),(-1.43286e-20F),(9.72421e-39F)},{(1.54369e-25F),(14.0548F),(-2.1511e+13F),(-0.00881374F),(-6.95922e+07F)},{(-27341.1F),(-8.45148e-17F),(2.83811e-38F),(-1.07017e-16F),(9.47799e-30F)},{(-1.6927e+22F),(1.0698e-15F),(-1.04946e-19F),(0.0906003F),(-5.35741e-06F)},{(2.13338e+12F),(-2.19258F),(3.55568e-22F),(6.57534e+09F),(-1.49129e-16F)},{(1.83402e+27F),(1.45956e+13F),(-3.35905e+38F),(9.37013e+24F),(1.68803e-16F)}}}; + try + { + long var_10 = (5395106984715048789L); + int var_15 = (-439958730); + try + { + try + { + var_7 = ((--var_12)!=var_13) ; + var_12 = (var_14++) ; + if( (!((var_15--)==func_16(var_228.var_252)))) + { + System.out.println(" if stmt begin,id=14 "); + long var_255 = (8515635330649142128L); + var_11[((var_15--)&0)][((var_254--)&1)] = (var_255++) ; + System.out.println(" if stmt end,id=14 "); + } + } + catch( java.lang.IllegalArgumentException myExp_256 ) + { + if( ((var_12++)<=( ( float )(++var_15) ))) + { + System.out.println(" if stmt begin,id=15 "); + var_226.var_45 = (+(++var_12)) ; + System.out.println(" if stmt end,id=15 "); + } + System.out.println("hello exception 47 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_257 ) + { + int var_258 = (997802231); + for( var_258 = 895 ;(var_258>868);var_258 = (var_258-9) ) + { + if( true) + { + System.out.println(" if stmt begin,id=16 "); + long var_259 = (-361903568504337865L); + System.out.println(" if stmt end,id=16 "); + } + } + System.out.println("hello exception 48 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_260 ) + { + float var_264 = (5.14163e-16F); + try + { + for( var_261 = 283 ;(var_261<343);var_261 = (var_261+15) ) + { + var_5.var_197.var_262 = var_228.var_44.var_32 ; + } + } + catch( java.lang.ArithmeticException myExp_263 ) + { + short var_269 = (short)(-16917); + if( ((var_264--)719);var_273 = (var_273-16) ) + { + int var_274 = (-309963007); + for( var_274 = 184 ;(var_274<252);var_274 = (var_274+17) ) + { + for( var_275 = 920 ;(var_275>905);var_275 = (var_275-3) ) + { + long var_276 = (7792224356717002073L); + } + } + } + } + catch( java.lang.ArithmeticException myExp_277 ) + { + try + { + cl_3 var_282 = new cl_3(); + try + { + int var_278 = (2105039580); + for( var_278 = 686 ;(var_278<702);var_278 = (var_278+16) ) + { + var_242 = var_228.var_44.var_53 ; + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_280 ) + { + if( ( ( boolean )var_279.var_281 )) + { + System.out.println(" if stmt begin,id=18 "); + var_221.var_114 = var_228.var_44.var_53 ; + System.out.println(" if stmt end,id=18 "); + } + System.out.println("hello exception 55 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_283 ) + { + boolean [][][] var_288 = {{{false,false},{true,true},{true,false},{true,true},{false,false},{false,true},{false,false}},{{true,true},{false,true},{true,true},{true,false},{true,true},{true,true},{true,true}},{{false,true},{false,false},{false,true},{true,true},{true,false},{false,true},{false,true}},{{true,true},{false,true},{true,true},{true,false},{true,false},{true,true},{false,false}},{{true,false},{true,false},{true,false},{false,true},{true,false},{true,true},{false,false}}}; + try + { + int var_284 = (2010077803); + for( var_284 = 441 ;(var_284>405);var_284 = (var_284-12) ) + { + int var_285 = (1395600907); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_286 ) + { + try + { + var_288[((~(var_298--))&4)][((((--var_289)-var_217.var_32.var_45)+( ( byte )var_290[(((++var_297)|var_279.var_75)&5)][(((++var_291)|func_16((!(!(!(!(!(!(!(!(func_16((!(!((--var_292)==var_221.var_78.var_79))))!=func_16((((++var_294)+( ( float )(++var_14) ))>=var_217.var_53.var_137)))))))))))))&4)] ))&6)][((var_240++)&1)] = (!((((--var_268)+func_16(var_288[((var_298--)&4)][((var_301++)&6)][((~((++var_298)*func_16(( ( boolean )(!((++var_232)==var_300)) ))))&1)]))&func_16((!(!(!(!(!(!(!(var_228.var_44.var_42.var_95&var_9))))))))))==func_16((!(!(!(!(!((var_18++)==( ( int )(++var_298) )))))))))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_305 ) + { + final boolean var_306 = true; + System.out.println("hello exception 58 !"); + } + System.out.println("hello exception 57 !"); + } + System.out.println("hello exception 56 !"); + } + System.out.println("hello exception 54 !"); + } + System.out.println("hello exception 53 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_307 ) + { + byte var_310 = (byte)(83); + boolean [][][] var_308 = {{{true,false,false,true},{false,false,false,false},{true,true,true,true},{false,true,false,true},{true,false,false,false},{false,false,true,true}},{{true,false,true,false},{true,false,false,false},{true,true,false,true},{true,true,false,false},{true,false,true,true},{false,true,false,false}}}; + try + { + if( (!((-(var_289++))!=var_300))) + { + System.out.println(" if stmt begin,id=19 "); + int var_311 = (-2068515900); + if( var_308[((--var_310)&1)][((var_310--)&5)][((var_309++)&3)]) + { + System.out.println(" if stmt begin,id=20 "); + try + { + try + { + var_308[((((++var_291)&var_221.var_77)|( ( byte )(var_310++) ))&1)][((++var_238)&5)][(((((+(var_311--))+var_218.var_33)&var_12)|var_5.var_201)&3)] = ((~(var_289--))var_268) ; + System.out.println("hello exception 60 !"); + } + } + catch( java.lang.ArithmeticException myExp_313 ) + { + try + { + var_5.var_314 = var_228.var_44.var_315 ; + } + catch( java.lang.IllegalArgumentException myExp_316 ) + { + var_5.var_197.var_262 = var_228.var_44.var_42 ; + System.out.println("hello exception 62 !"); + } + System.out.println("hello exception 61 !"); + } + System.out.println(" if stmt end,id=20 "); + } + else + { + System.out.println(" else stmt begin,id=11 "); + try + { + try + { + var_5.var_193.var_114.var_137 = (1.07143e-35F) ; + } + catch( java.lang.ArithmeticException myExp_317 ) + { + var_217.var_53.var_319 = var_279.var_319 ; + System.out.println("hello exception 64 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_321 ) + { + if( (!(!((~(--var_310))!=var_279.var_104)))) + { + System.out.println(" if stmt begin,id=21 "); + float var_322 = (2.53836e+33F); + System.out.println(" if stmt end,id=21 "); + } + else + { + System.out.println(" else stmt begin,id=12 "); + var_279.var_29 = (++var_318) ; + System.out.println(" else stmt end,id=12 "); + } + System.out.println("hello exception 65 !"); + } + System.out.println(" else stmt end,id=11 "); + } + System.out.println(" if stmt end,id=19 "); + } + else + { + System.out.println(" else stmt begin,id=13 "); + if( ((((--var_289)|var_228.var_323)-var_226.var_45)782);var_327 = (var_327-14) ) + { + for( var_328 = 170 ;(var_328>146);var_328 = (var_328-12) ) + { + float var_329 = (-6.48322e+10F); + } + } + System.out.println(" else stmt end,id=14 "); + } + System.out.println(" else stmt end,id=13 "); + } + } + catch( java.lang.IllegalArgumentException myExp_330 ) + { + try + { + try + { + try + { + long var_335 = (4303309116477094403L); + try + { + var_308 = var_332 ; + } + catch( java.lang.IllegalArgumentException myExp_334 ) + { + var_218.var_170 = (var_335--) ; + System.out.println("hello exception 67 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_336 ) + { + int var_338 = (-849122368); + try + { + var_226 = var_228.var_44.var_32 ; + } + catch( java.lang.ArithmeticException myExp_337 ) + { + var_308[((((+(--var_310))*var_240)+(byte)(-127))&1)][(((var_310++)|( ( int )var_339[((var_289++)&0)] ))&5)][((var_338--)&3)] = var_308[((var_289++)&1)][(((-(var_309++))&var_289)&5)][((var_310++)&3)] ; + System.out.println("hello exception 69 !"); + } + System.out.println("hello exception 68 !"); + } + } + catch( java.lang.ArithmeticException myExp_340 ) + { + try + { + if( var_299) + { + System.out.println(" if stmt begin,id=24 "); + var_221.var_94.var_342 = var_228.var_44.var_343 ; + System.out.println(" if stmt end,id=24 "); + } + else + { + System.out.println(" else stmt begin,id=15 "); + var_308[1][((++var_289)&5)][((-(var_310++))&3)] = ((+(-(var_18--)))==var_5.var_28.var_137) ; + System.out.println(" else stmt end,id=15 "); + } + } + catch( java.lang.ArithmeticException myExp_344 ) + { + int var_345 = (-791724993); + for( var_345 = 938 ;(var_345>917);var_345 = (var_345-7) ) + { + var_228.var_44.var_53.var_137 = (-(var_12--)) ; + } + System.out.println("hello exception 71 !"); + } + System.out.println("hello exception 70 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_346 ) + { + try + { + try + { + if( ((++var_310)==var_228.var_205)) + { + System.out.println(" if stmt begin,id=25 "); + var_228.var_103 = var_228.var_44.var_53 ; + System.out.println(" if stmt end,id=25 "); + } + else + { + System.out.println(" else stmt begin,id=16 "); + int var_347 = (587246122); + System.out.println(" else stmt end,id=16 "); + } + } + catch( java.lang.IllegalArgumentException myExp_348 ) + { + var_318 = (var_14++) ; + System.out.println("hello exception 73 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_349 ) + { + var_217.var_53 = var_228.var_44.var_53 ; + System.out.println("hello exception 74 !"); + } + System.out.println("hello exception 72 !"); + } + System.out.println("hello exception 66 !"); + } + System.out.println("hello exception 59 !"); + } + return var_5; +} +public strictfp int func_16(boolean var_17) +{ + short var_248 = (short)(-13181); + try + { + cl_3 var_230 = new cl_3(); + try + { + cl_24 [] var_222 = {new cl_24(),new cl_24(),new cl_24(),new cl_24()}; + final cl_10 var_227 = new cl_10(); + long var_246 = (6893775664051271584L); + try + { + byte var_220 = (byte)(-28); + long var_235 = (6735225729445032437L); + try + { + try + { + float var_223 = (-1.44664e+09F); + try + { + var_17 = (!(!((++var_18)<=var_5.func_19(var_217.var_54 ,var_218.var_219 ,((~(var_220--))/var_221.var_59.var_60) ,var_222 ,(var_223++) ,var_224[((-(var_18--))&5)])))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_225 ) + { + var_217.var_42 = var_228.var_44.var_42 ; + System.out.println("hello exception 75 !"); + } + } + catch( java.lang.ArithmeticException myExp_229 ) + { + try + { + var_228.var_103 = var_228.var_44.var_53 ; + } + catch( java.lang.IllegalArgumentException myExp_231 ) + { + cl_24 [] var_233 = {new cl_24(),new cl_24(),new cl_24(),new cl_24()}; + var_222 = var_233 ; + System.out.println("hello exception 77 !"); + } + System.out.println("hello exception 76 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_234 ) + { + if( ((++var_235)!=var_228.var_236)) + { + System.out.println(" if stmt begin,id=26 "); + int var_237 = (-1836644798); + for( var_237 = 123 ;(var_237<128);var_237 = (var_237+5) ) + { + var_235 = (var_238--) ; + } + System.out.println(" if stmt end,id=26 "); + } + System.out.println("hello exception 78 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_239 ) + { + try + { + if( (!((((+((++var_240)-var_228.var_205))*var_228.var_241)+var_242.var_60)>=var_14))) + { + System.out.println(" if stmt begin,id=27 "); + try + { + var_230 = var_242 ; + } + catch( java.lang.IllegalArgumentException myExp_243 ) + { + var_217.var_53 = var_228.var_44.var_53 ; + System.out.println("hello exception 80 !"); + } + System.out.println(" if stmt end,id=27 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_244 ) + { + try + { + var_228.var_103 = var_228.var_44.var_53 ; + } + catch( java.lang.ArithmeticException myExp_245 ) + { + if( (!(!(!(!(!((var_246--)<=var_221.var_145.var_29))))))) + { + System.out.println(" if stmt begin,id=28 "); + var_218 = var_228.var_44.var_32 ; + System.out.println(" if stmt end,id=28 "); + } + System.out.println("hello exception 83 !"); + } + System.out.println("hello exception 82 !"); + } + System.out.println("hello exception 79 !"); + } + } + catch( java.lang.ArithmeticException myExp_247 ) + { + if( ((var_248--)!=( ( int )(-(var_238++)) ))) + { + System.out.println(" if stmt begin,id=29 "); + long var_249 = (6343236013565900668L); + System.out.println(" if stmt end,id=29 "); + } + System.out.println("hello exception 84 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_250 ) + { + var_242.var_137 = (-(var_18--)) ; + System.out.println("hello exception 85 !"); + } + int [][] var_251 = {{(2039888466),(1391835485),(347625126),(974994719),(-1235565500),(-349143631),(1473902967)},{(191087097),(-709884039),(-824433276),(-1949902746),(-1064612650),(1745422025),(954035005)}}; + return var_251[(((var_12++)*var_238)&1)][6]; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2489); + CrcCheck.ToByteArray(this.var_5.GetChecksum(),b,"var_5.GetChecksum()"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<2;++a1){ + CrcCheck.ToByteArray(this.var_11[a0][a1],b,"var_11" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_12,b,"var_12"); + CrcCheck.ToByteArray(this.var_13,b,"var_13"); + CrcCheck.ToByteArray(this.var_14,b,"var_14"); + CrcCheck.ToByteArray(this.var_18,b,"var_18"); + CrcCheck.ToByteArray(this.var_217.GetChecksum(),b,"var_217.GetChecksum()"); + CrcCheck.ToByteArray(this.var_218.GetChecksum(),b,"var_218.GetChecksum()"); + CrcCheck.ToByteArray(this.var_221.GetChecksum(),b,"var_221.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + CrcCheck.ToByteArray(this.var_224[a0],b,"var_224" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_226.GetChecksum(),b,"var_226.GetChecksum()"); + CrcCheck.ToByteArray(this.var_228.GetChecksum(),b,"var_228.GetChecksum()"); + CrcCheck.ToByteArray(this.var_232,b,"var_232"); + CrcCheck.ToByteArray(this.var_238,b,"var_238"); + CrcCheck.ToByteArray(this.var_240,b,"var_240"); + CrcCheck.ToByteArray(this.var_242.GetChecksum(),b,"var_242.GetChecksum()"); + CrcCheck.ToByteArray(this.var_254,b,"var_254"); + CrcCheck.ToByteArray(this.var_261,b,"var_261"); + CrcCheck.ToByteArray(this.var_268,b,"var_268"); + CrcCheck.ToByteArray(this.var_273,b,"var_273"); + CrcCheck.ToByteArray(this.var_275,b,"var_275"); + CrcCheck.ToByteArray(this.var_279.GetChecksum(),b,"var_279.GetChecksum()"); + CrcCheck.ToByteArray(this.var_291,b,"var_291"); + CrcCheck.ToByteArray(this.var_292,b,"var_292"); + CrcCheck.ToByteArray(this.var_297,b,"var_297"); + CrcCheck.ToByteArray(this.var_299,b,"var_299"); + CrcCheck.ToByteArray(this.var_300,b,"var_300"); + CrcCheck.ToByteArray(this.var_309,b,"var_309"); + CrcCheck.ToByteArray(this.var_318,b,"var_318"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_320[a0][a1][a2],b,"var_320" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_325,b,"var_325"); + CrcCheck.ToByteArray(this.var_326,b,"var_326"); + CrcCheck.ToByteArray(this.var_328,b,"var_328"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_331[a0],b,"var_331" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_332[a0][a1][a2],b,"var_332" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_339[a0],b,"var_339" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_341[a0][a1][a2],b,"var_341" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_353,b,"var_353"); + CrcCheck.ToByteArray(this.var_354,b,"var_354"); + CrcCheck.ToByteArray(this.var_356,b,"var_356"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_359[a0][a1],b,"var_359" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_366,b,"var_366"); + CrcCheck.ToByteArray(this.var_373,b,"var_373"); + CrcCheck.ToByteArray(this.var_376,b,"var_376"); + CrcCheck.ToByteArray(this.var_378,b,"var_378"); + CrcCheck.ToByteArray(this.var_380.GetChecksum(),b,"var_380.GetChecksum()"); + CrcCheck.ToByteArray(this.var_381.GetChecksum(),b,"var_381.GetChecksum()"); + CrcCheck.ToByteArray(this.var_384.GetChecksum(),b,"var_384.GetChecksum()"); + CrcCheck.ToByteArray(this.var_388,b,"var_388"); + CrcCheck.ToByteArray(this.var_394,b,"var_394"); + CrcCheck.ToByteArray(this.var_398,b,"var_398"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<3;++a2){ + CrcCheck.ToByteArray(this.var_406[a0][a1][a2],b,"var_406" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_407[a0][a1],b,"var_407" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_412,b,"var_412"); + CrcCheck.ToByteArray(this.var_416,b,"var_416"); + CrcCheck.ToByteArray(this.var_419,b,"var_419"); + CrcCheck.ToByteArray(this.var_420,b,"var_420"); + CrcCheck.ToByteArray(this.var_424,b,"var_424"); + CrcCheck.ToByteArray(this.var_428,b,"var_428"); + CrcCheck.ToByteArray(this.var_435,b,"var_435"); + CrcCheck.ToByteArray(this.var_436,b,"var_436"); + CrcCheck.ToByteArray(this.var_437,b,"var_437"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<4;++a1){ + CrcCheck.ToByteArray(this.var_446[a0][a1],b,"var_446" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_448,b,"var_448"); + CrcCheck.ToByteArray(this.var_456,b,"var_456"); + CrcCheck.ToByteArray(this.var_459,b,"var_459"); + CrcCheck.ToByteArray(this.var_460,b,"var_460"); + CrcCheck.ToByteArray(this.var_462,b,"var_462"); + CrcCheck.ToByteArray(this.var_469,b,"var_469"); + CrcCheck.ToByteArray(this.var_475,b,"var_475"); + CrcCheck.ToByteArray(this.var_481,b,"var_481"); + CrcCheck.ToByteArray(this.var_482,b,"var_482"); + CrcCheck.ToByteArray(this.var_484,b,"var_484"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/Start.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..5598162b7df88d8e567307920ffd58d988454395 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_10.java MainClass.java cl_24.java cl_3.java cl_6.java CRC32.java cl_68.java cl_54.java CrcCheck.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_10.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_10.java new file mode 100644 index 0000000000000000000000000000000000000000..e0615c1a5d5ea17a9e1e7b64726f978edd472b8f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_10.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4271641260 + +//import java.util.zip.CRC32; + +class cl_10 +{ + final short var_33 = (short)(6274); + int var_45 = (-1735764227); + byte var_79 = (byte)(-77); + boolean var_95 = false; + boolean [] var_119 = {true,true,true,false,false}; + final long var_130 = (-2094143304841338197L); + double var_139 = (-5.21257e-183D); + long [][][] var_151 = {{{(8656675681041519096L),(6922680441389107082L),(-3851492691654669111L),(3445508424033238979L),(-7040742781601678797L),(-838952237735657361L)},{(1947404278842010262L),(-2928640209538059670L),(-8229470386059936307L),(4959314090259710557L),(8051742362045607756L),(5900647960977003344L)}},{{(6913488162287879620L),(7714279040120213343L),(-1170570321121121678L),(2081301737374067107L),(-5279364575981767907L),(-1775307192308458823L)},{(2423598967838037635L),(10157368915656686L),(1565090104729698574L),(5083802250570986604L),(1660492944374774065L),(273814523805584301L)}},{{(7423302648985163908L),(4907089244064430573L),(-1333650164562375213L),(5938476548469329868L),(3856223701992892588L),(648257843224253086L)},{(6632705538240429770L),(5167495530866021049L),(-7064930790681798901L),(4052131729773672565L),(2435662808104258835L),(3123529464224837752L)}}}; + long var_170 = (6750630273168338814L); + float [][][] var_219 = {{{(3.25378e+13F)},{(6.44254e+28F)},{(-7.08975e+16F)}},{{(-3.66211e+27F)},{(-2.20177e-32F)},{(-1.37486e+31F)}},{{(-4.75734e-07F)},{(1.53391e-10F)},{(2.33162e+16F)}},{{(-8826.61F)},{(4.14285e+32F)},{(-3.36052e+16F)}}}; + float var_266 = (-1.89387e+38F); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(377); + CrcCheck.ToByteArray(this.var_33,b,"var_33"); + CrcCheck.ToByteArray(this.var_45,b,"var_45"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + CrcCheck.ToByteArray(this.var_95,b,"var_95"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_119[a0],b,"var_119" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_130,b,"var_130"); + CrcCheck.ToByteArray(this.var_139,b,"var_139"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_151[a0][a1][a2],b,"var_151" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_170,b,"var_170"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<3;++a1){ + for(int a2=0;a2<1;++a2){ + CrcCheck.ToByteArray(this.var_219[a0][a1][a2],b,"var_219" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_266,b,"var_266"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_24.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_24.java new file mode 100644 index 0000000000000000000000000000000000000000..de219ea396ac7d1e8f794ad3cdf819907b4d02ad --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_24.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4271641260 + +//import java.util.zip.CRC32; + +class cl_24 extends cl_3 +{ + final cl_10 var_32 = new cl_10(); + cl_10 var_42 = new cl_10(); + cl_3 var_53 = new cl_3(); + cl_3 [][][] var_112 = {{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}}}; + long [][][] var_141 = {{{(3178953589100302344L),(2546318983196462002L),(-6307166307037312813L),(1583917655297486247L)},{(-2974034984432713894L),(8062549681401319698L),(-6642852759138793405L),(-2050721837042794774L)},{(-6834725569843821965L),(550199985529203430L),(-5367712306805330351L),(7510872884648664242L)},{(-8075239765277810410L),(-7563123033602742168L),(-3324233395032923943L),(1579244696839235928L)},{(-2464488880161160012L),(7421327599952376332L),(-13738019981753162L),(4995227661117611678L)},{(-5357391111267768401L),(-3921940880475788589L),(-7881185681748933626L),(-5380486300564146750L)}},{{(2328990767149205056L),(4898383722356366194L),(8656791006027921445L),(-7975289779478785772L)},{(8646965177526460491L),(-8003755972518180281L),(8281503859821622092L),(3456594973706501714L)},{(2220170392753101982L),(6970722986093317266L),(1332655310564469009L),(5427081463289490352L)},{(7663489816101659579L),(1027139940184935513L),(8201964729794897181L),(5786882067177117285L)},{(6992906606422272506L),(-820481117471774209L),(-3551184849758578922L),(-2186882187408301275L)},{(5285004297235875138L),(-199706570068041655L),(5446085394226470853L),(-4772072686450419692L)}}}; + cl_10 [] var_174 = {new cl_10(),new cl_10()}; + cl_10 [] var_315 = {new cl_10(),new cl_10(),new cl_10(),new cl_10()}; + final cl_3 [][] var_343 = {{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}}; + cl_3 [][][] var_390 = {{{new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3()}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(5341); + CrcCheck.ToByteArray(this.var_29,b,"var_29"); + CrcCheck.ToByteArray(this.var_32.GetChecksum(),b,"var_32.GetChecksum()"); + CrcCheck.ToByteArray(this.var_42.GetChecksum(),b,"var_42.GetChecksum()"); + CrcCheck.ToByteArray(this.var_53.GetChecksum(),b,"var_53.GetChecksum()"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_60,b,"var_60"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_112[a0][a1][a2].GetChecksum(),b,"var_112" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_117[a0],b,"var_117" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_123[a0],b,"var_123" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_137,b,"var_137"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_141[a0][a1][a2],b,"var_141" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_142[a0][a1][a2],b,"var_142" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_174[a0].GetChecksum(),b,"var_174" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_215[a0][a1],b,"var_215" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_281,b,"var_281"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_315[a0].GetChecksum(),b,"var_315" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_319[a0][a1][a2],b,"var_319" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_333[a0][a1][a2],b,"var_333" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_343[a0][a1].GetChecksum(),b,"var_343" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_390[a0][a1][a2].GetChecksum(),b,"var_390" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_3.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_3.java new file mode 100644 index 0000000000000000000000000000000000000000..49e47eae35e445ad872504490d7f016f3e1606e4 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_3.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4271641260 + +//import java.util.zip.CRC32; + +class cl_3 +{ + int var_29 = (932844800); + long var_54 = (2528198330848904856L); + byte var_60 = (byte)(-76); + short var_75 = (short)(-1433); + double var_104 = (-4.25585e+107D); + boolean [] var_117 = {false,false,true,false,false}; + long [] var_123 = {(-172607173933463047L),(-1117765691714560667L),(-3536531318049732506L),(6396415858351074971L),(4227171710416466520L),(7495885822135838424L),(-7349183601020453635L)}; + float var_137 = (-5.41625e+20F); + long [][][] var_142 = {{{(6263883262083098154L),(6177945045960404444L),(7692106657618493256L),(-3700241064210179801L)},{(3103499351890403472L),(6511384032682137338L),(7878665505729946971L),(-5676652580242889305L)},{(-8445849833795183044L),(-6935990723680701818L),(5676734841946500858L),(-5927017247173808390L)},{(8163471751170649760L),(5211610572313866451L),(-3059269723789475568L),(6240878391552364402L)},{(6791904863487172402L),(-4597531627627418489L),(8046038848880231420L),(334620628672944547L)},{(5081720820619234040L),(4185417348458543102L),(2193606315619154722L),(-9040381733571578652L)}},{{(-4931241552672915728L),(5731496546544780449L),(-5915130392987165976L),(4984172949948301696L)},{(-4265943417702185572L),(7615351951389994109L),(6767709241891068530L),(-4961600450373401653L)},{(6574799973058813191L),(-1184253585828374582L),(-5721213044777787837L),(-6044538292995679314L)},{(3125584195498460341L),(-6100281382811187564L),(-1931420213543362542L),(6048005933551903409L)},{(-8034582339219244057L),(-1523422316047422097L),(-4555745222462698838L),(-7245834880724404127L)},{(1849025129814106982L),(-9094846022296430671L),(-3033470481651336389L),(6038501093674006684L)}}}; + int [][] var_215 = {{(463530095),(-1744136655),(-1604814540),(-2069785949),(1967974065),(1334420430),(-1069725225)}}; + boolean var_281 = true; + double [][][] var_319 = {{{(-2.89572e-173D),(-4.26753e-56D),(-3.42092e-186D),(-3.01313e+212D),(-1.20233e+54D),(1.18393e-114D)},{(1.10613e+288D),(-1.30529e-23D),(5.2502e-256D),(-1.42143e+254D),(2.08504e-113D),(-7.61108e+307D)},{(-1.05058e-37D),(1.18489e+54D),(2.02167e-38D),(3.10869e-30D),(2.13376e-127D),(1.14227e+31D)},{(6.94265e-85D),(4.85969e+190D),(-4.49095e-117D),(3.86966e-256D),(1.65852e+277D),(1.26393e+300D)},{(5.54034e+200D),(1.91039e+199D),(9.09053e+240D),(5.6963e+114D),(5.33805e+256D),(-2.82654e+169D)},{(2.08215D),(-1.89192e+264D),(-1.57197e-172D),(-8.00164e+133D),(-1.15387e-235D),(1.53001e-31D)},{(2.31054e-66D),(4.65016e-263D),(-6.16729e+62D),(-1.31976e-270D),(7.66531e-47D),(-1.30402e-45D)}},{{(-1.4848e+35D),(6.54882e-181D),(6.90941e-182D),(2.26937e+271D),(-2.72172e+293D),(-1.64757e+209D)},{(1.8807e+273D),(4.63068e+208D),(-2.41418e+53D),(3.87593e-283D),(-8.42408e-85D),(6.56368e+271D)},{(8.92828e+95D),(7.2681e+213D),(-4.75671e+83D),(1.04924e-270D),(-1.41584e-300D),(-1.97509e+180D)},{(-1.96212e-281D),(1.48157e+238D),(-1.90296e-68D),(9.75024e-282D),(6.32475e-197D),(8.2191e-238D)},{(-5.30772e+76D),(1.19715e-203D),(1.89433e-282D),(-6.92571e+228D),(1.76869e-245D),(-1.04823e-47D)},{(-1.14202e-163D),(-1.03353e+194D),(7.76312e-131D),(1.11227e+295D),(-7.19264e+161D),(-2.33045e-34D)},{(-6.84593e+95D),(-1.91067e-38D),(-3.80078e-185D),(-3.13086e-195D),(1.81719e+107D),(-9.71085e+116D)}},{{(2.02166e-59D),(4.13344e+58D),(-2.8628e-288D),(-1.32136e-134D),(-3.5316e-282D),(9.13824e-248D)},{(-2.8012e-226D),(-5.70697e+203D),(-3.14801e+269D),(1.24577e+71D),(1.24766e+183D),(-2.09047e+90D)},{(1.34032e-191D),(-2.74834e+281D),(-6.06655e+128D),(-2.50557e+238D),(1.07222e-247D),(3.585e-298D)},{(1.77757e+68D),(-3.84486e-168D),(-1.06614e-48D),(-6.92371e-255D),(-8.71199e+267D),(-4.07711e+198D)},{(-3.4256e-252D),(-3.17574e-39D),(4.41871e+249D),(1.16677e+222D),(1.44689e+306D),(8.76253e+243D)},{(-4.39372e+224D),(-1.94453e+261D),(-1.6786e+257D),(-2.40629e-113D),(-1.30798e+159D),(2.01562e+41D)},{(-4.48625e+83D),(8.34823e-301D),(1.44152e-75D),(2.17365e-159D),(-3.26304e+158D),(-1.28849e+73D)}},{{(-1.25076e-37D),(-5.1327e+238D),(1.97191e+233D),(-2.90175e+75D),(-2.04747e+108D),(5.30986e-119D)},{(-1.10375e-78D),(6.61142e+135D),(5.52237e+291D),(-8.94498e+254D),(-2.66727e-74D),(4.10113e+177D)},{(-2.91228e+114D),(-2.25477e+78D),(-8.14774e-48D),(-2.96562e+26D),(5.60728e-242D),(2.78209e-122D)},{(-1.88094e-143D),(1.26194e-281D),(-5.33273e-230D),(-6.16119e-286D),(1.01878e-110D),(1.63741e+306D)},{(5.95608e-227D),(-2.14968e+263D),(-1.8436e-69D),(-3.36478e-41D),(-2.67405e-220D),(-1.06314e-16D)},{(-1.70412e+276D),(1.01672e-14D),(-2.61621e-123D),(1.44423e+43D),(7.6438e+240D),(1.17409e+235D)},{(3.95178e+46D),(3.81784e+37D),(-5.3613e+221D),(-1.43334e-108D),(-2.30865e+129D),(3.74349e-53D)}},{{(1.09158e+21D),(-5.98263e-105D),(-5.49726e+170D),(-6.7529e-200D),(-6.29528e+168D),(2.11891e-221D)},{(2.9261e-38D),(-7.60985e+223D),(2.19594e+66D),(-9.49149e+294D),(-4.98926e+58D),(3.03878e-261D)},{(-3.00428e-137D),(2.55467e-277D),(4.18006e+81D),(-5.10702e+160D),(-4.78941e-58D),(6.76792e-166D)},{(-1.49646e+204D),(-5.61656e+95D),(2.89569e+200D),(1.28161e+244D),(-5.38052e+152D),(-7.20512e-85D)},{(6.8105e-86D),(-2.76115e-228D),(-3.72919e-14D),(-9.76828e-70D),(8.70673e+242D),(3.72721e-264D)},{(1.02324e+283D),(-9.78072e-248D),(-4.57617e+210D),(6.10047e+106D),(-7.32246e+25D),(-4.5475e+234D)},{(2.62181e+85D),(3.7123e-219D),(-3.25784e-106D),(9.85075e-270D),(1.64019e-166D),(-5.22291e-51D)}},{{(-2.37376e-138D),(-1.25718e-138D),(-5.40549e+285D),(6.49922e+109D),(-3.21465e-256D),(1.70559e-240D)},{(-4.58874e+291D),(-3.95063e+250D),(4.99703e+305D),(-3.04576e+304D),(1.02561e-89D),(-8.95641e+210D)},{(-2.8006e-295D),(2.35434e+64D),(2.46653e-241D),(1.34404e-42D),(-1.94278e+298D),(-6.07702e-255D)},{(-0.0278007D),(9.7783e+55D),(5.04171e-295D),(-5.18803e-204D),(-4.29005e-163D),(-1.19625e+244D)},{(-1.76463e+148D),(3.34113e+37D),(-8.18314e-263D),(8.32176e-98D),(5.07652e-11D),(-6.22816e-130D)},{(-1.019e-228D),(5.99757e-12D),(-5.16499e+279D),(4.21066e-18D),(2.09078e-106D),(4.83293e+42D)},{(1.32776e-241D),(-1.07362e+26D),(9.88237e+143D),(-1.60633e-91D),(-2.61909e-264D),(6.14629e+170D)}}}; + boolean [][][] var_333 = {{{false,false,true,false},{false,false,false,true},{false,false,true,true},{true,true,true,true},{true,false,true,false},{false,false,true,false}},{{false,true,false,false},{false,false,false,false},{false,true,true,false},{false,false,true,true},{false,false,false,true},{true,true,true,false}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2565); + CrcCheck.ToByteArray(this.var_29,b,"var_29"); + CrcCheck.ToByteArray(this.var_54,b,"var_54"); + CrcCheck.ToByteArray(this.var_60,b,"var_60"); + CrcCheck.ToByteArray(this.var_75,b,"var_75"); + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_117[a0],b,"var_117" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_123[a0],b,"var_123" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_137,b,"var_137"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_142[a0][a1][a2],b,"var_142" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_215[a0][a1],b,"var_215" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_281,b,"var_281"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_319[a0][a1][a2],b,"var_319" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_333[a0][a1][a2],b,"var_333" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_54.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_54.java new file mode 100644 index 0000000000000000000000000000000000000000..213e7cdb3a6a883177871566504c276497d0b508 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_54.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4271641260 + +//import java.util.zip.CRC32; + +class cl_54 +{ + cl_24 var_44 = new cl_24(); + cl_3 var_103 = new cl_3(); + cl_3 [][][] var_111 = {{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}},{{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}}}; + final cl_10 var_153 = new cl_10(); + short var_205 = (short)(26120); + final byte var_236 = (byte)(-102); + float var_241 = (-1.38922e-26F); + boolean var_252 = false; + cl_10 var_262 = new cl_10(); + int var_323 = (-968967408); + cl_3 [][] var_342 = {{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()},{new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3(),new cl_3()}}; + double var_471 = (6.87617e+292D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(2212); + CrcCheck.ToByteArray(this.var_44.GetChecksum(),b,"var_44.GetChecksum()"); + CrcCheck.ToByteArray(this.var_103.GetChecksum(),b,"var_103.GetChecksum()"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<7;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_111[a0][a1][a2].GetChecksum(),b,"var_111" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"+".GetChecksum()"); + } + } + } + CrcCheck.ToByteArray(this.var_153.GetChecksum(),b,"var_153.GetChecksum()"); + CrcCheck.ToByteArray(this.var_205,b,"var_205"); + CrcCheck.ToByteArray(this.var_236,b,"var_236"); + CrcCheck.ToByteArray(this.var_241,b,"var_241"); + CrcCheck.ToByteArray(this.var_252,b,"var_252"); + CrcCheck.ToByteArray(this.var_262.GetChecksum(),b,"var_262.GetChecksum()"); + CrcCheck.ToByteArray(this.var_323,b,"var_323"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_342[a0][a1].GetChecksum(),b,"var_342" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"+".GetChecksum()"); + } + } + CrcCheck.ToByteArray(this.var_471,b,"var_471"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_6.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_6.java new file mode 100644 index 0000000000000000000000000000000000000000..d8072af33a107f78d6694f6d8be55bcb44f53b6f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_6.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4271641260 + +//import java.util.zip.CRC32; + +class cl_6 +{ + final cl_3 var_28 = new cl_3(); + byte var_30 = (byte)(46); + cl_24 var_31 = new cl_24(); + int var_41 = (1591265950); + final cl_54 var_43 = new cl_54(); + boolean var_46 = true; + final long var_50 = (3472705604178217187L); + cl_24 var_52 = new cl_24(); + final cl_68 var_193 = new cl_68(); + int var_196 = (-1381121307); + final cl_54 var_197 = new cl_54(); + final short var_201 = (short)(-7224); + byte var_202 = (byte)(-93); + byte var_207 = (byte)(74); + boolean [][] var_210 = {{false,true,false},{true,false,false}}; + byte var_211 = (byte)(63); + int [][] var_214 = {{(990643167),(-2095930449),(-596355034),(-1866446757),(-78750129),(1357119817),(-1150793234)}}; + byte var_216 = (byte)(3); + cl_10 [] var_314 = {new cl_10(),new cl_10(),new cl_10(),new cl_10()}; + cl_10 var_401 = new cl_10(); + double var_441 = (1.26356e-14D); +/*********************************/ +public strictfp byte func_19(long var_20, float[][][] var_21, double var_22, cl_24[] var_23, double var_24, boolean var_25) +{ + int var_26 = (-378917703); + for( var_26 = 673 ;(var_26>667);var_26 = (var_26-2) ) + { + int [][] var_39 = {{(585437207),(-97673233),(-1918088574),(811395193),(333522767),(1534134995),(1567867045)}}; + short var_27 = (short)(27240); + if( ((var_27--)!=( ( byte )var_28.var_29 ))) + { + System.out.println(" if stmt begin,id=30 "); + byte var_203 = (byte)(69); + try + { + int [] var_49 = {(1344907836)}; + byte var_40 = (byte)(78); + if( (!((var_30++)>var_31.var_32.var_33))) + { + System.out.println(" if stmt begin,id=31 "); + int var_34 = (-2016470972); + short var_47 = (short)(21918); + for( var_34 = 544 ;(var_34<549);var_34 = (var_34+1) ) + { + int var_35 = (-2042131116); + for( var_35 = 925 ;(var_35<930);var_35 = (var_35+5) ) + { + cl_68 [][] var_51 = {{new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68()},{new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68()},{new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68()},{new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68()},{new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68()},{new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68(),new cl_68()}}; + boolean var_37 = false; + long var_36 = (-5958766710968140338L); + var_39[((-(++var_27))&0)][((-(var_40++))&6)] = (++var_41) ; + var_31.var_42 = var_43.var_44.var_42 ; + var_43.var_44.var_42.var_45 = (var_40++) ; + var_39[(var_34&0)][(var_35&6)] = ((--var_40)&var_47) ; + var_49[((++var_47)&0)] = (var_27--) ; + var_22 = (((var_40--)+var_31.var_53.var_54)-var_193.func_55()) ; + } + } + System.out.println(" if stmt end,id=31 "); + } + } + catch( java.lang.ArithmeticException myExp_194 ) + { + int var_195 = (1750310755); + int [][] var_200 = {{(-451917654)},{(-2076726603)},{(-1323258471)},{(1795073135)},{(1666355056)}}; + for( var_195 = 900 ;(var_195>885);var_195 = (var_195-5) ) + { + for( var_196 = 120 ;(var_196<205);var_196 = (var_196+17) ) + { + try + { + var_46 = (!((++var_30)!=var_30)) ; + } + catch( java.lang.IllegalArgumentException myExp_198 ) + { + var_200[(((var_30++)+var_201)&4)][0] = var_200[((++var_203)&4)][((var_202++)&0)] ; + System.out.println("hello exception 87 !"); + } + } + } + System.out.println("hello exception 86 !"); + } + System.out.println(" if stmt end,id=30 "); + } + else + { + System.out.println(" else stmt begin,id=17 "); + int var_204 = (-290276569); + for( var_204 = 1017 ;(var_204<1077);var_204 = (var_204+12) ) + { + try + { + if( (((--var_27)-var_43.var_205)==var_193.var_89.var_32.var_33)) + { + System.out.println(" if stmt begin,id=32 "); + long var_206 = (8608637065936884738L); + System.out.println(" if stmt end,id=32 "); + } + else + { + System.out.println(" else stmt begin,id=18 "); + if( ((var_207--)>var_43.var_153.var_33)) + { + System.out.println(" if stmt begin,id=33 "); + double [][][] var_208 = {{{(3.27553e+283D),(-8.19221e+112D),(-1.80459e-82D),(3.468e+32D),(-1.19974e+239D),(-2.53384e+79D)},{(3.74686e+12D),(3.37222e-146D),(2.47208e+107D),(2.10617e+165D),(1.94077e+286D),(-6.31919e+135D)},{(-1.05273e-87D),(7.97941e+89D),(2.45081e+136D),(3.81736e-218D),(-2.70384e+214D),(-1.32721e-63D)},{(1.60878e+124D),(-3.34745e-105D),(2.92044e-289D),(1.67205e+174D),(-2.0138e-251D),(-9.61017e-65D)},{(-5.36217e-237D),(5.84878e+117D),(-9.39525e-170D),(2.71804e-184D),(-9.83108e-225D),(-6.03495e+63D)},{(-6.22654e-237D),(-2.34468e+163D),(2.99216e+236D),(-4.80891e+68D),(-5.97019e-222D),(1.13965e-235D)}},{{(-2.1526e-257D),(2.84119e-175D),(-3.14122e-131D),(1.94388e+213D),(-3.40001e+207D),(-1.80219e+154D)},{(-1.86169e+56D),(-7.07485e-292D),(3.00372e+188D),(-4.39935e-281D),(3.19198e-251D),(1.06308e-135D)},{(8.42723e-133D),(1.33258e+257D),(6.43262e+108D),(3.49194e+223D),(-3.97273e-79D),(3.02112e-09D)},{(2.4849e-113D),(6.24357e+49D),(4.04728e-110D),(2.56391e+266D),(6.24053e+65D),(-1.24017e-225D)},{(-2.01687e+114D),(-6.07648e-25D),(-1.57889e+41D),(-1.772e-222D),(1.79991e+174D),(30.6909D)},{(-1.21968e-296D),(6.58491e-254D),(-2.07655e+305D),(3.28684e-293D),(4.39275e+107D),(-2.80769e-216D)}},{{(-3.391e-253D),(-3.70308e+139D),(3.84453e+111D),(1.39203e-125D),(-3.41578e-294D),(-1.13496e+263D)},{(1.82246e+59D),(1.99114e-304D),(8.17663e+262D),(3.20149e-16D),(-1.41717e-212D),(8.84607e-129D)},{(-4.77307e+199D),(4.31027e-38D),(2.38595e-83D),(-3.12506e+49D),(2.45908e+97D),(3.79555e-281D)},{(-6.08314e+170D),(0.0244226D),(-3.16461e-103D),(-5.60114e+234D),(-4.44977e+90D),(-9.22578e-302D)},{(6.35304e+75D),(5.31183e-114D),(-2.04917e+158D),(-5.63449e-191D),(-3.796e-78D),(-3.7543e-104D)},{(4.29013e-54D),(-7.00334e-162D),(2.50278e+61D),(1.41608e-129D),(-6.08553e-157D),(1.40168e-210D)}},{{(1.12555e+155D),(-8.93386e-109D),(-3.35349e-114D),(1.1802e+298D),(-1.09477e-40D),(5.90148e+214D)},{(6.26334e+138D),(2.15698e-185D),(1.30307e-111D),(2.61581e+231D),(4.78413e-232D),(-5.04262e+176D)},{(5.9925e-83D),(-5.5175e-201D),(-1.81077e-109D),(8.18972e-118D),(6.4364e+290D),(2.85581e+213D)},{(4.31858e+223D),(1.46938e+224D),(6.0591e-179D),(-4.62864e-269D),(-2.21732e+20D),(-6.28835e+199D)},{(1.04925e-249D),(-4.43842e+36D),(-1.49564e-27D),(-3.36644e+170D),(-3.29123e+264D),(-1.25727e+176D)},{(3.8328e+112D),(1.18355e-26D),(8.89018e+204D),(1.70231e+156D),(-1.30312e-109D),(-7.86786e+160D)}},{{(-4.17944e-177D),(9.05657e-90D),(6.87237e+242D),(8.05629e-129D),(-6.46741e-109D),(7.90534e+76D)},{(1.88298e-58D),(-1.5311e+275D),(-6.78933e+270D),(4.74437e-236D),(1.73796e+62D),(1.25361e-131D)},{(6.36066e-44D),(4.91246e+262D),(-8.03364e-86D),(1.53575e-52D),(8.47679e-116D),(5.11301e+86D)},{(-1.28493e+40D),(2.57982e+259D),(9.56906e-247D),(-1.06244e-147D),(5.32219e-184D),(-2.6978e-159D)},{(-6.75374e+179D),(-3.98617e+270D),(1.39775e-52D),(9.41063e-29D),(5.30226e-214D),(8.89847e+220D)},{(9.16875e+45D),(1.54103e+85D),(1.59124e+44D),(1.36948e-100D),(6.84607e+191D),(-6.39131e-191D)}},{{(-2.1848e+196D),(1.10844e-244D),(-6.01336e-224D),(-1.80882e+59D),(1.07208e-128D),(3.51678e-271D)},{(1.14076e-95D),(-9.15035e-88D),(-3.32769e-214D),(1.06821e+142D),(1.86745e+185D),(-2.30292e+111D)},{(-2.5729e-278D),(8.59731e-119D),(2.03244e-41D),(-1.14895e-156D),(-4.91756e+177D),(1.59184e+243D)},{(-2.03377e+167D),(1.41512e+300D),(-2.67168e+176D),(-1.66865e-66D),(5.06966e+80D),(1.42987e-191D)},{(1.33349e-91D),(-2.1811e-191D),(5.35912e-44D),(4.39488e+195D),(-1.51461e+128D),(-9.67879e+162D)},{(1.61787e+76D),(-3.51536e-220D),(3.90455e+102D),(-6.82655e-258D),(-3.34123e-53D),(-6.77701e+172D)}},{{(6.68232e-12D),(-7.61477e-46D),(5.92739e+102D),(1.07945e+234D),(-2.04785e-11D),(-2.21839e-163D)},{(4.6328e-173D),(-5.42447e+39D),(-1.88078e+261D),(1.00865e-09D),(-7.94038e+220D),(1.82529e-65D)},{(8.76027e-178D),(-2.55404e+36D),(-1.26775e-197D),(-0.00105163D),(-606168D),(1.65989e-70D)},{(-3.63083e-149D),(-1.81369e+40D),(6.73071e+219D),(2.27776e+122D),(-9.98073e-148D),(4.964e+75D)},{(-8.52038e-254D),(4.74481e-10D),(-682.322D),(-2.52149e+241D),(-1.4562e+87D),(9.56374e-182D)},{(-1.36385e+126D),(-5.45169e-199D),(-1.62403e+26D),(3.18968e+41D),(1.1238e+219D),(8.3769e+130D)}}}; + System.out.println(" if stmt end,id=33 "); + } + System.out.println(" else stmt end,id=18 "); + } + } + catch( java.lang.IllegalArgumentException myExp_209 ) + { + if( var_210[((var_207++)&1)][(((-(var_207++))+( ( short )(var_211++) ))&2)]) + { + System.out.println(" if stmt begin,id=34 "); + try + { + double var_212 = (4.86423e-171D); + } + catch( java.lang.ArithmeticException myExp_213 ) + { + var_39 = var_214 ; + System.out.println("hello exception 90 !"); + } + System.out.println(" if stmt end,id=34 "); + } + System.out.println("hello exception 89 !"); + } + } + System.out.println(" else stmt end,id=17 "); + } + } + return (--var_216); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(154); + CrcCheck.ToByteArray(this.var_28.GetChecksum(),b,"var_28.GetChecksum()"); + CrcCheck.ToByteArray(this.var_30,b,"var_30"); + CrcCheck.ToByteArray(this.var_31.GetChecksum(),b,"var_31.GetChecksum()"); + CrcCheck.ToByteArray(this.var_41,b,"var_41"); + CrcCheck.ToByteArray(this.var_43.GetChecksum(),b,"var_43.GetChecksum()"); + CrcCheck.ToByteArray(this.var_46,b,"var_46"); + CrcCheck.ToByteArray(this.var_50,b,"var_50"); + CrcCheck.ToByteArray(this.var_52.GetChecksum(),b,"var_52.GetChecksum()"); + CrcCheck.ToByteArray(this.var_193.GetChecksum(),b,"var_193.GetChecksum()"); + CrcCheck.ToByteArray(this.var_196,b,"var_196"); + CrcCheck.ToByteArray(this.var_197.GetChecksum(),b,"var_197.GetChecksum()"); + CrcCheck.ToByteArray(this.var_201,b,"var_201"); + CrcCheck.ToByteArray(this.var_202,b,"var_202"); + CrcCheck.ToByteArray(this.var_207,b,"var_207"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<3;++a1){ + CrcCheck.ToByteArray(this.var_210[a0][a1],b,"var_210" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_211,b,"var_211"); + for(int a0=0;a0<1;++a0){ + for(int a1=0;a1<7;++a1){ + CrcCheck.ToByteArray(this.var_214[a0][a1],b,"var_214" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_216,b,"var_216"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_314[a0].GetChecksum(),b,"var_314" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_401.GetChecksum(),b,"var_401.GetChecksum()"); + CrcCheck.ToByteArray(this.var_441,b,"var_441"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_68.java b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_68.java new file mode 100644 index 0000000000000000000000000000000000000000..8cd77b2d52fb2a8d7b41735496027e6f4c879175 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/993_2018120417162/cl_68.java @@ -0,0 +1,513 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=4271641260 + +//import java.util.zip.CRC32; + +class cl_68 +{ + static long var_56 = (5792031368278410123L); + static int var_57 = (-281412300); + static short var_58 = (short)(3368); + static cl_3 var_59 = new cl_3(); + static byte var_77 = (byte)(-66); + static cl_10 var_78 = new cl_10(); + static cl_24 var_81 = new cl_24(); + static cl_24 var_82 = new cl_24(); + static long var_88 = (2374424951469173489L); + static cl_24 var_89 = new cl_24(); + final double var_92 = (-1.21418e+249D); + static cl_54 var_94 = new cl_54(); + final static float var_100 = (3.51535e-13F); + static boolean [] var_102 = {false,true,true}; + static int var_107 = (-2006482679); + float var_108 = (1.287e+07F); + static cl_3 var_114 = new cl_3(); + static int var_116 = (555057317); + final static boolean [] var_118 = {true,false,false,false,false}; + static long [] var_125 = {(-3715841861897664008L),(6698340644219587196L),(2800720567854464576L),(-800474029578538892L),(974551307151051848L),(-8440583374872844229L),(-6434160810269607199L)}; + static int var_135 = (-1015213594); + static int var_140 = (-2131183785); + static long [][][] var_143 = {{{(-3023197521032025758L),(-531507917409924117L),(8263838740797305579L),(7559265020675554580L)},{(4814990413290430867L),(-6648145680612890574L),(-1021430472249500031L),(-3251634710019649490L)},{(9021528261143344275L),(4425257547610192406L),(-8943137211814805833L),(-7028849784433098970L)},{(-7453018987117604479L),(8733009023760395963L),(-6069365432197470420L),(2622617448811266068L)},{(-2923183590981175501L),(304109491137004319L),(4310428034609750954L),(-5788615639292660773L)},{(-4161165069837604165L),(1407257697227778506L),(181513691825160335L),(7525199231452034189L)}},{{(6812744579307556872L),(-6293568121730111245L),(7871066759503894696L),(8624265110354235097L)},{(6138873286017725174L),(7343813713234958257L),(-114052551778437403L),(8193689941019018495L)},{(-5833211776058200832L),(3424274420459296842L),(-2716412149952088790L),(-9114306484090516254L)},{(309987891261604246L),(5306122914971213148L),(-7952357896448769565L),(-8787645000613612908L)},{(6003426983739360168L),(8366651073779917601L),(8797361713062761762L),(7509026065946278291L)},{(-9206041067049803383L),(6260054219452540930L),(6672852539016893171L),(-6255950037547844256L)}}}; + cl_24 var_145 = new cl_24(); + final static long [][][] var_150 = {{{(-3899070148245046169L),(-5255249814307132552L),(-3583165796315494276L),(-3896894425491772093L),(-8194333996093304942L),(-6528280181402056869L)},{(6319698711166541410L),(-8506593669034965122L),(-8478448752203503447L),(8664605266883127865L),(-831425593474368747L),(6622992556199541910L)}},{{(930847518383489747L),(410403551554402002L),(6709203919312223976L),(1909372250928180195L),(-7479608502804181726L),(4417378041222519261L)},{(6930697379480483439L),(-5555661764393936014L),(-8399306888573069620L),(-1591060282664949320L),(-8597340347077726034L),(-6723375782788251747L)}},{{(-6216602925142068430L),(4363098235159571788L),(3797541683621455698L),(9205890737466250151L),(7564052777948557991L),(-545734373564059206L)},{(3493066153066423147L),(4940100267643798798L),(2819531044804763891L),(-3046344655308332747L),(8119526458147074005L),(-7349496232334530405L)}}}; + cl_24 [] var_157 = {new cl_24()}; + int var_168 = (506117375); + int var_171 = (153195635); + cl_10 [] var_175 = {new cl_10(),new cl_10()}; + double var_181 = (9.06952e-200D); + cl_24 var_183 = new cl_24(); + int var_190 = (1902133232); + int var_192 = (-1612635344); + cl_10 [] var_421 = {new cl_10(),new cl_10(),new cl_10(),new cl_10()}; +/*********************************/ +public strictfp long func_55() +{ + byte [] var_152 = {(byte)(-78)}; + byte var_64 = (byte)(-106); + long [] var_191 = {(-2410445694218472665L),(-8690752640476770910L),(8635713178618156499L)}; + try + { + short var_65 = (short)(32363); + try + { + try + { + int [][] var_63 = {{(221285596),(1366481853),(-428692487)},{(450934760),(-1089533282),(-829008879)},{(1260805087),(509613311),(606970883)}}; + try + { + cl_3 var_163 = new cl_3(); + for( var_57 = 490 ;(var_57<496);var_57 = (var_57+6) ) + { + long var_155 = (972096168358120626L); + if( ((++var_58)!=var_59.var_60)) + { + System.out.println(" if stmt begin,id=35 "); + cl_24 var_61 = new cl_24(); + var_63[(((var_65--)*func_66(((--var_58)+( ( int )var_152[(((++var_65)+var_94.var_153.var_33)&0)] )) ,(var_155++) ,var_157 ,var_143 ,(-1.30229e+265D) ,(--var_64) ,var_135))&2)][((var_64++)&2)] = var_63[(((++var_64)+var_64)&2)][((~(++var_65))&2)] ; + System.out.println(" if stmt end,id=35 "); + } + else + { + System.out.println(" else stmt begin,id=19 "); + var_59 = var_94.var_44.var_53 ; + System.out.println(" else stmt end,id=19 "); + } + } + } + catch( java.lang.IllegalArgumentException myExp_164 ) + { + try + { + try + { + var_82.var_53.var_137 = ((--var_64)+var_77) ; + } + catch( java.lang.ArithmeticException myExp_165 ) + { + float var_166 = (2.14139e-38F); + System.out.println("hello exception 93 !"); + } + } + catch( java.lang.ArithmeticException myExp_167 ) + { + if( ((-(((-(var_168++))*(short)(-29323))+var_89.var_29))>var_58)) + { + System.out.println(" if stmt begin,id=36 "); + var_152[((var_77--)&0)] = (var_64--) ; + System.out.println(" if stmt end,id=36 "); + } + System.out.println("hello exception 94 !"); + } + System.out.println("hello exception 92 !"); + } + } + catch( java.lang.ArithmeticException myExp_169 ) + { + try + { + var_82.var_32.var_170 = (++var_171) ; + } + catch( java.lang.ArithmeticException myExp_172 ) + { + var_102[((var_65++)&2)] = true ; + System.out.println("hello exception 96 !"); + } + System.out.println("hello exception 95 !"); + } + } + catch( java.lang.ArithmeticException myExp_173 ) + { + try + { + try + { + var_145.var_174 = var_94.var_44.var_174 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_176 ) + { + int var_178 = (2014436922); + try + { + var_65 = (++var_58) ; + } + catch( java.lang.ArithmeticException myExp_177 ) + { + if( (!((var_65++)>=var_58))) + { + System.out.println(" if stmt begin,id=37 "); + var_152[((++var_178)&0)] = (++var_64) ; + System.out.println(" if stmt end,id=37 "); + } + System.out.println("hello exception 99 !"); + } + System.out.println("hello exception 98 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_179 ) + { + try + { + if( ((var_65--)>var_114.var_60)) + { + System.out.println(" if stmt begin,id=38 "); + int var_180 = (1374502238); + for( var_180 = 848 ;(var_180<892);var_180 = (var_180+11) ) + { + var_152[((-(var_77++))&0)] = (var_77++) ; + } + System.out.println(" if stmt end,id=38 "); + } + else + { + System.out.println(" else stmt begin,id=20 "); + if( (!(((--var_58)*var_108)==( ( double )(-325451317) )))) + { + System.out.println(" if stmt begin,id=39 "); + var_94.var_44.var_53.var_104 = var_181 ; + System.out.println(" if stmt end,id=39 "); + } + System.out.println(" else stmt end,id=20 "); + } + } + catch( java.lang.ArithmeticException myExp_182 ) + { + try + { + try + { + var_81 = var_183 ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_184 ) + { + var_64 = (var_64--) ; + System.out.println("hello exception 102 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_185 ) + { + int var_186 = (-1524802983); + System.out.println("hello exception 103 !"); + } + System.out.println("hello exception 101 !"); + } + System.out.println("hello exception 100 !"); + } + System.out.println("hello exception 97 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_187 ) + { + int var_188 = (-1442837392); + short var_189 = (short)(-4697); + for( var_188 = 721 ;(var_188<769);var_188 = (var_188+12) ) + { + if( (!(!(!((var_189--)==var_58))))) + { + System.out.println(" if stmt begin,id=40 "); + for( var_190 = 647 ;(var_190>641);var_190 = (var_190-2) ) + { + var_88 = (var_64++) ; + } + System.out.println(" if stmt end,id=40 "); + } + } + System.out.println("hello exception 104 !"); + } + return var_191[((--var_192)&2)]; +} +public static strictfp int func_66(int var_67, double var_68, cl_24[] var_69, long[][][] var_70, double var_71, int var_72, int var_73) +{ + long [][][] var_86 = {{{(-34727674561655957L),(-1898414211657920025L),(7393843651920434134L),(-1399235431947451506L),(655912417079356988L),(7825967848817257076L)},{(6075892090571107758L),(3541064312401461545L),(3791965273798377196L),(-88009500801825881L),(-1754246905892649342L),(5817125929234016876L)}},{{(-2758092643447154429L),(5760143413244473817L),(-3622086160227952496L),(-3278507080190670476L),(-8770749386288756478L),(-318182021486119056L)},{(3776790971852180446L),(-2445217620463221105L),(5097668881257011476L),(-4299868134946742182L),(-1851368476435370427L),(2643178360940328199L)}},{{(4735598558017567836L),(8545458141848207851L),(-1827967581286290773L),(-2765409954127974921L),(-2345501808172259301L),(-5422198230804215427L)},{(-1348923775600320902L),(-8723859551044081613L),(6374574326739467014L),(1385927418386863061L),(3706911007539456401L),(353603955870425606L)}}}; + boolean [] var_99 = {false,false,true}; + short var_87 = (short)(-25649); + boolean [] var_91 = {true,false,true,true,true}; + final long [] var_124 = {(-1945323852016573644L),(4858846665541121814L),(6663465394569752922L),(738276594341617884L),(-6844126927770509610L),(-1593380029152733678L),(4287868230050669402L)}; + try + { + float [] var_97 = {(3.91762e-27F),(1.04217e-17F),(-1.07453e+34F),(-6.3821e-16F),(0.159742F),(-9.0581e-17F),(-1.28457e+24F)}; + byte var_74 = (byte)(78); + long var_93 = (-8334543946024326721L); + if( (!((var_74--)=var_77)) ; + var_68 = (var_93--) ; + var_56 = ((var_77--)+var_56) ; + var_94.var_44.var_42.var_95 = ((var_74++)<( ( float )((var_74++)&var_59.var_60) )) ; + var_97[((-(var_74++))&6)] = (var_67--) ; + var_99[((var_77--)&2)] = (!(!(!(!((var_74--)>=var_100))))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_101 ) + { + var_99 = var_102 ; + var_94.var_103 = var_94.var_44.var_53 ; + var_59 = var_94.var_44.var_53 ; + var_99[(((var_87++)-var_57)&2)] = ((++var_68)==(byte)(5)) ; + var_82 = var_83 ; + var_68 = (++var_87) ; + var_70[((~(var_74--))&1)][((var_87++)&5)][(((--var_87)+var_57)&3)] = (~((-(var_58++))&( ( long )(4.33305e+09F) ))) ; + var_70[((var_58++)&1)][((~(var_74++))&5)][((var_77++)&3)] = var_105[((var_106--)&4)][((var_106++)&2)] ; + var_91[4] = (((~((var_74--)|( ( short )(var_107++) )))&var_89.var_53.var_29)>=var_58) ; + var_97[(((var_74--)|var_58)&6)] = (var_93--) ; + System.out.println("hello exception 105 !"); + } + } + catch( java.lang.IllegalArgumentException myExp_109 ) + { + try + { + var_93 = (-7491070861945579625L) ; + } + catch( java.lang.IllegalArgumentException myExp_110 ) + { + var_94.var_111 = var_94.var_44.var_112 ; + System.out.println("hello exception 107 !"); + } + System.out.println("hello exception 106 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_113 ) + { + var_59 = var_114 ; + System.out.println("hello exception 108 !"); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_115 ) + { + cl_3 var_121 = new cl_3(); + for( var_116 = 298 ;(var_116<331);var_116 = (var_116+11) ) + { + try + { + try + { + var_91 = var_118 ; + } + catch( java.lang.ArithmeticException myExp_120 ) + { + var_89.var_53 = var_94.var_44.var_53 ; + System.out.println("hello exception 110 !"); + } + } + catch( java.lang.ArithmeticException myExp_122 ) + { + var_102[((++var_107)&2)] = false ; + System.out.println("hello exception 111 !"); + } + } + System.out.println("hello exception 109 !"); + } + System.out.println(" if stmt end,id=41 "); + } + else + { + System.out.println(" else stmt begin,id=21 "); + var_59.var_123 = var_125 ; + System.out.println(" else stmt end,id=21 "); + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_126 ) + { + try + { + try + { + var_94.var_103.var_104 = ( ( double )(+(var_87++)) ) ; + } + catch( java.lang.IllegalArgumentException myExp_127 ) + { + byte var_129 = (byte)(-16); + try + { + try + { + int var_128 = (890019253); + for( var_128 = 466 ;(var_128<516);var_128 = (var_128+10) ) + { + var_125[((((++var_129)-var_129)*var_59.var_29)&6)] = var_124[((++var_107)&6)] ; + } + } + catch( java.lang.IllegalArgumentException myExp_131 ) + { + if( (!((-(+(var_87--)))348);var_135 = (var_135-7) ) + { + int var_136 = (-1278137196); + for( var_136 = 1008 ;(var_136<1044);var_136 = (var_136+12) ) + { + var_91[(((var_129--)&var_136)&4)] = ((~(--var_129))932);var_140 = (var_140-6) ) + { + var_70 = var_143 ; + } + } + catch( java.lang.IllegalArgumentException myExp_144 ) + { + try + { + var_69[((-(++var_87))&0)] = var_89 ; + } + catch( java.lang.ArithmeticException myExp_147 ) + { + cl_24 [][] var_148 = {{new cl_24()},{new cl_24()}}; + System.out.println("hello exception 119 !"); + } + System.out.println("hello exception 118 !"); + } + System.out.println(" else stmt end,id=23 "); + } + } + catch( java.lang.ArithmeticException myExp_149 ) + { + var_86 = var_150 ; + System.out.println("hello exception 120 !"); + } + System.out.println("hello exception 117 !"); + } + System.out.println("hello exception 113 !"); + } + return var_94.var_44.var_29; +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(943); + CrcCheck.ToByteArray(this.var_56,b,"var_56"); + CrcCheck.ToByteArray(this.var_57,b,"var_57"); + CrcCheck.ToByteArray(this.var_58,b,"var_58"); + CrcCheck.ToByteArray(this.var_59.GetChecksum(),b,"var_59.GetChecksum()"); + CrcCheck.ToByteArray(this.var_77,b,"var_77"); + CrcCheck.ToByteArray(this.var_78.GetChecksum(),b,"var_78.GetChecksum()"); + CrcCheck.ToByteArray(this.var_81.GetChecksum(),b,"var_81.GetChecksum()"); + CrcCheck.ToByteArray(this.var_82.GetChecksum(),b,"var_82.GetChecksum()"); + CrcCheck.ToByteArray(this.var_88,b,"var_88"); + CrcCheck.ToByteArray(this.var_89.GetChecksum(),b,"var_89.GetChecksum()"); + CrcCheck.ToByteArray(this.var_92,b,"var_92"); + CrcCheck.ToByteArray(this.var_94.GetChecksum(),b,"var_94.GetChecksum()"); + CrcCheck.ToByteArray(this.var_100,b,"var_100"); + for(int a0=0;a0<3;++a0){ + CrcCheck.ToByteArray(this.var_102[a0],b,"var_102" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_114.GetChecksum(),b,"var_114.GetChecksum()"); + CrcCheck.ToByteArray(this.var_116,b,"var_116"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_118[a0],b,"var_118" + "["+ Integer.toString(a0)+"]"); + } + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_125[a0],b,"var_125" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_135,b,"var_135"); + CrcCheck.ToByteArray(this.var_140,b,"var_140"); + for(int a0=0;a0<2;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_143[a0][a1][a2],b,"var_143" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_145.GetChecksum(),b,"var_145.GetChecksum()"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<2;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_150[a0][a1][a2],b,"var_150" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + for(int a0=0;a0<1;++a0){ + CrcCheck.ToByteArray(this.var_157[a0].GetChecksum(),b,"var_157" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_168,b,"var_168"); + CrcCheck.ToByteArray(this.var_171,b,"var_171"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_175[a0].GetChecksum(),b,"var_175" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_181,b,"var_181"); + CrcCheck.ToByteArray(this.var_183.GetChecksum(),b,"var_183.GetChecksum()"); + CrcCheck.ToByteArray(this.var_190,b,"var_190"); + CrcCheck.ToByteArray(this.var_192,b,"var_192"); + for(int a0=0;a0<4;++a0){ + CrcCheck.ToByteArray(this.var_421[a0].GetChecksum(),b,"var_421" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/CRC32.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/CRC32.java new file mode 100644 index 0000000000000000000000000000000000000000..78fca5bf42079397b88a5928635497ad99ba5454 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/CRC32.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + + +public class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf("\nFail to Get CRC!\n\tCalculation=%d\tLookupTable=%d\n",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xFFFFFFFFL; + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/CrcCheck.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/CrcCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..71646fe0fb0277225e3a3d605396a7814069d13f --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/CrcCheck.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +import java.lang.Long; +import java.lang.Double; + +class CrcBuffer{ + int i=0; + static int buffer_counter = 0; + byte [] buffer; + CrcBuffer(int size){ + this.buffer = new byte[size]; + buffer_counter++; + int i = 0; + for(i=0;i>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tShort-Value=%d\n",b.i-2,var_name,args); + } + } + + public static void ToByteArray(int args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tInt-Value=%d\n",b.i-4,var_name,args); + } + } + + + public static void ToByteArray(long args,CrcBuffer b,String var_name){ + b.buffer[b.i] =(byte)((args>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((args>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(args&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tLong-Value=%d\n",b.i-8,var_name,args); + } + } + + public static void ToByteArray(boolean args,CrcBuffer b,String var_name){ + if(args){ + b.buffer[b.i] = 0x01; + } + else{ + b.buffer[b.i] = 0x00; + } + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tBoolean-Value=%d\n",b.i-1,var_name,args? 1 : 0); + } + } + + public static void ToByteArray(float args,CrcBuffer b,String var_name){ + int iargs=Float.floatToIntBits(args); + b.buffer[b.i] =(byte)((iargs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((iargs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(iargs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tFloat-Value=%f\n",b.i-4,var_name,args); + } + } + + public static void ToByteArray(double args,CrcBuffer b,String var_name){ + long largs=Double.doubleToLongBits(args); + b.buffer[b.i] =(byte)((largs>>56)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>48)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>40)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>32)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>24)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>16)&0xff); + b.i++; + b.buffer[b.i] =(byte)((largs>>8)&0xff); + b.i++; + b.buffer[b.i] =(byte)(largs&0xff); + b.i++; + if(isVerbose) { + System.out.printf("Index=%d\tVarName=%s\tDouble-Value=%f\n",b.i-8,var_name,args); + } + } + + +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/MainClass.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/MainClass.java new file mode 100644 index 0000000000000000000000000000000000000000..dcd0284ce6eef2359778a96c30915e4a6cff0278 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/MainClass.java @@ -0,0 +1,536 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1808069720 + +//import java.util.zip.CRC32; + +class MainClass +{ + static byte var_1 = (byte)(84); + static int var_10 = (-771708079); + static int var_19 = (171924797); + static int var_26 = (-2048731605); + static float var_30 = (6.43942e-31F); + static cl_30 var_34 = new cl_30(); + static int var_52 = (427772399); + static cl_82 var_54 = new cl_82(); + static double [][][] var_58 = {{{(1.76828e-183D),(-6.13686e+195D),(-3.56139e+270D),(2.04665e+140D)},{(2.54005e-305D),(-2.34468e-224D),(-1.4467e+124D),(3.81891e-292D)},{(-8.16776e-70D),(5.44242e+212D),(-1.71772e-264D),(-1.42637e+208D)},{(6.8432e-295D),(-1.28079e-195D),(-2.81837e+32D),(1.04065e-224D)}},{{(-4.12176e+20D),(1.29855e+272D),(-1.43058e+48D),(1.08409e-285D)},{(5.875e-307D),(8.98015e-90D),(-9.37526e-229D),(1.06866e+285D)},{(-1.68648e+277D),(-1.25138e-281D),(-1.49695e+287D),(8.46588e-220D)},{(-3.33989e-162D),(-3.87129e-162D),(-3.71238e+99D),(1.31752e-234D)}},{{(4.40863e-118D),(4.2921e-285D),(3.41471e+47D),(1.93631e+51D)},{(-10297.2D),(4.89124e-306D),(-1.00766e-255D),(-1.41931e+249D)},{(7.71881e+20D),(-3.09324e+121D),(1.16156e+72D),(6.89109e+223D)},{(-4.66916e+90D),(1.94739e+254D),(-1.31764e+78D),(-7.2405e+258D)}}}; + static short var_65 = (short)(9001); + static int var_69 = (-317240755); + static cl_107 var_72 = new cl_107(); + static cl_121 [] var_74 = {new cl_121(),new cl_121(),new cl_121(),new cl_121(),new cl_121()}; + static cl_121 var_75 = new cl_121(); + static long var_79 = (2306459395309874207L); + static float [] var_86 = {(6.33737e+35F),(2.05197e-36F),(-1.90359e-08F),(-345.143F),(6.25442e-30F),(-1.19323e-34F),(-7.66476e+32F)}; + final static double var_88 = (1.46341e+168D); + static int var_90 = (1625980136); + final double var_96 = (8.81898e+102D); + static cl_144 var_97 = new cl_144(); + final static int [][][] var_100 = {{{(651824577),(69184547)},{(-774088356),(-61664237)},{(525977172),(482780588)},{(-578422472),(501801663)},{(1871796498),(1515598566)}},{{(-783371361),(-1396910647)},{(998809458),(-344064858)},{(-2131244169),(-2068410983)},{(-37204884),(-1691557242)},{(-1222813478),(1997514246)}},{{(-1033419777),(-1443784443)},{(-1296912179),(1744414257)},{(334736684),(-984041062)},{(936017305),(-668868148)},{(1925664324),(1858232162)}},{{(1008580592),(-2044976020)},{(-1552438173),(1614473047)},{(236444591),(-2088925368)},{(1012082563),(-1243464111)},{(851034230),(-462591549)}}}; + final static cl_158 var_102 = new cl_158(); + boolean var_117 = false; + static int var_119 = (-2072986889); + int var_121 = (-651566394); + static cl_144 var_122 = new cl_144(); + static int var_125 = (291170090); + static double [][][] var_149 = {{{(-1.26353e-203D),(1.23898e-08D),(-1.02561e-64D),(3.33788e-93D)},{(1.96881e+116D),(1.18607e-14D),(8.92054e-83D),(0.0219521D)},{(2.63851e-220D),(2.58818e-98D),(1.05287e+167D),(-1.67929e+72D)},{(4.82495e+221D),(1.16014e+09D),(4.0003e+148D),(-5.27567e+19D)}},{{(-1.17865e+279D),(-8.57995e+188D),(4.04428e+299D),(-2.74391e+111D)},{(-6.48714e-296D),(7.06324e+251D),(4.62472e+240D),(-7.31867e+85D)},{(2.39087e+218D),(3.76447e+153D),(1.06608e-303D),(-6.03855e+117D)},{(-2.54585e+211D),(4.17331e-91D),(-4.30199e+194D),(-2.77554e+109D)}},{{(7.83773e-23D),(-5.62959e+287D),(2.70868e+101D),(-1.41912e+35D)},{(-2.06379e+110D),(7.51118e-209D),(-1.05167e+102D),(-4.43744e-252D)},{(-1.60936e+275D),(-1.59328e-119D),(-4.67784e-253D),(-1.52003e+246D)},{(-8.43675e-78D),(2.09001e-248D),(-4.25564e+74D),(0.00057983D)}}}; + static byte var_151 = (byte)(2); + static byte var_154 = (byte)(54); + static byte var_158 = (byte)(-123); + static byte var_179 = (byte)(97); + static int var_186 = (375078925); + static boolean [][][] var_187 = {{{false,false}},{{true,true}},{{true,false}},{{false,true}}}; + static int var_189 = (432770990); + final static long var_190 = (3454266881626659991L); + long [][] var_216 = {{(-8355858365365534494L),(-3290041661685125189L),(-8640010941898134554L),(-7202657967779997392L),(-690828091753972691L),(3530643186731931534L)},{(-3391061146858116717L),(2712555590035188485L),(-9101950173069678323L),(6109360263700421017L),(-8006584538553045437L),(-3593817315556781794L)},{(2865835429980329057L),(-3835656421894440046L),(1903223134184720512L),(-5167967802121850287L),(5039103274924456321L),(8467765287247921727L)},{(-5998582806028497327L),(2107497052554563438L),(6810508408052727858L),(-3438666652505899349L),(4878158580452382383L),(8436118354242677684L)},{(7530333830521262740L),(-3320464188989537476L),(567473790901631018L),(-1820011799077334665L),(-4131695790669221228L),(4861891572093616104L)}}; + cl_30 var_248 = new cl_30(); + cl_158 var_302 = new cl_158(); + byte var_304 = (byte)(-59); + long var_359 = (-992617718502318861L); +/*********************************/ +public strictfp void run() +{ + byte var_314 = (byte)(33); + float var_311 = (-4.84885e+15F); + short var_318 = (short)(-28911); + float [] var_507 = {(-3.73755e-05F),(3712.84F),(-3.53512e-26F)}; + double var_343 = (2.1389e-307D); + int var_0 = (200159533); + int var_334 = (-1568787532); + cl_30 var_339 = new cl_30(); + long var_401 = (8227807695680944777L); + boolean [] var_346 = {true,true,false,false,true}; + final long [][] var_330 = {{(-1840100143551595966L),(-7473113765581667327L),(2633595499830791795L)},{(7972261755513273540L),(9173693402684424820L),(-4201862252895107289L)},{(864856840246842605L),(-5184261056399338652L),(4251166783841071353L)},{(80446434966782018L),(7862543679096702982L),(2706597726027015414L)},{(7706414611111489337L),(3324536293796631592L),(-464261553748365360L)},{(5580163468539091317L),(-5762268038854978012L),(866409075887845701L)}}; + for( var_0 = 847 ;(var_0<911);var_0 = (var_0+16) ) + { + long var_363 = (-4153532335871778005L); + long [][][] var_303 = {{{(-7760487871302699953L),(413049116911385500L),(7100701091889083162L),(-1674712549498975554L),(-7524262311330274144L),(-627735224360387826L)},{(-689501609339775738L),(7433067793891453659L),(6826942441579145078L),(-1378631806569807588L),(5161742673940776137L),(9035468160915355903L)},{(3308120115788442617L),(-3373027232753210564L),(-9095399241236248243L),(4177429115557753808L),(-5171119027666277852L),(-5066567896695752613L)},{(-6053004543973128752L),(9193249112653166446L),(-7314939180671661925L),(-3504049176329100886L),(6881890398757694377L),(1359150224711058381L)},{(-3117503624629304105L),(905766535428779472L),(-1095456609724534722L),(-5673409920866318814L),(4343762470942200981L),(-2379994569039859467L)},{(126517919858345522L),(-8088047840626863904L),(-3444479743742019450L),(5682973940902598249L),(302492507729182726L),(-8959936894594672998L)}},{{(-6315387428751580716L),(3488601173729661690L),(-8213797846410056380L),(5623816768086435188L),(9144327953209563847L),(-5474339183056400227L)},{(-4401888321616787226L),(-1722378496872347860L),(-67318848944739200L),(7456869931940414282L),(2794422898323662109L),(1169901764847180581L)},{(-4154149351301372256L),(-9141723053150843735L),(7917427078039745435L),(-3351440387225764725L),(254952328920691181L),(2988645552501475157L)},{(6176120149346395862L),(-5933133267037440035L),(-2813392908682331236L),(1298077473119378666L),(3021285357021096916L),(8258291637303636543L)},{(-7325342344527606917L),(4732098678285128757L),(1869483639238549458L),(5301795029086740635L),(-4389907872933775039L),(-5313385900164499149L)},{(7625404320158096087L),(5140804558159724702L),(-4576526817108671697L),(7316647113609944757L),(4973843483063180820L),(5366001435386848797L)}},{{(1743843364659360432L),(2244271276453844665L),(856386352515924772L),(-4560376185870536675L),(86070483721381479L),(8764654151970688555L)},{(-6571581653418853112L),(7220429694208069544L),(-3568545672088238304L),(-572005659208660326L),(5166947323232391275L),(1115523639940079001L)},{(-8830689184406170933L),(-1911667443182135295L),(9209003278124338060L),(2898419686648837331L),(-690513266088797881L),(662870531846519837L)},{(-4275066762679985558L),(-8785611036055723898L),(-7371162598281684029L),(377616191346953685L),(6811813213163761471L),(6932920170405756468L)},{(-8083256072825667414L),(-4973479509375280450L),(-1494987275224343527L),(2029583565104646532L),(-7718628133317891943L),(-2219407353198366769L)},{(-4372197783020584832L),(-8961364298720945155L),(-317319164874487785L),(8631468340662234744L),(-3727640984185387446L),(7021653627409763029L)}},{{(8431314953425275919L),(1175036459760436838L),(4787922364400909455L),(-3258515127883950571L),(2313139164999471667L),(6252685885726847906L)},{(-3245221317333187747L),(-1984050111284909148L),(-4556132666054124651L),(-7229588698741267804L),(-7831475057264444312L),(-4731354493216847687L)},{(2123825346068887010L),(-1688420477321435158L),(-2858963698698666986L),(6226878928653891979L),(4087574750748903222L),(1194310883997446434L)},{(1627854316548980802L),(-4029539683711136816L),(-7813045265006675706L),(-6929146148066227244L),(4367975420874127773L),(-2694885186470235940L)},{(-4856975105830056892L),(6525634087217783728L),(-1371371020659953402L),(4753835834145721969L),(210806988735566923L),(205992075008524353L)},{(6049290111427374403L),(5732157601439071313L),(7289588366060156039L),(-9152315278453269251L),(3637408973167974717L),(4195542159507087367L)}},{{(5911893052258902292L),(3378159559419115042L),(-4941426418581631042L),(8247547919019478528L),(-8424244203352391679L),(-2414204749496136617L)},{(-8080613771102381970L),(-4615845019157608126L),(3642121928695944627L),(-6828183237602255333L),(5943615027764980143L),(8166288804459400608L)},{(-161976263089820746L),(-4239295676088828233L),(-4700054031045315525L),(4978412275532235964L),(-8959090269820264444L),(-1933675593820502888L)},{(-1443780288989531151L),(-5827547207998284127L),(-91070479144962771L),(-7039828106717283032L),(-6048381088093119215L),(-2249918979583150814L)},{(8297969381363836488L),(-6116884228397896909L),(-4617631085572915893L),(2756888784660055748L),(6030921000760288628L),(-2904930317649605427L)},{(2437190815130224345L),(6604214970049340993L),(-1577101409595888490L),(-2515312808521795133L),(-5862954406860169235L),(401370035161259310L)}},{{(-8635380976393029967L),(-8463841341142595022L),(5695534322340124049L),(-7571151580630104404L),(8741235801045701398L),(4530260871343498147L)},{(-4785217030331648864L),(-5497905606865311583L),(-622387348040072400L),(7717756010973535200L),(-4586698020161144462L),(-2460115744809959598L)},{(-1261298543522805714L),(2809514275246250809L),(-5698555760260943792L),(-4282828858395966521L),(4293189160831754155L),(7483078757616623331L)},{(-522265910095226823L),(-2684619430257608830L),(7683711893030643437L),(9050318805377014998L),(6148141152217691521L),(-5604984543015023249L)},{(-7159752451922892970L),(-8425475281269940484L),(8174346029013609795L),(5580814863964855486L),(-7760918419922861287L),(4045876389554805799L)},{(8201721707016125322L),(-3308871603279902279L),(-2971896409504344447L),(8326300295101606103L),(475414322725946906L),(-1476859796484941315L)}}}; + long var_388 = (3130239165943036005L); + short var_305 = (short)(-10556); + long var_375 = (-2159565112426218669L); + short var_307 = (short)(935); + short var_315 = (short)(28165); + if( (!((++var_1)!=func_2(var_303[((var_305--)&5)][((var_179--)&5)][((+(~(var_304--)))&5)] ,((--var_307)&func_2((5623591169803543781L) ,(var_158++) ,( ( int )(--var_179) ) ,(var_311++) ,var_248.var_70 ,((var_314--)=var_122.var_118)))) ,(var_314++) ,((!((var_90--)>=var_96))==( ( boolean )(!(!(!(!((+(++var_318))>=func_40(((var_314++)+var_54.var_323) ,(--var_65) ,(!((-(var_151++))func_44(((var_318++)|var_54.var_323) ,((var_314++)&var_65) ,var_330[((++var_119)&5)][((--var_318)&2)] ,((--var_318)>=func_40(((var_314++)+var_190) ,(6218017824173350026L) ,(!((--var_334)>func_2((++var_1) ,((++var_65)*func_14((var_311--) ,((-(+(--var_314)))+( ( double )(var_334++) )) ,((++var_334)!=( ( double )(~(++var_314)) )) ,var_339)) ,(var_65--) ,(var_343++) ,(var_314++) ,var_346[((-(-(var_314--)))&4)] ,(++var_334)))))) ,(++var_318) ,(-(+(var_334--))) ,((var_318++)-var_121))))) ,var_248)) ,((var_318++)&var_79) ,(--var_334) ,(((var_186--)*func_40(((+(--var_314))*func_14((--var_359) ,var_96 ,((var_314--)<=func_59((~(--var_158)) ,( ( int )(~(-((((+(var_314++))-(-361401421))&var_34.var_214)|func_14((var_363--) ,(--var_19) ,(!(!((var_334--)>=( ( byte )((--var_314)-var_304) )))) ,var_248)))) ) ,true)) ,var_248)) ,(1687556799375135581L) ,(!(!((var_334++)!=func_20(var_88 ,(++var_375) ,var_54.var_55 ,((var_311++)=func_59((var_314--) ,((--var_318)+var_75.var_171) ,((--var_401)<=func_20(( ( double )var_69 ) ,(+(++var_314)) ,func_20(((var_314++)+var_158) ,(+(++var_314)) ,(var_343--) ,(!(!(!((+(var_318++))!=func_20((var_314--) ,(+((var_179--)+var_158)) ,(((++var_65)*func_40((((--var_318)&( ( long )(~((var_314++)-func_2(((var_318--)*var_75.var_380) ,var_359 ,(var_65--) ,(++var_401) ,(var_314++) ,(!(((+((var_154++)|var_122.var_163))-( ( short )(-(var_334++)) ))<=func_44(((var_401--)|var_154) ,((++var_334)|var_75.var_171) ,(+((var_314++)&(short)(15234))) ,((++var_318)<=func_2((--var_314) ,( ( long )(--var_65) ) ,(var_65++) ,( ( double )(var_314--) ) ,func_59((++var_334) ,((--var_65)*var_65) ,(!(!(!(!(!((--var_314)==var_65))))))) ,(!(!((+(--var_151))<=(byte)(82)))) ,(++var_401))) ,(var_65--) ,(~(++var_314)) ,func_59((var_314++) ,(~(var_318--)) ,true)))) ,(var_318++)))) ))|func_14(((((var_314--)|( ( int )(var_304++) ))|var_334)-( ( long )(+(++var_314)) )) ,(--var_311) ,(!(!(!(!(!((short)(-8270)!=var_0)))))) ,var_248)) ,(var_179++) ,(((--var_314)*func_14((var_359--) ,(-1.0426e+305D) ,(!((--var_179)<=func_2((~(var_314--)) ,(var_318--) ,(~(var_314++)) ,var_88 ,func_59((var_314--) ,(-161267122) ,(!((var_334++)>=func_40(((var_314--)|var_154) ,(++var_318) ,var_187[((~(++var_65))&3)][0][((var_158++)&1)])))) ,var_346[((~(--var_314))&4)] ,(--var_119)))) ,var_34))>=var_65)))&var_122.var_180) ,var_122.var_108 ,var_190))))) ,(var_179--)) ,var_97.var_108 ,((var_318++)|var_359)))))) ,((var_19--)+var_97.var_163)))<=( ( float )(-((++var_314)+( ( byte )(++var_334) ))) )) ,var_248) ,(var_314++) ,((var_314--)+var_304) ,var_117 ,(((var_314--)+( ( short )((var_318++)+func_2(((var_179--)&var_121) ,var_359 ,((var_318--)|func_2((5900036999862855512L) ,(~(++var_314)) ,func_14((var_65--) ,((~(var_314++))/func_40((var_334--) ,(--var_334) ,((++var_401)!=(5.29424e+49D)))) ,((--var_318)>=var_302.var_192) ,var_34) ,(--var_318) ,(+(var_314++)) ,(!(!(!((~(var_179--))==func_59((var_401--) ,var_10 ,( ( boolean )var_187[((-(var_314--))&3)][((var_154++)&0)][((var_314++)&1)] )))))) ,(~((~(var_314++))-var_79)))) ,((var_314++)&var_75.var_104) ,((+((++var_314)+func_40(((-(-(var_314++)))+var_79) ,(var_401--) ,((~(++var_304))!=var_72.var_73))))*var_154) ,true ,(-(--var_158)))) ))&var_79)))-var_119)))))))-func_14(var_507[2] ,(2.12676e+154D) ,(!((+(~(--var_314)))!=func_14(var_507[2] ,(~(-(-(var_318--)))) ,var_187[(((var_65++)-var_72.var_73)&3)][((~(var_318--))&0)][((~(var_65--))&1)] ,var_339))) ,var_339)) ,(var_334--) ,(!((var_334++)<=var_72.var_518)) ,((++var_65)-var_72.var_111)))))))))) )) ,var_248) ,(+(var_179++)) ,(!(!(((var_359--)296);var_550 = (var_550-8) ) + { + int var_551 = (-1798238407); + final long [][][] var_553 = {{{(-8038411825659187474L),(-5843587535624283371L),(3417366704536605364L),(7444580274115745525L),(2297591710887583279L),(-8266017626089588418L)},{(-2309856463724059483L),(-668610037445948337L),(-1405234425551347329L),(6056716119974711714L),(6703665606994427282L),(-9134475914236822552L)},{(30999198473007611L),(886041962599949479L),(5025354561442668580L),(7013196210952864136L),(404421678451704690L),(4087929740015731356L)},{(-9175217164139446890L),(6018022084749863179L),(-1195875560968315572L),(2433582084534965471L),(-8260146311957838510L),(7064560451907683919L)},{(-3016117735500568007L),(-5082930862152495051L),(-3769510154347384023L),(-7693489572830636653L),(8761927845697108881L),(-6596921352567099876L)},{(-1522909910779995653L),(3420443698291652050L),(-3179463641579134370L),(2080201913470356068L),(5035551058759630381L),(-9191687776209176714L)}},{{(5492328154369254398L),(1747045891150957825L),(1603803913729894983L),(6946971090842171630L),(5823523259592890526L),(1661807340702420005L)},{(-5591647241066622877L),(-17870371176841839L),(1273456969432913846L),(5866233294016808385L),(1627834022804107742L),(-6757459007473159319L)},{(-6129768730994763622L),(4730588134704940897L),(3189870534411096590L),(-4053647192179680490L),(-8607484838517640186L),(-3878771606887032727L)},{(-1139736457898030537L),(-8188093002701704543L),(-8476336668223093892L),(7894176380548953744L),(-634591171206158954L),(-1777369742847413403L)},{(-5694708510907848991L),(-6710951578462724985L),(-7284256751961197350L),(1668505701663150726L),(5495829653003871706L),(-5864216181263373668L)},{(6159676075467492092L),(-2194307557188052802L),(-1375041701310063409L),(-430112129311581745L),(5018789685676279426L),(-5299506663748018014L)}},{{(3206466840627771229L),(-7708495145512203383L),(1682216187989033554L),(-7701732552190435002L),(-3221180215752475325L),(4736007482199516001L)},{(-5032534003477560432L),(-4048962317259689023L),(4896282281425113489L),(1717854529648406339L),(-8693812930598315544L),(7134103902941478793L)},{(-6392644701686646224L),(8923941526526218036L),(-8883150272979288239L),(-6759175033539507970L),(4705847524280402842L),(-7348873211273972376L)},{(-838740933919096490L),(6705775271950360111L),(694157856703714538L),(606668915272161912L),(4761092202597822645L),(813986170239673069L)},{(9116411807371932923L),(-8531434691251344632L),(-2371953471955305763L),(5640559946355973041L),(5681980231829020479L),(-4632580761428069638L)},{(-1813120616614717315L),(1849763423950699785L),(-3779930958810748922L),(6124168276208245737L),(1517853574434073277L),(8006546677165980350L)}},{{(-4937740755406928573L),(8973240921813448457L),(-5655326260478229695L),(-1746573308926228498L),(5801750948295219074L),(-1907579068576783537L)},{(2178923877920643141L),(1726177422062949868L),(-495152888940527810L),(-6890205463866434904L),(-834507598167864248L),(-4694183359210197160L)},{(-5478749589501436335L),(-4095011395361850196L),(7482031817337506157L),(-77990606129458102L),(-2997301959414611787L),(5992882955234705077L)},{(-4621644563295521770L),(-2292522322901661475L),(-785785462054203137L),(3914176081496380678L),(7981144529437159797L),(-3909938621055365459L)},{(4111725484327552090L),(-3768516557139519030L),(-5804383291133503980L),(7163647450159592873L),(-1957119398023258150L),(-4201682682134653816L)},{(6709334727166239738L),(4978682616601686794L),(-6096062678805247402L),(6802899028704099653L),(-5069855343525775965L),(2596317264362402841L)}},{{(-6013034170371781019L),(7257271210144324714L),(-6209280387694081169L),(136981216774289154L),(2500501964183464815L),(-1668368688145290445L)},{(-4510130875185051744L),(-1642761050140260373L),(-8095571242395781238L),(9192311134094642404L),(-1102706606377673545L),(-5704598324310327971L)},{(283581043018229188L),(3330542481286742450L),(-5843340940332103867L),(-2012890608989469131L),(-7387604901169607758L),(7483407694006459489L)},{(-1733747221438641245L),(-7366367398407547127L),(6961804019541402645L),(-3515472350394513417L),(6027668959605740706L),(-328335687631710925L)},{(6923723387130366264L),(-4368685978736842765L),(-4906996452316484674L),(8457380036065890324L),(5365056499479293518L),(-5896107864223641828L)},{(-6283007552968282927L),(-7306238949204621849L),(784066427719549287L),(4955533340861479092L),(865260832058997674L),(5298323753557063624L)}},{{(1480127301605204877L),(1362284843612415343L),(657834282574942549L),(6168337714544872428L),(-5512148949529073594L),(-7228779528261483195L)},{(-7773043761336156517L),(-1255666393403335945L),(8371354739983024703L),(6609289389677324984L),(-3314568705610657025L),(5823087883280708636L)},{(3330492426456309499L),(-1393441455575782207L),(3028370106445695599L),(-797400697696025081L),(-3196320854523183189L),(-7715406275102743604L)},{(-1561697723096908903L),(-1107270233730653068L),(4193788505012670135L),(-1010708858401607294L),(1462825269704443091L),(6583124456448483376L)},{(-4955638047990033617L),(3124862204875959855L),(8017031845327016945L),(-7023445115613314844L),(8782841381537309955L),(6934408401147618217L)},{(2496392549117188517L),(6888483802446464037L),(-5230929992622210245L),(-877782993815757585L),(-7822527864703155952L),(-6949671005174766931L)}}}; + for( var_551 = 272 ;(var_551>261);var_551 = (var_551-11) ) + { + var_303 = var_553 ; + } + } + // if stmt end,id=1 + } + } + return ; +} +public strictfp short func_2(long var_3, long var_4, int var_5, double var_6, float var_7, boolean var_8, long var_9) +{ + double [][][] var_232 = {{{(4.25182e-154D),(-1.82639e+141D),(1.47488e-32D),(2.66465e-230D),(7.15837e-245D)},{(-9.73515e-48D),(4.61161e+197D),(-4.12618e-194D),(-5.08743e+207D),(-9.53097e-92D)},{(0.00249606D),(7.18744e+39D),(4.42211e+176D),(1.68375e-244D),(3.99576e+46D)},{(-5.17136e+124D),(1.63871e-57D),(3.20891e+08D),(-1.15389e-265D),(1.20215e+134D)},{(-1.64053e+59D),(-7.60559D),(7.11221e-181D),(-4.37428e-159D),(-3.43552e+172D)},{(-0.00547288D),(5.85802e-151D),(-1.82756e-236D),(6.61793e-81D),(-1.93029e-247D)}},{{(-3.11439e-140D),(-5.79909e+141D),(-7.48221e+119D),(1.58967e+78D),(6.39246e-176D)},{(-1.07762e-269D),(-2.14707e+257D),(1.6103e+43D),(1.13074e+279D),(3.22323e-280D)},{(-1.28537e-112D),(-1.61925e-164D),(7.17966e+52D),(1.88789e-177D),(5.15657e+264D)},{(1.44404e-37D),(-2.12643e-05D),(3.29285e-23D),(-1.66544e+43D),(-1.379e+194D)},{(5.0989e+08D),(-9.78503e+169D),(-1.46588e+98D),(-60.3724D),(-4.00826e+140D)},{(3.87688e-41D),(-4.51068e-30D),(1.72313e-08D),(2.6392e+37D),(-4.81986e-175D)}}}; + for( var_10 = 644 ;(var_10>631);var_10 = (var_10-13) ) + { + int var_11 = (-1976274779); + int [][] var_220 = {{(1522530259),(-671280908),(1559000170),(1081345563),(-1279628630)}}; + short var_219 = (short)(-8496); + for( var_11 = 136 ;(var_11>106);var_11 = (var_11-10) ) + { + byte var_13 = (byte)(-91); + long [][][] var_267 = {{{(4171511064552503049L),(-3377362463320548586L),(6815708114429386214L),(5294313436763797788L),(-8983776178760194497L),(4839589955348037709L),(5978930606217026428L)},{(-3801406347380971071L),(2434207492095759108L),(-7727209773126866427L),(6298186354068567048L),(-8999610006625949782L),(3139419017918561060L),(6219181003010514383L)},{(3522084478576080002L),(-2154227696586722557L),(-6727871092563716465L),(-8343086185113135991L),(-5500998142293574099L),(-9067072382928378891L),(603312841400010380L)},{(8335216218858857331L),(-7765127809990214279L),(43151906026849713L),(4001695827211302594L),(-3714706622983342603L),(-980449443588224171L),(-5008340610093621929L)},{(8196214746640309038L),(-5326210011319637825L),(-6534705696942718796L),(9132593989692597261L),(-6834659724851161916L),(5175967333501035593L),(4249300115547214544L)}},{{(5682787968578887264L),(4822180127135766715L),(-1818166334466497659L),(-8617069204979838964L),(2837519304895527758L),(-2978313850789836974L),(-1940220234148182227L)},{(-5785492960290330179L),(-661223406273459747L),(4857597967539975662L),(-4999546519091980584L),(5356356151018939412L),(2932358161593951580L),(-6079355550357503072L)},{(6389845048918891076L),(3726000540305827989L),(4515342786306237773L),(6289577266802862313L),(3263831270152724671L),(4768073140442906930L),(-5022606423426036517L)},{(6788239330411675261L),(-5612235404582318721L),(-5855399584832852975L),(5527102985891723964L),(1272950311805380689L),(-6948337371254348662L),(4922790797024738296L)},{(-3296579040560826340L),(8552468753657807611L),(-1000739727552545183L),(1112993544940625505L),(-7529589938594559326L),(7729710958298900933L),(4812603352170743108L)}}}; + int var_12 = (-433825858); + for( var_12 = 103 ;(var_12>73);var_12 = (var_12-10) ) + { + short var_217 = (short)(29387); + cl_30 var_265 = new cl_30(); + cl_30 var_275 = new cl_30(); + final short var_218 = (short)(2406); + byte [] var_229 = {(byte)(-28),(byte)(-80),(byte)(11),(byte)(62),(byte)(16),(byte)(64),(byte)(2)}; + final boolean [] var_281 = {true,true,false,true,true}; + if( (((~(++var_13))|var_10)!=func_14(func_44(var_97.var_163 ,((~(var_13--))|func_40((var_13++) ,var_216[((var_5--)&4)][((var_13++)&5)] ,false)) ,(--var_19) ,(!(!(!(!((func_20(((~(++var_217))+var_65) ,(++var_13) ,(++var_13) ,(!((var_13--)!=var_97.var_113)) ,((-((++var_9)&( ( long )(~(var_13--)) )))-var_218))*var_65)>=var_6))))) ,(-5614557190944600042L) ,(var_219--) ,(var_7++)) ,(++var_65) ,((var_13--)!=func_44(((var_151++)*var_190) ,var_220[((-(--var_154))&0)][(((+(++var_65))|var_75.var_171)&4)] ,(-2358581049587002125L) ,(!(!((++var_13)=( ( double )((var_151--)&var_219) ))) ,((var_13++)*var_65))) ,(~(++var_179)) ,var_58[(((var_219--)+var_65)&2)][((var_158--)&3)][(((--var_13)*(byte)(-106))&3)] ,var_34.var_204 ,(~(++var_151))) ,var_117 ,var_248))&4)][((+(var_219++))&5)] ,var_72.var_111 ,var_117))) ,(!(!((var_65--)==func_59(((var_189--)&func_14(( ( float )((var_65++)+var_96) ) ,var_75.var_143 ,((var_13++)>=func_40((--var_219) ,(var_5++) ,var_117)) ,var_248)) ,(var_219++) ,var_117)))) ,var_265)) ,var_267[((+(var_179++))&1)][(((var_154++)+( ( byte )(--var_13) ))&4)][((~(--var_13))&6)]) ,((+(var_13--))+var_190) ,(var_219--) ,(!(!((++var_151)==var_154))) ,(((var_9--)&var_65)*var_54.var_68)) ,(!(!(!(!((++var_13)<=var_65))))) ,var_275))&4)] ,(((var_6++)-( ( long )(var_5++) ))>=var_122.var_109) ,var_34) ,var_281[((--var_13)&4)])) ,(var_13++) ,func_14(((var_5--)-func_14((var_158++) ,var_232[((~(var_158--))&1)][((var_121++)&5)][((~(var_179++))&4)] ,(!(!(!(!((--var_158)!=var_151))))) ,var_248)) ,(~(var_158++)) ,(((var_9--)-var_190)=var_34.var_181) ) ,(var_183++)))) + { + // if stmt begin,id=3 + if( (((var_185++)|var_97.var_113)<=var_52)) + { + // if stmt begin,id=4 + if( var_122.var_108) + { + // if stmt begin,id=5 + int var_188 = (-527350737); + if( (!(!((--var_175)==func_20((++var_151) ,(var_90--) ,(--var_186) ,var_187[((var_175--)&3)][((var_189--)&0)][((--var_188)&1)] ,((-(++var_175))&(short)(5908))))))) + { + // if stmt begin,id=6 + var_34 = var_34 ; + // if stmt end,id=6 + } + // if stmt end,id=5 + } + // if stmt end,id=4 + } + else + { + // else stmt begin,id=2 + try + { + if( (!(!((var_175--)<=(byte)(87))))) + { + // if stmt begin,id=7 + var_183 = (--var_151) ; + // if stmt end,id=7 + } + } + catch( java.lang.ArithmeticException myExp_191 ) + { + var_102.var_192 = var_34.var_39 ; + System.out.println("hello exception 0 !"); + } + // else stmt end,id=2 + } + // if stmt end,id=3 + } + else + { + // else stmt begin,id=3 + int var_193 = (125664336); + for( var_193 = 474 ;(var_193<482);var_193 = (var_193+2) ) + { + int var_194 = (-772011908); + long var_200 = (-1786755201423341655L); + for( var_194 = 450 ;(var_194>398);var_194 = (var_194-13) ) + { + long [][] var_209 = {{(-5696185680201105770L),(-422350790576990563L)}}; + if( (!(((++var_183)+func_44(((var_1++)|var_79) ,(var_175++) ,(+(var_158--)) ,((var_154--)>var_75.var_104) ,(var_79--) ,((++var_183)*func_40((-(--var_183)) ,(var_175++) ,((var_65--)<=( ( double )(var_186++) )))) ,((+(++var_30))-func_40((++var_119) ,(~(var_175--)) ,(!(!(!(((((++var_65)|( ( short )var_34.var_181 ))*func_20((-(var_185++)) ,((var_154--)|var_190) ,(var_200--) ,(!(!((var_175--)<=var_16))) ,(8011708575995452897L)))!=func_40(((var_185++)|var_75.var_171) ,(5179946835020064339L) ,false))&&var_34.var_204))))))))!=(-725411474)))) + { + // if stmt begin,id=8 + double [][] var_207 = {{(3.38553e+277D)},{(-6.61445e-237D)},{(8.36809e+228D)},{(-3.27766e+272D)},{(-8.78136e+304D)}}; + var_207[4][((~(var_175--))&0)] = (+(((var_65--)*var_19)-func_20(((++var_154)&( ( int )(var_175--) )) ,var_209[((var_19++)&0)][((++var_1)&1)] ,(((+(var_175++))-var_34.var_35)*var_122.var_113) ,((+(var_175--))!=var_72.var_114) ,(-(var_175++))))) ; + // if stmt end,id=8 + } + else + { + // else stmt begin,id=4 + var_209[((var_175--)&0)][(((var_175++)-var_34.var_214)&1)] = ((+(--var_65))*var_10) ; + // else stmt end,id=4 + } + } + } + // else stmt end,id=3 + } + byte var_215 = (byte)(65); + return ( ( int )(--var_215) ); +} +public static strictfp double func_20(double var_21, long var_22, double var_23, boolean var_24, long var_25) +{ + short var_38 = (short)(-16036); + short var_29 = (short)(569); + for( var_26 = 805 ;(var_26>710);var_26 = (var_26-19) ) + { + int var_27 = (-1300847955); + for( var_27 = 401 ;(var_27<417);var_27 = (var_27+16) ) + { + boolean [][] var_28 = {{true,true,true,false,false},{false,false,true,false,true}}; + int var_31 = (-693267661); + int var_32 = (378474914); + int var_33 = (1252810623); + var_28[(var_26&1)][(var_27&4)] = (!(!((var_29++)<=var_30))) ; + for( var_33 = 975 ;(var_33<994);var_33 = (var_33+19) ) + { + byte var_37 = (byte)(-126); + try + { + var_34.var_35 = (((var_29++)|var_1)-var_1) ; + } + catch( java.lang.ArithmeticException myExp_36 ) + { + var_28[((var_38--)&1)][(((++var_37)-var_1)&4)] = (!((var_38--)>=var_34.var_39)) ; + var_22 = (+((--var_37)&func_40((var_32--) ,((var_38--)+var_79) ,true))) ; + System.out.println("hello exception 1 !"); + } + } + } + } + return (6.48699e+212D); +} +public static strictfp byte func_40(long var_41, long var_42, boolean var_43) +{ + byte var_165 = (byte)(-87); + int var_156 = (227671142); + if( ((+(var_1++))420);var_168 = (var_168-17) ) + { + double [][][] var_170 = {{{(-1.99382e-28D)},{(1.20724e+132D)},{(5.42288e-73D)},{(1.86032e+100D)},{(-2.41197e-221D)},{(1.5163e-145D)}},{{(2.04498e+212D)},{(4.73979e-213D)},{(-9.71577e+153D)},{(2.27341e-140D)},{(-1.0564e+139D)},{(-3.04728e-298D)}},{{(2.60465e-86D)},{(6.2744e+159D)},{(-1.51822e-199D)},{(-5.11545e+112D)},{(-3.8157e+113D)},{(-2.14818e+213D)}},{{(-1.09389e+132D)},{(-2.31715e+303D)},{(-1.26021e-127D)},{(-1.00168e+193D)},{(2.65119e+263D)},{(-2.5285e+94D)}},{{(-2.81245e+131D)},{(-1.71341e-118D)},{(-1.00484e-251D)},{(1.61811e-192D)},{(-6.44529e-34D)},{(-4.74208e-291D)}}}; + var_170[(((var_65++)*var_158)&4)][((-(~(var_165++)))&5)][(((var_156--)*var_75.var_171)&0)] = (var_156++) ; + } + // if stmt end,id=9 + } + return (byte)(20); +} +public static strictfp float func_44(long var_45, int var_46, long var_47, boolean var_48, long var_49, int var_50, float var_51) +{ + short var_56 = (short)(-24445); + for( var_52 = 803 ;(var_52>781);var_52 = (var_52-11) ) + { + try + { + double var_142 = (-1.40412e-26D); + byte var_134 = (byte)(65); + int var_53 = (-1281252361); + for( var_53 = 355 ;(var_53>342);var_53 = (var_53-13) ) + { + int [][] var_133 = {{(476648493),(-1724242991),(2112796522),(1938999296),(-2101758923),(-1074562114),(-1615729693)},{(-412651361),(1628653999),(1540527634),(307052501),(1650506853),(-1458918141),(-1964903238)},{(-680541257),(-380307822),(-1117395382),(-1818389809),(-1391402055),(-719919172),(1978678828)},{(1417919572),(-784421981),(-1282870080),(1176856956),(640680860),(-341259646),(1432787996)},{(-778578103),(1736608856),(94493047),(775860263),(-411991884),(-285946574),(727733461)}}; + try + { + var_34 = var_34 ; + var_54.var_55 = (-(var_56++)) ; + var_58[((++var_19)&2)][((var_56++)&3)][((var_50--)&3)] = (((var_1++)+func_59((var_49++) ,(-659396794) ,(((--var_56)+var_102.var_131)<=func_59((var_45++) ,var_133[(((var_50--)+var_65)&4)][((~(--var_134))&6)] ,(!((var_49--)<=var_75.var_104))))))-func_59((var_134++) ,var_133[((-(--var_56))&4)][((var_50--)&6)] ,((var_90++)>=func_59(((++var_1)&var_102.var_107) ,(+(--var_56)) ,((!(!((--var_142)>=var_75.var_143)))||( ( boolean )((-(++var_56))<( ( short )((+(++var_1))|var_72.var_114) )) )))))) ; + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_146 ) + { + var_58 = var_149 ; + System.out.println("hello exception 2 !"); + } + } + } + catch( java.lang.ArithmeticException myExp_150 ) + { + if( ((++var_151)<=var_34.var_35)) + { + // if stmt begin,id=10 + int var_152 = (-439408452); + cl_144 var_153 = new cl_144(); + for( var_152 = 398 ;(var_152<414);var_152 = (var_152+8) ) + { + var_122 = var_97 ; + } + // if stmt end,id=10 + } + else + { + // else stmt begin,id=5 + var_50 = (+(var_154--)) ; + // else stmt end,id=5 + } + System.out.println("hello exception 3 !"); + } + } + byte var_155 = (byte)(-61); + return var_86[((((++var_155)*var_69)&var_90)&6)]; +} +public static strictfp float func_59(long var_60, int var_61, boolean var_62) +{ + int [][][] var_64 = {{{(1656515841),(-1098275587)},{(-2086055229),(1010557935)},{(1408170173),(-1703283280)},{(597628801),(281869830)},{(1482426883),(1951421197)}},{{(-1946386110),(1833225481)},{(596631839),(1807164615)},{(-1285841610),(-1133760312)},{(-1294657952),(1444697193)},{(704896303),(-411272305)}},{{(-477427234),(340439969)},{(1536275434),(-337453862)},{(1320183108),(1135419937)},{(501786931),(1908526515)},{(-1234159310),(61654623)}},{{(2031675916),(685302805)},{(-1789248712),(-44059347)},{(2125191206),(905243293)},{(1238087643),(454377904)},{(-1411087833),(-2033858118)}}}; + float var_128 = (-3.40338e-21F); + int var_67 = (902293452); + var_64[((((++var_65)*( ( short )var_54.var_66 ))*( ( short )(1399655165) ))&3)][4][((var_1--)&1)] = (var_1--) ; + short var_71 = (short)(14119); + for( var_67 = 621 ;(var_67>620);var_67 = (var_67-1) ) + { + cl_107 var_116 = new cl_107(); + long [] var_106 = {(-8482498248982604087L),(7061757071993290173L)}; + cl_121 var_78 = new cl_121(); + var_54 = var_54 ; + cl_30 var_94 = new cl_30(); + try + { + byte var_81 = (byte)(-83); + float var_91 = (2.78361e-05F); + cl_144 var_123 = new cl_144(); + if( ((var_1++)==var_54.var_68)) + { + // if stmt begin,id=11 + float [] var_82 = {(-0.277037F),(-8.82968e+26F),(-6.36276e+24F),(1.04329e-16F),(-2.10097e+12F),(6.30273e+35F),(-1.44897e-36F)}; + for( var_69 = 612 ;(var_69>588);var_69 = (var_69-12) ) + { + int var_80 = (1819269470); + var_34.var_70 = ((var_61--)*( ( float )var_54.var_55 )) ; + cl_121 var_77 = new cl_121(); + cl_121 var_76 = new cl_121(); + final int var_83 = (-1713089661); + var_64[(((++var_71)&var_72.var_73)&3)][((--var_61)&4)][((var_65--)&1)] = ((var_1--)-var_65) ; + var_74[(var_69&4)] = var_75 ; + var_64[((var_19++)&3)][((+(var_81--))&4)][((++var_61)&1)] = (++var_19) ; + int var_84 = (-120666849); + var_1 = (var_81++) ; + var_81 = (var_81++) ; + var_82[(var_69&6)] = (++var_81) ; + var_82[6] = (+((--var_1)-var_75.var_85)) ; + var_82 = var_86 ; + var_62 = ((var_1++)>=var_88) ; + var_82[(var_69&6)] = (var_65--) ; + break; + + } + int var_95 = (-622578660); + var_34 = var_34 ; + if( (!(!((var_1--)!=var_65)))) + { + // if stmt begin,id=12 + long var_93 = (-6696332563123757141L); + int var_89 = (1907924981); + var_64[(((--var_61)*var_65)&3)][((~(var_1++))&4)][((+(-(var_71++)))&1)] = (++var_19) ; + var_64[(((--var_81)+var_34.var_35)&3)][(((--var_1)+var_1)&4)][((-(++var_71))&1)] = (--var_61) ; + var_1 = (var_81--) ; + boolean var_92 = true; + var_82[6] = (++var_91) ; + var_19 = (--var_65) ; + var_34 = var_34 ; + // if stmt end,id=12 + } + for( var_95 = 966 ;(var_95<999);var_95 = (var_95+11) ) + { + var_82[(((~(var_71--))|var_65)&6)] = (-(++var_71)) ; + int var_98 = (-1187767441); + var_82[(var_95&6)] = (var_91--) ; + var_97 = var_97 ; + var_64[((var_81++)&3)][((var_61--)&4)][(((var_71++)|var_1)&1)] = (+(++var_65)) ; + boolean var_110 = true; + var_64 = var_100 ; + var_64[(((--var_81)-var_54.var_66)&3)][4][((var_71++)&1)] = var_64[((~(++var_81))&3)][((((var_81++)&var_65)-var_102.var_105)&4)][((((var_61++)+var_75.var_104)|( ( int )(--var_81) ))&1)] ; + var_86[6] = ((--var_71)&var_19) ; + var_82[(var_95&6)] = ((-(++var_65))+( ( int )var_106[((((var_1++)-var_102.var_107)-var_69)&1)] )) ; + var_97.var_108 = ((var_71--)>var_97.var_109) ; + var_82[(var_95&6)] = (+(var_71++)) ; + var_82 = var_86 ; + var_82[(((var_1++)*var_10)&6)] = (var_91--) ; + var_82[((var_81--)&6)] = (var_65--) ; + break; + + } + if( (!((!(!((var_72.var_73|var_97.var_113)!=var_72.var_114)))!=var_62))) + { + // if stmt begin,id=13 + final byte [] var_115 = {(byte)(106),(byte)(81),(byte)(-23),(byte)(125),(byte)(-118),(byte)(100)}; + var_74[((--var_19)&4)] = var_75 ; + var_106[(((--var_71)+( ( short )var_115[((~(--var_71))&5)] ))&1)] = (--var_90) ; + var_72 = var_72 ; + var_97.var_118 = (~((var_1++)+var_90)) ; + // if stmt end,id=13 + break; + + } + else + { + // else stmt begin,id=6 + var_97 = var_97 ; + var_86[((~(++var_81))&6)] = (--var_71) ; + var_64[3][(((var_81++)-(byte)(62))&4)][1] = ((--var_71)*var_65) ; + var_64[((var_81--)&3)][((--var_19)&4)][(((var_81++)+var_75.var_104)&1)] = (1076701510) ; + var_71 = (var_65--) ; + // else stmt end,id=6 + } + // if stmt end,id=11 + } + else + { + // else stmt begin,id=7 + if( ((var_1++)<=( ( double )(var_1++) ))) + { + // if stmt begin,id=14 + long [] var_120 = {(580585666151419400L),(-7244043399991173307L)}; + var_106 = var_120 ; + var_97 = var_97 ; + var_97 = var_123 ; + // if stmt end,id=14 + } + // else stmt end,id=7 + } + } + catch( java.lang.ArrayIndexOutOfBoundsException myExp_124 ) + { + for( var_125 = 313 ;(var_125<319);var_125 = (var_125+2) ) + { + int var_126 = (1979732771); + for( var_126 = 381 ;(var_126<384);var_126 = (var_126+3) ) + { + int var_127 = (-938342567); + } + } + System.out.println("hello exception 4 !"); + } + } + return (var_128--); +} + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1413); + CrcCheck.ToByteArray(this.var_1,b,"var_1"); + CrcCheck.ToByteArray(this.var_10,b,"var_10"); + CrcCheck.ToByteArray(this.var_19,b,"var_19"); + CrcCheck.ToByteArray(this.var_26,b,"var_26"); + CrcCheck.ToByteArray(this.var_30,b,"var_30"); + CrcCheck.ToByteArray(this.var_34.GetChecksum(),b,"var_34.GetChecksum()"); + CrcCheck.ToByteArray(this.var_52,b,"var_52"); + CrcCheck.ToByteArray(this.var_54.GetChecksum(),b,"var_54.GetChecksum()"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_58[a0][a1][a2],b,"var_58" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_65,b,"var_65"); + CrcCheck.ToByteArray(this.var_69,b,"var_69"); + CrcCheck.ToByteArray(this.var_72.GetChecksum(),b,"var_72.GetChecksum()"); + for(int a0=0;a0<5;++a0){ + CrcCheck.ToByteArray(this.var_74[a0].GetChecksum(),b,"var_74" + "["+ Integer.toString(a0)+"]"+".GetChecksum()"); + } + CrcCheck.ToByteArray(this.var_75.GetChecksum(),b,"var_75.GetChecksum()"); + CrcCheck.ToByteArray(this.var_79,b,"var_79"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_86[a0],b,"var_86" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_88,b,"var_88"); + CrcCheck.ToByteArray(this.var_90,b,"var_90"); + CrcCheck.ToByteArray(this.var_96,b,"var_96"); + CrcCheck.ToByteArray(this.var_97.GetChecksum(),b,"var_97.GetChecksum()"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_100[a0][a1][a2],b,"var_100" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_102.GetChecksum(),b,"var_102.GetChecksum()"); + CrcCheck.ToByteArray(this.var_117,b,"var_117"); + CrcCheck.ToByteArray(this.var_119,b,"var_119"); + CrcCheck.ToByteArray(this.var_121,b,"var_121"); + CrcCheck.ToByteArray(this.var_122.GetChecksum(),b,"var_122.GetChecksum()"); + CrcCheck.ToByteArray(this.var_125,b,"var_125"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_149[a0][a1][a2],b,"var_149" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_151,b,"var_151"); + CrcCheck.ToByteArray(this.var_154,b,"var_154"); + CrcCheck.ToByteArray(this.var_158,b,"var_158"); + CrcCheck.ToByteArray(this.var_179,b,"var_179"); + CrcCheck.ToByteArray(this.var_186,b,"var_186"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<1;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_187[a0][a1][a2],b,"var_187" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_189,b,"var_189"); + CrcCheck.ToByteArray(this.var_190,b,"var_190"); + for(int a0=0;a0<5;++a0){ + for(int a1=0;a1<6;++a1){ + CrcCheck.ToByteArray(this.var_216[a0][a1],b,"var_216" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]"); + } + } + CrcCheck.ToByteArray(this.var_248.GetChecksum(),b,"var_248.GetChecksum()"); + CrcCheck.ToByteArray(this.var_302.GetChecksum(),b,"var_302.GetChecksum()"); + CrcCheck.ToByteArray(this.var_304,b,"var_304"); + CrcCheck.ToByteArray(this.var_359,b,"var_359"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/Start.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..a25f918ce4038b0fe223f76c5df91f208a81b5d8 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/Start.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.util.*; +public class Start +{ + public static void main(String[] args) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + MainClass mainclass = new MainClass(); + mainclass.run(); + System.out.printf("FIGO-FUZZ-Checksum=0x%x\n" , mainclass.GetChecksum()); + Runtime.getRuntime().gc(); + } +} + +// DEPENDENCE: cl_121.java MainClass.java cl_158.java cl_30.java cl_107.java CRC32.java CrcCheck.java cl_144.java cl_82.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_107.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_107.java new file mode 100644 index 0000000000000000000000000000000000000000..7abb902b8fbbf27fab9947ad6d71ee475bc130f9 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_107.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1808069720 + +//import java.util.zip.CRC32; + +class cl_107 +{ + int var_73 = (1005648514); + long var_111 = (8426351400870272196L); + short var_114 = (short)(-32716); + float var_382 = (6.35675e+18F); + double var_518 = (7.86978e-205D); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(26); + CrcCheck.ToByteArray(this.var_73,b,"var_73"); + CrcCheck.ToByteArray(this.var_111,b,"var_111"); + CrcCheck.ToByteArray(this.var_114,b,"var_114"); + CrcCheck.ToByteArray(this.var_382,b,"var_382"); + CrcCheck.ToByteArray(this.var_518,b,"var_518"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_121.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_121.java new file mode 100644 index 0000000000000000000000000000000000000000..7bbd5d4640a82bc223d85d3d75c4310ee1511862 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_121.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1808069720 + +//import java.util.zip.CRC32; + +class cl_121 +{ + int var_85 = (2132076913); + int [][][] var_99 = {{{(-1884668886),(-303725599)},{(-1952841514),(-1289161822)},{(648246785),(-1546754193)},{(-1466988075),(-594429864)},{(-1889105944),(1300715815)}},{{(-1872481124),(-561838852)},{(1373314073),(1814163331)},{(-557956060),(451377002)},{(-20650041),(-1222388300)},{(1795812872),(1073559491)}},{{(1805649623),(-1149857861)},{(1733631958),(-1079882836)},{(1727587099),(-378223084)},{(1827595891),(81205332)},{(1113912584),(-1894133015)}},{{(-1716691222),(176708425)},{(-103446015),(1046872222)},{(456662045),(-1058184883)},{(-1966769418),(735571243)},{(513627801),(-2061609666)}}}; + byte var_104 = (byte)(31); + float [] var_112 = {(-28.787F),(-1.03931e-31F)}; + final double var_143 = (1.09182e-229D); + short var_171 = (short)(-16571); + long var_380 = (-6257228614868186694L); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(191); + CrcCheck.ToByteArray(this.var_85,b,"var_85"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_99[a0][a1][a2],b,"var_99" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_104,b,"var_104"); + for(int a0=0;a0<2;++a0){ + CrcCheck.ToByteArray(this.var_112[a0],b,"var_112" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_143,b,"var_143"); + CrcCheck.ToByteArray(this.var_171,b,"var_171"); + CrcCheck.ToByteArray(this.var_380,b,"var_380"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_144.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_144.java new file mode 100644 index 0000000000000000000000000000000000000000..47d60c3cbf46b98f841a6e823a5495e19aa8548b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_144.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1808069720 + +//import java.util.zip.CRC32; + +class cl_144 +{ + boolean var_108 = false; + byte var_109 = (byte)(97); + final short var_113 = (short)(30379); + float var_118 = (2.60144e+06F); + double [][][] var_147 = {{{(-1.34578e-111D),(1.75205e-108D),(7.44932e+87D),(9.28859e-270D)},{(-2.21285e-66D),(-7.68923e-44D),(-4.5418e-190D),(-5.94974e+110D)},{(1.38598e+174D),(6.47491e+194D),(5.86957e+175D),(2.42507e-104D)},{(-1.27421e+47D),(3.11057e-110D),(1.50182e-146D),(-6.47538e-27D)}},{{(-3.32715e+20D),(2.17045e-203D),(-3.72283e-270D),(-4.35111e+232D)},{(2.05685e-75D),(-2.86426e+40D),(-1.61755e+34D),(-2.02114e+161D)},{(-4.13127e-263D),(2.99494e-133D),(6.9211e-152D),(-4.37345e+207D)},{(-1.25125e+125D),(-3.92635e+248D),(-4.34337e+206D),(-5.55423e+31D)}},{{(2.18193e-247D),(1.6154e+209D),(1.86219e+262D),(3.49428e-09D)},{(3.07512e-274D),(4.73869e+48D),(1.52174e-136D),(-2.2153e-233D)},{(3.02995e+77D),(5.30126e+14D),(-8.68377e+189D),(-2.81322e+54D)},{(-4.23975e+80D),(-2.94285e+257D),(-1.73376e-285D),(6.54655e-183D)}}}; + long var_163 = (3880103892836116929L); + int var_180 = (-1947713262); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(404); + CrcCheck.ToByteArray(this.var_108,b,"var_108"); + CrcCheck.ToByteArray(this.var_109,b,"var_109"); + CrcCheck.ToByteArray(this.var_113,b,"var_113"); + CrcCheck.ToByteArray(this.var_118,b,"var_118"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_147[a0][a1][a2],b,"var_147" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_163,b,"var_163"); + CrcCheck.ToByteArray(this.var_180,b,"var_180"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_158.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_158.java new file mode 100644 index 0000000000000000000000000000000000000000..c5a1c7a06f388b8242b1d744d2b522722daa7d5a --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_158.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1808069720 + +//import java.util.zip.CRC32; + +class cl_158 +{ + int var_103 = (243717256); + short var_105 = (short)(-30161); + byte var_107 = (byte)(81); + float var_131 = (2.97516e+06F); + double [][][] var_148 = {{{(-1.2679e-200D),(-6.83846e+272D),(-1.23167e-233D),(-6.25959e+252D)},{(5.07106e-263D),(-7.85457e+90D),(6.79309e+170D),(-4.3805e+235D)},{(1.46404e-214D),(3.16763e-282D),(-1.66993e+37D),(4.56142e+54D)},{(-2.84781e+51D),(-9.35056e+121D),(-6.11917e-281D),(-7.81812e+305D)}},{{(-3.85101e-115D),(-9.53541e+113D),(-2.76441e-121D),(-3.0427e+103D)},{(-6.10027e-305D),(3.49164e+288D),(4.72711e+06D),(2.31844e+261D)},{(4.11167e-296D),(1.25148e+205D),(1.49732e-295D),(-6.799e+142D)},{(1.22351e-72D),(2.56804e-263D),(-3.22562e+260D),(6.60299e+40D)}},{{(4.91434e-275D),(-1.51786e-168D),(1.22247e+266D),(-6.00836e+294D)},{(241143D),(3.37135e-15D),(-5.12627e+213D),(-1.26898e+96D)},{(-1.15823e-181D),(-1.19793e-230D),(5.47505e+64D),(3.05376e-158D)},{(-3.34678e-223D),(6.16191e-179D),(1.28315e-110D),(-8.04407e-84D)}}}; + long var_160 = (-9009921264744552029L); + double var_192 = (-5.59549e-244D); + boolean var_533 = true; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(412); + CrcCheck.ToByteArray(this.var_103,b,"var_103"); + CrcCheck.ToByteArray(this.var_105,b,"var_105"); + CrcCheck.ToByteArray(this.var_107,b,"var_107"); + CrcCheck.ToByteArray(this.var_131,b,"var_131"); + for(int a0=0;a0<3;++a0){ + for(int a1=0;a1<4;++a1){ + for(int a2=0;a2<4;++a2){ + CrcCheck.ToByteArray(this.var_148[a0][a1][a2],b,"var_148" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_160,b,"var_160"); + CrcCheck.ToByteArray(this.var_192,b,"var_192"); + CrcCheck.ToByteArray(this.var_533,b,"var_533"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_30.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_30.java new file mode 100644 index 0000000000000000000000000000000000000000..a36479c0548682e8c22b52c9754ee9debbc6dc76 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_30.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1808069720 + +//import java.util.zip.CRC32; + +class cl_30 +{ + int var_35 = (2082603279); + final double var_39 = (-3.32156e+75D); + float var_70 = (-5.56666e-32F); + int [][][] var_101 = {{{(-1410969422),(-1303377687)},{(-1349717389),(-311576448)},{(-757379112),(-989534312)},{(-314990128),(1061658398)},{(-563100915),(-817331438)}},{{(-1100150701),(1599270460)},{(-140811788),(-1030406416)},{(-1788318120),(-640743316)},{(-1734373798),(-1273060379)},{(-1372194163),(1331642262)}},{{(1629698645),(-1383791846)},{(2135793896),(-1997298539)},{(-1647107979),(1220574140)},{(-2019936913),(-414849319)},{(550687345),(1549645195)}},{{(914736372),(1014967020)},{(-141870376),(-418937210)},{(-835440803),(-1397894558)},{(378052628),(-1543098592)},{(-2140712914),(1007397461)}}}; + byte var_181 = (byte)(-59); + final boolean var_204 = false; + short var_214 = (short)(-26092); + long [][][] var_552 = {{{(-6745606937177062630L),(-7938813219731281086L),(-3634803064197829759L),(-4435168618938513522L),(-6642457037119746600L),(-5610365612684369001L)},{(-8882116423044073252L),(4614327407856053488L),(996231226931434813L),(6319920773492712011L),(-6929113237906309536L),(5023029161729056766L)},{(-1317764386607755221L),(-4884776620537690160L),(-6367449130444670497L),(-7527046859627492397L),(-8709570055265290387L),(-5425430294460030704L)},{(-5696997419068277123L),(518399607538936588L),(-6336517633183912087L),(4159310127645127096L),(-1226226336543197890L),(6274514891019984962L)},{(3095070913277710058L),(5216902178502074472L),(-6695244743906035964L),(-681098099667112869L),(-1072365955546014416L),(-3587749510866694006L)},{(8225885562272988870L),(5771661034402707686L),(178436252379314093L),(291488374822185478L),(-7635796121018183218L),(6743155828008877443L)}},{{(8345170271777493197L),(-9205335318253760901L),(-5775226470571344180L),(-8878465758078989251L),(-1257172022693018167L),(5370511250927941485L)},{(-8868825273222206164L),(-3404488054200866924L),(3728789959961059780L),(6833126189914113204L),(4020798754260958964L),(-3491013909780203935L)},{(6269539672734572899L),(-2557156421841244348L),(4242969627696037320L),(-1790975425834073635L),(8867479904552776159L),(1964084971959360226L)},{(-5106417786867471725L),(3810445739093102063L),(-4804495578546207903L),(2229732117145063130L),(1519468017311848088L),(-3315490573305411207L)},{(2869977051506820301L),(-2245831850389160177L),(7054620276130817545L),(-3569785339935014034L),(-5394286810718373280L),(5495007077660780521L)},{(-2005021978750907904L),(2420165971542693281L),(-994339399669594189L),(-8211066214713558000L),(-76812861029934133L),(-117620690910112729L)}},{{(7275571654758450141L),(-4348052955838612949L),(4032640655133278378L),(-87234059305338933L),(-2226798814507276919L),(8878322151239903454L)},{(7368594479692990145L),(-6137069056159614075L),(-1630675150475388994L),(-8364881023992879727L),(-2691292155901012325L),(1964150185803608964L)},{(3133661414877321171L),(2723519674940246710L),(5385267957663986626L),(-3915254886315768411L),(1085682582815024689L),(-3226980924751406463L)},{(-6473591558350116143L),(187440995352830103L),(-4784233926092050034L),(7754963284272947283L),(4066040703724405870L),(1742006379890779755L)},{(-1256694946826321236L),(3553669320329069341L),(4734030842585392044L),(-4210488087723225214L),(2443732592101346498L),(6905346265050346041L)},{(465947080595727743L),(115439980046412779L),(4096065791714024493L),(4285109995129227257L),(-1475993783313021662L),(-2763414192891237058L)}},{{(8794524874837241758L),(2711623540196652337L),(-1470669652069555363L),(3325308679819145817L),(5559455888951432452L),(8129051046153296299L)},{(591168594334974893L),(929037132944431824L),(-4440935916136344935L),(-3376054603992662485L),(-4858569249712448526L),(6529210191735294726L)},{(-6564722955921555643L),(-3685701737850108607L),(5529504622695986856L),(-7392727649067182449L),(-1058975996321954594L),(-1227095682918150788L)},{(6710832028128575551L),(2969231976430329480L),(-4973590516679671145L),(-8186864054283756439L),(878846651450563693L),(-4723100591703671225L)},{(-5545975864424056417L),(348901629777229452L),(-6778162430268698255L),(-3811579950867686888L),(-6325876950511508540L),(5758112682951993579L)},{(4582898544219071963L),(2006887675388877387L),(-1687435810818213426L),(-726213488335102858L),(5152571590539950113L),(-4775884400413929505L)}},{{(6218733358378547392L),(139952779825284952L),(-1777209247073481993L),(2105054484851294799L),(-6091755678843398851L),(6474784822821140244L)},{(1541091480971740348L),(-5649827083385576975L),(-6758224144455694334L),(8078233869049874500L),(-7830681415240639162L),(4330960127351150050L)},{(-4257710139667989515L),(-285638032197791358L),(2489288335223302487L),(1223104472975424230L),(-7951533353922842132L),(1905288027092423493L)},{(3717848701247391691L),(-2059751344288810866L),(-174006291511870361L),(-8938745025978884172L),(-5195042933845461590L),(-1287004068347483120L)},{(-5559622681232241733L),(-7872520132882649715L),(8851864121056366112L),(3479894275366633173L),(-832195744995796350L),(2845532345053770932L)},{(7248716206176335753L),(8091194124342516582L),(7367622026842644985L),(3286546429027915682L),(4861535321483937397L),(-5997470215763199L)}},{{(-1870798973713737929L),(1004954766736389327L),(-8916204539727409764L),(8796267178912635925L),(-2211743548022399290L),(5188706300870977667L)},{(-7272147485394146890L),(-2288979611802319357L),(-6287592698693621074L),(-4279752228325774593L),(7012934359802927469L),(-2537856361203373192L)},{(-3506832628503070984L),(-3158193818766946068L),(4225369723301149155L),(-2267782744418610500L),(-5456584766224174315L),(6092644305242032569L)},{(6129551024322707416L),(-5726315853773414191L),(1746737764981266543L),(8143746077381490439L),(-5789422949110537313L),(4085371416845782380L)},{(-525786951712608295L),(-8907475517641890857L),(2735479829488654640L),(3347623368876699187L),(-8942915301943791568L),(6750443943977854979L)},{(6159035597170550371L),(2467963499664847514L),(6972032525815824344L),(6722866006609537894L),(6922007968527263855L),(-7899553613601939306L)}}}; +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(1908); + CrcCheck.ToByteArray(this.var_35,b,"var_35"); + CrcCheck.ToByteArray(this.var_39,b,"var_39"); + CrcCheck.ToByteArray(this.var_70,b,"var_70"); + for(int a0=0;a0<4;++a0){ + for(int a1=0;a1<5;++a1){ + for(int a2=0;a2<2;++a2){ + CrcCheck.ToByteArray(this.var_101[a0][a1][a2],b,"var_101" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CrcCheck.ToByteArray(this.var_181,b,"var_181"); + CrcCheck.ToByteArray(this.var_204,b,"var_204"); + CrcCheck.ToByteArray(this.var_214,b,"var_214"); + for(int a0=0;a0<6;++a0){ + for(int a1=0;a1<6;++a1){ + for(int a2=0;a2<6;++a2){ + CrcCheck.ToByteArray(this.var_552[a0][a1][a2],b,"var_552" + "["+ Integer.toString(a0)+"]" + "["+ Integer.toString(a1)+"]" + "["+ Integer.toString(a2)+"]"); + } + } + } + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_82.java b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_82.java new file mode 100644 index 0000000000000000000000000000000000000000..2287e1e09775f3c1c0bb367b09f49aa2fdf2fb7b --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/996_2018101900375/cl_82.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +//SEED=1808069720 + +//import java.util.zip.CRC32; + +class cl_82 +{ + double var_55 = (-1.87945e+211D); + byte var_66 = (byte)(93); + short var_68 = (short)(1421); + float [] var_87 = {(1.27182e+09F),(-8.19522e-24F),(-9.59775e+27F),(-1.01147e-24F),(3.35866e-25F),(-4.77324e-18F),(-7.53344e+17F)}; + final int var_293 = (431819329); + long var_323 = (1906199299932418711L); +/*********************************/ + + public long GetChecksum() + { + System.out.printf("---Begin GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + CrcBuffer b = new CrcBuffer(51); + CrcCheck.ToByteArray(this.var_55,b,"var_55"); + CrcCheck.ToByteArray(this.var_66,b,"var_66"); + CrcCheck.ToByteArray(this.var_68,b,"var_68"); + for(int a0=0;a0<7;++a0){ + CrcCheck.ToByteArray(this.var_87[a0],b,"var_87" + "["+ Integer.toString(a0)+"]"); + } + CrcCheck.ToByteArray(this.var_293,b,"var_293"); + CrcCheck.ToByteArray(this.var_323,b,"var_323"); + CRC32 c = new CRC32(); + c.update(b.buffer,0,b.i); + System.out.printf("---End GetChecksum:%s\tLine=%d\n",Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getLineNumber()); + return c.getValue(); + } +} diff --git a/test/testsuite/fuzz_test/fuzz/Start_2018120416115/Start.java b/test/testsuite/fuzz_test/fuzz/Start_2018120416115/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..ecea2816e556608374ae9db5596f7e69eb872830 --- /dev/null +++ b/test/testsuite/fuzz_test/fuzz/Start_2018120416115/Start.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +public class Start +{ + public static void main(String[] args) + { + MainClass mainclass = new MainClass(); + mainclass.run(); + } +} + +class MainClass +{ + byte var_238 = (byte)(-115); + byte var_256 = (byte)(62); + long var_326 = (-3379501815843794963L); + final int [][][] var_371 = {{{(831945918),(596766226),(1947139000),(-52954513),(1865848185),(2027226478)},{(-2129943413),(-1218975963),(-1043236338),(1379535348),(-616355624),(-42363523)},{(1553505644),(1972365746),(-1006477644),(1443361758),(-2099037998),(99102743)},{(-774032274),(166566109),(-240876817),(85863441),(-919895969),(-1018527979)},{(1801209620),(-993122587),(-57644264),(1675552027),(1024990426),(2145449579)},{(139235737),(-50657380),(571557417),(454405247),(-831309833),(1532510460)}},{{(-1076146946),(404781998),(-1299453562),(1108628217),(691978867),(-1704593503)},{(-163905742),(-957540825),(1996999306),(1064156445),(-925231743),(763838896)},{(528951402),(-1911748655),(-134775444),(29303469),(437672722),(1470826715)},{(2075360115),(1388590586),(-981560894),(-717873694),(1351255016),(-14231280)},{(-1865804624),(-1426878141),(273517141),(-1691501664),(-571492165),(-497047217)},{(1451769018),(-1610449327),(1734012539),(-765494897),(190776475),(1692604241)}}}; + byte [][][] var_491 = {{{(byte)(27)},{(byte)(69)},{(byte)(109)},{(byte)(57)},{(byte)(111)}},{{(byte)(5)},{(byte)(-27)},{(byte)(-78)},{(byte)(-99)},{(byte)(-61)}},{{(byte)(92)},{(byte)(-38)},{(byte)(86)},{(byte)(-115)},{(byte)(-80)}},{{(byte)(-79)},{(byte)(101)},{(byte)(-78)},{(byte)(27)},{(byte)(127)}},{{(byte)(22)},{(byte)(-39)},{(byte)(112)},{(byte)(-51)},{(byte)(102)}},{{(byte)(7)},{(byte)(0)},{(byte)(91)},{(byte)(62)},{(byte)(75)}},{{(byte)(-50)},{(byte)(-24)},{(byte)(-9)},{(byte)(-30)},{(byte)(12)}}}; + long var_513 = (872311249); + long var_596 = (10446980491L); +/*********************************/ + public strictfp void run() + { System.out.printf("---------------------------\n"); + System.out.println(var_326); + System.out.println(var_513); + System.out.println(var_596); + return ; + } +} +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/CrcCheckForObject.java b/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/CrcCheckForObject.java new file mode 100644 index 0000000000000000000000000000000000000000..1c164f2d1a9caca562d3eb44b3f30a9f56805b7b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/CrcCheckForObject.java @@ -0,0 +1,669 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.annotation.Annotation; +import java.io.*; +import java.lang.reflect.*; +import java.util.*; +public class CrcCheckForObject { + /** + * 执行反射方法后返回可观测值,打印到标准输出流 + *

+ * param result1 执行反射方法后返回的Object类型 param method 执行反射需调用的方法 param instance + * 方法调用的对象 param parameters 方法调用的参数列表 return null + */ + private static boolean showDebug = false; + public static int length = 0; + private static List resultlist = new LinkedList<>(); + private static List foundationtypes = new ArrayList<>(); + //apifuzz的whitelist.txt,現在不從文件里讀了 + private static ArrayList whitelist = new ArrayList(Arrays.asList("static final boolean java.util.concurrent.atomic.AtomicLong.VM_SUPPORTS_LONG_CAS", + "java.lang.reflect.AccessibleObject.override", + "private final int java.lang.ThreadLocal.threadLocalHashCode", + "private static java.util.concurrent.atomic.AtomicInteger java.lang.ThreadLocal.nextHashCode", + "int java.lang.ThreadGroup.nthreads", + "private static long java.lang.Thread.threadSeqNumber", + "private long java.lang.Thread.tid", + "private static final long java.util.concurrent.locks.ReentrantReadWriteLock.TID", + "transient java.util.Set java.util.HashMap.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private final long libcore.util.NativeAllocationRegistry.freeFunction", + "private transient long java.math.BigInt.bignum", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.io.File.PREFIX_LENGTH_OFFSET", + "private static final long java.util.concurrent.locks.StampedLock.WSTATUS", + "private static final long java.util.concurrent.locks.StampedLock.WTAIL", + "private static final long java.util.concurrent.locks.StampedLock.STATE", + "private static final long java.util.concurrent.locks.StampedLock.PARKBLOCKER", + "private static final long java.util.concurrent.locks.StampedLock.WNEXT", + "private final long java.util.SplittableRandom.gamma", + "private volatile long java.util.concurrent.atomic.AtomicLong.value", + "private static final java.util.concurrent.atomic.AtomicLong java.util.SplittableRandom.defaultGen", + "private long java.util.SplittableRandom.seed", + "private static final int java.util.concurrent.Exchanger.ABASE", + "private static final long java.util.concurrent.Exchanger.BLOCKER", + "private static final long java.util.concurrent.Exchanger.MATCH", + "private static final long java.util.concurrent.Exchanger.BOUND", + "private transient long java.util.Date.fastTime", + "private transient sun.util.calendar.BaseCalendar$Date java.util.Date.cdate", + "private final java.util.Date java.util.logging.SimpleFormatter.dat", + "private transient int java.lang.Object.shadow$_monitor_", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "private int java.io.BufferedWriter.nextChar", + "private int java.lang.StackTraceElement.lineNumber", + "private java.lang.String java.lang.StackTraceElement.methodName", + "private static final long java.lang.StackTraceElement.serialVersionUID", + "private java.lang.ClassLoader java.lang.Thread.contextClassLoader", + "private static volatile java.lang.Thread$UncaughtExceptionHandler java.lang.Thread.uncaughtExceptionPreHandler ", + "private static final long java.util.concurrent.ConcurrentHashMap.CELLSBUSY", + "private static final long java.util.concurrent.ConcurrentHashMap.SIZECTL", + "private static final long java.util.concurrent.ConcurrentHashMap.TRANSFERINDEX", + "private static final long java.util.concurrent.ConcurrentHashMap.BASECOUNT", + "private volatile long java.util.zip.ZStreamRef.address", + "private static final long java.util.concurrent.PriorityBlockingQueue.ALLOCATIONSPINLOCK", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.lang.String java.util.Locale.languageTag", + "private transient volatile int java.util.Locale.hashCodeValue", + "private static volatile java.util.Locale java.util.Locale.defaultDisplayLocale", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "transient java.util.Set java.util.HashMap.entrySet", + "private transient int java.lang.Object.shadow$_monitor_", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.util.Set java.util.Hashtable.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private volatile long java.lang.Thread.nativePeer", + "java.lang.ThreadLocal$ThreadLocalMap java.lang.Thread.threadLocals", + "private static final int java.util.concurrent.ConcurrentHashMap.ABASE", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final java.util.concurrent.atomic.AtomicLong java.util.Random.seedUniquifier", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed, private static final long java.util.Random.seedOffset", + "private static final long java.util.concurrent.Exchanger.SLOT", + "private static final long java.util.concurrent.locks.StampedLock.WHEAD", + "transient int java.util.HashMap.size", + "transient int java.util.HashMap.modCount", + "private static final long java.util.Random.seedOffset", + "boolean java.lang.reflect.AccessibleObject.override", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed", + "private java.lang.String java.lang.StackTraceElement.fileName", + "private java.lang.String java.lang.StackTraceElement.declaringClass", + "private transient java.lang.Object java.lang.Class.vtable", + "private transient java.lang.Class java.lang.Class.superClass", + "private transient java.lang.String java.lang.Class.name", + "private final java.lang.Class java.lang.reflect.Constructor.serializationClass", + "private transient dalvik.system.ClassExt java.lang.Class.extData", + "private transient long java.util.regex.Pattern.address", + "private transient volatile java.lang.Object java.lang.Throwable.backtrace", + "private transient java.lang.Object java.lang.Class.dexCache", + "private transient java.lang.ClassLoader java.lang.Class.classLoader", + "private transient java.lang.Class java.lang.Class.componentType", + "private transient long java.lang.Class.sFields", + "private transient int java.lang.Class.referenceInstanceOffsets", + "private transient int java.lang.Class.primitiveType", + "private transient int java.lang.Class.objectSizeAllocFastPath", + "private transient int java.lang.Class.objectSize", + "private transient int java.lang.Class.numReferenceStaticFields", + "private transient int java.lang.Class.numReferenceInstanceFields", + "private transient long java.lang.Class.methods", + "private transient java.lang.Object[] java.lang.Class.ifTable", + "private transient long java.lang.Class.iFields", + "private transient volatile int java.lang.Class.dexTypeIndex", + "private transient int java.lang.Class.dexClassDefIndex", + "private transient short java.lang.Class.copiedMethodsOffset", + "private transient int java.lang.Class.clinitThreadId", + "private transient int java.lang.Class.classSize", + "private transient int java.lang.Class.classFlags", + "private transient int java.lang.Class.accessFlags", + "private java.lang.Class java.lang.reflect.Field.declaringClass", + "private final java.lang.Class java.lang.reflect.Constructor.serializationCtor", + "private transient int java.lang.Class.status", + "private transient short java.lang.Class.virtualMethodsOffset", + "private int java.lang.reflect.Field.dexFieldIndex ", + "private int java.lang.reflect.Field.offset", + "private int java.lang.reflect.Field.accessFlags", + "private int fuzzapiinvoke.getInstance.ObjectNewInstance$MyThread1.ticket", + "private long java.util.regex.Matcher.address", + "transient long java.util.regex.Pattern.address", + "private int java.lang.reflect.Field.dexFieldIndex", + "private char[] java.io.BufferedWriter.cb", + "private java.lang.Class java.lang.reflect.Field.type" + )); + private static String[] ss = {"class java.lang.Character","class java.lang.Integer", + "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", + "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", + "class java.lang.Byte", "class java.lang.String", "class java.lang.StringBuffer", + "class java.lang.Character$UnicodeBlock", "class java.util.Locale", + "class java.lang.StringBuilder", "class [I", "class [S", "class [J", "class [F", "class [D", + "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", + "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", + "class [Ljava.lang.StringBuilder;"}; // 该数组存放此类可以处理用于计算CRC的数据类型 + private static ArrayList dealtypes = new ArrayList(); + + //輸出每個Object單獨的CRC值 + public static List CRCListForObjects(Object... results) { + List finalres = new ArrayList<>(); + for (Object result1: results) { + try { + if (showDebug) { + System.out.println("============================== CRCcheck(Param info) =============================="); + System.out.println("| result: "+result1); + System.out.println("==================================================================================="); + } + + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + finalres.add(run(obj)); // used to be "result1", solve the problem of object-array + } else { + finalres.add(1000000000L); + } + } + } else { + finalres.add(run(result1)); // resultthreadgroup is object} + } + } else { + // result1 is null + finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + return null; + } + } + return finalres; + } + + //輸出Object數組總的CRC值 + public static long totalCRCForObjects(boolean showFieldInfo, Object... results){ + showDebug = showFieldInfo; + initialize(); + for (Object result1: results) { + try { + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + calculatecrc(obj); + } else { +// finalres.add(1000000000L); + } + } + } else { + calculatecrc(result1); + } + } else { + // result1 is null +// finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + } + } + return getCRC(); + } + + public static long run(Object obj) throws Exception { + initialize(); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< START GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + calculatecrc(obj); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< END GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + return getCRC(); + } + private static void initialize(){ + Collections.addAll(dealtypes, ss); + String[] strings = {"class java.lang.Character","class java.lang.Integer", "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", "class java.lang.Byte"}; + Collections.addAll(foundationtypes, strings); + resultlist.clear(); + } + + private static void calculatecrc(Object result) throws Exception { + // deal with Object + if(result != null){ + String resulttype = result.getClass().toString(); + // deal with the problem of class StringBuilder, StringBuffer and String + // we can`t get the specific fields we wanted, cast these to string by toString + if(resulttype.equals("class java.lang.String") || + resulttype.equals("class java.lang.StringBuilder") || + resulttype.equals("class java.lang.StringBuffer") || + resulttype.equals("class java.lang.Character$UnicodeBlock") || + resulttype.equals("class java.util.Locale") || result instanceof Annotation){ + String ostring = result.toString(); + byte[] bytes = ostring.getBytes("UTF-8"); + calculatecrc(bytes); + return; + } + if (foundationtypes.contains(result.getClass().toString())){ + // if basic types: + resultlist.add(result); + switch (result.getClass().toString()) { + case "class java.lang.Byte": + length += 1; + break; + case "class java.lang.Short": + length += 2; + break; + case "class java.lang.Integer": + length += 4; + break; + case "class java.lang.Long": + length += 8; + break; + case "class java.lang.Float": + length += 4; + break; + case "class java.lang.Double": + length += 8; + break; + case "class java.lang.Char": + length += 2; + break; + case "class java.lang.Character": + length += 2; + break; + case "class java.lang.Boolean": + length += 1; + break;} + } else if(resulttype.startsWith("class [")) { + // array(contains multidimensional array) + if ("class [I".equals(resulttype)) { + //int[] + int[] intparam = (int[]) result; + for (int i : intparam) { + resultlist.add(i); + length += 4; + } + } else if ("class [S".equals(resulttype)) { + //short[] + short[] shortparam = (short[]) result; + for (short s : shortparam) { + resultlist.add(s); + length += 2; + } + } else if ("class [J".equals(resulttype)) { + //long[] + long[] longparam = (long[]) result; + for (long l : longparam) { + resultlist.add(l); + length += 8; + } + } else if ("class [F".equals(resulttype)) { + //float[] + float[] floatparam = (float[]) result; + for (float f : floatparam) { + resultlist.add(f); + length += 4; + } + } else if ("class [D".equals(resulttype)) { + //double[] + double[] doubleparam = (double[]) result; + for (double d : doubleparam) { + resultlist.add(d); + length += 8; + } + } else if ("class [Z".equals(resulttype)) { + //boolean[] + boolean[] booleanparam = (boolean[]) result; + for (boolean b : booleanparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [B".equals(resulttype)) { + //byte[] + byte[] byteparam = (byte[]) result; + for (byte b : byteparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [C".equals(resulttype)) { + //char[] + char[] charparam = (char[]) result; + for (char c : charparam) { + resultlist.add(c); + length += 2; + } + } else if ("class [Ljava.lang.Character;".equals(resulttype)) { + // Character[] + Character[] charparam = (Character[]) result; + for (Character c : charparam) { + resultlist.add((char)c); + length += 2; + } + }else if (resulttype.startsWith("class [[")){ + // 多维数组,降维 + for (Object o: (Object[]) result){ + calculatecrc(o); + } + }else if (resulttype.equals("[Ljava.lang.String")){ + // string类型的数组 + for(String s:(String[]) result){ + calculatecrc(s); + } + + } + else if(resulttype.startsWith("class [L")){ + // 非基础类型数组 + for(Object o:(Object[])result){ + calculatecrc(o); + } + } + }else{ + // 该分支处理非基础类型对象, 先获取对象下指定层数的域和值,将最终结果中可用于计算CRC校验的值作为参数递归调用本方法 + // 首先取得首次传入的实例的域,若域的值可直接用于(包括基础类型和在本方法中特殊处理的其他类型)CRC计算,则不进入下一次获取域的循环 + // 最终获取的域和对应的值都有序的存放在getfaieldvalue()返回的map中 + // 接着对map进行遍历获取其中的值如若是本方法除此分支之外的其他分支可处理的类型则以value为参数递归调用,否则只将其输出在运行日志中 + //System.out.println("```````````````````````````get field`````````````````````````````````````````````"); + Mapmap = getFieldValue(result, 3); + //System.out.println("`````````````````````````get field end```````````````````````````````````````````"); + for(Map.Entry entry: map.entrySet()) { + Field key = entry.getKey(); + Object value = entry.getValue(); + //当field为基础类型或者string stringbu*** character数组时将数组信息打印出来 + String[] basicarray = new String[]{"class [I", "class [S", "class [J", "class [F", "class [D", "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", "class [Ljava.lang.StringBuilder;"}; + List basiclist = Arrays.asList(basicarray); + if(showDebug) { + if (basiclist.contains(key.getType().toString())) { + String str = key.getType().toString(); + switch (str) { + case "class [I": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((int[]) value)); + break; + case "class [S": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((short[]) value)); + break; + case "class [J": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((long[]) value)); + break; + case "class [F": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((float[]) value)); + break; + case "class [D": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((double[]) value)); + break; + case "class [Z": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((boolean[]) value)); + break; + case "class [B": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((byte[]) value)); + break; + case "class [C": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((char[]) value)); + break; + case "class [Ljava.lang.Character;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((Character[]) value)); + break; + case "class [Ljava.lang.String;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((String[]) value)); + break; + case "class [Ljava.lang.StringBuffer;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuffer[]) value)); + break; + case "class [Ljava.lang.StringBuilder;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuilder[]) value)); + break; + } + } else if (key.getType().toString().contains("[[")) { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.deepToString((Object[]) value)); + } else { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + value); + } + } + + if(value != null && dealtypes.contains(value.getClass().toString())){ + if(!whitelist.contains(key.toString())){ + // 如果为基础类型或者需要特殊处理的object类型且没在whitelist中则再次调用本身,否则只在控制台打印出来对象信息 + calculatecrc(value); + } + } + } + } + } + } + /* + 接受object类型参数,向下获取实例类的域两次 + : reutrn 返回包含域对象和对应的value的键值对的map + */ + private static Map getFieldValue(java.lang.Object obj, int length){ + Map map = new LinkedHashMap<>(); + Field[] rootf = obj.getClass().getDeclaredFields(); + //sort + rootf = CrcCheckForObject.sortFieldArray(rootf); + if(rootf == null){ + return map; + } + List cur_objs = new ArrayList<>(); + List next_objs = new ArrayList<>(); + // 先获取传入参数的域和对应的值, 放入map中, value 放入 cur_objs中 + //System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^root field : value^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); + for(Field f: rootf){ + if(whitelist.contains(f.toString())){ + continue; + } + //System.out.println("< which field: >" + f.toString()); + f.setAccessible(true); + java.lang.Object o; + try { + o = f.get(obj); + map.put(f,o); + } catch (IllegalAccessException e) { + o = null; + map.put(f, null); + } + next_objs.add(o); + //System.out.println("< field value: >" + o); + } + //System.out.println("------------------------------root end------------------------------------"); + while( length > 1){ + cur_objs.clear(); + cur_objs.addAll(next_objs); + next_objs.clear(); + for(Object o:cur_objs){ + if(o == null ){ + continue; + } + if(dealtypes.contains(o.getClass().toString())){ + //如果为基础类型则不向下获取实例的域 + continue; + } + Field[] fs = o.getClass().getDeclaredFields(); + fs = sortFieldArray(fs); + if(fs == null){ + continue; + } + for(Field fi: fs){ + + //System.out.println("< which field: >" + fi.toString()); + if(whitelist.contains(fi.toString())){ + continue; + } + fi.setAccessible(true); + Object oc; + try{ + oc = fi.get(o); + }catch(IllegalAccessException e){ + oc = null; + } + //System.out.println("< field value: >" + oc); + + map.put(fi, oc); + next_objs.add(oc); + } + } + length -= 1; + } + + return map; + } + + private static long getCRC () { + CrcBuffer b = new CrcBuffer(length); + for (Object obj:resultlist){ + if (obj.getClass().toString().equals("class java.lang.Byte")) { + CrcCheckwithChar.ToByteArray((byte) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Short")) { + CrcCheckwithChar.ToByteArray((short) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Integer")) { + CrcCheckwithChar.ToByteArray((int) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Long")) { + CrcCheckwithChar.ToByteArray((long) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Float")) { + CrcCheckwithChar.ToByteArray((float) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Double")) { + CrcCheckwithChar.ToByteArray((double) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Boolean")) { + CrcCheckwithChar.ToByteArray((boolean) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Character")) { + CrcCheckwithChar.ToByteArray((char) obj, b); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer, 0, b.i); + return c.getValue(); + } + + /** + * 进行Field[]排序 + */ + public static Field[] sortFieldArray (Field[] fields){ + if (fields == null || fields.length == 0) { + return null; + } + List flist = Arrays.asList(fields); + Collections.sort(flist, new FieldComparator()); + + return (Field[]) flist.toArray(); + } +} +/* + * sort the field array by field`s name + * + * */ +class FieldComparator implements Comparator{ + @Override + public int compare(Field f1, Field f2){ + return (f1.toString()).compareTo(f2.toString()); + } + +} + + +class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf(" +Fail to Get CRC! + Calculation=%d LookupTable=%d +",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xffffffffL; + } + +} diff --git a/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/CrcCheckwithChar.java b/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/CrcCheckwithChar.java new file mode 100644 index 0000000000000000000000000000000000000000..6b2e64a2d7f8dbf3f7513433b8de5fd9032cd52b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/CrcCheckwithChar.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.Double; + +class CrcBuffer { + int i = 0; + static int buffer_counter = 0; + byte[] buffer; + + CrcBuffer(int size) { + this.buffer = new byte[size]; + buffer_counter++; + //System.out.printf("Buffer-Counter=%d\tLength=%d\n", buffer_counter, size); + } +} + +public class CrcCheckwithChar { + /**************************************************************/ + static boolean isVerbose = false; + + public static void ToByteArray(char args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(byte args, CrcBuffer b) { + b.buffer[b.i] = args; + b.i++; + } + + public static void ToByteArray(short args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(int args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(long args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(boolean args, CrcBuffer b) { + if (args) { + b.buffer[b.i] = 0x01; + } else { + b.buffer[b.i] = 0x00; + } + b.i++; + } + + public static void ToByteArray(float args, CrcBuffer b) { + int iargs = Float.floatToIntBits(args); + b.buffer[b.i] = (byte) ((iargs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (iargs & 0xff); + b.i++; + } + + public static void ToByteArray(double args, CrcBuffer b) { + long largs = Double.doubleToLongBits(args); + b.buffer[b.i] = (byte) ((largs >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (largs & 0xff); + b.i++; + } +} diff --git a/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/Start.java b/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..084d4f0bebb0ea3c2ed85901213ba9c4d2bc6c8f --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/1176_2019091603087/Start.java @@ -0,0 +1,1739 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +// this is a test!!!!!!! +// seed : 1567599010025 +import java.util.*; +public class Start +{ + protected static MainClass var_810 = new MainClass(); + public static void getCheckSum() + { + System.out.println( "=======getCheckSum======="); + long crc = CrcCheckForObject.totalCRCForObjects(false, var_810, new Class_3(), new Class_4()); + System.out.println("CheckSum:"+crc); + } + public static void main(String[] args_0) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + var_810.run(); + getCheckSum(); + //这是一个空语句 + } +} +class MainClass +{ + private static int var_1 = 1259637500; + static boolean var_2 = true; + private static boolean var_10 = false; + public static short var_11 = (-26676); + protected static float var_12 = 6.9864776E7f; + static char var_19 = 'R'; + public static long var_32 = (-3837846766586458382L); + public static char var_50 = ','; + static byte[] array_52 = new byte[]{65,(-108),(-62),59}; + private static boolean var_54 = false; + static int var_55 = 2101311809; + public static char var_57 = 'D'; + protected static String var_66 = "69qPxU8:+;"; + private static boolean[] array_68 = new boolean[]{true,true,true}; + public static int var_72 = 1055852455; + public static byte var_73 = (-46); + public static byte var_79 = (-103); + private static double var_90 = (-4.4461463167233133E8d); + protected static short var_91 = (-21292); + public static byte var_94 = 6; + static boolean var_95 = true; + static byte[] array_96 = new byte[]{7}; + static byte var_102 = 52; + static char var_103 = '6'; + private static boolean var_107 = false; + private static String[][][] array_109 = new String[][][]{{{"Iuee8,Im7","Jpfj?gJvO,","N.8gA$]Gp+",".UW%LpPjt/","^39vO=wA]\"",":u`_A.RC|_","C2","7!!5W8gyd*"},{"X?Q.N'3o\\D","Io#@h,&B+(","Bh'Gs-/3xb"},{"k2>I)c+<_<","&Qf*()./-T","&ui(9!J\"x8","/UoyQNYF1"," uo|tg/(=h"}}}; + public static int var_112 = (-385535574); + protected static byte var_115 = (-122); + public static byte var_119 = 55; + public static byte var_121 = (-63); + protected static char var_124 = 'd'; + public static int var_135 = (-1377089295); + public static long var_136 = 323485797218974261L; + static boolean var_147 = false; + public static boolean var_150 = true; + public static boolean var_152 = false; + private static byte[][][] array_154 = new byte[][][]{{{119,(-124)},{68,97,92,16},{14}}}; + static double var_160 = 5.292948536561369E8d; + protected static float[] array_161 = new float[]{(-1.29729664E9f),7298065.5f,4.33636128E8f}; + private static short var_166 = (-17205); + private static byte var_186 = (-7); + static byte[][] array_198 = new byte[][]{{(-72),65,(-21)}}; + private static boolean var_204 = true; + protected static char var_206 = 'K'; + private static MainClass[][] array_212 = new MainClass[][]{{new MainClass(),new MainClass()},{new MainClass()}}; + static short var_219 = 29493; + protected static boolean[][] array_221 = new boolean[][]{{false,true,true,true,true,false},{false,false}}; + static byte var_229 = 35; + static int var_247 = (-360262596); + protected static char[] array_254 = new char[]{'~','Y','8',' '}; + public static double var_264 = 6.761143734236369E8d; + public static boolean var_266 = false; + private static boolean var_267 = true; + protected static short var_280 = (-11816); + static boolean var_287 = false; + private static char var_288 = '9'; + private static int var_294 = (-1841688147); + private static boolean var_295 = true; + public static boolean[][][] array_297 = new boolean[][][]{{{true,true,false,true,true}},{{true,true,true,false,true},{true,false,true,true,false,false,false,false},{false,false,false,false,true,true,false},{true,false,true,true,false,false,true}},{{true,true,true,false,true},{false,true,true,true,true}},{{false,true,false,true,false,true},{true,true,true}},{{false,true,false,true,false,false}},{{true,true,false,false},{true,true},{true,false,false,true,true}}}; + protected static boolean var_305 = true; + protected static byte var_306 = 15; + public static byte var_316 = 83; + protected static boolean var_323 = true; + public static int var_329 = 1206735304; + public static boolean var_339 = true; + public static float var_340 = (-3.87551584E8f); + static short var_347 = (-24000); + private static byte[][][] array_351 = new byte[][][]{{{(-101)},{114},{(-39),(-23)},{(-80),(-43),(-100),8,30}},{{(-51),104},{(-97),(-98),(-39),12,108},{101,(-99)}},{{114},{22},{(-29),63,54,(-60)}},{{(-127),117,(-11),17}},{{28,41,34},{85,(-77),67,(-40),66,(-69)},{69,(-11),(-104),(-128)},{11,110,(-106)},{49,3,(-52),(-80),67,34,4},{(-80),56}}}; + static byte var_361 = 83; + private static short var_391 = 7989; + protected static MainClass var_394 = new MainClass(); + private static int var_395 = 57534580; + private static int var_397 = (-1514658908); + protected static boolean var_398 = true; + static short var_404 = 3374; + public static boolean var_408 = true; + private static MainClass var_427 = new MainClass(); + static boolean var_429 = true; + static float var_430 = 1.4980471E9f; + private static char var_432 = '>'; + public static double var_435 = (-3.756420435009541E8d); + protected static byte var_438 = (-40); + protected static float var_453 = 9.7461632E8f; + private static Class_3 var_465 = new Class_3(); + static float var_466 = (-9107830.0f); + public static boolean var_476 = true; + public static boolean[][] array_477 = new boolean[][]{{true,false},{true,false,false,true,false,true}}; + private static Class_4 var_641 = new Class_4(); + static boolean[][][] array_651 = new boolean[][][]{{{false,false,false,false,false,false},{false},{false,true},{true,true,false},{false,false},{true,true,true},{false,true,true,true}},{{false,true,true,false,true,false},{true,true,false}},{{true},{true,false,false,false,true,false,true,true},{false,true}},{{false,true,false,false,false}},{{false,true,false,true},{false,true},{false,true,true,false,true,true,false},{true,false,false,false,true,true}},{{true,false,false,true,true},{false,true,true}},{{true,false,false},{false,false}}}; + static int[][][] array_653 = new int[][][]{{{1394228782,(-995624121),(-1533513344),(-17710079),599956172}},{{(-1131062676)},{(-1665815668),(-1864430398),(-895823924),1163975902},{496956162,10482749,(-362887850),(-507096297)},{(-881441652),(-1570684379),(-1008262181)},{(-1377809218),36166304,(-1579819043),(-1120441284)},{(-1427762963)},{970098107,(-931266604),(-835688310),347842324,(-1722851153)}},{{(-1429306331),1375377855},{(-1252989119),(-1831684816)}}}; + private static long var_656 = 1373367705022456330L; + protected static boolean var_658 = true; + public static boolean var_662 = false; + static short var_663 = 23842; + private static short[][] array_664 = new short[][]{{(-18201),(-260),18806,23966},{(-15771),(-18575),(-32351),(-8050),27834,(-749)}}; + public static double var_675 = (-1.0730840187804861E9d); + private static byte var_685 = (-68); + private static boolean[] array_697 = new boolean[]{false,false,true,false,true,false}; + static short var_703 = (-27112); + static char var_710 = 'k'; + private static long var_721 = 7087402254853699543L; + protected static byte var_723 = (-9); + private static boolean[] array_730 = new boolean[]{false,true,false,false}; + static byte var_733 = (-29); + static char var_745 = '1'; + protected static double var_759 = (-9.714277815657629E7d); + static float var_765 = 1.41441011E9f; + static String var_773 = "q[y?oN_Ec\\"; + static float var_778 = (-5.09079392E8f); + protected static boolean[][][] array_781 = new boolean[][][]{{{false,true,true,true},{false,false,true,false,false,true},{true,true,false,true,true}},{{false,false,false,true},{true,false,true,false},{false},{true,false,false,false,false,true},{false,true,true,true,false,true},{true,false}},{{false,true,true,true,true,true,false,false},{true,true}},{{true,false,false,false},{true},{false,true,true},{false,false,true,true}},{{false,false,true,false},{false,false},{false,true,true},{false,false,true,false}},{{false,false,false,true},{false,true},{false},{false,true,false,false,true},{false},{true,true,false,false}}}; + protected static double[] array_787 = new double[]{9.101085945825323E8d,(-1.0067305035252595E9d),(-1.2736717475418156E7d)}; + protected static long var_790 = (-6911608165508202920L); + static char var_795 = 'b'; + private static char var_805 = 'N'; + public boolean func_4(byte args_3, boolean args_4, short args_5, boolean args_6, boolean args_7, float args_8) + { + char var_9 = 'c'; + --var_9; + return var_2; + } + void func_7(double args_26, float args_27, short args_28, float args_29, short args_30, float args_31) + { + ++var_19; + var_1 = var_1; + } + protected char func_9(double args_43, boolean args_44, byte args_45, char args_46, float args_47, byte args_48) + { + double var_59 = (-3.1142644718757725E8d); + try + { + for (int id_49 = 73;id_49>3;id_49 -= 71) + { + if (var_12==var_12) + { + var_11 = (short)var_32; + var_50 = var_19; + } + for (int id_51 = 0;id_51<98;id_51 += 25) + { + int index_53 = var_50&array_52.length-1; + array_52[index_53] = (byte)4691807484924659677L; + var_54 = var_10; + } + var_55 = var_1; + } + boolean var_56 = false; + var_56 = var_56; + ++var_50; + } + catch (Exception e_1) + { + var_11--; + var_11--; + System.out.println( "=======Exception thrown======="+1); + } + finally + { + var_1 = var_57>>>((byte)var_12); + for (int id_58 = 8;id_58>4;id_58 -= 1) + { + var_59 = var_59; + for (int id_60 = 1;id_60<67;id_60 += 8) + { + var_54 = var_54; + int index_61 = ((byte)var_12)&array_52.length-1; + int index_62 = ((byte)var_12)&array_52.length-1; + int index_64 = var_11&array_52.length-1; + int index_63 = ((short)array_52[index_64])&array_52.length-1; + array_52[index_63] = array_52[index_62]; + } + } + --var_55; + --var_57; + try + { + try + { + int index_65 = var_50&array_52.length-1; + array_52[index_65] = (byte)var_19; + var_50 = var_57; + var_11 = var_11; + } + catch (Exception e_3) + { + var_12 = (-5.8606368E8f); + var_66 = var_66+(var_12++); + char var_67 = ')'; + var_67 = var_50; + System.out.println( "=======Exception thrown======="+2); + } + finally + { + var_66 = var_66+var_59; + var_1 = var_55; + } + int index_71 = ((short)(var_72-var_73))&array_52.length-1; + int index_70 = array_52[index_71]&array_52.length-1; + int index_69 = array_52[index_70]&array_68.length-1; + int index_74 = var_11&array_68.length-1; + if (array_68[index_74]) + { + var_54 = var_10; + var_10 = var_54|(var_11<=var_59); + } + else + { + var_66 = ",>OjFI7vTG"; + var_66 = var_66; + var_57 = var_57; + var_12 = var_12*var_32; + int index_75 = var_57&array_52.length-1; + int index_76 = var_11&array_52.length-1; + var_73 = array_52[index_76]; + } + } + catch (Exception e_2) + { + var_59 = -var_12; + int index_77 = var_73&array_52.length-1; + array_52[index_77] = var_73; + System.out.println( "=======Exception thrown======="+3); + } + int index_78 = ((char)var_79)&array_52.length-1; + int index_80 = '-'&array_52.length-1; + ++array_52[index_80]; + } + --var_32; + var_11 = var_11; + return (char)(-4.234954128257302E7d); + } + public float func_10(MainClass args_83, float args_84, boolean args_85, short args_86, double args_87, byte args_88) + { + var_54 = (false|var_10)||((var_11<=var_32); + MainClass var_92 = new MainClass(); + MainClass var_93 = new MainClass(); + byte var_98 = (-58); + String var_101 = "//YgjH[f@K"; + String var_108 = "G8Hd,PC=)u"; + for (int id_89 = 57;id_89>5;id_89 -= 8) + { + var_90 = var_90; + try + { + var_91--; + try + { + var_1 = var_55; + var_93 = var_92; + var_90 = 9.886165863573425E8d; + var_94 = (byte)(var_57<<((char)var_72)); + } + catch (Exception e_3) + { + var_12 = (-3.0379888E8f); + array_68 = array_68; + var_94 = var_94; + System.out.println( "=======Exception thrown======="+4); + } + MainClass var_97 = new MainClass(); + if (var_95) + { + array_96 = array_96; + var_93 = var_97; + var_94 = (byte)var_98; + var_1 = var_1; + } + else + { + var_12 = (-1.13458611E9f); + int index_99 = (var_1--)&array_96.length-1; + array_96[index_99] = (-30); + var_54 = true; + int index_100 = var_91&array_96.length-1; + var_94 = (byte)array_96[index_100]; + } + } + catch (Exception e_2) + { + var_101 = var_66; + if (( -var_32)!=var_90) + { + var_19 = (char)var_57; + var_12 = var_1--; + var_10 = false||(var_10||(var_79<=var_50)); + } + else + { + var_12 = var_91+var_102; + var_103 = (char)( -var_94); + array_68 = array_68; + var_94 = var_79; + } + var_19++; + System.out.println( "=======Exception thrown======="+5); + } + for (int id_104 = 61;id_104<76;id_104 += 4) + { + int index_105 = var_79&array_52.length-1; + int index_106 = var_72&array_52.length-1; + var_79 = array_52[index_106]; + try + { + var_19 = var_19; + var_11 = (short)( +var_102); + var_54 = var_107; + } + catch (Exception e_3) + { + array_68 = array_68; + var_91 = var_91; + int index_110 = var_94&array_109.length-1; + int index_111 = var_112&array_109[index_110].length-1; + int index_113 = ((short)var_50)&array_109[index_110][index_111].length-1; + array_109[index_110][index_111][index_113] = var_108; + System.out.println( "=======Exception thrown======="+6); + } + finally + { + var_91 = var_11; + int index_114 = var_112&array_52.length-1; + var_112 = ((char)var_91)>>(array_52[index_114]<<((char)var_90)); + int index_116 = ( ~var_11)&array_52.length-1; + array_52[index_116] = var_115; + } + --index_106; + } + var_12 = var_12; + } + return ((char)(var_91-var_19))/(1|var_32); + } + public void func_11(float args_128, boolean args_129, double args_130, float args_131, int args_132, float args_133) + { + for (int id_134 = 93;id_134>31;id_134 -= 7) + { + var_135++; + var_136--; + } + for (int id_137 = 13;id_137<45;id_137 += 9) + { + ++var_1; + int var_138 = 439185790; + var_138 = ((char)((char)var_102))^var_72; + var_12 = ( +var_94)*((byte)6.1236141E8f); + } + boolean[][][] array_139 = new boolean[][][]{{{false,true,true},{false,false},{true,true,true,false,true},{false,false,false,true},{false,true},{false,true,false,true}},{{false},{true,false,true,false,true}},{{true,true,true,false,false,true,true},{true,false},{false,true,true,true},{false,false,false}},{{true,true,false},{true,true,true,true,true,true},{false,true},{true,true,true}},{{false,true,false,true},{false,true,false,true,false},{false,false,true,true,false},{true,false,true,true,true},{true,false,true,false,true,true,true},{true}}}; + int index_140 = var_11&array_139.length-1; + int index_141 = var_55&array_139[index_140].length-1; + int index_142 = var_112&array_139[index_140][index_141].length-1; + int index_143 = var_72&array_139.length-1; + int index_144 = (((char)var_11)*((short)index_140))&array_139[index_143].length-1; + int index_145 = index_140&array_139[index_143][index_144].length-1; + MainClass var_148 = new MainClass(); + short var_149 = 13882; + int var_163 = 125248840; + if (array_139[index_143][index_144][index_145]) + { + for (int id_146 = 73;id_146>62;id_146 -= 3) + { + if (var_147) + { + var_50 = var_50; + array_139 = array_139; + index_145 = var_11&var_73; + var_148 = var_148; + } + else + { + var_11 = var_91; + var_149 = var_91; + var_90 = 5924815075531656541L+(36>>((char)var_19)); + var_150 = false; + var_112 = index_142; + } + var_12 = var_12-var_124; + for (int id_151 = 91;id_151<91;id_151 += 1) + { + var_12 = var_12; + var_57 = 'x'; + var_90 = var_57+var_91; + var_148 = var_148; + } + --var_91; + } + try + { + var_148 = var_148; + var_12 = 8.9310861E8f; + var_12 = (var_135<=((short)var_32); + var_90 = var_90; + array_68 = array_68; + index_140 = index_144; + var_149 = (short)(-31910); + } + else + { + var_103 = (char)var_11; + int index_155 = var_124&array_154.length-1; + int index_156 = var_55&array_154[index_155].length-1; + int index_157 = var_124&array_154[index_155][index_156].length-1; + int index_153 = array_154[index_155][index_156][index_157]&array_109.length-1; + int index_158 = var_115&array_109[index_153].length-1; + int index_159 = var_103&array_109[index_153][index_158].length-1; + array_109[index_153][index_158][index_159] = ("jR#4&p8^/="+var_90)+var_12; + } + var_103 = (char)var_12; + } + catch (Exception e_2) + { + var_90 = var_90; + var_66 = var_66; + var_124++; + var_32--; + System.out.println( "=======Exception thrown======="+7); + } + ++var_79; + if ( !( !true)) + { + try + { + var_66 = var_66+var_90; + var_12 = (-3.6440432E8f); + var_12 = 2.98705408E8f; + var_19 = var_103; + } + catch (Exception e_3) + { + var_11 = var_11; + array_68 = array_68; + var_150 = false; + index_142 = var_55; + System.out.println( "=======Exception thrown======="+8); + } + finally + { + var_66 = var_66; + var_55 = var_55; + var_150 = true; + var_160 = var_160; + int index_162 = index_145&array_161.length-1; + array_161[index_162] = var_12; + } + var_163 = index_145; + boolean var_164 = true; + if (var_164) + { + int index_165 = ((char)(var_11/(1|var_102)))&array_161.length-1; + var_160 = ('4'/(1|(var_135<>>var_32); + } + } + } + } + protected double func_12(float args_170, String args_171, byte args_172, String args_173, String args_174, float args_175) + { + var_11--; + var_150 = false; + return var_160; + } + protected String func_13(char args_178, boolean args_179, byte args_180, int args_181, int args_182, boolean args_183) + { + boolean[] array_190 = new boolean[]{false,true,true}; + float var_195 = (-2875139.0f); + boolean var_205 = true; + double var_207 = (-3.90868001561799E8d); + MainClass var_211 = new MainClass(); + short var_250 = 26756; + double var_265 = (-3.541710195956759E8d); + boolean var_269 = false; + String var_270 = "\"n3 9kih S"; + MainClass var_302 = new MainClass(); + try + { + for (int id_184 = 67;id_184<80;id_184 += 3) + { + for (int id_185 = 22;id_185>20;id_185 -= 3) + { + var_124 = (char)var_90; + var_186 = var_121; + int index_187 = ((short)((short)var_136))&array_161.length-1; + int index_188 = var_166&array_161.length-1; + int index_189 = var_19&array_161.length-1; + array_161[index_189] = array_161[index_188]; + } + try + { + var_90 = var_90; + var_103 = (char)(( -var_1)/(1|((char)var_186))); + } + catch (Exception e_3) + { + int index_191 = (var_112&var_57)&array_190.length-1; + int index_192 = var_103&array_190.length-1; + var_150 = array_190[index_192]; + var_11 = (short)var_103; + System.out.println( "=======Exception thrown======="+9); + } + var_1--; + var_166 = var_11; + for (int id_193 = 70;id_193>50;id_193 -= 3) + { + var_11 = (short)var_90; + var_66 = var_66; + var_19 = (char)var_90; + int index_194 = ((char)var_135)&array_52.length-1; + var_195 = (-54)-array_52[index_194]; + } + for (int id_196 = 10;id_196<87;id_196 += 39) + { + int index_197 = var_57&array_161.length-1; + int index_199 = ((char)((char)1.123817E7f))&array_198.length-1; + int index_201 = ((char)(var_55+var_135))&array_154.length-1; + int index_202 = (var_19++)&array_154[index_201].length-1; + int index_203 = var_121&array_154[index_201][index_202].length-1; + int index_200 = array_154[index_201][index_202][index_203]&array_198[index_199].length-1; + array_198[index_199][index_200] = (byte)(array_161[index_197]++); + } + } + ++var_91; + if (var_204) + { + if (var_205) + { + var_206 = (char)(-30971); + var_112 = 1570108913; + var_207 = 2.8850379313086033E7d; + var_207 = var_55*var_160; + } + var_11 = var_91; + var_207 = var_160; + int index_208 = var_166&array_154.length-1; + int index_209 = ( ~index_208)&array_154[index_208].length-1; + int index_210 = ((short)(var_19++))&array_154[index_208][index_209].length-1; + array_154[index_208][index_209][index_210] = (byte)((byte)((char)var_124)); + } + else + { + short var_216 = (-18583); + try + { + int index_213 = 'x'&array_212.length-1; + int index_214 = ((short)var_160)&array_212[index_213].length-1; + array_212[index_213][index_214] = var_211; + var_124 = (char)var_207; + var_150 = var_135>(var_1+var_160); + } + catch (Exception e_3) + { + var_1 = 1175167687; + var_55 = var_72; + int index_215 = var_216&array_109.length-1; + int index_217 = var_11&array_109[index_215].length-1; + int index_218 = var_57&array_109[index_215][index_217].length-1; + array_109[index_215][index_217][index_218] = var_66; + System.out.println( "=======Exception thrown======="+10); + } + var_219--; + } + try + { + int index_220 = ((byte)var_19)&array_161.length-1; + array_161[index_220] = var_195; + } + catch (Exception e_2) + { + int index_222 = var_206&array_221.length-1; + int index_223 = var_1&array_221[index_222].length-1; + int index_224 = var_103&array_221.length-1; + int index_225 = ((byte)'8')&array_221[index_224].length-1; + if (array_221[index_224][index_225]) + { + var_66 = ((var_66+var_54)+2.9131369077154495E7d)+var_54; + var_12 = var_12; + } + System.out.println( "=======Exception thrown======="+11); + } + ++var_72; + } + catch (Exception e_1) + { + --var_91; + try + { + int var_226 = (-744685510); + if ((var_226<=var_32)||(var_135>var_11)) + { + int index_228 = var_229&array_96.length-1; + int index_227 = array_96[index_228]&array_109.length-1; + int index_231 = var_1&array_154.length-1; + int index_232 = ((char)var_207)&array_154[index_231].length-1; + int index_233 = ((char)((char)var_219))&array_154[index_231][index_232].length-1; + int index_230 = array_154[index_231][index_232][index_233]&array_109[index_227].length-1; + int index_234 = (((short)var_160)/(1|( ~var_119)))&array_109[index_227][index_230].length-1; + int index_235 = var_226&array_109.length-1; + int index_236 = var_103&array_109[index_235].length-1; + int index_237 = ((char)(var_11/(1|var_226)))&array_109[index_235][index_236].length-1; + var_66 = array_109[index_235][index_236][index_237]; + } + else + { + int index_238 = var_55&array_109.length-1; + int index_239 = ((short)'q')&array_109[index_238].length-1; + int index_240 = var_124&array_109[index_238][index_239].length-1; + int index_241 = var_79&array_109.length-1; + int index_242 = var_166&array_109[index_241].length-1; + int index_243 = var_206&array_109[index_241][index_242].length-1; + int index_244 = 'k'&array_109.length-1; + int index_245 = var_73&array_109[index_244].length-1; + int index_246 = var_247&array_109[index_244][index_245].length-1; + array_109[index_244][index_245][index_246] = array_109[index_241][index_242][index_243]; + } + for (int id_248 = 15;id_248<82;id_248 += 68) + { + var_219 = var_166; + var_12 = var_12/(1|var_11); + var_207 = var_207; + var_219 = (short)var_136; + int index_249 = ((var_112<>var_250)))&array_212.length-1; + int index_251 = var_102&array_212[index_249].length-1; + array_212[index_249][index_251] = var_211; + } + var_166++; + for (int id_252 = 70;id_252<74;id_252 += 2) + { + var_12 = var_12; + var_66 = ((var_66+var_50)+var_91)+((var_66+var_94)+var_55); + int index_255 = ((short)((char)var_195))&array_254.length-1; + int index_253 = (var_57>>array_254[index_255])&array_212.length-1; + int index_256 = (var_226*var_19)&array_212[index_253].length-1; + array_212[index_253][index_256] = var_211; + } + int index_257 = var_219&array_52.length-1; + boolean var_258 = true; + if ((array_52[index_257]==var_119)|var_258) + { + var_166 = (short)var_79; + var_112 = +(((byte)var_160)-((byte)var_32)); + int index_259 = index_257&array_198.length-1; + int index_260 = 524786749&array_198[index_259].length-1; + int index_261 = var_112&array_198.length-1; + int index_262 = ((char)var_136)&array_198[index_261].length-1; + var_94 = array_198[index_261][index_262]; + } + else + { + var_66 = ((var_66+var_206)+var_79)+var_90; + int index_263 = var_72&array_161.length-1; + var_160 = array_161[index_263]--; + } + } + catch (Exception e_2) + { + var_11 = var_11; + var_265 = var_264; + if (var_266) + { + array_161 = array_161; + var_160 = var_207; + int index_268 = 14328&array_190.length-1; + array_190[index_268] = var_267; + var_269 = false; + var_270 = var_270; + } + else + { + int index_271 = ( +var_1)&array_212.length-1; + int index_272 = var_250&array_212[index_271].length-1; + int index_273 = var_103&array_212.length-1; + int index_274 = ((char)var_124)&array_212[index_273].length-1; + var_211 = array_212[index_273][index_274]; + } + System.out.println( "=======Exception thrown======="+13); + } + finally + { + for (int id_275 = 72;id_275<83;id_275 += 2) + { + var_270 = var_270+var_166; + int index_276 = ((char)var_136)&array_96.length-1; + int index_277 = ((char)var_72)&array_96.length-1; + var_229 = array_96[index_277]; + } + try + { + int index_278 = 1957828202&array_96.length-1; + array_96[index_278] = (byte)var_103; + int index_279 = var_280&array_254.length-1; + array_254[index_279] = (char)(var_247++); + var_160 = var_265; + } + catch (Exception e_3) + { + int index_281 = ((byte)((short)var_166))&array_212.length-1; + int index_282 = var_55&array_212[index_281].length-1; + int index_283 = (-75)&array_212.length-1; + int index_284 = var_50&array_212[index_283].length-1; + int index_285 = 17&array_212.length-1; + int index_286 = (-29)&array_212[index_285].length-1; + array_212[index_285][index_286] = array_212[index_283][index_284]; + System.out.println( "=======Exception thrown======="+14); + } + var_32++; + } + MainClass var_293 = new MainClass(); + if (var_287) + { + var_152 = (var_150||var_10)|var_267; + --var_94; + var_288 = var_124; + int index_289 = var_79&array_212.length-1; + int index_290 = (-4438)&array_212[index_289].length-1; + int index_291 = ((short)((short)var_160))&array_212.length-1; + int index_292 = var_124&array_212[index_291].length-1; + var_293 = array_212[index_291][index_292]; + } + ++var_294; + if (var_295) + { + for (int id_296 = 70;id_296>29;id_296 -= 6) + { + var_112 = ~((char)(var_112+var_57)); + var_186 = (byte)(var_1|var_166); + var_66 = var_270+((char)var_32); + array_297 = array_297; + int index_298 = ((byte)((short)var_102))&array_212.length-1; + int index_299 = var_57&array_212[index_298].length-1; + int index_300 = var_19&array_212.length-1; + int index_301 = ((short)var_280)&array_212[index_300].length-1; + var_302 = array_212[index_300][index_301]; + } + for (int id_303 = 19;id_303<30;id_303 += 3) + { + int index_304 = ((short)var_32)&array_161.length-1; + array_161[index_304] = var_195; + var_91 = var_219; + var_12 = 1.24159016E8f; + } + if (var_305&var_305) + { + var_265 = var_264; + var_195 = var_195; + var_103 = var_19; + } + else + { + var_150 = false; + var_207 = -var_124; + var_10 = var_107; + var_265 = var_207; + } + var_306++; + for (int id_307 = 85;id_307>45;id_307 -= 14) + { + var_294 = -(82-var_229); + var_107 = var_12!=var_12; + int index_308 = var_135&array_161.length-1; + int index_309 = ((var_250&var_229)/(1|((byte)var_264)))&array_161.length-1; + int index_310 = var_119&array_161.length-1; + array_161[index_310] = array_161[index_309]; + } + } + System.out.println( "=======Exception thrown======="+14); + } + return var_270; + } + public void func_14(int args_317, short args_318, byte args_319, boolean args_320, boolean args_321, double args_322) + { + var_50--; + --var_219; + if (var_323) + { + for (int id_324 = 91;id_324<92;id_324 += 1) + { + int var_326 = (-1864728767); + int index_325 = ((short)var_326)&array_254.length-1; + int index_327 = ((short)var_160)&array_254.length-1; + var_19 = array_254[index_327]; + index_327 = var_55; + var_267 = "RW?IkB#ilU"!=(var_66+var_10); + } + var_90 = var_90; + } + else + { + ++var_32; + int index_328 = ( -var_186)&array_254.length-1; + array_254[index_328] = 'y'; + } + var_135--; + var_150 = var_152; + } + private void func_15(byte args_333, char args_334, double args_335, int args_336, byte args_337, double args_338) + { + try + { + var_91 = var_166; + if (var_339^( !false)) + { + var_12 = var_340; + var_136--; + try + { + int index_341 = (-1119423199)&array_109.length-1; + int index_342 = var_91&array_109[index_341].length-1; + int index_343 = '('&array_109[index_341][index_342].length-1; + array_109[index_341][index_342][index_343] = "[=%gN; bQ-"; + } + catch (Exception e_3) + { + var_160 = 1.5545016951543427E9d; + var_264 = var_264; + int index_344 = var_115&array_154.length-1; + int index_345 = (var_57++)&array_154[index_344].length-1; + int index_346 = var_280&array_154[index_344][index_345].length-1; + var_264 = array_154[index_344][index_345][index_346]-((var_135++)&(var_119|var_186)); + System.out.println( "=======Exception thrown======="+15); + } + var_166 = var_219; + var_347 = var_91; + } + } + catch (Exception e_1) + { + ++var_135; + int index_348 = (((short)var_136)^(var_166++))&array_161.length-1; + int index_349 = ((byte)var_340)&array_161.length-1; + int index_350 = var_112&array_161.length-1; + array_161[index_350] = array_161[index_349]; + System.out.println( "=======Exception thrown======="+16); + } + int index_352 = ((char)6.9048019E8f)&array_351.length-1; + int index_353 = ((char)var_219)&array_351[index_352].length-1; + int index_354 = ((byte)var_264)&array_351[index_352][index_353].length-1; + array_351[index_352][index_353][index_354] = (byte)var_103; + } + private int func_16(float args_355, float args_356, char args_357, char args_358, MainClass args_359, byte args_360) + { + ++var_361; + int index_362 = ((char)var_112)&array_161.length-1; + array_161[index_362] = var_50--; + var_107 = false; + ++var_73; + return var_329; + } + float func_17(int args_363, byte[][] args_364, float args_365, short args_366, float args_367, String args_368) + { + var_54 = ((byte)var_72)>var_136; + ++var_32; + return var_340; + } + public float func_18(float args_370, String args_371, boolean[][] args_372, double args_373, String args_374, byte args_375) + { + for (int id_376 = 1;id_376<1;id_376 += 1) + { + --var_347; + ++var_73; + ++var_103; + var_91 = (-15577); + } + int var_392 = 1297948467; + try + { + for (int id_377 = 37;id_377>10;id_377 -= 10) + { + var_72 = ((byte)(var_57+var_306))*var_294; + try + { + int index_378 = 20&array_161.length-1; + int index_379 = var_102&array_161.length-1; + int index_380 = ( +var_288)&array_161.length-1; + array_161[index_380] = array_161[index_379]; + int index_382 = var_1&array_351.length-1; + int index_383 = index_379&array_351[index_382].length-1; + int index_384 = index_379&array_351[index_382][index_383].length-1; + int index_381 = array_351[index_382][index_383][index_384]&array_154.length-1; + int index_385 = var_73&array_154[index_381].length-1; + byte var_387 = 94; + int index_386 = var_387&array_154[index_381][index_385].length-1; + int index_388 = ((char)var_12)&array_154.length-1; + int index_389 = 'a'&array_154[index_388].length-1; + int index_390 = var_391&array_154[index_388][index_389].length-1; + var_361 = array_154[index_388][index_389][index_390]; + } + catch (Exception e_3) + { + var_135 = var_392; + float var_393 = 5.07270016E8f; + var_393 = var_340; + System.out.println( "=======Exception thrown======="+17); + } + finally + { + var_394 = var_394; + var_294 = var_247; + var_395 = var_247; + var_135 = var_329; + } + } + for (int id_396 = 88;id_396>9;id_396 -= 16) + { + var_397 = (-202182250); + var_186 = (byte)var_55; + array_198 = array_198; + var_186 = var_306; + } + var_219 = var_391; + --var_32; + var_66 = var_66+((var_32=array_161[index_399]; + var_19--; + var_347 = (short)(-27651); + System.out.println( "=======Exception thrown======="+18); + } + finally + { + ++var_206; + for (int id_400 = 76;id_400>47;id_400 -= 4) + { + --var_119; + if ( !((var_306<>>var_206)>(((short)var_395)+(var_121/(1|var_280)))) + { + var_124 = var_124; + var_91 = var_404; + var_91 = var_347; + var_12 = +(-9.5801005E8f); + } + else + { + int index_405 = (-1211218865)&array_109.length-1; + int index_406 = var_347&array_109[index_405].length-1; + int index_407 = var_50&array_109[index_405][index_406].length-1; + var_66 = array_109[index_405][index_406][index_407]+var_247; + } + } + } + short var_420 = 13919; + try + { + ++var_166; + var_91 = (short)var_219; + if (var_408) + { + try + { + int index_409 = var_124&array_161.length-1; + int index_410 = var_247&array_161.length-1; + var_340 = array_161[index_410]; + int index_411 = ((char)var_160)&array_109.length-1; + int index_413 = ((byte)var_19)&array_254.length-1; + int index_412 = array_254[index_413]&array_109[index_411].length-1; + int index_414 = var_11&array_109[index_411][index_412].length-1; + int index_415 = var_392&array_109.length-1; + int index_416 = 11&array_109[index_415].length-1; + int index_418 = ((byte)var_219)&array_161.length-1; + int index_417 = ((char)array_161[index_418])&array_109[index_415][index_416].length-1; + var_66 = array_109[index_415][index_416][index_417]; + } + catch (Exception e_3) + { + int index_419 = var_420&array_198.length-1; + int index_421 = var_1&array_198[index_419].length-1; + int index_422 = ((byte)var_280)&array_198.length-1; + int index_424 = var_294&array_351.length-1; + int index_425 = var_166&array_351[index_424].length-1; + int index_426 = index_419&array_351[index_424][index_425].length-1; + int index_423 = ((short)array_351[index_424][index_425][index_426])&array_198[index_422].length-1; + var_115 = array_198[index_422][index_423]; + System.out.println( "=======Exception thrown======="+19); + } + finally + { + var_427 = var_427; + var_12 = var_340; + var_57 = var_124; + var_391 = 27587; + var_398 = true; + } + var_124 = var_103; + for (int id_428 = 79;id_428>40;id_428 -= 5) + { + var_264 = var_264; + var_55 = var_288<<((byte)(var_119>>var_103)); + array_212 = array_212; + var_427 = new MainClass(); + var_429 = var_107; + var_430 = var_430; + } + } + var_150 = false; + var_166 = (short)var_280; + int index_431 = var_432&array_109.length-1; + int index_433 = var_50&array_109[index_431].length-1; + int index_434 = var_166&array_109[index_431][index_433].length-1; + var_66 = (array_109[index_431][index_433][index_434]+4.6266729005915356E8d)+var_435; + } + catch (Exception e_1) + { + --var_420; + int index_437 = ((char)var_438)&array_154.length-1; + int index_440 = ((short)(-27007))&array_198.length-1; + int index_441 = ((short)var_294)&array_198[index_440].length-1; + int index_439 = array_198[index_440][index_441]&array_154[index_437].length-1; + int index_442 = var_347&array_154[index_437][index_439].length-1; + int index_436 = (array_154[index_437][index_439][index_442]+((short)var_32))&array_109.length-1; + int index_443 = ((char)var_340)&array_109[index_436].length-1; + int index_444 = var_72&array_109[index_436][index_443].length-1; + int index_445 = index_443&array_109.length-1; + int index_446 = ((char)((short)var_435))&array_109[index_445].length-1; + int index_447 = ((short)index_437)&array_109[index_445][index_446].length-1; + int index_448 = var_115&array_109.length-1; + int index_449 = ((char)var_438)&array_109[index_448].length-1; + int index_450 = index_442&array_109[index_448][index_449].length-1; + array_109[index_448][index_449][index_450] = array_109[index_445][index_446][index_447]; + System.out.println( "=======Exception thrown======="+20); + } + return ( -var_11)-var_72; + } + private byte func_20(String args_469, boolean args_470, MainClass args_471, float args_472, short args_473, float args_474) + { + int index_475 = ((char)var_135)&array_254.length-1; + array_254[index_475] = (char)var_50; + var_466 = -var_294; + int index_478 = var_103&array_477.length-1; + int index_479 = var_72&array_477[index_478].length-1; + array_477[index_478][index_479] = var_476^var_429; + return (byte)var_90; + } + protected float func_22(short args_645, char args_646, char args_647, short args_648, double args_649, String args_650) + { + boolean var_665 = true; + try + { + array_651 = array_651; + var_103--; + } + catch (Exception e_1) + { + for (int id_652 = 63;id_652>32;id_652 -= 4) + { + int index_654 = (var_72&((char)var_136))&array_653.length-1; + int index_655 = ((short)var_656)&array_653[index_654].length-1; + int index_657 = ((byte)var_79)&array_653[index_654][index_655].length-1; + array_653[index_654][index_655][index_657] = var_55; + } + var_398 = var_658; + array_351 = array_351; + for (int id_659 = 37;id_659>12;id_659 -= 4) + { + int index_660 = (var_166-(-17545))&array_254.length-1; + int index_661 = var_206&array_254.length-1; + var_103 = array_254[index_661]; + } + if (var_264>(var_119*var_112)) + { + if (var_662) + { + var_11 = var_663; + var_54 = var_90>>((char)var_91))&array_109[index_682][index_683].length-1; + char var_687 = 'b'; + int index_686 = var_687&array_109.length-1; + int index_688 = ((byte)var_264)&array_109[index_686].length-1; + int index_689 = (-910274810)&array_109[index_686][index_688].length-1; + array_109[index_686][index_688][index_689] = array_109[index_682][index_683][index_684]; + } + } + ++var_316; + System.out.println( "=======Exception thrown======="+26); + } + finally + { + var_206--; + try + { + int index_690 = var_166&array_109.length-1; + int index_692 = var_103&array_254.length-1; + int index_691 = (10<14;id_705 -= 54) + { + var_112--; + try + { + var_430 = +((byte)((-87)-var_121)); + var_73 = var_79; + int index_706 = ((short)((short)1.37056077E9f))&array_52.length-1; + int index_707 = ((byte)(var_430--))&array_52.length-1; + int index_708 = var_73&array_154.length-1; + int index_709 = var_710&array_154[index_708].length-1; + int index_711 = ((short)var_136)&array_154[index_708][index_709].length-1; + array_154[index_708][index_709][index_711] = array_52[index_707]; + } + catch (Exception e_3) + { + int index_712 = ((char)var_206)&array_52.length-1; + array_52[index_712] = var_438; + int index_713 = (var_294--)&array_697.length-1; + int index_714 = var_685&array_697.length-1; + var_10 = array_697[index_714]; + System.out.println( "=======Exception thrown======="+28); + } + try + { + var_703 = var_391; + var_10 = var_166<(var_397/(1|576516663819775316L)); + var_391 = var_703; + } + catch (Exception e_3) + { + int index_715 = var_55&array_109.length-1; + int index_716 = ((byte)index_715)&array_109[index_715].length-1; + int index_717 = var_166&array_109[index_715][index_716].length-1; + array_109[index_715][index_716][index_717] = var_66; + System.out.println( "=======Exception thrown======="+29); + } + } + } + return 5.6507789E8f; + } + public byte func_8(MainClass args_34, MainClass args_35, int args_36, double args_37, byte args_38, short args_39) + { + boolean var_169 = true; + for (int id_40 = 58;id_40>55;id_40 -= 1) + { + for (int id_41 = 46;id_41<58;id_41 += 2) + { + for (int id_42 = 17;id_42<25;id_42 += 9) + { + double actualArgs_81 = (var_1++); + boolean actualArgs_82 = (var_10&&var_10); + float actualArgs_117 = (var_11++); + boolean actualArgs_118 = (var_54||var_10); + short actualArgs_120 = ((short)var_119); + float actualArgs_122 = func_10(new MainClass(), actualArgs_117, actualArgs_118, (short)actualArgs_120, var_90, (byte)var_121); + byte actualArgs_123 = ((byte)(var_103*var_32)); + var_124 = func_9(actualArgs_81, actualArgs_82, (byte)48, (char)'w', actualArgs_122, (byte)actualArgs_123); + } + for (int id_125 = 81;id_125>69;id_125 -= 4) + { + int index_127 = var_19&array_96.length-1; + int index_126 = array_96[index_127]&array_52.length-1; + var_55 = array_52[index_126]++; + int index_176 = (-21148)&array_161.length-1; + byte actualArgs_177 = ((byte)(-1.0403574049274318E7d)); + String actualArgs_311 = (func_13((char)var_50, var_10, (byte)var_229, index_176, index_126, var_150)+var_166); + float actualArgs_312 = ((11|var_72)+var_103); + double actualArgs_313 = func_12(array_161[index_176], var_66, (byte)actualArgs_177, var_66, actualArgs_311, actualArgs_312); + int index_314 = (-1103861189)&array_161.length-1; + int actualArgs_315 = var_206/(1|var_121); + func_11(var_12, var_169, actualArgs_313, array_161[index_314], actualArgs_315, var_12); + } + } + var_316 = (byte)((byte)var_206); + var_50++; + byte actualArgs_330 = (byte)var_329; + boolean actualArgs_331 = (var_186>var_264)&&(var_107||(var_94>=var_19)); + boolean actualArgs_332 = actualArgs_331^var_10; + func_14(767817339, (short)var_166, (byte)actualArgs_330, actualArgs_331, actualArgs_332, var_264); + } + --var_79; + float actualArgs_369 = func_17(1663690426, array_198, var_12, (short)var_91, var_340, var_66); + float actualArgs_451 = func_18(var_430, var_66, array_221, var_90, var_66, (byte)var_79); + char actualArgs_452 = ((char)var_160); + char actualArgs_454 = func_9(var_90, var_429, (byte)var_361, (char)var_19, var_453, (byte)var_102); + MainClass actualArgs_467 = var_465.func_19(array_198, (char)var_103, (byte)var_316, var_54, (short)var_404, var_466); + int actualArgs_468 = func_16(actualArgs_369, actualArgs_451, (char)actualArgs_452, (char)actualArgs_454, actualArgs_467, (byte)var_361)<'},{'G','C'},{'q','i'},{'o',')','U','9','Q','0'},{'A','<','T','s','_','4'},{'^'}}; + int index_489 = (-28049)&array_488.length-1; + byte var_491 = (-3); + int index_490 = var_491&array_488[index_489].length-1; + index_490 = array_488[index_489][index_490]--; + array_492 = array_492; + } + int index_494 = ((byte)var_495)&array_493.length-1; + int index_496 = var_495&array_493.length-1; + array_493[index_496]--; + } + for (int id_497 = 23;id_497<59;id_497 += 5) + { + for (int id_498 = 32;id_498<39;id_498 += 1) + { + var_500 = "9 )\\8|62'n"+var_499; + var_503 = (char)(var_501/var_502); + var_499 = var_499|var_495; + int index_506 = 1947709853&array_505.length-1; + int index_507 = (-3456)&array_505[index_506].length-1; + int index_504 = ( +array_505[index_506][index_507])&array_492.length-1; + short var_509 = (-18943); + int index_508 = ((short)((byte)var_509))&array_492[index_504].length-1; + int index_510 = var_509&array_492.length-1; + int index_511 = index_510&array_492[index_510].length-1; + array_492[index_510][index_511] = array_492[index_504][index_508]&&true; + } + var_499 = var_503-var_499; + try + { + int index_512 = var_503&array_492.length-1; + int index_514 = var_503&array_505.length-1; + int index_516 = 669721418&array_505.length-1; + int index_517 = (((short)var_518)<array_505[index_599][index_600])) + { + var_499++; + int index_601 = var_545&array_563.length-1; + int index_602 = var_595&array_563[index_601].length-1; + array_563[index_601][index_602] = var_518; + } + else + { + if ((var_502==(var_566++))&&var_603) + { + int index_604 = 31490&array_563.length-1; + int index_605 = var_552&array_563[index_604].length-1; + int index_606 = index_599&array_563.length-1; + int index_607 = ((char)var_502)&array_563[index_606].length-1; + var_518 = array_563[index_606][index_607]; + var_500 = var_500+var_566; + } + else + { + var_500 = var_500+(-2.663504E7f); + int index_610 = var_503&array_505.length-1; + int index_611 = var_503&array_505[index_610].length-1; + int index_609 = array_505[index_610][index_611]&array_608.length-1; + int index_612 = var_545&array_608[index_609].length-1; + int index_613 = ((short)((short)var_530))&array_608[index_609][index_612].length-1; + int index_614 = ( ~var_580)&array_563.length-1; + int index_615 = index_610&array_563[index_614].length-1; + array_563[index_614][index_615] = array_608[index_609][index_612][index_613]--; + } + var_503 = var_523; + for (int id_616 = 13;id_616<35;id_616 += 3) + { + array_493 = array_493; + int index_617 = var_552&array_492.length-1; + int index_618 = ((char)(index_617-var_545))&array_492[index_617].length-1; + int index_619 = ((short)var_531)&array_573.length-1; + int index_621 = var_622&array_505.length-1; + int index_625 = var_503&array_505.length-1; + int index_627 = var_622&array_505.length-1; + int index_628 = ((short)( -var_518))&array_505[index_627].length-1; + int index_626 = array_505[index_627][index_628]&array_505[index_625].length-1; + int index_624 = array_505[index_625][index_626]&array_493.length-1; + int index_623 = ((char)array_493[index_624])&array_505[index_621].length-1; + int index_620 = array_505[index_621][index_623]&array_492.length-1; + int index_629 = ((char)var_501)&array_492[index_620].length-1; + array_492[index_620][index_629] = array_492[index_617][index_618]^array_573[index_619]; + } + try + { + var_503 = var_630; + var_500 = "aj(LnO2@Yo"; + var_499 = (-165283138); + } + catch (Exception e_3) + { + var_631 = var_622; + array_632 = array_632; + var_580 = (byte)var_633; + array_634 = array_634; + var_595 = var_499; + System.out.println( "=======Exception thrown======="+25); + } + finally + { + int index_635 = var_570&array_505.length-1; + int index_636 = var_545&array_505[index_635].length-1; + int index_637 = var_499&array_505.length-1; + int index_638 = (var_622--)&array_505[index_637].length-1; + var_545 = array_505[index_637][index_638]; + } + } + System.out.println( "=======Exception thrown======="+25); + } + int index_639 = var_633&array_563.length-1; + int index_640 = var_631&array_563[index_639].length-1; + return var_495==((byte)array_563[index_639][index_640]); + } +} +// DEPENDENCE: CrcCheckwithChar.java CrcCheckForObject.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/CrcCheckForObject.java b/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/CrcCheckForObject.java new file mode 100644 index 0000000000000000000000000000000000000000..1c164f2d1a9caca562d3eb44b3f30a9f56805b7b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/CrcCheckForObject.java @@ -0,0 +1,669 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.annotation.Annotation; +import java.io.*; +import java.lang.reflect.*; +import java.util.*; +public class CrcCheckForObject { + /** + * 执行反射方法后返回可观测值,打印到标准输出流 + *

+ * param result1 执行反射方法后返回的Object类型 param method 执行反射需调用的方法 param instance + * 方法调用的对象 param parameters 方法调用的参数列表 return null + */ + private static boolean showDebug = false; + public static int length = 0; + private static List resultlist = new LinkedList<>(); + private static List foundationtypes = new ArrayList<>(); + //apifuzz的whitelist.txt,現在不從文件里讀了 + private static ArrayList whitelist = new ArrayList(Arrays.asList("static final boolean java.util.concurrent.atomic.AtomicLong.VM_SUPPORTS_LONG_CAS", + "java.lang.reflect.AccessibleObject.override", + "private final int java.lang.ThreadLocal.threadLocalHashCode", + "private static java.util.concurrent.atomic.AtomicInteger java.lang.ThreadLocal.nextHashCode", + "int java.lang.ThreadGroup.nthreads", + "private static long java.lang.Thread.threadSeqNumber", + "private long java.lang.Thread.tid", + "private static final long java.util.concurrent.locks.ReentrantReadWriteLock.TID", + "transient java.util.Set java.util.HashMap.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private final long libcore.util.NativeAllocationRegistry.freeFunction", + "private transient long java.math.BigInt.bignum", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.io.File.PREFIX_LENGTH_OFFSET", + "private static final long java.util.concurrent.locks.StampedLock.WSTATUS", + "private static final long java.util.concurrent.locks.StampedLock.WTAIL", + "private static final long java.util.concurrent.locks.StampedLock.STATE", + "private static final long java.util.concurrent.locks.StampedLock.PARKBLOCKER", + "private static final long java.util.concurrent.locks.StampedLock.WNEXT", + "private final long java.util.SplittableRandom.gamma", + "private volatile long java.util.concurrent.atomic.AtomicLong.value", + "private static final java.util.concurrent.atomic.AtomicLong java.util.SplittableRandom.defaultGen", + "private long java.util.SplittableRandom.seed", + "private static final int java.util.concurrent.Exchanger.ABASE", + "private static final long java.util.concurrent.Exchanger.BLOCKER", + "private static final long java.util.concurrent.Exchanger.MATCH", + "private static final long java.util.concurrent.Exchanger.BOUND", + "private transient long java.util.Date.fastTime", + "private transient sun.util.calendar.BaseCalendar$Date java.util.Date.cdate", + "private final java.util.Date java.util.logging.SimpleFormatter.dat", + "private transient int java.lang.Object.shadow$_monitor_", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "private int java.io.BufferedWriter.nextChar", + "private int java.lang.StackTraceElement.lineNumber", + "private java.lang.String java.lang.StackTraceElement.methodName", + "private static final long java.lang.StackTraceElement.serialVersionUID", + "private java.lang.ClassLoader java.lang.Thread.contextClassLoader", + "private static volatile java.lang.Thread$UncaughtExceptionHandler java.lang.Thread.uncaughtExceptionPreHandler ", + "private static final long java.util.concurrent.ConcurrentHashMap.CELLSBUSY", + "private static final long java.util.concurrent.ConcurrentHashMap.SIZECTL", + "private static final long java.util.concurrent.ConcurrentHashMap.TRANSFERINDEX", + "private static final long java.util.concurrent.ConcurrentHashMap.BASECOUNT", + "private volatile long java.util.zip.ZStreamRef.address", + "private static final long java.util.concurrent.PriorityBlockingQueue.ALLOCATIONSPINLOCK", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.lang.String java.util.Locale.languageTag", + "private transient volatile int java.util.Locale.hashCodeValue", + "private static volatile java.util.Locale java.util.Locale.defaultDisplayLocale", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "transient java.util.Set java.util.HashMap.entrySet", + "private transient int java.lang.Object.shadow$_monitor_", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.util.Set java.util.Hashtable.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private volatile long java.lang.Thread.nativePeer", + "java.lang.ThreadLocal$ThreadLocalMap java.lang.Thread.threadLocals", + "private static final int java.util.concurrent.ConcurrentHashMap.ABASE", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final java.util.concurrent.atomic.AtomicLong java.util.Random.seedUniquifier", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed, private static final long java.util.Random.seedOffset", + "private static final long java.util.concurrent.Exchanger.SLOT", + "private static final long java.util.concurrent.locks.StampedLock.WHEAD", + "transient int java.util.HashMap.size", + "transient int java.util.HashMap.modCount", + "private static final long java.util.Random.seedOffset", + "boolean java.lang.reflect.AccessibleObject.override", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed", + "private java.lang.String java.lang.StackTraceElement.fileName", + "private java.lang.String java.lang.StackTraceElement.declaringClass", + "private transient java.lang.Object java.lang.Class.vtable", + "private transient java.lang.Class java.lang.Class.superClass", + "private transient java.lang.String java.lang.Class.name", + "private final java.lang.Class java.lang.reflect.Constructor.serializationClass", + "private transient dalvik.system.ClassExt java.lang.Class.extData", + "private transient long java.util.regex.Pattern.address", + "private transient volatile java.lang.Object java.lang.Throwable.backtrace", + "private transient java.lang.Object java.lang.Class.dexCache", + "private transient java.lang.ClassLoader java.lang.Class.classLoader", + "private transient java.lang.Class java.lang.Class.componentType", + "private transient long java.lang.Class.sFields", + "private transient int java.lang.Class.referenceInstanceOffsets", + "private transient int java.lang.Class.primitiveType", + "private transient int java.lang.Class.objectSizeAllocFastPath", + "private transient int java.lang.Class.objectSize", + "private transient int java.lang.Class.numReferenceStaticFields", + "private transient int java.lang.Class.numReferenceInstanceFields", + "private transient long java.lang.Class.methods", + "private transient java.lang.Object[] java.lang.Class.ifTable", + "private transient long java.lang.Class.iFields", + "private transient volatile int java.lang.Class.dexTypeIndex", + "private transient int java.lang.Class.dexClassDefIndex", + "private transient short java.lang.Class.copiedMethodsOffset", + "private transient int java.lang.Class.clinitThreadId", + "private transient int java.lang.Class.classSize", + "private transient int java.lang.Class.classFlags", + "private transient int java.lang.Class.accessFlags", + "private java.lang.Class java.lang.reflect.Field.declaringClass", + "private final java.lang.Class java.lang.reflect.Constructor.serializationCtor", + "private transient int java.lang.Class.status", + "private transient short java.lang.Class.virtualMethodsOffset", + "private int java.lang.reflect.Field.dexFieldIndex ", + "private int java.lang.reflect.Field.offset", + "private int java.lang.reflect.Field.accessFlags", + "private int fuzzapiinvoke.getInstance.ObjectNewInstance$MyThread1.ticket", + "private long java.util.regex.Matcher.address", + "transient long java.util.regex.Pattern.address", + "private int java.lang.reflect.Field.dexFieldIndex", + "private char[] java.io.BufferedWriter.cb", + "private java.lang.Class java.lang.reflect.Field.type" + )); + private static String[] ss = {"class java.lang.Character","class java.lang.Integer", + "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", + "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", + "class java.lang.Byte", "class java.lang.String", "class java.lang.StringBuffer", + "class java.lang.Character$UnicodeBlock", "class java.util.Locale", + "class java.lang.StringBuilder", "class [I", "class [S", "class [J", "class [F", "class [D", + "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", + "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", + "class [Ljava.lang.StringBuilder;"}; // 该数组存放此类可以处理用于计算CRC的数据类型 + private static ArrayList dealtypes = new ArrayList(); + + //輸出每個Object單獨的CRC值 + public static List CRCListForObjects(Object... results) { + List finalres = new ArrayList<>(); + for (Object result1: results) { + try { + if (showDebug) { + System.out.println("============================== CRCcheck(Param info) =============================="); + System.out.println("| result: "+result1); + System.out.println("==================================================================================="); + } + + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + finalres.add(run(obj)); // used to be "result1", solve the problem of object-array + } else { + finalres.add(1000000000L); + } + } + } else { + finalres.add(run(result1)); // resultthreadgroup is object} + } + } else { + // result1 is null + finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + return null; + } + } + return finalres; + } + + //輸出Object數組總的CRC值 + public static long totalCRCForObjects(boolean showFieldInfo, Object... results){ + showDebug = showFieldInfo; + initialize(); + for (Object result1: results) { + try { + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + calculatecrc(obj); + } else { +// finalres.add(1000000000L); + } + } + } else { + calculatecrc(result1); + } + } else { + // result1 is null +// finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + } + } + return getCRC(); + } + + public static long run(Object obj) throws Exception { + initialize(); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< START GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + calculatecrc(obj); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< END GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + return getCRC(); + } + private static void initialize(){ + Collections.addAll(dealtypes, ss); + String[] strings = {"class java.lang.Character","class java.lang.Integer", "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", "class java.lang.Byte"}; + Collections.addAll(foundationtypes, strings); + resultlist.clear(); + } + + private static void calculatecrc(Object result) throws Exception { + // deal with Object + if(result != null){ + String resulttype = result.getClass().toString(); + // deal with the problem of class StringBuilder, StringBuffer and String + // we can`t get the specific fields we wanted, cast these to string by toString + if(resulttype.equals("class java.lang.String") || + resulttype.equals("class java.lang.StringBuilder") || + resulttype.equals("class java.lang.StringBuffer") || + resulttype.equals("class java.lang.Character$UnicodeBlock") || + resulttype.equals("class java.util.Locale") || result instanceof Annotation){ + String ostring = result.toString(); + byte[] bytes = ostring.getBytes("UTF-8"); + calculatecrc(bytes); + return; + } + if (foundationtypes.contains(result.getClass().toString())){ + // if basic types: + resultlist.add(result); + switch (result.getClass().toString()) { + case "class java.lang.Byte": + length += 1; + break; + case "class java.lang.Short": + length += 2; + break; + case "class java.lang.Integer": + length += 4; + break; + case "class java.lang.Long": + length += 8; + break; + case "class java.lang.Float": + length += 4; + break; + case "class java.lang.Double": + length += 8; + break; + case "class java.lang.Char": + length += 2; + break; + case "class java.lang.Character": + length += 2; + break; + case "class java.lang.Boolean": + length += 1; + break;} + } else if(resulttype.startsWith("class [")) { + // array(contains multidimensional array) + if ("class [I".equals(resulttype)) { + //int[] + int[] intparam = (int[]) result; + for (int i : intparam) { + resultlist.add(i); + length += 4; + } + } else if ("class [S".equals(resulttype)) { + //short[] + short[] shortparam = (short[]) result; + for (short s : shortparam) { + resultlist.add(s); + length += 2; + } + } else if ("class [J".equals(resulttype)) { + //long[] + long[] longparam = (long[]) result; + for (long l : longparam) { + resultlist.add(l); + length += 8; + } + } else if ("class [F".equals(resulttype)) { + //float[] + float[] floatparam = (float[]) result; + for (float f : floatparam) { + resultlist.add(f); + length += 4; + } + } else if ("class [D".equals(resulttype)) { + //double[] + double[] doubleparam = (double[]) result; + for (double d : doubleparam) { + resultlist.add(d); + length += 8; + } + } else if ("class [Z".equals(resulttype)) { + //boolean[] + boolean[] booleanparam = (boolean[]) result; + for (boolean b : booleanparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [B".equals(resulttype)) { + //byte[] + byte[] byteparam = (byte[]) result; + for (byte b : byteparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [C".equals(resulttype)) { + //char[] + char[] charparam = (char[]) result; + for (char c : charparam) { + resultlist.add(c); + length += 2; + } + } else if ("class [Ljava.lang.Character;".equals(resulttype)) { + // Character[] + Character[] charparam = (Character[]) result; + for (Character c : charparam) { + resultlist.add((char)c); + length += 2; + } + }else if (resulttype.startsWith("class [[")){ + // 多维数组,降维 + for (Object o: (Object[]) result){ + calculatecrc(o); + } + }else if (resulttype.equals("[Ljava.lang.String")){ + // string类型的数组 + for(String s:(String[]) result){ + calculatecrc(s); + } + + } + else if(resulttype.startsWith("class [L")){ + // 非基础类型数组 + for(Object o:(Object[])result){ + calculatecrc(o); + } + } + }else{ + // 该分支处理非基础类型对象, 先获取对象下指定层数的域和值,将最终结果中可用于计算CRC校验的值作为参数递归调用本方法 + // 首先取得首次传入的实例的域,若域的值可直接用于(包括基础类型和在本方法中特殊处理的其他类型)CRC计算,则不进入下一次获取域的循环 + // 最终获取的域和对应的值都有序的存放在getfaieldvalue()返回的map中 + // 接着对map进行遍历获取其中的值如若是本方法除此分支之外的其他分支可处理的类型则以value为参数递归调用,否则只将其输出在运行日志中 + //System.out.println("```````````````````````````get field`````````````````````````````````````````````"); + Mapmap = getFieldValue(result, 3); + //System.out.println("`````````````````````````get field end```````````````````````````````````````````"); + for(Map.Entry entry: map.entrySet()) { + Field key = entry.getKey(); + Object value = entry.getValue(); + //当field为基础类型或者string stringbu*** character数组时将数组信息打印出来 + String[] basicarray = new String[]{"class [I", "class [S", "class [J", "class [F", "class [D", "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", "class [Ljava.lang.StringBuilder;"}; + List basiclist = Arrays.asList(basicarray); + if(showDebug) { + if (basiclist.contains(key.getType().toString())) { + String str = key.getType().toString(); + switch (str) { + case "class [I": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((int[]) value)); + break; + case "class [S": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((short[]) value)); + break; + case "class [J": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((long[]) value)); + break; + case "class [F": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((float[]) value)); + break; + case "class [D": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((double[]) value)); + break; + case "class [Z": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((boolean[]) value)); + break; + case "class [B": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((byte[]) value)); + break; + case "class [C": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((char[]) value)); + break; + case "class [Ljava.lang.Character;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((Character[]) value)); + break; + case "class [Ljava.lang.String;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((String[]) value)); + break; + case "class [Ljava.lang.StringBuffer;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuffer[]) value)); + break; + case "class [Ljava.lang.StringBuilder;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuilder[]) value)); + break; + } + } else if (key.getType().toString().contains("[[")) { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.deepToString((Object[]) value)); + } else { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + value); + } + } + + if(value != null && dealtypes.contains(value.getClass().toString())){ + if(!whitelist.contains(key.toString())){ + // 如果为基础类型或者需要特殊处理的object类型且没在whitelist中则再次调用本身,否则只在控制台打印出来对象信息 + calculatecrc(value); + } + } + } + } + } + } + /* + 接受object类型参数,向下获取实例类的域两次 + : reutrn 返回包含域对象和对应的value的键值对的map + */ + private static Map getFieldValue(java.lang.Object obj, int length){ + Map map = new LinkedHashMap<>(); + Field[] rootf = obj.getClass().getDeclaredFields(); + //sort + rootf = CrcCheckForObject.sortFieldArray(rootf); + if(rootf == null){ + return map; + } + List cur_objs = new ArrayList<>(); + List next_objs = new ArrayList<>(); + // 先获取传入参数的域和对应的值, 放入map中, value 放入 cur_objs中 + //System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^root field : value^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); + for(Field f: rootf){ + if(whitelist.contains(f.toString())){ + continue; + } + //System.out.println("< which field: >" + f.toString()); + f.setAccessible(true); + java.lang.Object o; + try { + o = f.get(obj); + map.put(f,o); + } catch (IllegalAccessException e) { + o = null; + map.put(f, null); + } + next_objs.add(o); + //System.out.println("< field value: >" + o); + } + //System.out.println("------------------------------root end------------------------------------"); + while( length > 1){ + cur_objs.clear(); + cur_objs.addAll(next_objs); + next_objs.clear(); + for(Object o:cur_objs){ + if(o == null ){ + continue; + } + if(dealtypes.contains(o.getClass().toString())){ + //如果为基础类型则不向下获取实例的域 + continue; + } + Field[] fs = o.getClass().getDeclaredFields(); + fs = sortFieldArray(fs); + if(fs == null){ + continue; + } + for(Field fi: fs){ + + //System.out.println("< which field: >" + fi.toString()); + if(whitelist.contains(fi.toString())){ + continue; + } + fi.setAccessible(true); + Object oc; + try{ + oc = fi.get(o); + }catch(IllegalAccessException e){ + oc = null; + } + //System.out.println("< field value: >" + oc); + + map.put(fi, oc); + next_objs.add(oc); + } + } + length -= 1; + } + + return map; + } + + private static long getCRC () { + CrcBuffer b = new CrcBuffer(length); + for (Object obj:resultlist){ + if (obj.getClass().toString().equals("class java.lang.Byte")) { + CrcCheckwithChar.ToByteArray((byte) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Short")) { + CrcCheckwithChar.ToByteArray((short) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Integer")) { + CrcCheckwithChar.ToByteArray((int) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Long")) { + CrcCheckwithChar.ToByteArray((long) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Float")) { + CrcCheckwithChar.ToByteArray((float) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Double")) { + CrcCheckwithChar.ToByteArray((double) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Boolean")) { + CrcCheckwithChar.ToByteArray((boolean) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Character")) { + CrcCheckwithChar.ToByteArray((char) obj, b); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer, 0, b.i); + return c.getValue(); + } + + /** + * 进行Field[]排序 + */ + public static Field[] sortFieldArray (Field[] fields){ + if (fields == null || fields.length == 0) { + return null; + } + List flist = Arrays.asList(fields); + Collections.sort(flist, new FieldComparator()); + + return (Field[]) flist.toArray(); + } +} +/* + * sort the field array by field`s name + * + * */ +class FieldComparator implements Comparator{ + @Override + public int compare(Field f1, Field f2){ + return (f1.toString()).compareTo(f2.toString()); + } + +} + + +class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf(" +Fail to Get CRC! + Calculation=%d LookupTable=%d +",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xffffffffL; + } + +} diff --git a/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/CrcCheckwithChar.java b/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/CrcCheckwithChar.java new file mode 100644 index 0000000000000000000000000000000000000000..6b2e64a2d7f8dbf3f7513433b8de5fd9032cd52b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/CrcCheckwithChar.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.Double; + +class CrcBuffer { + int i = 0; + static int buffer_counter = 0; + byte[] buffer; + + CrcBuffer(int size) { + this.buffer = new byte[size]; + buffer_counter++; + //System.out.printf("Buffer-Counter=%d\tLength=%d\n", buffer_counter, size); + } +} + +public class CrcCheckwithChar { + /**************************************************************/ + static boolean isVerbose = false; + + public static void ToByteArray(char args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(byte args, CrcBuffer b) { + b.buffer[b.i] = args; + b.i++; + } + + public static void ToByteArray(short args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(int args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(long args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(boolean args, CrcBuffer b) { + if (args) { + b.buffer[b.i] = 0x01; + } else { + b.buffer[b.i] = 0x00; + } + b.i++; + } + + public static void ToByteArray(float args, CrcBuffer b) { + int iargs = Float.floatToIntBits(args); + b.buffer[b.i] = (byte) ((iargs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (iargs & 0xff); + b.i++; + } + + public static void ToByteArray(double args, CrcBuffer b) { + long largs = Double.doubleToLongBits(args); + b.buffer[b.i] = (byte) ((largs >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (largs & 0xff); + b.i++; + } +} diff --git a/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/Start.java b/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..1a690df3ae74c6224e08e5dc289efd83b2909a8b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/1233_2019091603087/Start.java @@ -0,0 +1,3554 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +// this is a test!!!!!!! +// seed : 1567599011574 +import java.util.*; +public class Start +{ + protected static MainClass var_1583 = new MainClass(); + public static void getCheckSum() + { + System.out.println( "=======getCheckSum======="); + long crc = CrcCheckForObject.totalCRCForObjects(false, var_1583, new Class_3(), new Class_4(), new Class_5(), new Class_6(), new Class_7()); + System.out.println("CheckSum:"+crc); + } + public static void main(String[] args_0) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + var_1583.run(); + getCheckSum(); + //这是一个空语句 + } +} +class MainClass +{ + private static char var_1 = 'u'; + static String var_23 = ";F;QkdE-YS"; + protected static int var_101 = (-1039209187); + static Class_5 var_211 = new Class_5(); + public static short var_212 = 16859; + static byte[][] array_213 = new byte[][]{{(-90),(-69),14,91,(-127),104,62},{108,5,31},{(-100),107,(-110),(-113)}}; + public static boolean var_215 = true; + static long var_224 = 6992238244334689613L; + public static short var_225 = 12250; + private static float var_226 = (-1.15516659E9f); + public static boolean[][] array_243 = new boolean[][]{{false,false,false,true,false,false},{false,true}}; + public static double var_268 = 7.847222660364724E8d; + protected static int var_274 = (-1171053516); + static char var_276 = '-'; + protected static boolean var_278 = true; + public static int var_279 = (-1962231815); + static boolean var_281 = true; + protected static float var_282 = (-2.66356864E8f); + public static float var_283 = (-3.95936864E8f); + public static short[] array_294 = new short[]{(-8846),(-1329),(-24406),(-5605),20637,810,30063,28737}; + private static int var_295 = (-663355905); + protected static double var_302 = (-2.793764562311597E8d); + public static String var_303 = "~G1t1dPxlz"; + public static char var_305 = '/'; + static short var_306 = (-14098); + static Class_4 var_330 = new Class_4(); + private static boolean var_335 = true; + private static short var_336 = 11719; + static int[][][] array_339 = new int[][][]{{{1432734567,(-795018320)},{(-1939857893)},{1955129371,(-831077379),779657562,1552248335},{2084562338,564471974,(-1838330458),1814492852,(-257261008),1184178279},{(-962163889),(-1292155948),(-1886126503)}},{{(-364530837)},{(-607229866),691324627,(-811738360),(-1847670431)},{69729057,921417842},{1169486046,531527647}},{{359757632,1048439345,991800650,596003211,(-556724133)},{1229318474,2082681445,1121942428,818995724,270514489},{1914174818,(-120390843)},{1685249786,556632451,411745905}},{{230538695,(-1182549734),768948880,395197977},{(-756562851),(-511718482),(-590241575)}},{{(-291909191),1432622126,524007179},{(-1734530818),(-690485610),(-1504592830),1816404759},{(-1736369435),(-1605397675)},{(-1770001671)},{197845570,740037177,(-1297144753),444059949,228561535},{(-2012798685),1107212529,694242164,(-299365330)},{31214386}}}; + protected static String var_345 = "zBY[vPahC("; + public static boolean var_346 = true; + public static short var_347 = 10555; + private static short var_350 = 23300; + public static float[] array_370 = new float[]{9.6240877E8f,2.58299888E8f}; + protected static short var_372 = (-31951); + static char var_379 = '7'; + protected static byte var_381 = (-72); + private static int var_384 = (-19946921); + public static String var_548 = "L1lhd=E'#U"; + static Class_6 var_585 = new Class_6(); + protected static boolean var_596 = false; + private static float[] array_600 = new float[]{(-1.70001523E9f),(-8.0729632E8f),(-5711550.0f),(-1.15109722E9f),1.31999117E9f,(-6068689.0f)}; + private static float var_604 = (-5.9343066E8f); + protected static short var_609 = 25225; + private static int var_615 = (-956360741); + protected static char var_616 = 'x'; + static byte var_635 = (-28); + public static String var_639 = "I.v00XHwdI"; + static Class_3 var_645 = new Class_3(); + static boolean var_648 = false; + public static char var_660 = '\\'; + public static char var_669 = 'a'; + static int var_670 = 849894392; + private static short var_673 = (-9160); + protected static boolean var_676 = true; + static boolean var_677 = true; + protected static int var_679 = (-1197464475); + static int[] array_682 = new int[]{(-1668032037)}; + private static short var_691 = (-15210); + public static double var_693 = (-9.521891283359936E8d); + static Class_6[][][] array_695 = new Class_6[][][]{{{new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6()},{new Class_6()},{new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6()},{new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()}}}; + public static double var_700 = 4.130658852757883E8d; + static MainClass var_707 = new MainClass(); + static String var_708 = "Le+X2[PkD)"; + static char var_711 = '2'; + public static boolean var_715 = true; + private static boolean var_717 = false; + public static int var_720 = 1238557203; + public static boolean var_724 = true; + public static String[][] array_726 = new String[][]{{"b#`=0ob`z<","U&ZmEu7$id","-n>f^8;gQ\"","K.cV?U,h|*"},{"]y!?T !$88","Ny>'Q_x^T.","_f5LVN3+S`","*#kQSJO)G ","];%5 \\bcUs"},{"dYW?Ph*][N",".h4Vv`EB?q","6i3:~U&gfj","e|\"!-3UPW~"},{"~1f~uqf$yN",":#Do/ghin^","BV`#nSM9DX"},{"|)HW6","[YtPO4[~bK"}}; + static short[][][] array_727 = new short[][][]{{{31277,14383},{24288,(-9003),(-16084),19257,(-10035),(-3341)},{18140,(-16987),31759,(-17875),22003},{31653}},{{14444,12532,11284,(-32681)},{16043,(-14645)}},{{(-25862)}},{{(-5657),(-19010),26447},{24867},{4077,3910}}}; + static boolean var_728 = true; + public static long var_736 = 4449485167732263873L; + public static byte var_741 = 24; + private static byte var_742 = (-26); + static int var_746 = (-739746959); + public static Class_3 var_754 = new Class_3(); + private static char var_760 = 'm'; + public static char var_764 = 'd'; + protected static int[][] array_775 = new int[][]{{(-302029087),335451334},{259031743},{(-201858039),(-1814694820),1949955228,361061252},{(-1510061134),1696425349}}; + static short var_779 = 29190; + static boolean var_784 = true; + protected static char[] array_785 = new char[]{'8','a','&'}; + protected static short[] array_789 = new short[]{20018,27418,(-18554),17602,(-13125)}; + protected static boolean var_805 = true; + protected static short var_818 = 23397; + private static byte var_822 = (-109); + private static short[] array_827 = new short[]{(-30194),19872,12329,10891,(-22645)}; + protected static short var_828 = 31835; + public static int[] array_871 = new int[]{319105371,(-1459009168),1203833312,(-1232091159),17471169,(-638884453)}; + private static char var_875 = '='; + private static char var_876 = 'O'; + protected static double var_885 = (-3.242500490416877E8d); + public static String[][] array_886 = new String[][]{{"(Im;\"M?= /","x5_))#yO6","("},{"j tB^'3EZ6"},{"L`7@v|vm]I","-/GT:(PWf]"},{"dWTBcYJ4&","GR'KlDc 0\"","g~HW8)6bS=","P[pz=qXyY.","FG\\OC\"RdJ \":/\\=y","?v[Sh:8D1 "}}; + private static boolean var_894 = false; + private static boolean var_895 = false; + private static char var_899 = '1'; + static double var_901 = 1.0599469807620634E9d; + static byte var_903 = (-91); + private static char[] array_916 = new char[]{'k','X','~','_'}; + protected static boolean var_921 = false; + static byte var_922 = (-11); + public static char var_931 = 'j'; + public static double[][][] array_932 = new double[][][]{{{1.7341120670227253E8d,(-1.287458527702671E9d),(-4.196587166923516E8d),3.967960401528755E8d,(-1.6481828487583923E8d)},{(-1.5087596645390995E9d)},{1.277913813482186E8d,7.729384492421182E8d}},{{(-1.5535646384906733E8d),(-4.020328004659879E8d),(-1.0868247664062463E8d),(-4.429338492548988E8d),(-5.901362522419078E7d)},{(-1.3789055541137257E9d),1.0795239674844155E9d,2483047.6021944783d,4.550733302428823E8d},{(-3.618800011766973E8d)},{4.3526749671567523E8d,(-1.2372198237113097E8d),(-1.47807480289139E9d)},{(-1.4838782629146302E9d),(-3.0204335313204515E8d),3.7490261871794057E8d},{(-4.43696736955449E8d),2.024435221617093E8d}},{{1.3219405572704518E8d,6.869811219633003E8d,4.2223187347076625E7d,(-7.403363029248438E8d)},{1.879655911783002E8d,(-1.4468771584552267E8d),8.308576194998187E8d,5.316572538197464E8d},{9.29992233160231E7d,7.34355639651945E8d,7.931074799581026E7d,(-9.81470574687041E8d)},{(-1.6500943769461205E9d),2.8601625110143967E7d},{1.1236249240750526E8d,(-3.774828315504114E8d),4.4665539078554615E7d},{1.4887639784518285E9d,(-8.127604924158232E8d),(-1.6908315593139648E9d)}},{{1.4246168957105628E8d,3.3130046876755404E8d,5.901386046793851E8d},{(-7.086888640986454E7d),6.436172236928048E8d,8.750394640874125E8d,4.2668456157373214E8d},{2.435666495336031E8d,2.6604323686432594E8d,(-1.3751455708316312E9d)}}}; + private static int var_941 = (-329674143); + protected static int var_943 = 1389389174; + public static byte var_946 = (-93); + static double[][][] array_948 = new double[][][]{{{(-8.255449651841143E8d),(-3.209730639279295E8d),(-5.723986908682141E8d)},{1.3609357953267604E8d,(-3.763547864121457E8d),2.2994558501991045E7d},{3.2394658279917043E8d,(-4.3574603016537195E8d),6.510755379060494E8d,2.5674684658937386E8d,(-4.295816361579436E8d)}},{{(-1.311706885757901E9d),(-1.3665400045769448E9d),1.454000561704956E9d},{(-1.550097906071815E8d),(-1.0145557887587775E9d)},{3.007010800981328E8d,(-1.371640893117544E8d)}},{{(-4.8416551160162044E8d),4.004407810774081E8d},{(-1.5474429040522957E9d),(-8.74298587661315E8d),4.9908547717293733E8d,(-1.1005610909245688E7d),1.5946549878656259E9d,5.987894783666288E7d,2.143890262354935E8d},{(-9067514.985293811d),(-6.096784797991985E8d)},{(-3.658273753294635E8d),1.2297135999172962E9d,2899319.8289574105d,(-1.5070994614646256E8d),(-1.9383922412123233E8d)}},{{1.2151490275833673E9d,7.000393955907094E7d,3.62687292519762E8d,(-1.0680066504518546E8d),(-1.708882723894727E8d),885463.9655178668d},{(-8.016251555216576E7d),(-2.242623530270114E8d),(-9.33144683158739E8d),2.4128147824929675E8d,(-3.825315133325176E8d)},{3.931549103259513E8d,5.1514615027685744E8d}}}; + private static String var_954 = "bVNz88=;:a"; + public static byte var_975 = 32; + static double var_978 = (-6.3600276188271895E7d); + public static char var_986 = 'x'; + public static int var_987 = 1835339243; + private static boolean var_988 = true; + static byte var_997 = 37; + static float var_999 = 7.4130925E8f; + protected static boolean var_1006 = true; + protected static double var_1013 = (-9.77660106765409E8d); + public static boolean var_1014 = false; + protected static byte[] array_1017 = new byte[]{(-6),(-75)}; + protected static Class_7[] array_1023 = new Class_7[]{new Class_7(),new Class_7(),new Class_7()}; + protected static boolean var_1054 = false; + static boolean[][] array_1058 = new boolean[][]{{true,true,true},{true,false},{true,false,true,true,false},{true,true,false,false,true,false}}; + private static Class_6 var_1070 = new Class_6(); + private static boolean[][] array_1082 = new boolean[][]{{false,false,true,false},{false},{false,false,true,false},{true,false,false,false}}; + static String var_1083 = "b#(]/U`F**"; + private static byte var_1093 = (-111); + public static Class_5 var_1094 = new Class_5(); + static int var_1109 = 1963062697; + static short[][][] array_1111 = new short[][][]{{{(-6257),18560,25970,(-26817),(-14737),4625},{11127,14862,(-29918),16273},{21006,2799,(-3348)}},{{9032,8919,10350,25136,(-24957)}},{{31597,(-7758),(-10004),9773},{(-26065),(-16131),(-26294)},{(-17490),(-1589),(-14837)},{31347,(-4944),11303,(-21678)},{(-15123),18941,(-21998),10581},{(-15756),12356,(-8165),(-10829)}},{{24042,(-22770),18716},{(-32296),3094,(-14867)},{11772}},{{11625,1368,17054,(-9015)},{(-23840),(-7183),3058,18290},{(-21862),19770,(-3736)},{(-14368),(-29591)}},{{(-6244),(-8849),29061},{4337,(-21125)},{(-26129)}}}; + protected static int[] array_1124 = new int[]{(-74784838),1109732025,1919820071,(-1276463143),(-1318654773)}; + public static short var_1133 = 24390; + static double var_1135 = 4.294944645478408E8d; + static String var_1142 = "BNBbL?B!\\q"; + protected static char var_1144 = 'q'; + static boolean var_1150 = false; + public static double var_1166 = 6.524492449740164E7d; + private static char var_1171 = 'p'; + protected static byte var_1187 = 79; + public static String var_1194 = "q|pM$KyXwy"; + static String[][] array_1195 = new String[][]{{"-1X8,s&OJ\"","0y\"wsW;Z\\8","?qR;#FE!C4","BPheb)7\"Sw","i3jI&RK|JR"},{"GW\\l>5K(9_","]xZQ2t$]t$","s:C>9t)670","A#(lexK[;%"},{"b/hQ~.z~tI","g;J<|\\OhW","qE^\"l6;6iX"},{"TuLwF0E=:E"},{">(%+3P0k! ","EZ +LW?[_(","@+bn*;Kky","ppRDCl+&zh"},{"E?bz\"'Y 9Z","5IM`]nzf[,","v|K80#|ofR","%42l`-?G.P","PUZl>y5\\~)","npfCqoR[\"N","0Z^^H1lLbM"},{"k'O)i!-M"}}; + private static char var_1199 = 'K'; + protected static byte var_1219 = 113; + private static boolean[] array_1220 = new boolean[]{false,false,true}; + private static Class_4 var_1222 = new Class_4(); + protected static char var_1232 = '&'; + static short var_1240 = 27895; + protected static byte var_1273 = (-115); + static byte var_1276 = (-37); + static boolean var_1278 = true; + public static float[][][] array_1299 = new float[][][]{{{(-1.156896E9f)},{(-3.90442784E8f),1.06148115E9f,(-1.77057395E9f)},{2.77438656E8f,9.7317626E8f}},{{(-1.3694032E8f),6.1226656E8f},{2.1449456E8f,(-1.03157523E9f)},{(-6.0009562E8f),2.856314E7f,1.41056858E9f,1.09280256E9f,(-4.6903888E8f),(-7869879.5f),(-1.35370778E9f)}}}; + static byte var_1304 = 78; + private static String var_1307 = "_4bvHe&YA/"; + private static int var_1317 = 1942693526; + private static String var_1348 = "^-><$Vj/"; + private static Class_6 var_1361 = new Class_6(); + protected static byte var_1365 = 57; + static boolean var_1367 = true; + protected static char var_1369 = 'y'; + public static int[][] array_1396 = new int[][]{{(-787008442),1983924194,1715648074},{(-1388658037),(-151697169),1775212329,125768225,(-623504054),880481197},{795814449,1323505173,(-1533146350),(-606822527)},{2084070717,1431646325,821290176,292161060,1257762394},{(-11497792),1678176415,(-1567912760),1191519626},{1104875410,1675739172,983632992,34979136,2086761123}}; + public static long var_1401 = (-8725187397060740159L); + protected static short var_1410 = 27163; + protected static int[] array_1412 = new int[]{(-1297835123),(-1681831320),1153747042,1399183572}; + private static int[][][] array_1421 = new int[][][]{{{861470088,1696229577,(-1210421179),(-302445196)},{276699817,1794649361,(-473321562),863037199},{(-1937557892),1054431155,1937043539,428715134,287272653,(-1704813559)}},{{748604944,1105242230,(-269094309),(-1830451356),(-1197681004),157222575},{1529397569,1382291820,935982797,(-1611841650),(-2004131204),1766836974},{(-1494588137),1855998387,(-1424267466),1504714761,(-295385052),1851064103,(-1210947932)},{(-1593560088),1364706624,(-883817894),97777595,1452735640}},{{609322340},{(-1185578325),(-686702082),(-368683083),(-300982879),(-349628931)},{(-291464829),(-2042946567),(-96140557),(-417556082),(-592039930)},{(-1221405144),110006663,(-940301477)},{2116553050,1949051056,1436718849,1530223000,385942507}},{{(-340133674)},{1362447184,(-1221535434),309090104},{597037712,1456739385,(-179659624),1080123594,(-38819436),(-647591562),(-233216302)}},{{470754529,1695745608,(-803466349),1491159016},{1519503967,(-593219509),1358265633,1193811589,(-905486848),(-2068762624),(-13756685)},{(-1328335848),1112701238,(-47630853)},{(-473299944),81638545},{(-788309918),(-1233103243),1744792925,(-2005465470)},{(-1482022615),(-753974777),(-1372059885),111421945}}}; + static short var_1428 = (-28741); + public static short var_1434 = 25297; + static Class_5 var_1435 = new Class_5(); + protected static String var_1436 = "'pDo:T5uA|"; + public static int var_1443 = 1953103054; + static short var_1451 = 8902; + public static int var_1456 = 658413446; + public static int var_1479 = (-1942169694); + public static boolean var_1483 = true; + static boolean var_1497 = false; + protected static MainClass[] array_1501 = new MainClass[]{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()}; + protected static long var_1505 = (-7762010960839063293L); + static Class_7 var_1507 = new Class_7(); + private static byte var_1516 = (-113); + protected static byte var_1520 = 0; + protected static char var_1522 = 'X'; + private static double var_1529 = (-4.4151499862665296E8d); + protected static char var_1531 = 'U'; + private static float var_1537 = 7.7697715E8f; + private static String var_1541 = "fzEXtF3s_c"; + public static String var_1546 = "&&!rXJWRP"; + static String var_1561 = "7t^-|DT*~:"; + public static byte var_1573 = (-34); + private static char var_1577 = '!'; + static char[] array_1580 = new char[]{'D','e','J','J','1','!','B','|'}; + private byte func_9(Class_4 args_218, String args_219, int args_220, char args_221, short args_222, char args_223) + { + String var_244 = "E`[l#jg:[$"; + Class_3[][][] array_247 = new Class_3[][][]{{{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3()}},{{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3()}},{{new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3()},{new Class_3()},{new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3()}}}; + double var_280 = (-1.0682309303907183E8d); + boolean var_292 = false; + boolean var_293 = false; + short[][][] array_296 = new short[][][]{{{13777,7492,14722,(-32047)},{20575,763,(-3435),15137}},{{24407,(-30062),(-20905),30575,27414},{2081},{(-54),5331,(-12138)},{9885,13607},{(-28961)}},{{(-1595),370,(-10135)},{1204},{20439,(-776)},{6775,(-1661),6700,(-26368)},{23745,30831,(-27422),32276},{27238,18883,(-2131),(-17170)},{(-10316),24142,(-1026),20706,27338}}}; + byte var_299 = (-19); + int var_301 = 1977741968; + Class_5 var_314 = new Class_5(); + MainClass[][][] array_360 = new MainClass[][][]{{{new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass()}},{{new MainClass(),new MainClass()}},{{new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()}},{{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass()}}}; + try + { + --var_1; + try + { + ++var_212; + try + { + var_215 = var_215; + var_215 = var_215; + var_212 = (short)(((short)var_224)*var_224); + var_225 = var_225; + } + catch (Exception e_3) + { + var_226 = +(var_212*(-4)); + int index_227 = var_101&array_213.length-1; + int index_228 = var_1&array_213[index_227].length-1; + array_213[index_227][index_228] = 72; + System.out.println( "=======Exception thrown======="+14); + } + for (int id_229 = 14;id_229<59;id_229 += 12) + { + var_215 = var_215; + var_215 = true; + int index_230 = (-49)&array_213.length-1; + int index_232 = ((short)var_1)&array_213.length-1; + int index_233 = var_1&array_213[index_232].length-1; + int index_231 = array_213[index_232][index_233]&array_213[index_230].length-1; + int index_234 = var_1&array_213.length-1; + int index_237 = index_231&array_213.length-1; + int index_238 = index_233&array_213[index_237].length-1; + int index_236 = ((char)array_213[index_237][index_238])&array_213.length-1; + int index_239 = ((char)var_101)&array_213[index_236].length-1; + int index_235 = array_213[index_236][index_239]&array_213[index_234].length-1; + int index_240 = var_225&array_213.length-1; + int index_241 = ((byte)(-1.4650901E7f))&array_213[index_240].length-1; + array_213[index_240][index_241] = array_213[index_234][index_235]; + } + try + { + double var_242 = (-4.0838446328091025E8d); + var_242 = var_242; + var_1 = var_1; + array_243 = array_243; + } + catch (Exception e_3) + { + var_244 = var_23; + var_101 = var_101; + int index_245 = var_212&array_213.length-1; + int index_246 = var_1&array_213[index_245].length-1; + var_1 = (char)((char)(array_213[index_245][index_246]--)); + System.out.println( "=======Exception thrown======="+15); + } + } + catch (Exception e_2) + { + int index_249 = var_225&array_213.length-1; + int index_250 = ((short)(-2))&array_213[index_249].length-1; + int index_248 = array_213[index_249][index_250]&array_247.length-1; + int index_251 = var_225&array_247[index_248].length-1; + int index_252 = index_251&array_247[index_248][index_251].length-1; + int index_253 = index_252&array_247.length-1; + int index_254 = (var_1+((short)var_1))&array_247[index_253].length-1; + int index_255 = ((char)((char)var_212))&array_247[index_253][index_254].length-1; + int index_257 = var_1&array_213.length-1; + int index_258 = var_225&array_213[index_257].length-1; + int index_256 = (array_213[index_257][index_258]--)&array_247.length-1; + int index_259 = var_225&array_247[index_256].length-1; + int index_260 = index_252&array_247[index_256][index_259].length-1; + array_247[index_256][index_259][index_260] = array_247[index_253][index_254][index_255]; + System.out.println( "=======Exception thrown======="+16); + } + finally + { + int index_261 = ((char)var_101)&array_213.length-1; + int index_264 = ((var_1-var_101)|((byte)(-5.439104038344609E8d)))&array_213.length-1; + int index_265 = index_264&array_213[index_264].length-1; + int index_263 = array_213[index_264][index_265]&array_213.length-1; + int index_267 = ((byte)var_268)&array_213.length-1; + int index_270 = ((byte)(var_212-var_224))&array_213.length-1; + int index_271 = ((byte)(var_226--))&array_213[index_270].length-1; + int index_269 = array_213[index_270][index_271]&array_213[index_267].length-1; + int index_266 = array_213[index_267][index_269]&array_213[index_263].length-1; + int index_262 = array_213[index_263][index_266]&array_213[index_261].length-1; + int index_272 = ((char)var_101)&array_213.length-1; + int index_273 = var_274&array_213[index_272].length-1; + int index_275 = var_276&array_213.length-1; + int index_277 = 56&array_213[index_275].length-1; + array_213[index_275][index_277] = array_213[index_272][index_273]; + } + var_212 = var_212; + if (( !(var_226==var_226))||(var_225!=var_225)) + { + if (var_278) + { + var_1 = var_276; + var_215 = var_215; + var_279 = var_274; + var_215 = true; + var_280 = var_268; + } + var_1 = var_276; + var_226 = var_226; + var_101 = var_274; + if (var_281) + { + var_282 = +( ~var_212); + var_212 = (short)var_226; + var_268 = var_283*((short)((short)var_225)); + } + else + { + int index_284 = ((short)var_276)&array_213.length-1; + int index_285 = var_212&array_213[index_284].length-1; + array_213[index_284][index_285] = (byte)var_225; + } + ++var_1; + } + else + { + int index_286 = var_276&array_213.length-1; + int index_288 = ((char)((byte)var_225))&array_213.length-1; + int index_289 = ((short)var_276)&array_213[index_288].length-1; + int index_287 = array_213[index_288][index_289]&array_213[index_286].length-1; + int index_290 = ((char)(var_282+var_225))&array_213.length-1; + int index_291 = var_225&array_213[index_290].length-1; + array_213[index_290][index_291]++; + } + } + catch (Exception e_1) + { + var_292 = var_215; + if (var_293) + { + try + { + var_279 = 947468966; + var_1 = 'm'; + array_294 = array_294; + } + catch (Exception e_3) + { + array_243 = array_243; + var_226 = var_226; + System.out.println( "=======Exception thrown======="+18); + } + finally + { + var_226 = (-5.4055898E8f); + var_276 = 't'; + var_279 = +((byte)(var_274--)); + var_274 = var_279; + var_23 = var_244+((byte)(var_295>>var_224)); + var_268 = ((short)((byte)327141918))*(var_279>>>((char)var_226)); + } + var_280 = +var_282; + ++var_276; + try + { + var_215 = var_215; + var_283 = var_282; + } + catch (Exception e_3) + { + var_215 = true; + int index_297 = (-26854)&array_296.length-1; + int index_298 = ((char)(var_225+var_299))&array_296[index_297].length-1; + int index_300 = var_299&array_296[index_297][index_298].length-1; + var_215 = (var_282+var_226)>=array_296[index_297][index_298][index_300]; + System.out.println( "=======Exception thrown======="+19); + } + finally + { + array_247 = new Class_3[][][]{{{new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3()}},{{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()}},{{new Class_3(),new Class_3()},{new Class_3()},{new Class_3(),new Class_3(),new Class_3(),new Class_3(),new Class_3()}}}; + var_23 = ((var_23+var_292)+var_301)+var_274; + var_1 = var_1; + var_279 = var_299+((byte)var_302); + } + try + { + var_225 = (short)((char)var_299); + var_268 = var_268; + int index_304 = (( ~var_299)*((char)var_299))&array_294.length-1; + var_23 = (var_303+(-63))+(array_294[index_304]&var_301); + var_1 = var_305; + var_215 = var_215&&var_292; + } + catch (Exception e_3) + { + var_306 = var_212; + int index_307 = var_299&array_213.length-1; + int index_308 = ((byte)'M')&array_213[index_307].length-1; + var_305 = (char)array_213[index_307][index_308]; + int index_309 = (-972837364)&array_213.length-1; + int index_311 = var_306&array_296.length-1; + int index_312 = (-11378)&array_296[index_311].length-1; + int index_313 = var_295&array_296[index_311][index_312].length-1; + int index_310 = ((char)array_296[index_311][index_312][index_313])&array_213[index_309].length-1; + array_213[index_309][index_310] = var_299; + System.out.println( "=======Exception thrown======="+20); + } + } + else + { + ++var_224; + var_279 = var_1/(1|(var_276|((char)var_299))); + if (((byte)var_280)<=var_268) + { + var_299 = (byte)'I'; + var_314 = var_211; + int index_315 = var_305&array_213.length-1; + int index_316 = var_279&array_213[index_315].length-1; + var_274 = array_213[index_315][index_316]/(1|var_306); + int index_317 = var_305&array_294.length-1; + array_294[index_317] = var_212; + } + else + { + var_244 = var_303; + var_292 = var_276!=((char)var_276); + var_1 = var_1; + var_306 = (-30492); + } + for (int id_318 = 14;id_318<75;id_318 += 9) + { + var_306 = (short)'1'; + var_292 = (( +var_212)<=var_212)&&(var_279<=1.65259891E9f); + var_215 = var_292; + int index_319 = ((char)( -var_301))&array_294.length-1; + array_294[index_319] = var_212; + int index_320 = var_301&array_296.length-1; + int index_321 = var_225&array_296[index_320].length-1; + int index_322 = ((short)((byte)var_268))&array_296[index_320][index_321].length-1; + int index_323 = ((short)var_305)&array_296.length-1; + int index_325 = ((byte)(-28))&array_294.length-1; + int index_324 = ((char)array_294[index_325])&array_296[index_323].length-1; + int index_326 = ((byte)182864682)&array_296[index_323][index_324].length-1; + var_212 = array_296[index_323][index_324][index_326]; + } + } + for (int id_327 = 39;id_327>4;id_327 -= 4) + { + int index_328 = var_1&array_213.length-1; + int index_329 = var_299&array_213[index_328].length-1; + var_1 = (char)array_213[index_328][index_329]; + } + var_330 = new Class_4(); + try + { + ++var_299; + int index_331 = ((short)(var_224++))&array_213.length-1; + int index_332 = index_331&array_213[index_331].length-1; + int index_333 = var_276&array_213.length-1; + int index_334 = var_225&array_213[index_333].length-1; + array_213[index_333][index_334]++; + } + catch (Exception e_2) + { + if (((var_274!=var_274)^var_335)||(var_305>var_279)) + { + var_330 = var_330; + var_305 = var_305; + var_336 = var_306; + } + for (int id_337 = 26;id_337<33;id_337 += 2) + { + int index_340 = var_295&array_339.length-1; + int index_341 = var_274&array_339[index_340].length-1; + int index_342 = var_212&array_339[index_340][index_341].length-1; + int index_338 = array_339[index_340][index_341][index_342]&array_296.length-1; + int index_343 = 932732420&array_296[index_338].length-1; + int index_344 = var_276&array_296[index_338][index_343].length-1; + array_296[index_338][index_343][index_344] = var_212; + } + try + { + var_330 = var_330; + var_345 = (var_23+(var_276<=var_282))+var_280; + var_215 = var_215; + var_346 = var_292; + } + catch (Exception e_3) + { + var_212 = var_347; + var_292 = var_224>>'/')&array_213.length-1; + int index_378 = var_299&array_213[index_375].length-1; + int index_374 = array_213[index_375][index_378]&array_294.length-1; + var_225 = array_294[index_374]; + System.out.println( "=======Exception thrown======="+23); + } + finally + { + int index_380 = ((char)(var_381-var_379))&array_296.length-1; + int index_382 = ((char)var_305)&array_296[index_380].length-1; + int index_383 = (-674022673)&array_296[index_380][index_382].length-1; + var_350 = (short)(var_379+array_296[index_380][index_382][index_383]); + var_302 = var_302; + var_379 = (char)var_282; + } + var_268 = var_302; + var_1 = ')'; + System.out.println( "=======Exception thrown======="+23); + } + System.out.println( "=======Exception thrown======="+23); + } + return (byte)(-31850); + } + public boolean[][] func_13(short args_590, double args_591, boolean args_592, char args_593, boolean args_594, int args_595) + { + if (var_596) + { + var_302 = var_302; + try + { + --var_224; + --var_224; + } + catch (Exception e_2) + { + var_346 = var_268<=var_268; + var_225 = (-16564); + System.out.println( "=======Exception thrown======="+39); + } + var_347--; + for (int id_597 = 84;id_597>23;id_597 -= 62) + { + var_548 = var_345; + int var_598 = (-425178508); + var_598 = var_212*((byte)'y'); + for (int id_599 = 62;id_599<81;id_599 += 3) + { + var_215 = var_282>((char)(var_279/(1|8375635514927959470L))); + int index_601 = var_295&array_600.length-1; + int index_603 = var_306&array_294.length-1; + int index_602 = (((short)(-6972289373219803897L))%(1|array_294[index_603]))&array_600.length-1; + var_604 = array_600[index_602]; + } + boolean var_605 = false; + if (var_605) + { + int index_606 = ((short)((char)var_381))&array_600.length-1; + array_600[index_606] = var_226; + var_282 = var_226; + } + } + } + else + { + var_282 = var_226; + int index_607 = var_305&array_213.length-1; + int index_608 = ( -((char)var_609))&array_213[index_607].length-1; + var_604 = +array_213[index_607][index_608]; + } + boolean[][] array_617 = new boolean[][]{{false,true},{true,true,true},{true,false},{true,false,false,true,false},{true,false,false},{true,true,true,false},{true,true,false,false},{false,false,false,true,false,true}}; + try + { + try + { + try + { + var_381 = var_381; + var_302 = +((byte)(var_224++)); + var_379 = (char)var_279; + var_268 = var_268; + var_295 = var_279; + } + catch (Exception e_3) + { + short var_610 = (-18403); + var_302 = var_283*( +var_610); + int index_611 = var_372&array_213.length-1; + int index_612 = 111&array_213[index_611].length-1; + array_213[index_611][index_612] = var_381; + int index_613 = '*'&array_600.length-1; + int index_614 = ((byte)((char)var_381))&array_600.length-1; + var_283 = array_600[index_614]; + System.out.println( "=======Exception thrown======="+40); + } + var_224--; + } + catch (Exception e_2) + { + var_225 = var_372; + --var_615; + ++var_616; + var_224--; + System.out.println( "=======Exception thrown======="+41); + } + try + { + array_617 = array_617; + var_1++; + } + catch (Exception e_2) + { + var_279 = ((char)var_615)%(1|((short)var_379)); + var_268 = var_381--; + for (int id_618 = 85;id_618>9;id_618 -= 16) + { + var_346 = var_212==var_350; + var_347 = (short)var_276; + var_268 = var_302; + var_268 = (-8.279325321134653E8d); + var_268 = var_379--; + var_211 = var_211; + } + int index_619 = 1899774414&array_294.length-1; + int index_620 = var_276&array_294.length-1; + var_347 = array_294[index_620]; + System.out.println( "=======Exception thrown======="+42); + } + finally + { + --var_279; + --var_224; + var_336--; + } + var_616 = 'W'; + --var_384; + var_548 = var_548; + var_268 = -(-7.7148006E8f); + } + catch (Exception e_1) + { + var_282 = ((short)var_268)*var_276; + var_346 = var_215; + var_282 = var_282; + ++var_384; + var_346 = var_215; + var_305--; + System.out.println( "=======Exception thrown======="+43); + } + var_346 = ((var_215&var_215)^var_215)!=var_346; + var_381--; + return array_617; + } + double func_14(float args_621, char args_622, double args_623, byte args_624, float args_625, String args_626) + { + var_303 = var_548; + var_372 = 2721; + int index_627 = ((char)var_101)&array_339.length-1; + int index_628 = var_225&array_339[index_627].length-1; + int index_629 = (var_295<<((char)1.7516866E7f))&array_339[index_627][index_628].length-1; + int index_630 = ((short)var_276)&array_339.length-1; + int index_632 = var_305&array_213.length-1; + int index_633 = var_306&array_213[index_632].length-1; + int index_631 = array_213[index_632][index_633]&array_339[index_630].length-1; + int index_634 = var_274&array_339[index_630][index_631].length-1; + array_339[index_630][index_631][index_634]++; + return ((char)var_1)-var_306; + } + void func_15(float args_650, int args_651, double args_652, boolean args_653, char args_654, byte args_655) + { + boolean[] array_656 = new boolean[]{true,false,false,false,false,true}; + int index_657 = var_379&array_656.length-1; + int index_658 = var_381&array_656.length-1; + float var_675 = 1.01287568E8f; + if (array_656[index_658]) + { + ++var_224; + var_1--; + } + else + { + for (int id_659 = 23;id_659>16;id_659 -= 4) + { + try + { + int index_662 = ((short)((char)var_224))&array_213.length-1; + int index_663 = ( -var_336)&array_213[index_662].length-1; + int index_661 = array_213[index_662][index_663]&array_213.length-1; + int index_664 = 21198&array_213[index_661].length-1; + var_101 = ((byte)((byte)var_660))<11;id_668 -= 2) + { + var_1 = var_305; + var_23 = var_303; + var_669 = (char)index_657; + int index_671 = ((byte)var_379)&array_339.length-1; + int index_672 = var_673&array_339[index_671].length-1; + int index_674 = ((short)var_675)&array_339[index_671][index_672].length-1; + array_339[index_671][index_672][index_674] = var_670; + } + } + if (((var_676|var_677)|(var_677&var_676))||var_677) + { + var_302 = (-8.142507243557829E8d); + array_294 = array_294; + var_347--; + var_330 = var_330; + } + } + int index_678 = var_679&array_213.length-1; + int index_680 = var_616&array_213[index_678].length-1; + var_679 = ((byte)(-346692908))/(1|array_213[index_678][index_680]); + } + public short func_16(boolean args_684, boolean args_685, String args_686, int args_687, float args_688, String args_689) + { + String var_694 = "K@bV~?xjBq"; + for (int id_690 = 37;id_690<96;id_690 += 8) + { + --var_691; + var_279 = var_384; + for (int id_692 = 66;id_692>1;id_692 -= 33) + { + var_635 = var_635; + try + { + var_346 = var_215; + var_336 = var_691; + var_268 = var_268; + var_345 = "40;id_699 -= 6) + { + var_23 = var_639; + var_215 = false; + } + var_700 = var_693; + boolean var_701 = true; + if (var_701) + { + var_700 = var_635*(-446228210409940506L); + var_346 = var_346; + var_615 = var_384; + var_302 = var_302--; + var_283 = var_226; + var_101 = var_101; + } + } + int index_702 = var_615&array_213.length-1; + int index_703 = var_635&array_213[index_702].length-1; + int index_704 = var_669&array_213.length-1; + int index_705 = var_276&array_213[index_704].length-1; + array_213[index_704][index_705]--; + } + for (int id_706 = 70;id_706<94;id_706 += 3) + { + var_707 = var_707; + var_708 = var_23; + } + int var_716 = 1746106496; + boolean var_723 = false; + char var_740 = 'f'; + short var_792 = 25078; + char var_820 = 'g'; + short[] array_821 = new short[]{(-8446),(-5185),4354}; + boolean[] array_823 = new boolean[]{false,false,true,true}; + try + { + try + { + var_645 = new Class_3(); + var_282 = var_604; + int index_709 = (-78)&array_600.length-1; + int index_710 = (((byte)var_336)*var_711)&array_600.length-1; + int index_713 = var_306&array_213.length-1; + int index_714 = (-835250718)&array_213[index_713].length-1; + int index_712 = array_213[index_713][index_714]&array_370.length-1; + array_370[index_712] = array_600[index_710]; + } + catch (Exception e_2) + { + if (var_715&var_715) + { + var_268 = var_268; + array_213 = array_213; + } + else + { + var_305 = 'i'; + var_716 = var_716; + } + var_224++; + if (var_717) + { + int index_718 = '('&array_600.length-1; + int index_719 = var_720&array_600.length-1; + int index_722 = var_336&array_600.length-1; + int index_721 = ((byte)array_600[index_722])&array_600.length-1; + array_600[index_721] = array_600[index_719]; + var_381 = var_381; + } + if (var_226<(((short)127)/(1|var_669))) + { + var_635 = var_635; + var_724 = var_723; + int index_725 = var_615&array_370.length-1; + array_370[index_725] = var_283; + array_726 = array_726; + array_727 = array_727; + } + else + { + var_1 = var_379; + var_283 = var_604; + var_694 = var_23; + var_724 = ((var_381>>var_224)<=7929820919774037929L)||var_723; + } + System.out.println( "=======Exception thrown======="+46); + } + ++var_224; + if (var_728) + { + var_305 = 'w'; + var_295 = var_274; + for (int id_729 = 15;id_729<72;id_729 += 7) + { + var_283 = var_381-var_279; + int index_730 = var_679&array_339.length-1; + int index_731 = '/'&array_339[index_730].length-1; + int index_733 = var_716&array_213.length-1; + int index_734 = var_305&array_213[index_733].length-1; + int index_732 = array_213[index_733][index_734]&array_339[index_730][index_731].length-1; + var_635 = (byte)(array_339[index_730][index_731][index_732]*(var_279>>>'g')); + } + for (int id_735 = 55;id_735<93;id_735 += 5) + { + float var_737 = 7.3658496E7f; + var_737 = var_736-(-65); + var_548 = "z*$U~\"NB ;"+var_305; + int index_738 = var_1&array_370.length-1; + int index_739 = var_740&array_370.length-1; + var_283 = array_370[index_739]; + } + try + { + var_302 = var_268; + var_742 = var_741; + } + catch (Exception e_3) + { + var_302 = +var_283; + var_724 = var_346; + int index_744 = 17&array_213.length-1; + int index_745 = var_746&array_213[index_744].length-1; + int index_743 = (((short)var_609)*array_213[index_744][index_745])&array_339.length-1; + int index_747 = var_615&array_339[index_743].length-1; + int index_748 = ((byte)1731761152)&array_339[index_743][index_747].length-1; + int index_749 = var_609&array_339.length-1; + int index_750 = var_716&array_339[index_749].length-1; + int index_751 = ((byte)var_1)&array_339[index_749][index_750].length-1; + var_101 = array_339[index_749][index_750][index_751]; + System.out.println( "=======Exception thrown======="+47); + } + finally + { + int index_752 = ((short)((char)var_660))&array_726.length-1; + int index_753 = (-21724)&array_726[index_752].length-1; + var_694 = array_726[index_752][index_753]+var_101; + var_754 = var_645; + } + int index_755 = var_720&array_213.length-1; + int index_756 = (var_635/(1|var_295))&array_213[index_755].length-1; + int index_757 = ((byte)(var_347%(1|(-12369))))&array_213.length-1; + int index_759 = ((byte)3.42590272E8f)&array_600.length-1; + int index_758 = ((short)array_600[index_759])&array_213[index_757].length-1; + array_213[index_757][index_758]--; + } + ++var_720; + try + { + var_760 = var_1; + var_691++; + var_723 = (true&(var_215||var_215))||( !(var_724|var_346)); + try + { + int index_761 = var_746&array_726.length-1; + int index_762 = var_740&array_726[index_761].length-1; + array_726[index_761][index_762] = var_694; + } + catch (Exception e_3) + { + var_305 = (char)var_736; + int index_763 = var_764&array_682.length-1; + array_682[index_763] = var_295; + System.out.println( "=======Exception thrown======="+48); + } + var_215 = var_346; + } + catch (Exception e_2) + { + var_282 = ( +var_736)-var_279; + try + { + var_548 = var_639+var_609; + int index_765 = var_295&array_726.length-1; + int index_766 = ((char)(10404*var_742))&array_726[index_765].length-1; + int index_768 = var_711&array_727.length-1; + int index_769 = (((short)var_212)&( +var_742))&array_727[index_768].length-1; + int index_770 = var_350&array_727[index_768][index_769].length-1; + int index_767 = array_727[index_768][index_769][index_770]&array_726.length-1; + int index_771 = 't'&array_726[index_767].length-1; + array_726[index_767][index_771] = array_726[index_765][index_766]+var_639; + } + catch (Exception e_3) + { + int index_772 = var_276&array_339.length-1; + int index_773 = var_764&array_339[index_772].length-1; + int index_777 = var_336&array_213.length-1; + int index_778 = ((short)( -var_779))&array_213[index_777].length-1; + int index_776 = array_213[index_777][index_778]&array_775.length-1; + int index_780 = var_1&array_775[index_776].length-1; + int index_774 = ((short)(array_775[index_776][index_780]++))&array_339[index_772][index_773].length-1; + int index_781 = ((byte)(index_778/(1|var_691)))&array_339.length-1; + int index_782 = var_381&array_339[index_781].length-1; + int index_783 = ((char)(-114))&array_339[index_781][index_782].length-1; + index_781 = array_339[index_781][index_782][index_783]; + System.out.println( "=======Exception thrown======="+50); + } + System.out.println( "=======Exception thrown======="+50); + } + finally + { + var_746 = var_101; + if (var_784) + { + var_700 = var_302; + int index_786 = (var_615++)&array_785.length-1; + int index_787 = ((byte)var_302)&array_785.length-1; + var_276 = array_785[index_787]; + var_660 = var_305; + var_694 = var_708+var_302; + } + for (int id_788 = 45;id_788<54;id_788 += 4) + { + int index_790 = ((short)var_381)&array_789.length-1; + int index_791 = var_635&array_789.length-1; + var_792 = array_789[index_791]; + int index_793 = 'd'&array_682.length-1; + int index_794 = var_691&array_682.length-1; + int index_795 = ((short)(var_741+var_741))&array_682.length-1; + array_682[index_795] = array_682[index_794]; + } + } + } + catch (Exception e_1) + { + int index_796 = var_1&array_600.length-1; + int index_797 = (((byte)var_274)+var_691)&array_600.length-1; + var_283 = array_600[index_797]; + for (int id_798 = 24;id_798<86;id_798 += 32) + { + try + { + var_212 = var_609; + var_302 = var_693; + var_215 = var_724&&true; + } + catch (Exception e_3) + { + var_215 = var_724&var_215; + int index_800 = ((short)((-1609630658)-var_740))&array_775.length-1; + int index_801 = var_350&array_775[index_800].length-1; + int index_799 = array_775[index_800][index_801]&array_370.length-1; + int index_802 = ((char)((short)var_693))&array_370.length-1; + var_226 = array_370[index_802]; + System.out.println( "=======Exception thrown======="+52); + } + try + { + int index_803 = ((short)((char)var_693))&array_785.length-1; + int index_804 = var_792&array_785.length-1; + var_740 = array_785[index_804]; + } + catch (Exception e_3) + { + var_279 = var_720; + var_669 = 'Y'; + var_336 = var_609; + var_805 = var_346; + System.out.println( "=======Exception thrown======="+53); + } + try + { + var_268 = var_302; + var_740 = var_276; + int index_806 = var_691&array_695.length-1; + int index_807 = 'e'&array_695[index_806].length-1; + int index_808 = var_381&array_695[index_806][index_807].length-1; + int index_809 = var_274&array_695.length-1; + int index_810 = ((byte)'f')&array_695[index_809].length-1; + int index_812 = 1609553276&array_213.length-1; + int index_813 = var_742&array_213[index_812].length-1; + int index_811 = array_213[index_812][index_813]&array_695[index_809][index_810].length-1; + int index_815 = var_347&array_213.length-1; + int index_816 = (var_212+((short)var_711))&array_213[index_815].length-1; + int index_814 = array_213[index_815][index_816]&array_695.length-1; + int index_817 = var_818&array_695[index_814].length-1; + int index_819 = var_615&array_695[index_814][index_817].length-1; + array_695[index_814][index_817][index_819] = array_695[index_809][index_810][index_811]; + } + catch (Exception e_3) + { + var_820 = var_616; + var_23 = "-:0xB?fh;H"; + var_302 = var_693; + System.out.println( "=======Exception thrown======="+54); + } + finally + { + var_345 = var_303; + var_694 = ((var_548+var_226)+((byte)var_746))+((var_23+"tLw'lEx?f$")+var_820); + var_302 = var_615--; + array_821 = array_821; + var_760 = (char)((byte)((short)var_384)); + var_707 = var_707; + } + var_822 = var_742; + --var_740; + } + System.out.println( "=======Exception thrown======="+54); + } + finally + { + var_305 = (char)var_268; + int index_825 = var_691&array_682.length-1; + int index_824 = array_682[index_825]&array_823.length-1; + int index_826 = ((short)var_225)&array_823.length-1; + if (array_823[index_826]) + { + var_760 = (char)var_101; + array_294 = array_827; + } + } + return var_828; + } + public Class_7 func_18(float args_864, char args_865, String args_866, String args_867, char args_868, double args_869) + { + var_302 = var_700; + for (int id_870 = 71;id_870>56;id_870 -= 6) + { + ++var_635; + int index_872 = var_305&array_871.length-1; + int index_874 = ((char)var_224)&array_785.length-1; + int index_873 = ((short)array_785[index_874])&array_871.length-1; + --array_871[index_873]; + } + try + { + --var_381; + var_276 = (char)var_875; + } + catch (Exception e_1) + { + var_226 = var_604; + ++var_876; + var_822 = var_822; + var_268 = (-5.3293982961263776E8d); + var_700 = var_268; + System.out.println( "=======Exception thrown======="+56); + } + Class_7 var_877 = new Class_7(); + return var_877; + } + char func_19(short args_879, float args_880, float args_881, float args_882, String[][] args_883, String args_884) + { + var_805 = var_805&(var_693(var_282+array_370[index_896])) + { + var_818 = var_779; + char var_900 = 'J'; + if (var_897) + { + if (var_898) + { + var_876 = var_899; + var_805 = var_894; + var_693 = var_350/(1|var_900); + } + try + { + var_268 = var_901; + var_346 = var_895; + int index_902 = ((byte)( +var_903))&array_213.length-1; + int index_904 = var_818&array_213[index_902].length-1; + int index_905 = (var_616++)&array_213.length-1; + int index_906 = ((byte)var_899)&array_213[index_905].length-1; + var_742 = array_213[index_905][index_906]; + } + catch (Exception e_3) + { + var_876 = (char)var_736; + var_742 = (byte)var_693; + int index_907 = var_908&array_726.length-1; + int index_910 = (var_372|((short)var_911))&array_213.length-1; + int index_913 = ((byte)var_670)&array_339.length-1; + int index_914 = ((byte)var_818)&array_339[index_913].length-1; + int index_917 = var_673&array_916.length-1; + int index_915 = (array_916[index_917]&var_635)&array_339[index_913][index_914].length-1; + int index_912 = array_339[index_913][index_914][index_915]&array_213[index_910].length-1; + int index_909 = array_213[index_910][index_912]&array_726[index_907].length-1; + array_726[index_907][index_909] = var_303+((char)(-1509011265)); + System.out.println( "=======Exception thrown======="+57); + } + finally + { + var_336 = (short)var_901; + var_742 = var_381; + var_693 = 3.013399739268277E7d; + var_679 = var_764--; + } + var_215 = var_215; + --var_918; + for (int id_919 = 61;id_919>10;id_919 -= 11) + { + var_779 = (short)( +'('); + var_691 = var_779; + } + } + else + { + for (int id_920 = 74;id_920>16;id_920 -= 20) + { + var_282 = var_741/(1|((char)(var_379%(1|var_279)))); + var_345 = var_639; + var_707 = var_707; + var_604 = var_279--; + var_921 = var_760>>((byte)var_700))&array_339[index_934][index_935].length-1; + int index_933 = array_339[index_934][index_935][index_937]&array_932.length-1; + int index_938 = var_295&array_932[index_933].length-1; + int index_939 = var_635&array_932[index_933][index_938].length-1; + int index_940 = var_941&array_932.length-1; + int index_942 = ((-52)|var_943)&array_932[index_940].length-1; + int index_944 = var_212&array_932[index_940][index_942].length-1; + var_268 = array_932[index_940][index_942][index_944]; + System.out.println( "=======Exception thrown======="+58); + } + for (int id_945 = 94;id_945>49;id_945 -= 8) + { + var_822 = var_741; + var_346 = var_305>=var_946; + var_918 = var_669; + int index_947 = var_742&array_370.length-1; + int index_949 = var_822&array_948.length-1; + int index_950 = ((short)var_903)&array_948[index_949].length-1; + int index_951 = var_943&array_948[index_949][index_950].length-1; + array_948[index_949][index_950][index_951] = 24+array_370[index_947]; + } + for (int id_952 = 16;id_952<24;id_952 += 9) + { + int index_953 = 1120231321&array_370.length-1; + array_370[index_953] = -((byte)(var_922-(-87))); + String[][][] array_955 = new String[][][]{{{"sYzdN|Eme#"},{"G`SlwnBF|(","#=Ioj~_Pc","t^SFaA8_)M","Tt.k\\;MUZ*","-W=e*F\"&I@",":bIsfL1GQ%"},{".Utss\\rs)M","4o *twUi/~","j'7$`mfuc.",")|=ov99Kp ","EG ~D~$j3b"},{"nn[HZ3)S[y","6|aq8w1nMo","VvM5_D6;Dz","410JWmt^0c","BO/TS~\"nL*"}}}; + int index_957 = var_615&array_294.length-1; + int index_956 = array_294[index_957]&array_955.length-1; + int index_958 = ((byte)var_899)&array_955[index_956].length-1; + int index_959 = ((char)var_918)&array_955[index_956][index_958].length-1; + array_955[index_956][index_958][index_959] = var_954; + } + } + int index_960 = var_616&array_871.length-1; + int index_961 = var_779&array_871.length-1; + index_896 = array_871[index_961]; + } + return (byte)var_885; + } + char func_21(byte args_968, int args_969, byte args_970, int args_971, byte args_972, char args_973) + { + byte var_974 = 81; + var_974 = var_822; + var_295--; + var_282 = var_379++; + ++var_224; + return var_276; + } + boolean func_6(boolean args_16, float args_17, int args_18, String args_19, MainClass args_20, char args_21) + { + Class_4 var_100 = new Class_4(); + for (int id_22 = 96;id_22>84;id_22 -= 2) + { + var_23 = var_23; + int actualArgs_214 = (var_101+var_211.func_8((short)var_212, (short)var_212, (short)var_212, var_101, var_101, array_213)); + boolean actualArgs_216 = ( !var_215); + char actualArgs_385 = var_211.func_8((short)var_212, (short)var_306, (short)12982, var_279, var_384, array_213); + int index_217 = func_9(var_330, var_303, var_295, (char)var_276, (short)var_306, (char)actualArgs_385)&array_213.length-1; + int index_386 = var_350&array_213[index_217].length-1; + float actualArgs_387 = ((-1.42735104E8f)-array_213[index_217][index_386]); + short actualArgs_457 = var_211.func_10(actualArgs_216, (char)var_1, var_345, (byte)var_381, (short)var_225, new Class_3()); + char actualArgs_458 = var_211.func_8((short)actualArgs_457, (short)var_347, (short)var_225, index_217, var_384, new byte[][]{{(-64),(-101),78,80},{31,(-60),79,(-117),(-102),124}}); + boolean actualArgs_549 = (var_381<=var_330.func_11(var_23, var_283, (byte)var_381, var_548, array_370, var_295)); + if (var_100.func_7(actualArgs_214, actualArgs_216, actualArgs_387, (byte)(-55), (char)actualArgs_458, actualArgs_549)) + { + var_282 = actualArgs_387; + double actualArgs_586 = '3'/(1|var_224); + int index_587 = ((byte)( ~var_381))&array_370.length-1; + char actualArgs_588 = (char)((-4.159761408769752E8d)/array_370[index_587]); + byte actualArgs_589 = (byte)((short)( ~var_381)); + float actualArgs_636 = (var_224+var_635); + char actualArgs_637 = ((char)var_224); + byte actualArgs_638 = ((byte)(-7385242959308995405L)); + String actualArgs_640 = (var_639+var_212); + double actualArgs_641 = func_14(actualArgs_636, (char)actualArgs_637, var_268, (byte)actualArgs_638, var_226, actualArgs_640); + char actualArgs_642 = ((char)var_381); + int index_643 = var_381&array_600.length-1; + int index_644 = ((short)var_211.func_10(actualArgs_549, (char)var_276, actualArgs_640, (byte)var_635, (short)var_336, var_645))&array_600.length-1; + boolean actualArgs_646 = (array_600[index_643]!=array_600[index_644]); + boolean[][] actualArgs_647 = func_13((short)actualArgs_457, actualArgs_641, actualArgs_549, (char)actualArgs_642, actualArgs_646, (-257918915)); + var_585.func_12((char)'?', (short)var_336, actualArgs_586, (char)actualArgs_588, (byte)actualArgs_589, actualArgs_647); + } + } + String var_829 = "ezYgW~SS&~"; + float var_962 = (-1.24316058E9f); + short var_982 = (-5291); + if (var_648) + { + var_347++; + var_379 = var_1; + for (int id_649 = 87;id_649>47;id_649 -= 41) + { + String actualArgs_830 = (var_829+var_350); + String actualArgs_831 = (var_639+var_346); + int index_683 = func_16(var_805, var_215, actualArgs_830, var_101, var_226, actualArgs_831)&array_682.length-1; + int index_681 = array_682[index_683]&array_600.length-1; + String actualArgs_832 = (var_345+var_225); + int index_878 = ((short)func_19((short)var_609, var_604, var_283, var_283, array_886, var_303))&array_370.length-1; + int index_887 = ( +func_20(var_283, (char)var_616, var_303, actualArgs_832, var_548, var_962))&array_785.length-1; + String actualArgs_963 = (var_548+((byte)var_225)); + String actualArgs_964 = ((var_345+"lXE+#h;A5G")+(1.2492663E9f*var_372)); + char actualArgs_965 = ((char)(var_306-var_224)); + int actualArgs_966 = func_18(array_370[index_878], (char)array_785[index_887], actualArgs_963, actualArgs_964, (char)actualArgs_965, (-7.65422193959958E8d)).func_17(var_700, var_901, var_279, array_339, (byte)var_742, actualArgs_831); + int index_967 = var_615&array_785.length-1; + char actualArgs_976 = func_21((byte)var_741, index_878, (byte)var_975, var_101, (byte)var_742, (char)actualArgs_965); + int actualArgs_977 = func_9(var_100, actualArgs_832, actualArgs_966, (char)array_785[index_967], (short)29674, (char)actualArgs_976)>>(var_276|((byte)index_887)); + int actualArgs_979 = (var_876-var_943); + float actualArgs_980 = (var_962++); + byte actualArgs_981 = func_9(var_100, var_639, var_720, (char)var_711, (short)var_818, (char)actualArgs_976); + char actualArgs_983 = ((char)var_982); + boolean actualArgs_984 = true&&var_330.func_7(actualArgs_979, var_724, actualArgs_980, (byte)actualArgs_981, (char)actualArgs_983, var_894); + char actualArgs_985 = (char)var_943; + func_15(array_600[index_681], actualArgs_977, var_978, actualArgs_984, (char)actualArgs_985, (byte)var_635); + } + var_673 = (-672); + var_986--; + } + return ( +var_224)>var_282; + } + boolean func_22(float args_991, String args_992, char args_993, float args_994, boolean[][] args_995, int args_996) + { + int var_1026 = 151537018; + byte var_1046 = 22; + float var_1089 = (-1.10373496E8f); + boolean var_1097 = false; + char var_1131 = '8'; + String var_1151 = "I:,@a(~-mn"; + float[] array_1181 = new float[]{9.6314739E8f,(-6.0673363E8f)}; + short var_1183 = 10682; + double var_1190 = (-2.1910066408437505E8d); + short var_1260 = 27791; + boolean[] array_1275 = new boolean[]{false,false,false}; + byte var_1289 = 106; + String var_1298 = "eRILZI`ivB"; + char var_1309 = 'g'; + short var_1313 = 13586; + byte var_1315 = (-31); + String var_1345 = "QHZ6QFyM=k"; + try + { + var_742 = var_997; + var_764++; + try + { + var_997++; + for (int id_998 = 88;id_998>81;id_998 -= 2) + { + var_302 = var_700; + var_741 = (byte)(var_302+var_1); + char actualArgs_1000 = ((char)(var_764^var_679)); + byte actualArgs_1001 = ((byte)3.508349009444629E8d); + float actualArgs_1002 = (var_764++); + var_700 = func_14(var_999, (char)actualArgs_1000, var_901, (byte)actualArgs_1001, actualArgs_1002, var_639); + } + } + catch (Exception e_2) + { + --var_822; + try + { + var_616 = 'K'; + int index_1003 = 9303&array_339.length-1; + boolean actualArgs_1005 = (false&var_215); + int index_1007 = var_828&array_682.length-1; + int index_1008 = var_922&array_370.length-1; + int index_1009 = 1332493937&array_726.length-1; + char var_1011 = 'I'; + int index_1010 = var_1011&array_726[index_1009].length-1; + int index_1004 = func_16(actualArgs_1005, var_1006, var_303, array_682[index_1007], array_370[index_1008], array_726[index_1009][index_1010])&array_339[index_1003].length-1; + int index_1012 = ((char)var_876)&array_339[index_1003][index_1004].length-1; + boolean actualArgs_1015 = !(var_921^var_330.func_7(var_274, var_1006, var_282, (byte)var_381, (char)var_986, var_1014)); + char actualArgs_1016 = (char)var_276; + int index_1020 = var_381&array_827.length-1; + int index_1019 = array_827[index_1020]&array_871.length-1; + int index_1018 = array_871[index_1019]&array_1017.length-1; + func_15(6.7070496E8f, array_339[index_1003][index_1004][index_1012], var_1013, actualArgs_1015, (char)actualArgs_1016, (byte)array_1017[index_1018]); + } + catch (Exception e_3) + { + var_708 = "HUyl $Ek.P"; + int index_1021 = 'G'&array_213.length-1; + int index_1024 = ((var_997>>var_736)/(1|((char)var_673)))&array_1023.length-1; + int index_1025 = ((short)(index_1021>>>var_1026))&array_1023.length-1; + double actualArgs_1027 = (var_226--); + int actualArgs_1028 = ((-6137)>>'c'); + byte actualArgs_1029 = ((byte)1.3064756996794186E9d); + String actualArgs_1030 = (var_23+var_828); + int index_1022 = array_1023[index_1025].func_17(var_693, actualArgs_1027, actualArgs_1028, array_339, (byte)actualArgs_1029, actualArgs_1030)&array_213[index_1021].length-1; + float actualArgs_1031 = (1473069565>>>array_213[index_1021][index_1022])*(var_736/(1|28225)); + int index_1032 = var_822&array_785.length-1; + func_15(actualArgs_1031, (-1397250502), (-7.365401415797465E8d), var_895, (char)array_785[index_1032], (byte)var_822); + System.out.println( "=======Exception thrown======="+60); + } + finally + { + var_978 = var_901; + var_975 = 20; + int index_1033 = '2'&array_932.length-1; + short var_1035 = (-25762); + int index_1034 = (var_943^var_1035)&array_932[index_1033].length-1; + int index_1036 = var_372&array_932[index_1033][index_1034].length-1; + int index_1040 = var_350&array_785.length-1; + int index_1039 = array_785[index_1040]&array_871.length-1; + int index_1038 = array_871[index_1039]&array_789.length-1; + int index_1037 = array_789[index_1038]&array_932.length-1; + int index_1041 = ( +var_986)&array_932[index_1037].length-1; + String actualArgs_1043 = (var_708+var_226); + char actualArgs_1044 = ((char)var_922); + int index_1042 = func_9(var_330, actualArgs_1043, var_274, (char)var_616, (short)var_225, (char)actualArgs_1044)&array_932[index_1037][index_1041].length-1; + var_885 = array_932[index_1037][index_1041][index_1042]; + } + int index_1045 = var_931&array_1017.length-1; + int index_1047 = var_212&array_785.length-1; + char actualArgs_1048 = func_21((byte)91, (-212363681), (byte)array_1017[index_1045], var_670, (byte)var_1046, (char)array_785[index_1047]); + double actualArgs_1049 = var_901-var_670; + int index_1050 = ( -(-574876466))&array_785.length-1; + int index_1051 = ((short)((char)var_1046))&array_213.length-1; + int index_1052 = (var_828--)&array_213[index_1051].length-1; + int index_1053 = var_741&array_827.length-1; + int index_1055 = var_635&array_600.length-1; + char actualArgs_1056 = ((char)array_600[index_1055]); + boolean[][] actualArgs_1057 = func_13((short)array_827[index_1053], var_693, var_1054, (char)actualArgs_1056, var_1054, var_615); + var_585.func_12((char)actualArgs_1048, (short)(-18881), actualArgs_1049, (char)array_785[index_1050], (byte)array_213[index_1051][index_1052], actualArgs_1057); + System.out.println( "=======Exception thrown======="+60); + } + short var_1079 = (-26875); + try + { + int index_1060 = var_379&array_600.length-1; + int index_1059 = ((short)array_600[index_1060])&array_1058.length-1; + int index_1062 = var_1026&array_916.length-1; + int index_1061 = (array_916[index_1062]/(1|var_211.func_8((short)var_818, (short)var_691, (short)(-8665), (-651023263), 343066527, array_213)))&array_1058[index_1059].length-1; + int index_1064 = var_381&array_213.length-1; + int index_1065 = var_818&array_213[index_1064].length-1; + int index_1063 = array_213[index_1064][index_1065]&array_1058.length-1; + int index_1066 = 1834922336&array_1058[index_1063].length-1; + if (array_1058[index_1063][index_1066]) + { + var_707 = var_707; + int index_1067 = var_669&array_785.length-1; + int index_1068 = var_1&array_886.length-1; + int index_1069 = var_276&array_886[index_1068].length-1; + array_886[index_1068][index_1069] = var_708+(((short)var_946)>>array_785[index_1067]); + var_225 = var_225; + } + } + catch (Exception e_2) + { + ++var_736; + short actualArgs_1071 = ((short)((char)var_276)); + short actualArgs_1072 = ((short)var_282); + int actualArgs_1073 = (var_615>>(var_822&var_372)); + char actualArgs_1074 = var_211.func_8((short)actualArgs_1071, (short)actualArgs_1072, (short)var_691, var_384, actualArgs_1073, array_213); + int index_1075 = var_660&array_932.length-1; + int index_1078 = var_1079&array_789.length-1; + int index_1077 = array_789[index_1078]&array_370.length-1; + int index_1076 = ((byte)array_370[index_1077])&array_932[index_1075].length-1; + int index_1080 = var_987&array_932[index_1075][index_1076].length-1; + byte actualArgs_1081 = (byte)(var_691|var_279); + var_1070.func_12((char)actualArgs_1074, (short)var_350, array_932[index_1075][index_1076][index_1080], (char)var_276, (byte)actualArgs_1081, array_1082); + System.out.println( "=======Exception thrown======="+61); + } + finally + { + try + { + var_639 = "tZh0J4sG|?"; + var_1083 = (var_954+var_276)+(((char)var_295)-((char)var_305)); + byte actualArgs_1084 = ((byte)var_224); + int actualArgs_1085 = (func_21((byte)var_741, var_1026, (byte)var_822, var_295, (byte)actualArgs_1084, (char)var_660)>>>((byte)var_931)); + int actualArgs_1086 = (1076421971/(1|((short)var_615))); + var_760 = func_21((byte)actualArgs_1084, actualArgs_1085, (byte)4, actualArgs_1086, (byte)var_903, (char)var_931); + } + catch (Exception e_3) + { + var_268 = var_1013; + var_303 = var_548; + var_922 = (byte)(( +var_336)/var_226); + var_225 = (short)var_736; + var_876 = (char)(var_1046-func_19((short)var_347, var_226, var_226, var_283, new String[][]{{"ce**n|IO_3","O'fv`!\\~Nz","t_L/:aFsc3","y`Mi]Vl;@Q"},{"2fra#ma)Ke","w\\[_njy>5v","fKI92H|/bq"}}, var_345)); + short actualArgs_1088 = ((short)var_700); + String actualArgs_1090 = (var_345+var_295); + int index_1087 = func_19((short)actualArgs_1088, 1.09807544E8f, var_1089, 9.2879904E8f, array_886, actualArgs_1090)&array_932.length-1; + int index_1091 = var_875&array_932[index_1087].length-1; + int index_1092 = var_943&array_932[index_1087][index_1091].length-1; + var_1093 = (byte)array_932[index_1087][index_1091][index_1092]; + System.out.println( "=======Exception thrown======="+62); + } + finally + { + var_211 = var_1094; + char actualArgs_1098 = ((char)var_693); + String actualArgs_1099 = (var_954+var_691); + byte actualArgs_1100 = func_9(var_330, var_548, var_1026, (char)var_669, (short)(-28492), (char)var_986); + int index_1096 = var_1094.func_10(var_1097, (char)actualArgs_1098, actualArgs_1099, (byte)actualArgs_1100, (short)9360, var_645)&array_294.length-1; + int index_1101 = ((byte)var_720)&array_370.length-1; + int index_1102 = var_986&array_600.length-1; + int index_1095 = func_19((short)array_294[index_1096], array_370[index_1101], var_604, array_600[index_1102], array_886, var_954)&array_932.length-1; + int index_1103 = ((byte)(-7293))&array_932[index_1095].length-1; + int index_1104 = var_720&array_932[index_1095][index_1103].length-1; + array_932[index_1095][index_1103][index_1104] = var_978; + } + int index_1105 = (var_779-1657749573)&array_727.length-1; + int index_1106 = var_635&array_727[index_1105].length-1; + int index_1107 = '+'&array_727[index_1105][index_1106].length-1; + int index_1108 = var_1109&array_727.length-1; + int index_1112 = ((char)(var_1046++))&array_1111.length-1; + int index_1113 = (var_946<>>((short)actualArgs_1119))&array_1124.length-1; + int actualArgs_1126 = (array_1124[index_1125]++); + float actualArgs_1127 = (var_224/(1|6722701799674625331L)); + byte actualArgs_1128 = ((byte)(var_986-var_1089)); + char actualArgs_1129 = ((char)( +var_903)); + if (var_330.func_7(actualArgs_1126, var_1006, actualArgs_1127, (byte)actualArgs_1128, (char)actualArgs_1129, var_1097)) + { + var_1013 = var_901; + var_1093 = var_742; + double actualArgs_1130 = -actualArgs_1129; + func_15(var_226, 1023048965, actualArgs_1130, true, (char)var_1131, (byte)actualArgs_1128); + char actualArgs_1132 = (char)var_673; + char actualArgs_1134 = ((char)((short)actualArgs_1126)); + float actualArgs_1136 = (var_975+5120991866750763250L); + String actualArgs_1137 = ((var_303+var_1054)+(-462227907)); + double actualArgs_1138 = func_14(var_226, (char)actualArgs_1134, var_1135, (byte)actualArgs_1121, actualArgs_1136, actualArgs_1137); + char actualArgs_1139 = (char)(var_742--); + var_585.func_12((char)actualArgs_1132, (short)var_1133, actualArgs_1138, (char)actualArgs_1139, (byte)actualArgs_1128, array_1082); + } + else + { + int index_1140 = var_711&array_886.length-1; + char var_1143 = '3'; + int index_1141 = ((byte)func_9(var_330, var_1142, var_746, (char)var_876, (short)var_372, (char)var_1143))&array_886[index_1140].length-1; + String actualArgs_1145 = (array_886[index_1140][index_1141]+(var_1144>>var_616)); + int index_1146 = ((char)3851570161306762355L)&array_213.length-1; + int actualArgs_1148 = (var_381%(1|'\\')); + char actualArgs_1149 = ((char)index_1140); + short actualArgs_1152 = func_16(true, var_1150, var_1151, var_941, var_604, var_548); + int index_1154 = (var_941%(1|func_9(var_330, var_345, actualArgs_1119, (char)var_1131, (short)var_779, (char)var_616)))&array_294.length-1; + int index_1153 = array_294[index_1154]&array_916.length-1; + int index_1147 = func_9(new Class_4(), var_708, actualArgs_1148, (char)actualArgs_1149, (short)actualArgs_1152, (char)array_916[index_1153])&array_213[index_1146].length-1; + int index_1156 = ((short)var_302)&array_1155.length-1; + int index_1157 = '5'&array_1155[index_1156].length-1; + int index_1158 = 1535895472&array_1155.length-1; + short actualArgs_1160 = ((short)actualArgs_1127); + float actualArgs_1161 = ( -var_347); + String actualArgs_1162 = (var_303+var_1151); + int index_1159 = func_19((short)actualArgs_1160, var_282, (-7.1107768E7f), actualArgs_1161, array_886, actualArgs_1162)&array_1155[index_1158].length-1; + short actualArgs_1163 = array_1155[index_1158][index_1159].func_10(var_346, (char)var_760, var_345, (byte)var_997, (short)var_372, var_645); + short actualArgs_1164 = var_211.func_10(var_346, (char)'*', "r_AlZZx%/Q", (byte)array_213[index_1146][index_1147], (short)actualArgs_1163, var_645); + short actualArgs_1165 = var_1094.func_10(false, (char)var_276, actualArgs_1145, (byte)var_903, (short)actualArgs_1164, var_754); + double actualArgs_1167 = ((short)var_736)+((short)((byte)var_1166)); + int index_1170 = var_1171&array_339.length-1; + int index_1172 = index_1146&array_339[index_1170].length-1; + int index_1173 = actualArgs_1152&array_339[index_1170][index_1172].length-1; + int index_1169 = array_339[index_1170][index_1172][index_1173]&array_1111.length-1; + int index_1174 = 30&array_1111[index_1169].length-1; + int index_1175 = (-8023)&array_1111[index_1169][index_1174].length-1; + int index_1168 = (func_9(var_330, var_548, index_1147, (char)var_1131, (short)actualArgs_1165, (char)actualArgs_1123)%(1|array_1111[index_1169][index_1174][index_1175]))&array_1155.length-1; + int var_1177 = 815721893; + byte actualArgs_1178 = ((byte)var_224); + int index_1179 = var_922&array_1124.length-1; + int index_1176 = func_21((byte)var_1046, var_1177, (byte)actualArgs_1178, array_1124[index_1179], (byte)var_997, (char)'+')&array_1155[index_1168].length-1; + int index_1182 = var_1183&array_1181.length-1; + int index_1184 = (((char)55)+actualArgs_1149)&array_1181.length-1; + int index_1185 = var_670&array_600.length-1; + int index_1180 = func_19((short)var_212, array_1181[index_1182], array_1181[index_1184], array_600[index_1185], new String[][]{{"!i+4\\_at0<"},{"!&y0Oa7pBE","RMY6g3L)I_","Eaa8EHftmK","92g]'c4gqS","YqD/zurh*7",".J#A902'd","'(J%,3RzD~"}}, actualArgs_1162)&array_1155.length-1; + int index_1186 = var_1187&array_1155[index_1180].length-1; + short actualArgs_1188 = ((short)var_885); + int index_1189 = ((byte)var_1190)&array_339.length-1; + int index_1191 = ((char)var_997)&array_339[index_1189].length-1; + int index_1192 = (-760197683)&array_339[index_1189][index_1191].length-1; + char actualArgs_1193 = array_1155[index_1180][index_1186].func_8((short)var_818, (short)actualArgs_1164, (short)actualArgs_1188, (-2136845054), array_339[index_1189][index_1191][index_1192], array_213); + int index_1196 = var_943&array_1195.length-1; + boolean actualArgs_1198 = var_330.func_7(index_1170, actualArgs_1120, var_1089, (byte)var_381, (char)actualArgs_1122, var_895); + byte actualArgs_1200 = ((byte)var_224); + int index_1197 = var_1094.func_10(actualArgs_1198, (char)var_1199, var_345, (byte)actualArgs_1200, (short)var_779, var_645)&array_1195[index_1196].length-1; + int index_1201 = ((short)var_679)&array_1195.length-1; + int index_1202 = 'X'&array_1195[index_1201].length-1; + byte actualArgs_1203 = func_20(actualArgs_1127, (char)actualArgs_1193, var_1194, array_1195[index_1196][index_1197], array_1195[index_1201][index_1202], 6.8060877E8f); + var_585.func_12((char)actualArgs_1129, (short)actualArgs_1165, actualArgs_1167, (char)var_669, (byte)actualArgs_1203, array_1082); + } + } + else + { + int index_1205 = ((char)(var_224&var_1131))&array_948.length-1; + String actualArgs_1208 = (var_1142+var_818); + float actualArgs_1209 = (var_1133/(1|var_986)); + byte actualArgs_1210 = ((byte)var_673); + String actualArgs_1211 = (var_303+var_604); + int index_1212 = var_1093&array_339.length-1; + int index_1213 = ((char)((char)var_997))&array_339[index_1212].length-1; + int index_1214 = '*'&array_339[index_1212][index_1213].length-1; + int index_1207 = var_330.func_11(actualArgs_1208, actualArgs_1209, (byte)actualArgs_1210, actualArgs_1211, array_370, array_339[index_1212][index_1213][index_1214])&array_727.length-1; + int index_1215 = ((short)((char)var_746))&array_727[index_1207].length-1; + int index_1216 = var_946&array_727[index_1207][index_1215].length-1; + int index_1206 = array_727[index_1207][index_1215][index_1216]&array_948[index_1205].length-1; + int index_1218 = ((short)var_975)&array_294.length-1; + int index_1217 = array_294[index_1218]&array_948[index_1205][index_1206].length-1; + int index_1204 = ((char)array_948[index_1205][index_1206][index_1217])&array_682.length-1; + char actualArgs_1223 = ((char)var_1171); + short actualArgs_1224 = ((short)var_224); + int index_1221 = func_9(var_1222, var_954, var_279, (char)actualArgs_1223, (short)actualArgs_1224, (char)var_986)&array_1220.length-1; + array_1220[index_1221] = var_330.func_7(array_682[index_1204], var_1054, var_226, (byte)var_1219, (char)'k', true); + } + System.out.println( "=======Exception thrown======="+63); + } + finally + { + --var_679; + try + { + int index_1225 = var_306&array_695.length-1; + int index_1226 = var_615&array_695[index_1225].length-1; + int index_1227 = var_987&array_695[index_1225][index_1226].length-1; + int index_1230 = ((byte)1961636233)&array_1023.length-1; + int index_1231 = var_1232&array_1023.length-1; + double actualArgs_1233 = (index_1226++); + byte[][][] array_1235 = new byte[][][]{{{13,37,18},{(-46),(-42),92,12,24,(-125)},{(-44),(-77),(-11),16,(-71),(-10)},{10,106}}}; + float actualArgs_1237 = (var_224+var_736); + byte actualArgs_1238 = ((byte)var_1183); + String actualArgs_1239 = (var_954+var_669); + int actualArgs_1241 = (var_941|var_1240); + int index_1236 = var_1222.func_11(var_1142, actualArgs_1237, (byte)actualArgs_1238, actualArgs_1239, array_370, actualArgs_1241)&array_1235.length-1; + Class_5 var_1243 = new Class_5(); + boolean actualArgs_1244 = (var_894^var_346); + Class_5[][][] array_1245 = new Class_5[][][]{{{new Class_5()},{new Class_5()},{new Class_5(),new Class_5(),new Class_5(),new Class_5(),new Class_5(),new Class_5(),new Class_5()},{new Class_5()},{new Class_5(),new Class_5(),new Class_5()},{new Class_5(),new Class_5()}},{{new Class_5(),new Class_5()},{new Class_5(),new Class_5(),new Class_5(),new Class_5(),new Class_5(),new Class_5()},{new Class_5()},{new Class_5(),new Class_5()}}}; + int index_1247 = ((short)var_283)&array_1017.length-1; + int index_1246 = array_1017[index_1247]&array_1245.length-1; + int index_1248 = var_822&array_1245[index_1246].length-1; + int index_1251 = var_922&array_916.length-1; + int index_1250 = array_916[index_1251]&array_294.length-1; + short actualArgs_1252 = ((short)var_736); + short var_1253 = (-8134); + int actualArgs_1254 = (var_1253*var_876); + int actualArgs_1255 = (var_975*var_660); + int index_1249 = var_1243.func_8((short)var_306, (short)array_294[index_1250], (short)actualArgs_1252, actualArgs_1254, actualArgs_1255, array_213)&array_1245[index_1246][index_1248].length-1; + int index_1256 = var_274&array_1245.length-1; + int index_1257 = ((char)actualArgs_1233)&array_1245[index_1256].length-1; + int index_1258 = var_1232&array_1245[index_1256][index_1257].length-1; + char actualArgs_1259 = array_1245[index_1256][index_1257][index_1258].func_8((short)actualArgs_1252, (short)actualArgs_1252, (short)25281, (-931029582), (-1006888817), array_213); + short actualArgs_1261 = ((short)var_1260); + int index_1242 = var_1243.func_10(actualArgs_1244, (char)actualArgs_1259, actualArgs_1239, (byte)var_997, (short)actualArgs_1261, var_754)&array_1235[index_1236].length-1; + int index_1262 = var_347&array_1235[index_1236][index_1242].length-1; + int index_1234 = array_1235[index_1236][index_1242][index_1262]&array_932.length-1; + int index_1263 = ((char)var_736)&array_932[index_1234].length-1; + int index_1264 = var_616&array_932[index_1234][index_1263].length-1; + int index_1265 = ((byte)var_943)&array_1017.length-1; + String actualArgs_1266 = (var_1151+var_226); + int index_1229 = array_1023[index_1231].func_17(actualArgs_1233, array_932[index_1234][index_1263][index_1264], actualArgs_1254, array_339, (byte)array_1017[index_1265], actualArgs_1266)&array_1181.length-1; + int index_1228 = ((short)array_1181[index_1229])&array_695.length-1; + int index_1267 = var_720&array_695[index_1228].length-1; + int index_1268 = ((char)1.05708904E8f)&array_695[index_1228][index_1267].length-1; + char actualArgs_1269 = (char)((short)((char)var_885)); + array_695[index_1228][index_1267][index_1268].func_12((char)actualArgs_1269, (short)actualArgs_1252, var_1135, (char)actualArgs_1259, (byte)91, array_1082); + } + catch (Exception e_2) + { + --var_899; + int index_1271 = ((byte)'4')&array_682.length-1; + int index_1270 = array_682[index_1271]&array_1220.length-1; + if (array_1220[index_1270]!=(var_1150||var_1222.func_7(var_943, var_346, var_226, (byte)var_1093, (char)var_876, var_1006))) + { + int index_1272 = ((byte)var_1273)&array_1017.length-1; + int index_1274 = 't'&array_1017.length-1; + var_975 = array_1017[index_1274]; + var_1187 = var_381; + } + else + { + var_997 = var_1219; + array_1275 = array_1275; + var_876 = var_931; + var_875 = var_616; + } + try + { + var_1070.func_12((char)var_1199, (short)var_1260, var_1135, (char)'\\', (byte)var_946, array_1082); + var_1276 = (byte)(var_736--); + int index_1277 = ((byte)'6')&array_785.length-1; + array_785[index_1277] = (char)(-1746323532); + } + catch (Exception e_3) + { + float actualArgs_1279 = ( +func_16(var_921, var_1278, var_639, var_670, var_1089, var_548)); + float actualArgs_1280 = ( -var_660); + float actualArgs_1281 = ( +var_876); + String actualArgs_1282 = (var_1151+true); + char actualArgs_1283 = func_19((short)var_779, (-2.09573856E8f), actualArgs_1280, actualArgs_1281, array_886, actualArgs_1282); + byte actualArgs_1284 = ((byte)var_1199); + int index_1285 = var_986&array_1181.length-1; + String actualArgs_1286 = (var_639+((char)var_372)); + int index_1288 = ( -var_1289)&array_600.length-1; + char actualArgs_1290 = ((char)var_711); + String actualArgs_1291 = (var_1083+var_1089); + float actualArgs_1292 = ( -var_1171); + int index_1287 = func_20(array_600[index_1288], (char)actualArgs_1290, actualArgs_1291, var_345, actualArgs_1282, actualArgs_1292)&array_948.length-1; + int index_1293 = ((byte)var_736)&array_948[index_1287].length-1; + int actualArgs_1295 = (var_101|var_764); + byte actualArgs_1296 = ((byte)var_212); + int index_1294 = func_21((byte)var_1187, var_279, (byte)var_1046, actualArgs_1295, (byte)actualArgs_1296, (char)var_764)&array_948[index_1287][index_1293].length-1; + array_948[index_1287][index_1293][index_1294] = func_14(actualArgs_1279, (char)actualArgs_1283, var_1135, (byte)actualArgs_1284, array_1181[index_1285], actualArgs_1286); + System.out.println( "=======Exception thrown======="+65); + } + for (int id_1297 = 15;id_1297<53;id_1297 += 20) + { + var_1298 = var_1083+var_1089; + var_381 = var_381; + int index_1300 = var_931&array_1299.length-1; + int index_1301 = ((short)var_224)&array_1299[index_1300].length-1; + int index_1303 = var_1304&array_948.length-1; + String var_1306 = "mZ@ /in67n"; + String actualArgs_1308 = (var_1306+var_1307); + int actualArgs_1310 = ( ~var_1309); + short actualArgs_1311 = ((short)var_736); + int index_1305 = func_9(var_330, actualArgs_1308, actualArgs_1310, (char)var_764, (short)actualArgs_1311, (char)var_899)&array_948[index_1303].length-1; + int index_1312 = ((char)var_609)&array_948[index_1303][index_1305].length-1; + int index_1302 = ((byte)array_948[index_1303][index_1305][index_1312])&array_1299[index_1300][index_1301].length-1; + var_1313 = (short)((byte)array_1299[index_1300][index_1301][index_1302]); + } + System.out.println( "=======Exception thrown======="+65); + } + finally + { + for (int id_1314 = 75;id_1314>5;id_1314 -= 24) + { + var_997 = (byte)var_1315; + int index_1316 = var_1317&array_1124.length-1; + var_894 = array_1124[index_1316]<(var_660&((byte)var_212)); + } + int index_1318 = (var_875|var_876)&array_695.length-1; + int index_1320 = var_1232&array_789.length-1; + int index_1319 = array_789[index_1320]&array_695[index_1318].length-1; + int index_1321 = var_987&array_695[index_1318][index_1319].length-1; + int index_1323 = ((byte)var_283)&array_727.length-1; + String actualArgs_1325 = (var_345+var_660); + int index_1326 = var_1315&array_370.length-1; + byte actualArgs_1327 = ((byte)var_901); + int index_1328 = ((byte)((short)var_975))&array_886.length-1; + int index_1329 = (var_609++)&array_886[index_1328].length-1; + int index_1324 = var_1222.func_11(actualArgs_1325, array_370[index_1326], (byte)actualArgs_1327, array_886[index_1328][index_1329], array_370, var_943)&array_727[index_1323].length-1; + int index_1331 = ((byte)((byte)var_282))&array_1023.length-1; + float actualArgs_1333 = ( -var_604); + char actualArgs_1334 = ((char)var_1190); + String actualArgs_1335 = (var_708+'R'); + String actualArgs_1336 = (var_1151+var_336); + int index_1337 = (var_903<>>var_330.func_11(var_708, var_226, (byte)var_1046, var_1345, array_370, index_1322))&array_695[index_1322][index_1341].length-1; + short actualArgs_1346 = (short)']'; + int index_1347 = ((short)((short)var_1219))&array_1181.length-1; + double actualArgs_1349 = -func_19((short)(-19602), array_1181[index_1347], var_226, var_282, array_886, var_1348); + byte actualArgs_1350 = (byte)var_742; + array_695[index_1322][index_1341][index_1344].func_12((char)var_760, (short)actualArgs_1346, actualArgs_1349, (char)var_986, (byte)actualArgs_1350, array_1082); + } + var_1260++; + var_1046++; + } + return var_1150^(var_1289<=var_225); + } + public void func_5(char args_9, char args_10, byte args_11, boolean args_12, char args_13, byte args_14) + { + boolean[] array_1359 = new boolean[]{true,true,false,false,true}; + for (int id_15 = 3;id_15<63;id_15 += 9) + { + try + { + if ((func_6(true, var_282, var_987, var_23, new MainClass(), (char)']')||(var_988||false))&&var_988) + { + var_226 = var_604; + float actualArgs_989 = ( +var_679)/(1|var_224); + int actualArgs_990 = var_350++; + int index_1351 = var_1133&array_1299.length-1; + int index_1352 = (-675553010)&array_1299[index_1351].length-1; + int index_1353 = index_1352&array_1299[index_1351][index_1352].length-1; + boolean actualArgs_1354 = func_22(1.7958744E8f, var_23, (char)var_986, array_1299[index_1351][index_1352][index_1353], array_243, var_279); + char actualArgs_1355 = (char)actualArgs_989; + char actualArgs_1356 = ((char)var_922); + int index_1357 = var_828&array_600.length-1; + byte actualArgs_1358 = func_20(var_999, (char)actualArgs_1356, var_708, var_303, "_/v)|P&gZu", array_600[index_1357]); + func_15(actualArgs_989, actualArgs_990, var_693, actualArgs_1354, (char)actualArgs_1355, (byte)actualArgs_1358); + } + else + { + var_764 = var_1144; + var_306 = var_818; + var_828 = var_609; + boolean[] array_1360 = new boolean[]{false,true,false}; + array_1360 = array_1359; + } + ++var_1273; + int index_1362 = (-24)&array_339.length-1; + int index_1363 = var_741&array_339[index_1362].length-1; + int index_1364 = var_1365&array_339[index_1362][index_1363].length-1; + char actualArgs_1366 = (char)array_339[index_1362][index_1363][index_1364]; + var_1361.func_12((char)var_616, (short)var_350, var_901, (char)actualArgs_1366, (byte)var_742, array_1082); + } + catch (Exception e_2) + { + var_693 = var_1135; + var_305++; + var_828++; + boolean actualArgs_1368 = ((var_673<=var_679)^var_1367); + byte actualArgs_1370 = ((byte)var_978); + int index_1371 = var_679&array_727.length-1; + float actualArgs_1374 = ( -var_691); + String actualArgs_1375 = (var_1307+var_741); + int index_1373 = var_330.func_11(var_639, actualArgs_1374, (byte)var_635, actualArgs_1375, array_370, var_1317)&array_1017.length-1; + int index_1372 = array_1017[index_1373]&array_727[index_1371].length-1; + int index_1376 = ((byte)var_669)&array_727[index_1371][index_1372].length-1; + var_1240 = var_211.func_10(actualArgs_1368, (char)var_1369, var_1307, (byte)actualArgs_1370, (short)array_727[index_1371][index_1372][index_1376], var_645); + System.out.println( "=======Exception thrown======="+66); + } + int index_1377 = ((char)var_1276)&array_827.length-1; + var_679 = array_827[index_1377]/(1|var_741); + } + float var_1378 = 1.45075443E9f; + int actualArgs_1379 = var_1276%(1|1055101950); + char actualArgs_1380 = (char)var_670; + byte actualArgs_1381 = (byte)var_720; + func_15(var_1378, actualArgs_1379, var_885, var_346, (char)actualArgs_1380, (byte)actualArgs_1381); + } + public strictfp void run() + { + float var_1475 = 2.92458528E8f; + Class_4 var_1518 = new Class_4(); + float var_1526 = 4.25257568E8f; + char var_1527 = '1'; + char var_1552 = 'i'; + Class_7 var_1556 = new Class_7(); + boolean var_1565 = true; + try + { + byte var_2 = (-69); + var_2 = (byte)(var_1++); + try + { + try + { + int index_1397 = 116&array_1396.length-1; + int index_1398 = var_1232&array_1396[index_1397].length-1; + int index_1399 = var_741&array_1017.length-1; + int index_1400 = ((byte)(var_1401++))&array_1124.length-1; + byte actualArgs_1402 = func_9(var_330, var_548, var_1317, (char)var_379, (short)var_336, (char)var_616); + char actualArgs_1403 = ((char)var_1187); + char actualArgs_1404 = func_21((byte)array_1017[index_1399], array_1124[index_1400], (byte)actualArgs_1402, index_1397, (byte)var_946, (char)actualArgs_1403); + byte actualArgs_1405 = func_9(var_330, var_23, array_1396[index_1397][index_1398], (char)actualArgs_1404, (short)var_673, (char)'A'); + int index_1406 = ((char)((char)var_609))&array_932.length-1; + int index_1407 = (((short)var_1013)-var_609)&array_932[index_1406].length-1; + int index_1408 = ((short)var_746)&array_932[index_1406][index_1407].length-1; + int index_1409 = var_1410&array_1195.length-1; + String actualArgs_1414 = ("@T-5;id_1446 -= 2) + { + int index_1447 = ((char)var_736)&array_1299.length-1; + int index_1448 = 't'&array_1299[index_1447].length-1; + int index_1449 = var_609&array_1299[index_1447][index_1448].length-1; + String actualArgs_1450 = (var_548+var_1006); + var_1304 = func_20(array_1299[index_1447][index_1448][index_1449], (char)var_379, actualArgs_1450, "U;3Hc*J('Y", "gB<$/kso'", var_283); + } + byte actualArgs_1452 = (byte)var_1451; + func_15(var_283, var_987, var_302, var_1054, (char)'@', (byte)actualArgs_1452); + var_997++; + int index_1453 = var_1317&array_827.length-1; + int index_1454 = var_212&array_827.length-1; + array_827[index_1454]--; + } + catch (Exception e_2) + { + for (int id_1455 = 68;id_1455<79;id_1455 += 2) + { + int index_1457 = var_742&array_727.length-1; + int index_1459 = ((byte)var_922)&array_1396.length-1; + int index_1460 = 2102276380&array_1396[index_1459].length-1; + int index_1458 = array_1396[index_1459][index_1460]&array_727[index_1457].length-1; + int index_1461 = ((byte)( ~var_975))&array_727[index_1457][index_1458].length-1; + int index_1462 = ((short)(var_224*(-76)))&array_1412.length-1; + array_1412[index_1462] = var_1456/(1|((short)array_727[index_1457][index_1458][index_1461])); + } + char actualArgs_1463 = (char)var_679; + char actualArgs_1464 = (char)(((char)var_224)&var_875); + float actualArgs_1465 = ((var_760++)-var_381); + char actualArgs_1466 = ((char)(-5.50918765672201E7d)); + String actualArgs_1467 = ((var_345+7.399755897930466E8d)+var_669); + byte actualArgs_1468 = func_20(actualArgs_1465, (char)actualArgs_1466, "w33w!72?aY"},{"<>@@(Ne5)[","[6~,Z^0VxP","|LgeB20XbX"},{"5YF&Y745`8",")@((OaC)e,",".v||Mrq>vF","K6\\u)vr h@"},{"aHGpJnE70q","-Tuu|=O2q!","KQ#>_z6t'Q"}}, var_303)&array_727.length-1; + int index_1476 = ((char)var_224)&array_727[index_1473].length-1; + int index_1478 = (var_828>>>var_1479)&array_1421.length-1; + int index_1480 = var_1273&array_1421[index_1478].length-1; + int index_1482 = (-1264793836)&array_1017.length-1; + int index_1481 = array_1017[index_1482]&array_1421[index_1478][index_1480].length-1; + int index_1477 = array_1421[index_1478][index_1480][index_1481]&array_727[index_1473][index_1476].length-1; + var_673 = array_727[index_1473][index_1476][index_1477]; + System.out.println( "=======Exception thrown======="+69); + } + finally + { + if ( !(var_1483&&( !var_1483))) + { + char var_1484 = 'H'; + var_1484 = 'a'; + short actualArgs_1485 = (short)((byte)var_1171); + float actualArgs_1486 = ( +((char)1.187257799158474E9d)); + byte actualArgs_1487 = ((byte)var_711); + int actualArgs_1488 = (var_276*var_720); + byte actualArgs_1489 = func_9(var_330, var_1307, actualArgs_1488, (char)var_305, (short)var_1133, (char)var_276); + byte actualArgs_1490 = ((byte)var_268); + char actualArgs_1491 = func_19((short)var_225, var_1475, var_1475, var_999, array_886, var_1436); + char actualArgs_1492 = func_21((byte)actualArgs_1487, actualArgs_1488, (byte)actualArgs_1489, var_1443, (byte)actualArgs_1490, (char)actualArgs_1491); + double actualArgs_1493 = func_14(actualArgs_1486, (char)actualArgs_1492, var_268, (byte)var_1093, var_226, "]*u*M]n|Ii"); + double actualArgs_1494 = ((-9.1938586E8f)*(var_931++)); + char actualArgs_1495 = ((char)((byte)var_691)); + boolean[][] actualArgs_1496 = func_13((short)var_818, actualArgs_1494, var_215, (char)actualArgs_1495, var_724, (-527166060)); + var_585.func_12((char)var_669, (short)actualArgs_1485, actualArgs_1493, (char)']', (byte)var_1187, actualArgs_1496); + } + else + { + --var_1428; + var_212--; + boolean actualArgs_1498 = (var_1497^(var_295<='@')); + int actualArgs_1499 = (var_987%(1|((byte)var_1401))); + String actualArgs_1500 = (var_23+var_548); + int index_1502 = 16813&array_1501.length-1; + if (func_6(actualArgs_1498, var_282, actualArgs_1499, actualArgs_1500, array_1501[index_1502], (char)var_760)) + { + int index_1503 = var_922&array_886.length-1; + int index_1504 = ((short)var_746)&array_886[index_1503].length-1; + var_345 = var_1083+(array_886[index_1503][index_1504]+((char)var_1505)); + byte actualArgs_1506 = ((byte)var_899); + int actualArgs_1508 = var_1507.func_17(var_978, var_1135, var_941, array_339, (byte)var_1276, var_548); + var_1278 = var_1222.func_11(var_1307, var_283, (byte)actualArgs_1506, var_1194, array_370, actualArgs_1508)==( -((char)var_1144)); + } + else + { + int index_1510 = (var_212*var_1304)&array_1220.length-1; + String actualArgs_1511 = ("J.6l1iY6.M"+var_1054); + int index_1509 = func_16(array_1220[index_1510], true, actualArgs_1511, index_1502, var_283, ";u5s'$c*i^")&array_600.length-1; + int index_1512 = var_899&array_600.length-1; + var_1475 = array_600[index_1512]; + var_693 = var_999/(1|var_609); + } + } + var_1150 = var_693","8s6-O5v/uO","Yxa7n9pP|W"},{"LuRnq|Uu]W","P*NPpXKgo+","p:0|]_=VBt","spakJ#L~Qq","C4\"8!Q_-US","yUh/(rAz|V","exmTlq!uxo","ZQ[36QHy:T"}}, var_1525)5;id_1532 -= 2) + { + var_828 = (short)( -var_295); + int index_1533 = var_1187&array_370.length-1; + short actualArgs_1535 = ((short)var_693); + String var_1538 = "LC!YSrL_(c"; + int index_1536 = ((byte)func_16(var_346, var_1278, var_1436, var_746, var_1537, var_1538))&array_600.length-1; + float actualArgs_1539 = (var_1369/(1|var_224)); + String actualArgs_1540 = (var_303+var_1520); + int index_1534 = func_19((short)actualArgs_1535, array_600[index_1536], var_604, actualArgs_1539, array_886, actualArgs_1540)&array_370.length-1; + var_1537 = array_370[index_1534]; + } + try + { + var_946 = var_946; + var_548 = var_1541; + short actualArgs_1542 = (short)((var_1456/(1|var_212))*var_1093); + short actualArgs_1543 = ((short)((char)var_1505)); + float actualArgs_1544 = (var_1401++); + String actualArgs_1545 = (var_639+var_274); + int actualArgs_1547 = var_1507.func_17(3.2441986337949354E7d, var_978, var_987, array_339, (byte)var_975, var_1546); + int actualArgs_1548 = var_1518.func_11(var_23, actualArgs_1544, (byte)var_946, actualArgs_1545, array_370, actualArgs_1547); + char actualArgs_1549 = var_1435.func_8((short)(-27608), (short)(-4425), (short)actualArgs_1543, actualArgs_1548, (-1029884901), array_213); + String actualArgs_1550 = (var_1348+var_1526); + int index_1551 = ((short)var_347)&array_916.length-1; + byte actualArgs_1553 = func_9(var_330, actualArgs_1550, 648358489, (char)array_916[index_1551], (short)(-29882), (char)var_1552); + var_1361.func_12((char)var_1369, (short)actualArgs_1542, 3.7666483640725744E8d, (char)actualArgs_1549, (byte)actualArgs_1553, array_1082); + } + catch (Exception e_3) + { + int index_1554 = var_660&array_1023.length-1; + int index_1555 = var_1133&array_1023.length-1; + var_1556 = array_1023[index_1555]; + int index_1557 = ((char)(-597495976))&array_871.length-1; + array_871[index_1557] = var_1109; + System.out.println( "=======Exception thrown======="+71); + } + try + { + char actualArgs_1558 = (char)(1874405928*(var_1133*var_1317)); + byte actualArgs_1559 = (byte)var_1401; + int index_1560 = ((short)((short)(-14239)))&array_916.length-1; + int actualArgs_1562 = var_1556.func_17(var_268, var_901, var_987, array_339, (byte)actualArgs_1559, var_1561); + byte actualArgs_1563 = ((byte)var_1171); + byte actualArgs_1564 = (byte)var_1556.func_17(var_302, var_693, actualArgs_1562, array_339, (byte)actualArgs_1563, var_303); + func_5((char)actualArgs_1558, (char)actualArgs_1558, (byte)actualArgs_1559, var_921, (char)array_916[index_1560], (byte)actualArgs_1564); + } + catch (Exception e_3) + { + var_1552 = var_1369; + var_805 = var_1565; + var_999 = var_1526; + System.out.println( "=======Exception thrown======="+72); + } + finally + { + var_350 = (-4281); + var_1094 = var_211; + var_1365 = var_1304; + int index_1566 = ( +((byte)var_1219))&array_600.length-1; + char actualArgs_1567 = (char)array_600[index_1566]; + char actualArgs_1568 = ((char)var_779); + boolean actualArgs_1569 = func_6(var_921, 1.3488728E8f, var_1443, "OaNY s2PC", var_707, (char)actualArgs_1568); + char actualArgs_1570 = (char)var_1273; + byte actualArgs_1571 = (byte)( +(-61)); + func_5((char)var_1199, (char)actualArgs_1567, (byte)var_742, actualArgs_1569, (char)actualArgs_1570, (byte)actualArgs_1571); + } + var_306 = var_1428; + } + int index_1572 = ( -(var_903^var_101))&array_785.length-1; + boolean actualArgs_1574 = (((char)var_268)=='['); + float actualArgs_1575 = ((-1861168611)*((char)var_1456)); + String actualArgs_1576 = ((var_639+var_295)+var_347); + char actualArgs_1578 = ((char)(var_828*var_1577)); + boolean actualArgs_1579 = func_6(actualArgs_1574, actualArgs_1575, var_720, actualArgs_1576, var_707, (char)actualArgs_1578); + int index_1581 = var_997&array_1580.length-1; + byte actualArgs_1582 = (byte)var_885; + func_5((char)array_785[index_1572], (char)var_876, (byte)var_1573, actualArgs_1579, (char)array_1580[index_1581], (byte)actualArgs_1582); + } + } +} +class Class_3 +{ + public static char var_1383 = '4'; + protected static byte[][] array_1384 = new byte[][]{{65,51},{60,(-3),(-128)},{(-70),(-66),69,(-80),118},{11,(-32),(-51),1,(-125),66,108,(-96)}}; + private static MainClass var_1390 = new MainClass(); + private static String var_1391 = "bYo\\6U\">RM"; + private static float var_1392 = 5.5957894E8f; + static MainClass var_1393 = new MainClass(); + private static byte var_1394 = (-112); + public void func_4(byte args_3, double args_4, MainClass args_5, byte args_6, char args_7, char args_8) + { + MainClass var_1382 = new MainClass(); + short var_1386 = (-1097); + int index_1385 = var_1386&array_1384.length-1; + int index_1387 = index_1385&array_1384[index_1385].length-1; + boolean actualArgs_1388 = var_1383<(index_1385--); + int index_1389 = (var_1390.func_20(8.2805594E8f, (char)var_1383, var_1391, var_1391, var_1391, var_1392)>>var_1393.func_21((byte)var_1394, index_1385, (byte)var_1394, index_1387, (byte)var_1394, (char)var_1383))&array_1384.length-1; + int index_1395 = var_1386&array_1384[index_1389].length-1; + var_1382.func_5((char)var_1383, (char)'C', (byte)array_1384[index_1385][index_1387], actualArgs_1388, (char)'V', (byte)array_1384[index_1389][index_1395]); + } +} +class Class_4 +{ + public static boolean var_30 = false; + public static int var_31 = (-1759342740); + private static byte var_32 = 24; + protected static char var_33 = '|'; + public static boolean var_35 = false; + protected static double var_36 = 1.3397771667433065E8d; + private static String var_37 = " aWu:TaRt6"; + static long var_38 = (-86857768526940136L); + public static boolean var_39 = true; + static float var_40 = 3.69057184E8f; + static boolean var_41 = false; + protected static Class_4 var_43 = new Class_4(); + private static byte var_48 = 34; + protected static String var_51 = "e(O ~e7G)l"; + static boolean var_52 = true; + public static boolean var_53 = false; + public static Class_3 var_54 = new Class_3(); + protected static Class_3 var_55 = new Class_3(); + static int var_57 = (-400481591); + protected static char var_60 = '_'; + protected static float var_63 = 1.15771597E9f; + protected static byte var_65 = 7; + protected static int var_66 = 1255097543; + private static double var_67 = (-9.838687955809822E8d); + static String var_68 = "5H*8Dc3W!U"; + protected static boolean var_70 = true; + private static boolean[][] array_71 = new boolean[][]{{true,false,false},{true,true,false,true,false},{false,false,false},{true,false}}; + protected static boolean[][] array_78 = new boolean[][]{{false,true,true},{false,false,true},{true,true,false,true,true,true,false},{true,true,true,false},{true,true,false,true}}; + private static boolean[][] array_79 = new boolean[][]{{false,true,false,false,false},{true},{false,false},{true,true,true,false,true,false},{false,true,true,true,true},{true,true,false},{false,false}}; + public static byte var_81 = (-112); + public static char var_83 = '\\'; + public static float var_88 = 1.15672461E9f; + static boolean var_89 = true; + static byte var_90 = (-2); + private static Class_3 var_92 = new Class_3(); + private static MainClass var_93 = new MainClass(); + protected static boolean var_94 = false; + protected static boolean var_96 = false; + public static byte var_97 = (-11); + static short var_465 = (-22559); + public static char[][] array_467 = new char[][]{{'h','%','L'},{'E','U','/','6'},{'c','9','L','A','8','m'},{'v','>','?','r','&'},{'v','k','Z','q','-'},{'-','^','-'},{'i','Z','u','Q','N',':','R'}}; + private static float var_468 = 3.3978768E8f; + static boolean[][] array_469 = new boolean[][]{{false,false,false,false,true,true,true},{true,true,false},{false,true,false,false,true,true},{false,false,true,false}}; + protected static String var_475 = ";1_WYvru/J"; + protected static boolean var_476 = false; + static int[] array_478 = new int[]{(-1989409711),1037870916}; + static short var_482 = (-20987); + public static float var_489 = 2.416277E7f; + protected static int[][][] array_496 = new int[][][]{{{669339068,822109314,424645832,508838308},{1899595148,(-383102645),(-284603536),(-1402718672)},{(-2026799607),1580174659,1859030356},{(-198679462),779719351},{461706235,955819020},{678526782,662959867,(-973926945),(-1536710322)}},{{375475720,1111658375,(-2103689232),855960687},{320737424,(-70714192),(-180442028),(-1832125839)},{348168238,174018309},{(-491889893),(-2032563102),(-853225843)},{1555076692,(-1347802115)},{219231682},{(-327822112)}},{{(-743862705),1080261283,(-734070511),(-1581680144),(-1371333952),115880207,(-325839238)},{1670754451,1997504164,(-1181505439),2003872060},{(-410288364),(-1159985848),543798076,(-2142359011),381081030},{1697732796,1555478051,888303700,(-210914101),190268002,688357675,319363341}}}; + protected static char var_503 = 'X'; + protected static byte var_511 = 17; + public static boolean var_512 = false; + protected static short var_519 = 18957; + static boolean var_520 = false; + private static char var_522 = '2'; + public static short var_527 = 28961; + static short var_529 = 1126; + protected static boolean var_531 = true; + private static int var_532 = 1989913498; + private static short var_541 = (-12902); + public boolean func_7(int args_24, boolean args_25, float args_26, byte args_27, char args_28, boolean args_29) + { + short var_34 = 10908; + if (var_30) + { + try + { + ++var_31; + var_33 = (char)var_32; + var_34 = (short)var_34; + if ( !var_35) + { + var_36 = var_36; + var_37 = var_37; + } + var_34 = (short)var_34; + } + catch (Exception e_2) + { + ++var_38; + if ( !((var_39&&var_39)&(var_39||var_39))) + { + var_36 = var_36; + var_32 = var_32; + var_37 = var_37+var_40; + } + var_31 = var_31; + var_36 = -var_36; + var_41 = var_41; + System.out.println( "=======Exception thrown======="+1); + } + for (int id_42 = 64;id_42>13;id_42 -= 6) + { + var_43 = var_43; + var_37 = var_37; + } + --var_34; + var_31 = var_31; + var_36 = var_36; + var_34 = (short)var_36; + } + else + { + var_37 = var_37; + var_34 = var_34; + var_31++; + for (int id_44 = 57;id_44>0;id_44 -= 9) + { + var_40 = var_40; + var_33 = 'W'; + } + var_37 = var_37; + } + int var_58 = 89457061; + for (int id_45 = 40;id_45>14;id_45 -= 4) + { + try + { + try + { + var_33 = (char)((short)var_32); + var_41 = (var_31&var_31)>=var_36; + boolean var_46 = false; + var_46 = var_46||(var_3641;id_47 -= 4) + { + var_34 = var_34; + var_37 = ((var_37+var_40)+var_32)+var_33; + var_33 = var_33; + var_37 = "|/@-)=:CU|"; + } + try + { + var_33 = (char)var_33; + var_36 = var_36; + var_37 = var_37; + var_33 = (char)var_34; + } + catch (Exception e_3) + { + var_41 = var_41; + var_40 = var_40; + var_34 = (short)var_33; + var_32 = (byte)((char)((short)var_31)); + var_48 = var_48; + var_40 = var_40; + System.out.println( "=======Exception thrown======="+3); + } + } + catch (Exception e_2) + { + for (int id_49 = 41;id_49<49;id_49 += 3) + { + var_48 = var_32; + var_34 = var_34; + var_32 = (byte)var_40; + var_37 = var_37; + var_40 = -( +var_40); + } + if (var_38>((byte)(var_33--))) + { + var_36 = var_36; + var_40 = var_40; + var_40 = var_33++; + } + for (int id_50 = 10;id_50>8;id_50 -= 1) + { + var_36 = var_36; + var_37 = (var_51+var_51)+var_52; + var_34 = var_34; + var_52 = var_41; + } + var_34++; + if (var_53) + { + var_31 = (-872037482); + var_31 = var_31; + var_40 = (-1.33831176E8f); + } + System.out.println( "=======Exception thrown======="+4); + } + finally + { + var_34 = var_34; + var_32++; + var_55 = var_54; + for (int id_56 = 31;id_56<44;id_56 += 7) + { + var_58 = var_57; + var_36 = var_31/var_40; + var_36 = var_36; + var_33 = (char)var_40; + var_40 = var_48+(-111); + } + var_31 = var_58; + boolean var_59 = true; + if (var_59) + { + var_48 = (byte)var_58; + var_60 = var_33; + } + } + for (int id_61 = 66;id_61>18;id_61 -= 25) + { + var_34 = var_34; + var_57++; + } + var_31 = var_60^var_58; + if ((var_34++)>(var_32%(1|((short)var_33)))) + { + for (int id_62 = 19;id_62<55;id_62 += 5) + { + var_51 = var_37; + var_33 = '3'; + var_63 = var_63; + var_34 = var_34; + } + for (int id_64 = 96;id_64>90;id_64 -= 2) + { + var_31 = (-285554110); + var_63 = (-1.19326605E9f); + var_32 = var_32; + } + var_33 = (char)((byte)var_40); + --var_65; + } + else + { + if ((((byte)var_34)^((byte)var_66))>var_36) + { + var_34 = (short)(var_32*var_36); + var_67 = var_36; + var_63 = var_40; + var_66 = (var_60%(1|(-1766306110)))^((short)var_40); + var_68 = var_37; + var_41 = var_41; + } + for (int id_69 = 59;id_69>10;id_69 -= 10) + { + var_41 = var_63<=5305; + var_52 = var_41^var_41; + var_52 = var_70; + var_48 = (byte)var_34; + var_40 = var_63--; + } + --var_38; + var_51 = var_51; + } + } + boolean var_91 = true; + char var_95 = 'f'; + double var_98 = 1.3029122040064515E8d; + try + { + var_48 = var_65; + int index_72 = ((short)var_38)&array_71.length-1; + int index_73 = (var_32++)&array_71[index_72].length-1; + int index_74 = var_34&array_71.length-1; + int index_75 = var_60&array_71[index_74].length-1; + int index_76 = var_34&array_71.length-1; + int index_77 = 1568269795&array_71[index_76].length-1; + if ((array_71[index_72][index_73]&&array_71[index_74][index_75])|array_71[index_76][index_77]) + { + ++var_34; + var_33--; + var_33++; + try + { + array_78 = array_71; + var_48 = (byte)((short)var_36); + } + catch (Exception e_3) + { + array_79 = array_71; + var_36 = var_67; + var_34 = var_34; + System.out.println( "=======Exception thrown======="+5); + } + finally + { + var_65 = (byte)var_65; + var_40 = var_38++; + var_37 = "Uo<$HGJ[c?"+30675; + } + var_34--; + --var_38; + } + else + { + var_41 = var_65>=var_65; + --var_38; + var_63 = var_63; + ++var_33; + } + } + catch (Exception e_1) + { + for (int id_80 = 63;id_80<95;id_80 += 9) + { + var_81 = (byte)var_34; + for (int id_82 = 60;id_82>21;id_82 -= 5) + { + var_68 = ("SN~eF-&-1o"+((byte)var_33))+((short)('C'+var_83)); + var_81 = var_81; + byte[][] array_84 = new byte[][]{{42,(-49),84},{(-24),79,121,79,(-51),25},{(-64),(-1)},{(-42),(-16)}}; + int index_85 = var_31&array_84.length-1; + int index_86 = var_65&array_84[index_85].length-1; + array_84[index_85][index_86] = var_81; + } + } + ++var_31; + var_32 = var_65; + try + { + var_37 = var_51; + try + { + short var_87 = 6744; + var_57 = var_87-var_34; + var_57 = var_57+var_65; + var_40 = var_63; + } + catch (Exception e_3) + { + var_68 = var_68; + var_88 = var_40; + System.out.println( "=======Exception thrown======="+7); + } + finally + { + var_32 = (byte)var_67; + var_34 = (short)var_60; + var_34 = var_34; + } + --var_31; + } + catch (Exception e_2) + { + if (var_89&( !(var_32==var_48))) + { + var_36 = var_67; + var_67 = var_36; + var_37 = var_68; + var_90 = (byte)var_36; + } + else + { + var_70 = var_41; + var_70 = var_70; + var_48 = var_90; + } + if ( !var_91) + { + var_66 = var_31; + var_57 = var_57+((char)var_65); + } + else + { + var_92 = var_92; + var_93 = var_93; + } + var_48 = var_32; + var_33++; + var_31++; + System.out.println( "=======Exception thrown======="+8); + } + finally + { + ++var_81; + if (var_94) + { + var_95 = var_83; + var_31 = var_57; + var_34 = (short)var_38; + var_52 = var_70||true; + var_88 = var_63; + var_92 = var_55; + } + else + { + var_36 = var_67; + var_90 = (byte)((byte)((byte)var_38)); + var_41 = var_41; + var_90 = var_32; + var_37 = var_68; + var_48 = var_90; + } + if (var_96) + { + var_97 = var_65; + var_41 = var_70; + var_58 = var_31; + var_36 = var_98; + } + var_34 = var_34; + } + var_34 = (short)(((short)var_63)*var_48); + System.out.println( "=======Exception thrown======="+8); + } + boolean var_99 = true; + return var_99; + } + public int func_11(String args_459, float args_460, byte args_461, String args_462, float[] args_463, int args_464) + { + var_465--; + int var_480 = (-1244999902); + try + { + for (int id_466 = 16;id_466>1;id_466 -= 6) + { + var_57--; + array_467 = new char[][]{{'C','|','r'},{')'}}; + var_468 = var_60--; + var_55 = var_92; + --var_31; + var_60 = var_83; + } + --var_38; + var_38--; + int index_470 = ((byte)( -var_468))&array_469.length-1; + int index_471 = var_465&array_469[index_470].length-1; + int index_472 = var_81&array_469.length-1; + int index_473 = var_465&array_469[index_472].length-1; + if (array_469[index_472][index_473]) + { + ++var_31; + for (int id_474 = 58;id_474>46;id_474 -= 5) + { + var_51 = ("vULm#g0D(["+var_475)+var_67; + var_93 = var_93; + var_83 = var_33; + var_70 = var_476; + var_31 = var_60--; + } + try + { + var_465 = (short)var_65; + var_51 = var_68+(var_70^(var_41&&var_70)); + } + catch (Exception e_3) + { + var_67 = var_67; + var_70 = var_70; + System.out.println( "=======Exception thrown======="+28); + } + ++var_97; + var_70 = var_41; + } + } + catch (Exception e_1) + { + var_38++; + try + { + var_51 = "yla[b3F6)+"; + for (int id_477 = 32;id_477>22;id_477 -= 3) + { + array_469 = array_469; + var_36 = var_63--; + } + try + { + var_68 = "-s'^_u5M,#"; + var_36 = (-4.212366820756431E8d); + var_465 = (short)var_67; + var_51 = var_51; + var_88 = var_88; + } + catch (Exception e_3) + { + int index_479 = (var_33-var_465)&array_478.length-1; + var_480 = array_478[index_479]<<((byte)var_40); + var_465 = var_465; + System.out.println( "=======Exception thrown======="+30); + } + var_465 = (short)((byte)var_38); + --var_38; + var_93 = var_93; + } + catch (Exception e_2) + { + ++var_465; + int index_481 = var_482&array_467.length-1; + int index_483 = var_57&array_467[index_481].length-1; + int index_484 = var_57&array_467.length-1; + int index_485 = 105&array_467[index_484].length-1; + array_467[index_484][index_485]++; + System.out.println( "=======Exception thrown======="+31); + } + finally + { + --var_66; + var_465--; + var_465 = var_465; + } + System.out.println( "=======Exception thrown======="+31); + } + short[][][] array_497 = new short[][][]{{{21260},{(-10014),(-16836),(-29564),(-23295),21516,20343,(-19923)},{(-2196),16128},{(-9916),22162,21881,(-10043)},{18700,23927}},{{9785,21210,(-3579),(-20829)},{(-28409),4297,71,17477},{6693,(-9371),(-24135)},{31368,23065,17115,(-2531),14722},{2567,7239,(-29524)},{32682,23526,11799,101}},{{29685,10026,7338,(-9573),(-32694)},{14962},{8385,(-30102),(-7187)},{8197,16170,21753,(-3433),(-9422),23225}},{{(-6351),(-6798),2477,(-7502),29489},{(-12677),15562}}}; + char var_518 = '8'; + for (int id_486 = 30;id_486<80;id_486 += 7) + { + for (int id_487 = 37;id_487>17;id_487 -= 3) + { + for (int id_488 = 0;id_488<31;id_488 += 8) + { + var_63 = var_489; + var_32 = (byte)var_65; + } + try + { + int index_490 = ((short)var_38)&array_467.length-1; + int index_491 = ((byte)((byte)var_32))&array_467[index_490].length-1; + int index_493 = var_90&array_467.length-1; + int index_494 = var_482&array_467[index_493].length-1; + int index_492 = array_467[index_493][index_494]&array_467.length-1; + int index_495 = var_482&array_467[index_492].length-1; + var_33 = array_467[index_492][index_495]; + } + catch (Exception e_3) + { + var_67 = var_67; + var_36 = var_36; + var_37 = var_475; + System.out.println( "=======Exception thrown======="+32); + } + finally + { + var_65 = (-101); + var_489 = var_489; + array_496 = array_496; + var_70 = var_476; + } + try + { + var_33 = (char)var_60; + var_67 = var_67; + } + catch (Exception e_3) + { + array_497 = new short[][][]{{{32305,23313,(-27325),11761},{8640,13092,31459},{28107,15879,20411,10559,983,14237,31045,(-26976)}},{{(-21862),(-11004),9723},{(-15485)},{2140,(-30919),(-24352),11704},{18924,(-13369)}},{{(-11868),(-27363),20885},{12452,19661,(-13101)},{(-7536),19707,26577,5244},{(-32061),(-3557),12361},{(-2201),(-11185),19912,6371}}}; + int index_499 = var_83&array_497.length-1; + int index_500 = ((byte)index_499)&array_497[index_499].length-1; + int index_501 = (var_60%(1|((byte)var_63)))&array_497[index_499][index_500].length-1; + int index_498 = array_497[index_499][index_500][index_501]&array_478.length-1; + array_478[index_498] = 1655783367; + System.out.println( "=======Exception thrown======="+33); + } + var_33 = var_33; + for (int id_502 = 21;id_502<28;id_502 += 4) + { + var_465 = (short)((short)( -var_503)); + var_31 = var_480++; + var_41 = ((var_33var_32); + var_51 = var_37; + } + try + { + short var_504 = (-20087); + var_489 = (((char)var_504)+((byte)var_57))-(var_83|(var_480>>var_503)); + } + catch (Exception e_3) + { + int index_505 = 4849&array_496.length-1; + int index_507 = var_32&array_496.length-1; + int index_508 = (var_465>>>((char)var_97))&array_496[index_507].length-1; + int index_509 = ((char)var_36)&array_496[index_507][index_508].length-1; + int index_506 = array_496[index_507][index_508][index_509]&array_496[index_505].length-1; + int index_510 = ((char)((short)var_36))&array_496[index_505][index_506].length-1; + var_480 = ~array_496[index_505][index_506][index_510]; + System.out.println( "=======Exception thrown======="+34); + } + } + var_476 = false; + --var_511; + try + { + var_40 = var_468; + if (var_512&&var_512) + { + int index_513 = ((char)var_489)&array_497.length-1; + int index_515 = var_482&array_467.length-1; + int index_516 = var_503&array_467[index_515].length-1; + int index_514 = ((-26838)%(1|array_467[index_515][index_516]))&array_497[index_513].length-1; + int index_517 = ((var_518*var_503)/(1|var_519))&array_497[index_513][index_514].length-1; + var_36 = -(var_38*array_497[index_513][index_514][index_517]); + } + if (var_520) + { + var_465 = (short)var_38; + var_83 = var_503; + } + else + { + int index_521 = var_522&array_467.length-1; + int index_523 = ((byte)var_31)&array_467[index_521].length-1; + int index_524 = (var_65&var_522)&array_467.length-1; + int index_525 = var_60&array_467[index_524].length-1; + int index_526 = var_527&array_467.length-1; + int index_528 = ( ~((char)var_67))&array_467[index_526].length-1; + array_467[index_526][index_528] = array_467[index_524][index_525]; + } + var_66++; + var_519 = (short)var_83; + } + catch (Exception e_2) + { + var_529++; + var_65 = var_511; + for (int id_530 = 6;id_530<93;id_530 += 22) + { + var_522 = var_33; + var_67 = var_67; + var_36 = var_36; + var_529 = var_527; + } + var_68 = var_475; + var_476 = ((short)var_482)!=(-10357); + System.out.println( "=======Exception thrown======="+35); + } + finally + { + var_51 = "W|j\"|AxWI~"+var_52; + if (true|((var_38<=var_48)|var_531)) + { + var_67 = var_36; + var_532 = var_31; + var_81 = 97; + int index_535 = var_518&array_496.length-1; + int index_536 = var_480&array_496[index_535].length-1; + int index_537 = var_83&array_496[index_535][index_536].length-1; + int index_534 = (52891445&array_496[index_535][index_536][index_537])&array_497.length-1; + int index_538 = (index_534++)&array_497[index_534].length-1; + int index_539 = ((char)var_67)&array_497[index_534][index_538].length-1; + int index_533 = array_497[index_534][index_538][index_539]&array_467.length-1; + int index_540 = 'o'&array_467[index_533].length-1; + array_467[index_533][index_540] = var_503; + } + var_480--; + var_67 = var_36; + } + ++var_541; + --var_81; + } + int index_542 = 1452449694&array_496.length-1; + int index_543 = var_60&array_496[index_542].length-1; + int index_544 = ((byte)var_532)&array_496[index_542][index_543].length-1; + int index_545 = 12285&array_496.length-1; + int index_546 = var_511&array_496[index_545].length-1; + int index_547 = ((char)var_36)&array_496[index_545][index_546].length-1; + return array_496[index_545][index_546][index_547]; + } +} +class Class_5 +{ + static long var_108 = 4117565168468467076L; + private static boolean var_112 = false; + private static char var_116 = '"'; + static boolean var_119 = true; + private static char[][] array_120 = new char[][]{{'g','['},{'(','E'},{'d','z','(','X',']',' '},{'z','b','1','P','|','L'},{'t','6','r','O','|'},{'2','\'','J','<','h','?'},{'9','u','h',':'}}; + private static byte var_122 = 41; + private static byte var_134 = 127; + private static float var_136 = 4.77349216E8f; + protected static int var_147 = (-1543689414); + static String var_148 = "cot|>MK ,="; + public static double var_150 = 2.519163604928355E8d; + static boolean var_157 = true; + static String var_158 = "r|;?`8b<@D"; + protected static short var_161 = 1299; + protected static int var_162 = (-630681932); + static boolean var_184 = true; + private static short var_186 = (-425); + public static int var_187 = (-1015557171); + private static short var_188 = 4263; + private static int var_189 = (-119267960); + public static char var_407 = '~'; + public static Class_5 var_408 = new Class_5(); + static byte[][] array_412 = new byte[][]{{(-63),(-55),0,40},{98,63,73},{91,8,60,(-71),57,(-44)},{(-66)}}; + static String[][] array_422 = new String[][]{{"\\~UN;MmV~;",")no~N|G@fO","xQ_xDQwb|G","vWz:SWVD|r"},{"~h038'@90H","<5s,|ydyG`"},{"KL~t|&]c$1","9p@g@lff|3","k~5Bntd%L!","\\|+,NhidMo","|UVB?q'Zs=","JFeXAvLh2="},{"8m\\>r@cEQ)","B=Kk|h,Wf","j2l&Jc$:X ","&KDC.(RC@@"}}; + static boolean[][][] array_431 = new boolean[][][]{{{false,false,false,true,true,false},{true,false,false,false},{false,false,true}},{{false,false,true,false},{true,true,true,true},{true,false,false,true,true},{false,false,false,false,false,true},{true,true,false,false,false,false}},{{true,true,true},{true,false,true},{true,false,true,true}}}; + protected static short var_441 = (-8472); + protected static float var_456 = (-1.38989683E9f); + public char func_8(short args_102, short args_103, short args_104, int args_105, int args_106, byte[][] args_107) + { + var_108++; + short[] array_113 = new short[]{(-13388),31388,22575}; + for (int id_109 = 47;id_109>27;id_109 -= 3) + { + int var_110 = (-114727043); + ++var_110; + float var_111 = (-1.79576528E8f); + var_111 = var_111++; + try + { + if (var_112) + { + int index_115 = ((short)var_116)&array_113.length-1; + int index_114 = array_113[index_115]&array_113.length-1; + int index_117 = ((char)(-992514141))&array_113.length-1; + int index_118 = ((byte)var_108)&array_113.length-1; + array_113[index_118] = array_113[index_117]; + } + else + { + var_119 = var_119; + int index_121 = var_122&array_120.length-1; + int index_123 = ((short)(var_122<70;id_124 -= 4) + { + var_110 = 1815329733; + int index_125 = var_110&array_113.length-1; + int index_126 = ((byte)index_125)&array_113.length-1; + int index_127 = var_110&array_113.length-1; + array_113[index_127] = array_113[index_126]; + } + } + catch (Exception e_2) + { + int[][][] array_128 = new int[][][]{{{(-1178219227),25848327},{(-1629124073),1607505748,878828788,1975351978,1025005689},{(-1871261736)},{1989970143}}}; + int index_129 = var_116&array_128.length-1; + int index_130 = ( -'4')&array_128[index_129].length-1; + int index_132 = ((byte)',')&array_113.length-1; + int index_131 = array_113[index_132]&array_128[index_129][index_130].length-1; + index_130 = array_128[index_129][index_130][index_131]+var_116; + System.out.println( "=======Exception thrown======="+9); + } + } + var_122--; + Class_3 var_149 = new Class_3(); + MainClass var_151 = new MainClass(); + int[][][] array_163 = new int[][][]{{{1712078658,1025630918,1573297021,531762132},{2120710603,1265364657,1020583838},{1861608999,(-1702854947),1286257262},{1181203498,(-870167418),(-246214521),(-424730019)},{(-2000333098)}},{{(-586165251),(-1647358948),1173398133,(-320232926)},{1674103368,(-1732925660),1619862644}},{{(-1857572398),(-1570740892),(-499323597),(-1729496491)},{1880252718,212700072,1730329293,1145456454,(-1200909454)},{243700317,(-307931897),437321653,(-2134842383),(-1175567188)},{393202143,(-168295508),95541250}}}; + String var_165 = "Of1m1F%2\"["; + int var_176 = (-695001566); + boolean var_179 = false; + short var_182 = (-29797); + for (int id_133 = 76;id_133>37;id_133 -= 7) + { + if (var_134==var_122) + { + for (int id_135 = 78;id_135<88;id_135 += 2) + { + float var_137 = (-1.60761562E9f); + var_137 = var_136; + var_137 = var_137; + int index_139 = ((byte)var_116)&array_120.length-1; + int index_140 = var_116&array_120[index_139].length-1; + int index_138 = array_120[index_139][index_140]&array_120.length-1; + int index_141 = 10173&array_120[index_138].length-1; + int index_142 = ((char)'3')&array_120.length-1; + int index_144 = ((char)var_108)&array_113.length-1; + int index_143 = array_113[index_144]&array_120[index_142].length-1; + int index_145 = ((char)index_143)&array_120.length-1; + int index_146 = var_134&array_120[index_145].length-1; + array_120[index_145][index_146] = array_120[index_142][index_143]; + } + var_147++; + try + { + var_147 = var_147; + var_136 = var_134+var_108; + var_148 = ("eEOyKPKV "+((short)var_108))+var_147; + var_149 = var_149; + var_150 = (-1.4855268145449314E8d); + } + catch (Exception e_3) + { + var_151 = var_151; + int index_152 = ((short)(-803635294))&array_113.length-1; + int index_153 = '='&array_113.length-1; + var_119 = array_113[index_152]>(array_113[index_153]^((short)var_108)); + System.out.println( "=======Exception thrown======="+10); + } + finally + { + var_150 = var_150; + var_147 = var_147>>>(var_147--); + int index_155 = var_147&array_113.length-1; + int index_154 = array_113[index_155]&array_120.length-1; + int index_156 = index_154&array_120[index_154].length-1; + array_120[index_154][index_156] = var_116; + } + } + if (var_157) + { + ++var_134; + var_158 = "!#+n3.sG7#"+((short)(-1.2057647797453554E9d)); + } + for (int id_159 = 23;id_159<77;id_159 += 8) + { + int index_160 = ((char)var_108)&array_113.length-1; + if (array_113[index_160]!=var_161) + { + var_136 = (-1.72323664E8f); + var_162 = var_162; + int[][][] array_164 = new int[][][]{{{1682951358},{(-577442008),710540404,1974247065},{2081503249,(-83775870),(-249054817),(-73194211),442907192}},{{(-560886742),987452559,1718826409,(-2117384026),1627314477},{(-65825778),(-1471737387),(-118494032),(-1045471679)},{1616731021,1910829553,646840231,(-379402781),1596567576},{1375476308,2132958936},{(-91712723),699791455,244099779,1756476207}},{{2035583754},{1332829158,761367060,74558725},{(-1894725593),1426901137,(-2119527296),545720237}}}; + array_164 = array_163; + var_134 = (byte)(var_122-((char)1.66514266E9f)); + var_165 = var_148; + } + else + { + var_150 = var_150; + var_148 = var_158+var_162; + var_150 = var_150; + } + short var_166 = 29552; + int index_167 = ( +((short)var_162))&array_163.length-1; + int index_168 = var_122&array_163[index_167].length-1; + int index_169 = var_122&array_163[index_167][index_168].length-1; + int index_170 = var_116&array_163.length-1; + int index_171 = ((char)((short)var_122))&array_163[index_170].length-1; + int index_172 = index_171&array_163[index_170][index_171].length-1; + array_163[index_170][index_171][index_172] = var_166&array_163[index_167][index_168][index_169]; + } + try + { + var_134++; + try + { + var_161 = (short)((var_116|var_116)>>70); + int index_173 = ((short)(var_116++))&array_163.length-1; + int index_174 = var_161&array_163[index_173].length-1; + int index_175 = var_162&array_163[index_173][index_174].length-1; + var_176 = ((byte)var_147)^array_163[index_173][index_174][index_175]; + } + catch (Exception e_3) + { + int index_177 = 3955&array_120.length-1; + int index_178 = var_162&array_120[index_177].length-1; + array_120[index_177][index_178] = (char)5953880938243188844L; + var_134 = var_122; + var_136 = var_136; + index_178 = index_178+var_122; + System.out.println( "=======Exception thrown======="+11); + } + var_165 = var_165; + var_122 = var_134; + try + { + var_122 = var_134; + var_119 = (var_119^(var_108<=var_150))&&false; + var_116 = var_116; + var_150 = 1.3084721004220412E9d; + var_179 = true|var_179; + var_122 = (byte)var_136; + } + catch (Exception e_3) + { + var_179 = var_179; + var_116 = 'l'; + var_116 = var_116; + System.out.println( "=======Exception thrown======="+12); + } + finally + { + var_150 = var_150; + var_162 = var_162; + var_119 = var_119; + var_150 = (-9.570638191768014E8d); + int index_180 = ((char)var_108)&array_113.length-1; + int index_181 = var_182&array_113.length-1; + var_182 = array_113[index_181]; + } + var_134 = var_122; + } + catch (Exception e_2) + { + var_150 = var_150; + for (int id_183 = 23;id_183>13;id_183 -= 2) + { + var_116 = (char)((var_134--)|var_108); + var_147 = ((byte)( -var_162))>>var_162; + var_179 = ((char)(var_116-var_116))>='F'; + var_179 = var_184&&var_179; + var_136 = var_136; + } + for (int id_185 = 28;id_185<53;id_185 += 4) + { + var_186 = (-3635); + var_136 = -(var_122>>((short)(-1633780603))); + var_116 = var_116; + } + var_187 = var_116>>var_186; + var_182 = var_188; + System.out.println( "=======Exception thrown======="+13); + } + var_189++; + for (int id_190 = 11;id_190<15;id_190 += 1) + { + int index_191 = var_186&array_163.length-1; + int index_192 = var_188&array_163[index_191].length-1; + int index_193 = ((short)((byte)var_134))&array_163[index_191][index_192].length-1; + int index_194 = (-114)&array_163.length-1; + int index_195 = ((byte)var_116)&array_163[index_194].length-1; + int index_196 = var_161&array_163[index_194][index_195].length-1; + var_147 = array_163[index_194][index_195][index_196]; + } + } + int index_198 = var_122&array_163.length-1; + int index_199 = (-13)&array_163[index_198].length-1; + int index_200 = (-33)&array_163[index_198][index_199].length-1; + int index_197 = ((byte)array_163[index_198][index_199][index_200])&array_120.length-1; + int index_202 = ( -var_116)&array_120.length-1; + int index_204 = ((short)var_108)&array_120.length-1; + int index_205 = var_186&array_120[index_204].length-1; + int index_203 = array_120[index_204][index_205]&array_120[index_202].length-1; + int index_201 = array_120[index_202][index_203]&array_120[index_197].length-1; + int index_206 = var_134&array_120.length-1; + int index_209 = var_186&array_113.length-1; + int index_208 = (array_113[index_209]++)&array_120.length-1; + int index_210 = index_204&array_120[index_208].length-1; + int index_207 = array_120[index_208][index_210]&array_120[index_206].length-1; + return array_120[index_206][index_207]; + } + public short func_10(boolean args_388, char args_389, String args_390, byte args_391, short args_392, Class_3 args_393) + { + var_122 = var_134; + boolean var_394 = true; + short[] array_395 = new short[]{(-22650)}; + long var_420 = 3794191492344493788L; + short var_454 = 21116; + if (var_394) + { + try + { + array_395 = array_395; + ++var_108; + var_150 = var_122+var_189; + } + catch (Exception e_2) + { + var_158 = var_148+2061989670; + var_119 = var_116>=var_189; + var_136 = var_116++; + for (int id_396 = 28;id_396<29;id_396 += 2) + { + var_134 = (-109); + var_188 = 14440; + var_150 = var_150; + } + int index_397 = ( +((short)var_108))&array_120.length-1; + int index_398 = ((byte)(var_162/(1|var_162)))&array_120[index_397].length-1; + short var_400 = 3746; + int index_399 = var_400&array_120.length-1; + int index_401 = var_188&array_120[index_399].length-1; + int index_402 = ((char)var_186)&array_120.length-1; + int index_404 = ((byte)(-27))&array_120.length-1; + int index_405 = index_402&array_120[index_404].length-1; + int index_403 = array_120[index_404][index_405]&array_120[index_402].length-1; + array_120[index_402][index_403] = array_120[index_399][index_401]; + System.out.println( "=======Exception thrown======="+24); + } + var_162 = var_147; + var_136 = var_136; + var_189++; + var_119 = var_119; + try + { + var_158 = var_158; + var_116 = var_116; + for (int id_406 = 67;id_406>37;id_406 -= 16) + { + var_148 = var_158; + var_136 = -(var_407++); + } + ++var_407; + try + { + Class_5 var_409 = new Class_5(); + var_409 = var_408; + } + catch (Exception e_3) + { + int index_410 = (var_116+var_189)&array_120.length-1; + int index_411 = var_188&array_120[index_410].length-1; + var_136 = array_120[index_410][index_411]+var_108; + System.out.println( "=======Exception thrown======="+25); + } + finally + { + var_184 = var_189<=var_150; + array_412 = array_412; + var_150 = var_150; + } + for (int id_413 = 92;id_413>86;id_413 -= 2) + { + int index_414 = var_162&array_412.length-1; + short var_416 = 872; + int index_415 = var_416&array_412[index_414].length-1; + int index_418 = var_134&array_412.length-1; + int index_419 = ((char)((byte)var_420))&array_412[index_418].length-1; + int index_417 = array_412[index_418][index_419]&array_412.length-1; + int index_421 = index_419&array_412[index_417].length-1; + var_122 = array_412[index_417][index_421]; + } + } + catch (Exception e_2) + { + --var_187; + int index_423 = ( +((byte)var_187))&array_422.length-1; + int index_424 = var_189&array_422[index_423].length-1; + array_422[index_423][index_424] = ((var_158+var_407)+var_186)+var_150; + try + { + int index_425 = var_116&array_412.length-1; + int index_426 = var_134&array_412[index_425].length-1; + array_412[index_425][index_426] = var_122; + } + catch (Exception e_3) + { + var_150 = var_150; + var_119 = var_119; + int index_427 = ((short)var_420)&array_395.length-1; + array_395[index_427] = var_188; + var_162 = index_427; + boolean[][] array_428 = new boolean[][]{{false,false,false,false,false},{true},{false},{true,false,true,true,false},{false,false},{true}}; + array_428 = array_428; + System.out.println( "=======Exception thrown======="+27); + } + finally + { + int index_429 = 'W'&array_422.length-1; + int index_430 = index_429&array_422[index_429].length-1; + var_158 = array_422[index_429][index_430]+true; + var_150 = var_150; + } + int index_432 = 'K'&array_431.length-1; + int index_433 = ((char)((char)var_188))&array_431[index_432].length-1; + int index_434 = var_116&array_431[index_432][index_433].length-1; + int index_435 = index_434&array_431.length-1; + int index_436 = ((byte)var_116)&array_431[index_435].length-1; + int index_437 = var_116&array_431[index_435][index_436].length-1; + if (array_431[index_435][index_436][index_437]) + { + var_407 = (char)var_189; + int index_440 = var_441&array_412.length-1; + int index_442 = 54&array_412[index_440].length-1; + int index_439 = array_412[index_440][index_442]&array_412.length-1; + int index_443 = 2047848175&array_412[index_439].length-1; + int index_438 = array_412[index_439][index_443]&array_412.length-1; + int index_444 = (-113)&array_412[index_438].length-1; + array_412[index_438][index_444] = (byte)var_108; + } + else + { + var_407 = (char)var_122; + int index_445 = (1890082664/(1|((byte)var_150)))&array_422.length-1; + int index_446 = 'P'&array_422[index_445].length-1; + array_422[index_445][index_446] = "'A_k8Z:h\"i"; + var_119 = var_184; + } + System.out.println( "=======Exception thrown======="+27); + } + finally + { + var_441++; + int index_448 = var_189&array_412.length-1; + int index_449 = var_162&array_412[index_448].length-1; + int index_447 = array_412[index_448][index_449]&array_412.length-1; + int index_450 = ((short)(var_407>>>var_407))&array_412[index_447].length-1; + array_412[index_447][index_450] = var_134; + } + } + else + { + int index_451 = (((byte)var_189)>>var_108)&array_412.length-1; + int index_453 = (var_186&var_454)&array_412.length-1; + int index_455 = ((char)(var_456*var_188))&array_412[index_453].length-1; + int index_452 = array_412[index_453][index_455]&array_412[index_451].length-1; + var_162 = ((char)array_412[index_451][index_452])<64;id_557 -= 2) + { + short var_558 = 17220; + var_558++; + } + boolean var_559 = true; + short var_561 = (-14020); + int var_562 = 358993160; + MainClass[][][] array_566 = new MainClass[][][]{{{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass()},{new MainClass()}},{{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass()}},{{new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass()},{new MainClass()},{new MainClass()}},{{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass()}},{{new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass()},{new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass()}}}; + byte var_576 = (-63); + int var_582 = 880061067; + double var_583 = (-2.296090281737486E8d); + if (var_559) + { + var_560--; + var_556++; + try + { + --var_561; + --var_556; + var_561 = var_561; + var_560--; + var_562 = +(var_561>>>(var_562++)); + } + catch (Exception e_2) + { + if (var_563==var_563) + { + var_561 = (short)(-2233855341770311257L); + var_562 = 887506622; + } + var_560 = (-3); + var_560 = var_560; + try + { + var_562 = var_562; + var_563 = var_563; + } + catch (Exception e_3) + { + array_564 = array_564; + var_565 = (var_565+var_560)+var_563; + System.out.println( "=======Exception thrown======="+37); + } + finally + { + array_566 = array_566; + var_562 = var_560^var_556; + var_563 = (120<<((byte)var_560))+(var_556--); + var_565 = var_565+((short)var_567); + } + var_562 = +var_561; + System.out.println( "=======Exception thrown======="+37); + } + for (int id_568 = 85;id_568>23;id_568 -= 7) + { + var_556--; + var_563 = var_563*var_562; + for (int id_569 = 38;id_569>35;id_569 -= 1) + { + var_570 = var_570==((var_565+var_571)==(var_571+var_560)); + var_560 = var_560; + var_565 = var_565; + } + ++var_567; + for (int id_572 = 3;id_572<12;id_572 += 2) + { + var_565 = var_565; + var_565 = var_565; + } + if (var_573) + { + var_570 = var_570; + var_562 = +var_556; + } + else + { + var_562 = var_574++; + var_563 = ((short)var_575)-var_563; + var_562 = var_562; + var_570 = var_570; + var_565 = (var_571+var_576)+(var_574-(var_556+1057069727603319592L)); + } + } + for (int id_577 = 69;id_577<82;id_577 += 2) + { + var_561 = var_561; + if (var_578) + { + var_574 = 'J'; + var_563 = var_563; + var_570 = (((byte)var_561)-var_563)<(var_579-((char)var_562)); + var_561 = var_561; + } + var_574--; + try + { + var_574 = (char)var_563; + var_562 = var_562; + var_574 = (char)var_563; + var_562 = var_562; + } + catch (Exception e_3) + { + var_561 = (short)var_562; + var_575 = var_576; + var_570 = var_570; + var_563 = var_563; + var_570 = (((char)(-2.0838945521798736E8d))>=var_556)&&var_570; + System.out.println( "=======Exception thrown======="+38); + } + finally + { + var_563 = var_567--; + var_580 = (char)((char)var_563); + } + var_567--; + var_570 = (var_563>=var_580)^var_581; + } + var_562++; + } + else + { + var_582++; + var_579 = var_579; + var_582 = ((char)((short)(-1.20411994E9f)))<a$2hWcCK?","`9\\\\Nuc-T[","H*.sRp]_1["},{"JU\"[7!*:(e","&e/KIezg)A","o?JHz6VOJ\""},{"[A2pUt~|\\5","xq*Af|qlZL","Zd3K/07VPi"},{"XY(5JS`kOW","E^4~,W.2FA",">c1TsgL`m/","\\(b~_lv40$"},{"MH*7J u^t@","n.).v$Xp8","ZR","%1QORsV$\")"},{"CA`J?6h_CZ","ZUkkVZI*t)","+C+*3Z2`y!","Lnp!mm/Hoa","Ba--yd + * param result1 执行反射方法后返回的Object类型 param method 执行反射需调用的方法 param instance + * 方法调用的对象 param parameters 方法调用的参数列表 return null + */ + private static boolean showDebug = false; + public static int length = 0; + private static List resultlist = new LinkedList<>(); + private static List foundationtypes = new ArrayList<>(); + //apifuzz的whitelist.txt,現在不從文件里讀了 + private static ArrayList whitelist = new ArrayList(Arrays.asList("static final boolean java.util.concurrent.atomic.AtomicLong.VM_SUPPORTS_LONG_CAS", + "java.lang.reflect.AccessibleObject.override", + "private final int java.lang.ThreadLocal.threadLocalHashCode", + "private static java.util.concurrent.atomic.AtomicInteger java.lang.ThreadLocal.nextHashCode", + "int java.lang.ThreadGroup.nthreads", + "private static long java.lang.Thread.threadSeqNumber", + "private long java.lang.Thread.tid", + "private static final long java.util.concurrent.locks.ReentrantReadWriteLock.TID", + "transient java.util.Set java.util.HashMap.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private final long libcore.util.NativeAllocationRegistry.freeFunction", + "private transient long java.math.BigInt.bignum", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.io.File.PREFIX_LENGTH_OFFSET", + "private static final long java.util.concurrent.locks.StampedLock.WSTATUS", + "private static final long java.util.concurrent.locks.StampedLock.WTAIL", + "private static final long java.util.concurrent.locks.StampedLock.STATE", + "private static final long java.util.concurrent.locks.StampedLock.PARKBLOCKER", + "private static final long java.util.concurrent.locks.StampedLock.WNEXT", + "private final long java.util.SplittableRandom.gamma", + "private volatile long java.util.concurrent.atomic.AtomicLong.value", + "private static final java.util.concurrent.atomic.AtomicLong java.util.SplittableRandom.defaultGen", + "private long java.util.SplittableRandom.seed", + "private static final int java.util.concurrent.Exchanger.ABASE", + "private static final long java.util.concurrent.Exchanger.BLOCKER", + "private static final long java.util.concurrent.Exchanger.MATCH", + "private static final long java.util.concurrent.Exchanger.BOUND", + "private transient long java.util.Date.fastTime", + "private transient sun.util.calendar.BaseCalendar$Date java.util.Date.cdate", + "private final java.util.Date java.util.logging.SimpleFormatter.dat", + "private transient int java.lang.Object.shadow$_monitor_", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "private int java.io.BufferedWriter.nextChar", + "private int java.lang.StackTraceElement.lineNumber", + "private java.lang.String java.lang.StackTraceElement.methodName", + "private static final long java.lang.StackTraceElement.serialVersionUID", + "private java.lang.ClassLoader java.lang.Thread.contextClassLoader", + "private static volatile java.lang.Thread$UncaughtExceptionHandler java.lang.Thread.uncaughtExceptionPreHandler ", + "private static final long java.util.concurrent.ConcurrentHashMap.CELLSBUSY", + "private static final long java.util.concurrent.ConcurrentHashMap.SIZECTL", + "private static final long java.util.concurrent.ConcurrentHashMap.TRANSFERINDEX", + "private static final long java.util.concurrent.ConcurrentHashMap.BASECOUNT", + "private volatile long java.util.zip.ZStreamRef.address", + "private static final long java.util.concurrent.PriorityBlockingQueue.ALLOCATIONSPINLOCK", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.lang.String java.util.Locale.languageTag", + "private transient volatile int java.util.Locale.hashCodeValue", + "private static volatile java.util.Locale java.util.Locale.defaultDisplayLocale", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "transient java.util.Set java.util.HashMap.entrySet", + "private transient int java.lang.Object.shadow$_monitor_", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.util.Set java.util.Hashtable.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private volatile long java.lang.Thread.nativePeer", + "java.lang.ThreadLocal$ThreadLocalMap java.lang.Thread.threadLocals", + "private static final int java.util.concurrent.ConcurrentHashMap.ABASE", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final java.util.concurrent.atomic.AtomicLong java.util.Random.seedUniquifier", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed, private static final long java.util.Random.seedOffset", + "private static final long java.util.concurrent.Exchanger.SLOT", + "private static final long java.util.concurrent.locks.StampedLock.WHEAD", + "transient int java.util.HashMap.size", + "transient int java.util.HashMap.modCount", + "private static final long java.util.Random.seedOffset", + "boolean java.lang.reflect.AccessibleObject.override", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed", + "private java.lang.String java.lang.StackTraceElement.fileName", + "private java.lang.String java.lang.StackTraceElement.declaringClass", + "private transient java.lang.Object java.lang.Class.vtable", + "private transient java.lang.Class java.lang.Class.superClass", + "private transient java.lang.String java.lang.Class.name", + "private final java.lang.Class java.lang.reflect.Constructor.serializationClass", + "private transient dalvik.system.ClassExt java.lang.Class.extData", + "private transient long java.util.regex.Pattern.address", + "private transient volatile java.lang.Object java.lang.Throwable.backtrace", + "private transient java.lang.Object java.lang.Class.dexCache", + "private transient java.lang.ClassLoader java.lang.Class.classLoader", + "private transient java.lang.Class java.lang.Class.componentType", + "private transient long java.lang.Class.sFields", + "private transient int java.lang.Class.referenceInstanceOffsets", + "private transient int java.lang.Class.primitiveType", + "private transient int java.lang.Class.objectSizeAllocFastPath", + "private transient int java.lang.Class.objectSize", + "private transient int java.lang.Class.numReferenceStaticFields", + "private transient int java.lang.Class.numReferenceInstanceFields", + "private transient long java.lang.Class.methods", + "private transient java.lang.Object[] java.lang.Class.ifTable", + "private transient long java.lang.Class.iFields", + "private transient volatile int java.lang.Class.dexTypeIndex", + "private transient int java.lang.Class.dexClassDefIndex", + "private transient short java.lang.Class.copiedMethodsOffset", + "private transient int java.lang.Class.clinitThreadId", + "private transient int java.lang.Class.classSize", + "private transient int java.lang.Class.classFlags", + "private transient int java.lang.Class.accessFlags", + "private java.lang.Class java.lang.reflect.Field.declaringClass", + "private final java.lang.Class java.lang.reflect.Constructor.serializationCtor", + "private transient int java.lang.Class.status", + "private transient short java.lang.Class.virtualMethodsOffset", + "private int java.lang.reflect.Field.dexFieldIndex ", + "private int java.lang.reflect.Field.offset", + "private int java.lang.reflect.Field.accessFlags", + "private int fuzzapiinvoke.getInstance.ObjectNewInstance$MyThread1.ticket", + "private long java.util.regex.Matcher.address", + "transient long java.util.regex.Pattern.address", + "private int java.lang.reflect.Field.dexFieldIndex", + "private char[] java.io.BufferedWriter.cb", + "private java.lang.Class java.lang.reflect.Field.type" + )); + private static String[] ss = {"class java.lang.Character","class java.lang.Integer", + "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", + "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", + "class java.lang.Byte", "class java.lang.String", "class java.lang.StringBuffer", + "class java.lang.Character$UnicodeBlock", "class java.util.Locale", + "class java.lang.StringBuilder", "class [I", "class [S", "class [J", "class [F", "class [D", + "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", + "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", + "class [Ljava.lang.StringBuilder;"}; // 该数组存放此类可以处理用于计算CRC的数据类型 + private static ArrayList dealtypes = new ArrayList(); + + //輸出每個Object單獨的CRC值 + public static List CRCListForObjects(Object... results) { + List finalres = new ArrayList<>(); + for (Object result1: results) { + try { + if (showDebug) { + System.out.println("============================== CRCcheck(Param info) =============================="); + System.out.println("| result: "+result1); + System.out.println("==================================================================================="); + } + + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + finalres.add(run(obj)); // used to be "result1", solve the problem of object-array + } else { + finalres.add(1000000000L); + } + } + } else { + finalres.add(run(result1)); // resultthreadgroup is object} + } + } else { + // result1 is null + finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + return null; + } + } + return finalres; + } + + //輸出Object數組總的CRC值 + public static long totalCRCForObjects(boolean showFieldInfo, Object... results){ + showDebug = showFieldInfo; + initialize(); + for (Object result1: results) { + try { + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + calculatecrc(obj); + } else { +// finalres.add(1000000000L); + } + } + } else { + calculatecrc(result1); + } + } else { + // result1 is null +// finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + } + } + return getCRC(); + } + + public static long run(Object obj) throws Exception { + initialize(); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< START GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + calculatecrc(obj); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< END GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + return getCRC(); + } + private static void initialize(){ + Collections.addAll(dealtypes, ss); + String[] strings = {"class java.lang.Character","class java.lang.Integer", "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", "class java.lang.Byte"}; + Collections.addAll(foundationtypes, strings); + resultlist.clear(); + } + + private static void calculatecrc(Object result) throws Exception { + // deal with Object + if(result != null){ + String resulttype = result.getClass().toString(); + // deal with the problem of class StringBuilder, StringBuffer and String + // we can`t get the specific fields we wanted, cast these to string by toString + if(resulttype.equals("class java.lang.String") || + resulttype.equals("class java.lang.StringBuilder") || + resulttype.equals("class java.lang.StringBuffer") || + resulttype.equals("class java.lang.Character$UnicodeBlock") || + resulttype.equals("class java.util.Locale") || result instanceof Annotation){ + String ostring = result.toString(); + byte[] bytes = ostring.getBytes("UTF-8"); + calculatecrc(bytes); + return; + } + if (foundationtypes.contains(result.getClass().toString())){ + // if basic types: + resultlist.add(result); + switch (result.getClass().toString()) { + case "class java.lang.Byte": + length += 1; + break; + case "class java.lang.Short": + length += 2; + break; + case "class java.lang.Integer": + length += 4; + break; + case "class java.lang.Long": + length += 8; + break; + case "class java.lang.Float": + length += 4; + break; + case "class java.lang.Double": + length += 8; + break; + case "class java.lang.Char": + length += 2; + break; + case "class java.lang.Character": + length += 2; + break; + case "class java.lang.Boolean": + length += 1; + break;} + } else if(resulttype.startsWith("class [")) { + // array(contains multidimensional array) + if ("class [I".equals(resulttype)) { + //int[] + int[] intparam = (int[]) result; + for (int i : intparam) { + resultlist.add(i); + length += 4; + } + } else if ("class [S".equals(resulttype)) { + //short[] + short[] shortparam = (short[]) result; + for (short s : shortparam) { + resultlist.add(s); + length += 2; + } + } else if ("class [J".equals(resulttype)) { + //long[] + long[] longparam = (long[]) result; + for (long l : longparam) { + resultlist.add(l); + length += 8; + } + } else if ("class [F".equals(resulttype)) { + //float[] + float[] floatparam = (float[]) result; + for (float f : floatparam) { + resultlist.add(f); + length += 4; + } + } else if ("class [D".equals(resulttype)) { + //double[] + double[] doubleparam = (double[]) result; + for (double d : doubleparam) { + resultlist.add(d); + length += 8; + } + } else if ("class [Z".equals(resulttype)) { + //boolean[] + boolean[] booleanparam = (boolean[]) result; + for (boolean b : booleanparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [B".equals(resulttype)) { + //byte[] + byte[] byteparam = (byte[]) result; + for (byte b : byteparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [C".equals(resulttype)) { + //char[] + char[] charparam = (char[]) result; + for (char c : charparam) { + resultlist.add(c); + length += 2; + } + } else if ("class [Ljava.lang.Character;".equals(resulttype)) { + // Character[] + Character[] charparam = (Character[]) result; + for (Character c : charparam) { + resultlist.add((char)c); + length += 2; + } + }else if (resulttype.startsWith("class [[")){ + // 多维数组,降维 + for (Object o: (Object[]) result){ + calculatecrc(o); + } + }else if (resulttype.equals("[Ljava.lang.String")){ + // string类型的数组 + for(String s:(String[]) result){ + calculatecrc(s); + } + + } + else if(resulttype.startsWith("class [L")){ + // 非基础类型数组 + for(Object o:(Object[])result){ + calculatecrc(o); + } + } + }else{ + // 该分支处理非基础类型对象, 先获取对象下指定层数的域和值,将最终结果中可用于计算CRC校验的值作为参数递归调用本方法 + // 首先取得首次传入的实例的域,若域的值可直接用于(包括基础类型和在本方法中特殊处理的其他类型)CRC计算,则不进入下一次获取域的循环 + // 最终获取的域和对应的值都有序的存放在getfaieldvalue()返回的map中 + // 接着对map进行遍历获取其中的值如若是本方法除此分支之外的其他分支可处理的类型则以value为参数递归调用,否则只将其输出在运行日志中 + //System.out.println("```````````````````````````get field`````````````````````````````````````````````"); + Mapmap = getFieldValue(result, 3); + //System.out.println("`````````````````````````get field end```````````````````````````````````````````"); + for(Map.Entry entry: map.entrySet()) { + Field key = entry.getKey(); + Object value = entry.getValue(); + //当field为基础类型或者string stringbu*** character数组时将数组信息打印出来 + String[] basicarray = new String[]{"class [I", "class [S", "class [J", "class [F", "class [D", "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", "class [Ljava.lang.StringBuilder;"}; + List basiclist = Arrays.asList(basicarray); + if(showDebug) { + if (basiclist.contains(key.getType().toString())) { + String str = key.getType().toString(); + switch (str) { + case "class [I": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((int[]) value)); + break; + case "class [S": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((short[]) value)); + break; + case "class [J": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((long[]) value)); + break; + case "class [F": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((float[]) value)); + break; + case "class [D": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((double[]) value)); + break; + case "class [Z": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((boolean[]) value)); + break; + case "class [B": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((byte[]) value)); + break; + case "class [C": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((char[]) value)); + break; + case "class [Ljava.lang.Character;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((Character[]) value)); + break; + case "class [Ljava.lang.String;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((String[]) value)); + break; + case "class [Ljava.lang.StringBuffer;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuffer[]) value)); + break; + case "class [Ljava.lang.StringBuilder;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuilder[]) value)); + break; + } + } else if (key.getType().toString().contains("[[")) { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.deepToString((Object[]) value)); + } else { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + value); + } + } + + if(value != null && dealtypes.contains(value.getClass().toString())){ + if(!whitelist.contains(key.toString())){ + // 如果为基础类型或者需要特殊处理的object类型且没在whitelist中则再次调用本身,否则只在控制台打印出来对象信息 + calculatecrc(value); + } + } + } + } + } + } + /* + 接受object类型参数,向下获取实例类的域两次 + : reutrn 返回包含域对象和对应的value的键值对的map + */ + private static Map getFieldValue(java.lang.Object obj, int length){ + Map map = new LinkedHashMap<>(); + Field[] rootf = obj.getClass().getDeclaredFields(); + //sort + rootf = CrcCheckForObject.sortFieldArray(rootf); + if(rootf == null){ + return map; + } + List cur_objs = new ArrayList<>(); + List next_objs = new ArrayList<>(); + // 先获取传入参数的域和对应的值, 放入map中, value 放入 cur_objs中 + //System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^root field : value^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); + for(Field f: rootf){ + if(whitelist.contains(f.toString())){ + continue; + } + //System.out.println("< which field: >" + f.toString()); + f.setAccessible(true); + java.lang.Object o; + try { + o = f.get(obj); + map.put(f,o); + } catch (IllegalAccessException e) { + o = null; + map.put(f, null); + } + next_objs.add(o); + //System.out.println("< field value: >" + o); + } + //System.out.println("------------------------------root end------------------------------------"); + while( length > 1){ + cur_objs.clear(); + cur_objs.addAll(next_objs); + next_objs.clear(); + for(Object o:cur_objs){ + if(o == null ){ + continue; + } + if(dealtypes.contains(o.getClass().toString())){ + //如果为基础类型则不向下获取实例的域 + continue; + } + Field[] fs = o.getClass().getDeclaredFields(); + fs = sortFieldArray(fs); + if(fs == null){ + continue; + } + for(Field fi: fs){ + + //System.out.println("< which field: >" + fi.toString()); + if(whitelist.contains(fi.toString())){ + continue; + } + fi.setAccessible(true); + Object oc; + try{ + oc = fi.get(o); + }catch(IllegalAccessException e){ + oc = null; + } + //System.out.println("< field value: >" + oc); + + map.put(fi, oc); + next_objs.add(oc); + } + } + length -= 1; + } + + return map; + } + + private static long getCRC () { + CrcBuffer b = new CrcBuffer(length); + for (Object obj:resultlist){ + if (obj.getClass().toString().equals("class java.lang.Byte")) { + CrcCheckwithChar.ToByteArray((byte) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Short")) { + CrcCheckwithChar.ToByteArray((short) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Integer")) { + CrcCheckwithChar.ToByteArray((int) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Long")) { + CrcCheckwithChar.ToByteArray((long) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Float")) { + CrcCheckwithChar.ToByteArray((float) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Double")) { + CrcCheckwithChar.ToByteArray((double) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Boolean")) { + CrcCheckwithChar.ToByteArray((boolean) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Character")) { + CrcCheckwithChar.ToByteArray((char) obj, b); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer, 0, b.i); + return c.getValue(); + } + + /** + * 进行Field[]排序 + */ + public static Field[] sortFieldArray (Field[] fields){ + if (fields == null || fields.length == 0) { + return null; + } + List flist = Arrays.asList(fields); + Collections.sort(flist, new FieldComparator()); + + return (Field[]) flist.toArray(); + } +} +/* + * sort the field array by field`s name + * + * */ +class FieldComparator implements Comparator{ + @Override + public int compare(Field f1, Field f2){ + return (f1.toString()).compareTo(f2.toString()); + } + +} + + +class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf(" +Fail to Get CRC! + Calculation=%d LookupTable=%d +",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xffffffffL; + } + +} diff --git a/test/testsuite/fuzz_test/langfuzz/1468_2019091603087/CrcCheckwithChar.java b/test/testsuite/fuzz_test/langfuzz/1468_2019091603087/CrcCheckwithChar.java new file mode 100644 index 0000000000000000000000000000000000000000..6b2e64a2d7f8dbf3f7513433b8de5fd9032cd52b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/1468_2019091603087/CrcCheckwithChar.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.Double; + +class CrcBuffer { + int i = 0; + static int buffer_counter = 0; + byte[] buffer; + + CrcBuffer(int size) { + this.buffer = new byte[size]; + buffer_counter++; + //System.out.printf("Buffer-Counter=%d\tLength=%d\n", buffer_counter, size); + } +} + +public class CrcCheckwithChar { + /**************************************************************/ + static boolean isVerbose = false; + + public static void ToByteArray(char args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(byte args, CrcBuffer b) { + b.buffer[b.i] = args; + b.i++; + } + + public static void ToByteArray(short args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(int args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(long args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(boolean args, CrcBuffer b) { + if (args) { + b.buffer[b.i] = 0x01; + } else { + b.buffer[b.i] = 0x00; + } + b.i++; + } + + public static void ToByteArray(float args, CrcBuffer b) { + int iargs = Float.floatToIntBits(args); + b.buffer[b.i] = (byte) ((iargs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (iargs & 0xff); + b.i++; + } + + public static void ToByteArray(double args, CrcBuffer b) { + long largs = Double.doubleToLongBits(args); + b.buffer[b.i] = (byte) ((largs >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (largs & 0xff); + b.i++; + } +} diff --git a/test/testsuite/fuzz_test/langfuzz/1468_2019091603087/Start.java b/test/testsuite/fuzz_test/langfuzz/1468_2019091603087/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..1884874b4a4928070fddcb9e6ac4c6b66a3e3716 --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/1468_2019091603087/Start.java @@ -0,0 +1,2438 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +// this is a test!!!!!!! +// seed : 1568086566261 +import java.util.*; +public class Start +{ + static MainClass var_1156 = new MainClass(); + public static void getCheckSum() + { + System.out.println( "=======getCheckSum======="); + long crc = CrcCheckForObject.totalCRCForObjects(false, var_1156, new Class_3(), new Class_4(), new Class_5(), new Class_6(), new Class_7(), new Class_8(), new Class_9()); + System.out.println("CheckSum:"+crc); + } + public static void main(String[] args_0) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + var_1156.run(); + getCheckSum(); + //这是一个空语句 + } +} +class MainClass +{ + protected static byte var_154 = 120; + protected static short[][][] array_155 = new short[][][]{{{(-18529),(-28619),5558,32642,(-1094)},{4297,14241,(-4115)},{(-11073),(-15738),14302,(-2832)},{16234,27230,(-30684),(-20880),(-25526)},{(-32700),4112,3344,25594,(-22194),(-3430)},{(-5789),17729}},{{19597,(-4336),22345,(-9688)},{(-19454),4223,5603,31867}},{{(-8600),(-14373),2433,(-19830)},{23563,(-8185),10478,(-27930),6584},{17219,4673,7429,(-17724),9709,12656,(-7025)},{(-4064),16952,26559,981}},{{(-13514),445,22872},{(-25463),10426},{(-16175),(-16219)},{13501,7634,(-30084)},{8916,17924,(-15904)},{(-22327),(-14815),(-17230),(-32469)},{(-6446)},{(-6271),(-20289),(-16513),(-16674),(-4854)},{(-30138),25217,(-17547),6904,(-7414)}},{{(-10398),17294,(-4723),22345,(-3498),32528},{(-25083),(-14158)},{4274,(-1281),25560,18802,(-18796),13718},{(-5306),7065,(-869),29004},{(-13230)},{19524,20130,(-28933),16645,565},{(-17987),30899,7490,9649,(-23619)}}}; + static short var_163 = 19986; + private static Class_3[] array_928 = new Class_3[]{new Class_3(),new Class_3(),new Class_3()}; + protected static double var_931 = (-3.057457452971529E8d); + static Class_8 var_932 = new Class_8(); + static byte[][] array_934 = new byte[][]{{47,(-119),21,(-101)},{(-31),48,(-94),57},{(-77),(-100),(-3),(-100)},{89}}; + protected static char var_935 = 'J'; + protected static byte var_937 = 103; + protected static boolean var_940 = true; + public static float var_942 = (-7885903.5f); + static boolean var_947 = false; + public static long var_952 = (-5461871094617313732L); + public static double var_954 = (-9.624909686075075E8d); + static int var_956 = 381606447; + private static Class_5 var_959 = new Class_5(); + protected static String var_965 = "N#,$qi^l9l"; + private static int var_973 = 523825604; + public static long var_982 = 2689498835715291120L; + protected static char var_1002 = 'j'; + public static Class_6[][][] array_1015 = new Class_6[][][]{{{new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6()}},{{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()}}}; + private static int var_1031 = 1200357787; + static byte var_1033 = 52; + public static boolean[] array_1034 = new boolean[]{true,false,true}; + public static char var_1036 = 'I'; + protected static Class_3 var_1043 = new Class_3(); + private static short var_1044 = (-20189); + public static byte var_1045 = 46; + private static short[][][] array_1057 = new short[][][]{{{10211,5130,(-2308),10397},{21276,19684,29887,4262},{(-10378),23566,(-6947),(-30487)},{18823,12180,16333,23641}},{{1924,6643,2349},{10282,25218},{(-5024),(-8239)},{21007,19115,6144,9764,(-22756)},{12562,18420,28339,6420,31282,6006},{(-27637),24271,(-11321),(-6826)},{(-13152),26711,(-26729),(-3919)}}}; + private static Class_5 var_1068 = new Class_5(); + public static Class_6 var_1080 = new Class_6(); + public static char var_1087 = 'f'; + public static int var_1088 = (-498315724); + public static short var_1092 = 3074; + private static byte var_1096 = 66; + private static Class_5 var_1102 = new Class_5(); + public static Class_8 var_1117 = new Class_8(); + private static float var_1142 = 7.0813741E8f; + private static String[] array_1143 = new String[]{"m9m/4)U\"+O",".+K+fo;|Q<","03!pzZYc!H","z7w7\",.\"A"}; + static Class_4 var_1145 = new Class_4(); + protected static String var_1153 = "+P30;id_9 -= 33) + { + int index_929 = (-1725764333)&array_928.length-1; + int index_930 = ((char)var_931)&array_928.length-1; + float actualArgs_936 = (var_933*var_935); + int actualArgs_938 = (var_937&var_163); + byte actualArgs_939 = (byte)var_932.func_17((char)var_933, (-335217295), array_934, (short)var_163, actualArgs_936, actualArgs_938); + boolean actualArgs_941 = (var_931<=((byte)91))|(var_940|(var_933>var_163)); + int actualArgs_943 = ((char)((byte)var_942))>>actualArgs_938; + int index_944 = ((short)7.6644838E8f)&array_155.length-1; + int index_945 = ((short)( ~actualArgs_943))&array_155[index_944].length-1; + int index_946 = var_154&array_155[index_944][index_945].length-1; + array_928[index_930].func_5((byte)actualArgs_939, actualArgs_941, actualArgs_943, (short)array_155[index_944][index_945][index_946], 1.0957596517000785E9d, var_947); + } + int var_949 = (-1386899342); + int index_948 = (((char)var_949)+13818)&array_934.length-1; + int index_950 = var_163&array_934[index_948].length-1; + int index_951 = ((char)var_952)&array_934.length-1; + int index_953 = ((byte)var_954)&array_934[index_951].length-1; + --array_934[index_951][index_953]; + return var_937; + } + public strictfp void run() + { + char var_987 = 'f'; + double var_1020 = 1.3713718949891253E9d; + MainClass var_1072 = new MainClass(); + char var_1099 = 'g'; + long var_1113 = (-7634785918758657800L); + int var_1118 = (-1388621405); + for (int id_1 = 52;id_1<76;id_1 += 3) + { + try + { + for (int id_2 = 27;id_2<49;id_2 += 5) + { + byte actualArgs_955 = ((byte)var_952); + double actualArgs_957 = (var_942/(1|var_956)); + int actualArgs_958 = (((short)var_942)&var_154); + double actualArgs_960 = ( +var_937); + char actualArgs_961 = ((char)actualArgs_957); + double actualArgs_962 = ( +var_937); + byte actualArgs_963 = ((byte)var_942); + short actualArgs_964 = var_959.func_9(actualArgs_960, (char)actualArgs_961, actualArgs_960, actualArgs_962, (char)var_935, (byte)actualArgs_963); + actualArgs_963 = func_4(var_942, (byte)actualArgs_955, actualArgs_957, actualArgs_958, (short)actualArgs_964, var_965); + } + try + { + int index_966 = ( +var_935)&array_155.length-1; + int index_967 = index_966&array_155[index_966].length-1; + double actualArgs_969 = (var_942--); + byte actualArgs_970 = ((byte)index_967); + int index_968 = var_959.func_9(actualArgs_969, (char)var_935, 4.6075593899529177E8d, actualArgs_969, (char)var_935, (byte)actualArgs_970)&array_155[index_966][index_967].length-1; + index_966 = array_155[index_966][index_967][index_968]^actualArgs_970; + } + catch (Exception e_3) + { + var_931 = var_931; + var_932 = var_932; + array_928 = array_928; + System.out.println( "=======Exception thrown======="+41); + } + int index_971 = 29571&array_155.length-1; + int index_972 = (((byte)var_973)&func_4(var_942, (byte)var_154, var_931, var_973, (short)var_163, "|?w0jt^|vU"))&array_155[index_971].length-1; + int index_975 = 13968&array_928.length-1; + byte actualArgs_977 = ((byte)var_942); + double actualArgs_978 = (2.6874548E7f/(1|index_972)); + int actualArgs_979 = (var_937-var_935); + short actualArgs_980 = ((short)123); + int index_976 = func_4(var_942, (byte)actualArgs_977, actualArgs_978, actualArgs_979, (short)actualArgs_980, var_965)&array_928.length-1; + float actualArgs_981 = ( -var_942); + short actualArgs_983 = ((short)var_982); + int index_974 = array_928[index_976].func_16((byte)var_937, actualArgs_981, (short)actualArgs_983, (short)4419, (char)var_935, var_954)&array_155[index_971][index_972].length-1; + int index_984 = (-2061591144)&array_155.length-1; + int index_985 = actualArgs_980&array_155[index_984].length-1; + int index_986 = actualArgs_980&array_155[index_984][index_985].length-1; + ++array_155[index_984][index_985][index_986]; + } + catch (Exception e_2) + { + var_987++; + for (int id_988 = 74;id_988>47;id_988 -= 4) + { + Class_8 var_989 = new Class_8(); + var_932 = var_989; + } + try + { + var_942 = -('!'>>>(var_973--)); + var_154 = var_937; + Class_4 var_990 = new Class_4(); + int index_991 = var_937&array_155.length-1; + char actualArgs_993 = ((char)index_991); + double actualArgs_994 = func_10((short)var_163, var_956, (byte)var_937, (short)var_163, var_965, var_965); + double actualArgs_995 = (var_163*var_937); + char actualArgs_996 = ((char)index_991); + int index_992 = var_959.func_9(var_931, (char)actualArgs_993, actualArgs_994, actualArgs_995, (char)actualArgs_996, (byte)(-3))&array_155[index_991].length-1; + int index_999 = ((byte)(index_991^var_982))&array_155.length-1; + int index_1000 = var_154&array_155[index_999].length-1; + int index_1001 = var_1002&array_155[index_999][index_1000].length-1; + int index_998 = array_155[index_999][index_1000][index_1001]&array_155.length-1; + int index_1003 = ((-1584301423)%(1|var_956))&array_155[index_998].length-1; + double var_1005 = 6.080070455577594E7d; + byte actualArgs_1006 = func_4(var_942, (byte)var_154, var_1005, index_1000, (short)var_163, var_965); + double actualArgs_1007 = ( +index_992); + int index_1008 = (var_937&((short)var_1002))&array_155.length-1; + int index_1009 = var_987&array_155[index_1008].length-1; + int index_1010 = var_163&array_155[index_1008][index_1009].length-1; + int index_1004 = func_4(var_942, (byte)actualArgs_1006, actualArgs_1007, index_1003, (short)array_155[index_1008][index_1009][index_1010], var_965)&array_155[index_998][index_1003].length-1; + int index_997 = array_155[index_998][index_1003][index_1004]&array_155[index_991][index_992].length-1; + String actualArgs_1011 = var_965+0; + char actualArgs_1012 = (char)(-111); + int actualArgs_1013 = +var_987; + short var_1014 = 29904; + var_990.func_7((short)array_155[index_991][index_992][index_997], actualArgs_1011, (char)actualArgs_1012, actualArgs_1013, var_947, (short)var_1014); + } + catch (Exception e_3) + { + int index_1016 = var_1002&array_1015.length-1; + int index_1018 = ((short)( ~index_1016))&array_928.length-1; + int index_1021 = '`'&array_1015.length-1; + int index_1022 = ((short)var_987)&array_1015[index_1021].length-1; + int index_1023 = ((byte)25488)&array_1015[index_1021][index_1022].length-1; + int index_1024 = ((short)(var_1002>>index_1022))&array_1015.length-1; + int index_1025 = var_937&array_1015[index_1024].length-1; + int index_1026 = var_973&array_1015[index_1024][index_1025].length-1; + char actualArgs_1027 = array_1015[index_1024][index_1025][index_1026].func_13(var_1020, (byte)var_154, var_942, (char)var_1002, (short)var_163, array_155); + int index_1019 = var_959.func_9(var_1020, (char)actualArgs_1027, var_1020, (-7.377643064698399E8d), (char)var_1002, (byte)var_154)&array_928.length-1; + short actualArgs_1028 = ((short)index_1018); + int index_1029 = ((char)var_954)&array_928.length-1; + int index_1030 = ( -(var_1031&var_937))&array_928.length-1; + int actualArgs_1032 = array_928[index_1030].func_11((short)(-14709), index_1025, (byte)var_937, true, (short)var_163, (char)actualArgs_1027); + int index_1035 = ((char)var_163)&array_1034.length-1; + short actualArgs_1037 = var_959.func_9(var_1020, (char)var_1036, var_1020, var_931, (char)actualArgs_1027, (byte)var_937); + int index_1038 = index_1035&array_928.length-1; + int index_1039 = ( -actualArgs_1027)&array_928.length-1; + char actualArgs_1040 = array_928[index_1039].func_16((byte)var_937, var_942, (short)actualArgs_1037, (short)actualArgs_1037, (char)var_1036, var_931); + int index_1017 = array_928[index_1019].func_11((short)actualArgs_1028, actualArgs_1032, (byte)var_1033, array_1034[index_1035], (short)actualArgs_1037, (char)actualArgs_1040)&array_1015[index_1016].length-1; + int index_1041 = var_154&array_1015[index_1016][index_1017].length-1; + byte actualArgs_1046 = ((byte)var_1045); + boolean var_1047 = false; + short actualArgs_1048 = ((short)1.7819617316351235E8d); + char actualArgs_1049 = ((char)actualArgs_1037); + int index_1042 = var_1043.func_11((short)var_1044, var_1031, (byte)actualArgs_1046, var_1047, (short)actualArgs_1048, (char)actualArgs_1049)&array_1015.length-1; + int index_1051 = var_1031&array_934.length-1; + int index_1052 = ((char)var_942)&array_934[index_1051].length-1; + int index_1050 = array_934[index_1051][index_1052]&array_1015[index_1042].length-1; + int index_1053 = index_1042&array_1015[index_1042][index_1050].length-1; + double actualArgs_1054 = (var_982*( +actualArgs_1028)); + byte actualArgs_1055 = ((byte)index_1016); + short actualArgs_1056 = ((short)(-1.6152332309406493E9d)); + var_1036 = array_1015[index_1042][index_1050][index_1053].func_13(actualArgs_1054, (byte)actualArgs_1055, var_942, (char)var_935, (short)actualArgs_1056, array_1057); + System.out.println( "=======Exception thrown======="+43); + } + finally + { + int index_1058 = ( -((byte)var_1036))&array_155.length-1; + int index_1059 = 't'&array_155[index_1058].length-1; + int index_1060 = var_1036&array_155[index_1058][index_1059].length-1; + array_155[index_1058][index_1059][index_1060] = (short)var_987; + byte actualArgs_1061 = ((byte)1044015460); + int index_1062 = (-98)&array_155.length-1; + int index_1064 = 13979&array_155.length-1; + int index_1065 = var_163&array_155[index_1064].length-1; + int index_1066 = ( -func_4(var_942, (byte)var_154, var_931, index_1064, (short)(-27438), var_965))&array_155[index_1064][index_1065].length-1; + int index_1063 = array_155[index_1064][index_1065][index_1066]&array_155[index_1062].length-1; + double actualArgs_1069 = (var_935++); + double actualArgs_1070 = (var_163*var_952); + byte actualArgs_1071 = ((byte)var_982); + int index_1067 = var_1068.func_9(actualArgs_1069, (char)var_1002, var_1020, actualArgs_1070, (char)var_1036, (byte)actualArgs_1071)&array_155[index_1062][index_1063].length-1; + String actualArgs_1073 = (var_1068.func_8((short)var_163, var_1072, var_1020, (byte)var_1033, actualArgs_1069, (short)var_163)+var_965); + var_1045 = func_4((-5.1490256E7f), (byte)actualArgs_1061, var_931, index_1060, (short)array_155[index_1062][index_1063][index_1067], actualArgs_1073); + } + --var_987; + System.out.println( "=======Exception thrown======="+43); + } + ++var_973; + try + { + int index_1074 = var_973&array_934.length-1; + int index_1075 = var_1044&array_934[index_1074].length-1; + boolean actualArgs_1077 = (var_947&var_940); + char actualArgs_1078 = ((char)var_163); + int index_1076 = var_1043.func_11((short)17963, index_1074, (byte)var_1045, actualArgs_1077, (short)var_1044, (char)actualArgs_1078)&array_934.length-1; + double actualArgs_1081 = (var_987+var_956); + float var_1082 = (-9.629881E8f); + float actualArgs_1083 = (var_942+var_1082); + short actualArgs_1084 = ((short)var_1082); + int index_1079 = var_1080.func_13(actualArgs_1081, (byte)var_1045, actualArgs_1083, (char)var_987, (short)actualArgs_1084, array_155)&array_934[index_1076].length-1; + --array_934[index_1076][index_1079]; + } + catch (Exception e_2) + { + var_965 = var_965; + int index_1085 = var_1044&array_934.length-1; + int index_1086 = var_1045&array_934[index_1085].length-1; + array_934[index_1085][index_1086] = var_937; + try + { + var_956 = var_1033%(1|index_1086); + var_942 = var_942*(var_1087>>(var_1088|var_163)); + var_1002 = var_1002; + int index_1089 = ((char)((char)var_956))&array_928.length-1; + int index_1090 = index_1086&array_928.length-1; + short actualArgs_1091 = ((short)5.7923386E8f); + int index_1093 = var_987&array_155.length-1; + int index_1094 = 107&array_155[index_1093].length-1; + int index_1095 = var_1096&array_155[index_1093][index_1094].length-1; + String actualArgs_1097 = (var_965+var_1036); + double actualArgs_1098 = func_10((short)var_1092, var_1088, (byte)var_937, (short)array_155[index_1093][index_1094][index_1095], actualArgs_1097, "Lq/I!uZ@;t"); + var_1036 = array_928[index_1090].func_16((byte)var_937, var_942, (short)actualArgs_1091, (short)actualArgs_1091, (char)var_1002, actualArgs_1098); + } + catch (Exception e_3) + { + var_1099 = (char)20422; + var_965 = var_965; + var_947 = var_1044>=((char)(var_1045++)); + char actualArgs_1103 = ((char)var_987); + int index_1101 = var_1102.func_9((-5114557.966424248d), (char)var_1087, var_931, var_954, (char)actualArgs_1103, (byte)107)&array_934.length-1; + int index_1104 = ((byte)var_942)&array_934[index_1101].length-1; + int index_1100 = array_934[index_1101][index_1104]&array_934.length-1; + int index_1105 = ((char)((short)var_1092))&array_934[index_1100].length-1; + int index_1106 = (-1836034011)&array_934.length-1; + int index_1107 = var_1087&array_934[index_1106].length-1; + var_1045 = array_934[index_1106][index_1107]; + System.out.println( "=======Exception thrown======="+45); + } + System.out.println( "=======Exception thrown======="+45); + } + finally + { + try + { + var_1072 = var_1072; + var_931 = ((byte)(-102))*((short)(var_1002/(1|var_987))); + int index_1108 = 1578765675&array_1057.length-1; + int index_1110 = (((byte)var_931)<kX28dIk6"}; + public static boolean var_257 = false; + public static short[][][] array_264 = new short[][][]{{{21207,10839,(-6274)},{13740,(-15772)},{8507,18404,(-21846),(-30330),(-14150),(-13022),20379},{20069,(-31379),4703,(-13091),21132},{(-11793),(-18791),(-840),23457}},{{(-17466),27248,31720}},{{(-11540),31559,(-27047),(-17413)},{(-873),(-27730),(-7320),(-5666)},{(-31515),(-29163),4549,(-18200),31415,(-28325),25742},{(-1816),(-24266),16991,13310},{5295,29292,1182,7242,(-29581)},{(-27729),(-30974)},{(-20599),(-8861),(-8834),(-23966)}}}; + protected static Class_5 var_265 = new Class_5(); + protected static Class_5 var_266 = new Class_5(); + public static byte var_276 = 70; + protected static long var_357 = (-3806526698501221805L); + public static long var_362 = (-6381024419983207293L); + protected static int var_364 = (-1562605023); + static int var_366 = 1569437133; + static int var_367 = 546710204; + static short var_374 = 1546; + protected static Class_7 var_376 = new Class_7(); + public static Class_3 var_377 = new Class_3(); + public static int var_378 = 1757339791; + protected static double var_386 = (-1571122.8336882133d); + private static byte var_388 = 107; + private static boolean var_408 = false; + protected static char var_410 = '\''; + static double var_433 = 3.398377015531973E8d; + protected static boolean var_437 = true; + public static int var_439 = (-1987991973); + static Class_8 var_523 = new Class_8(); + public static Class_9 var_698 = new Class_9(); + static long var_708 = (-540431761403456070L); + protected static long[][][] array_819 = new long[][][]{{{955561698935167243L,(-2885340550342364211L),(-7997491227926058579L)},{(-8202238319759446782L),835269184588606752L,(-3340192756965553780L),(-1536028571067503544L)}},{{8611999023479772697L,904474690817146385L,3749272420535445600L,7320678882260258829L,4940777606005702204L},{(-1978893220803545204L),(-8319231080580164260L),(-5757256273163573986L),(-521681287745182106L)},{7558210240765863035L,(-3072201995237318968L),5566629466945238844L,(-4636068940861049162L),649988774591781020L,6213633137223777409L,(-2189220083289871898L),(-6348421318330734516L)}},{{8089147674990246011L,4693730710083793831L},{4098008634705899348L,8366215392217485863L,309874947488218864L,(-6182705482430400433L)},{(-6685828766288144627L),7886142699107929117L,(-2080152754296359487L),1244797462657711572L,(-3482901912828983812L),848083514453492760L,(-7069280399486957134L),(-3443864532631308863L)},{4327293026674764640L,3323637525001176196L,4840582824277078152L,(-4265957918286780936L)},{(-3030201347208244361L),4474159021459124014L,6940024696182240772L,(-1110941358400674546L)}},{{8014941278842412061L,6387146766190282208L,1052903673807282662L,4734070319185437566L,(-4363760419608157744L)},{2627649293672235568L,(-478132742380794338L),(-3261662780744398663L)},{(-8713451177571511822L),118886787902425098L},{(-2534485507934310445L)}},{{2135888934457349227L},{4998044687110253607L,8331508695005542961L},{4976198302073782675L,(-3697722341516798187L),(-2858325269632763216L),3002946392790509973L,(-4388660869041989310L),(-2507816930789903840L)},{7180557858382979373L,(-9196808352956177493L),(-3600273064774423199L),(-9201901607160687999L),3536058106735283205L}}}; + public static byte var_820 = 89; + protected static short[][][] array_823 = new short[][][]{{{14467},{(-7024),(-25488),(-17517)},{1949,10602,(-6349),(-14637),(-12769),30619,14979,19855},{(-14000),18787,(-9466),(-17559),(-9947)},{16011,(-31551),(-7154),(-7551),10173,11403,(-4421),20153},{17615,14010,9632}},{{(-20250),7146,14375,(-5710)},{(-24348),8950,(-23698),(-28790),919},{3852,26709,9068,23465,13055},{(-27280),(-16636),23670,1945},{(-31090),6731,3582,(-6405),7726,(-25545),29938,(-7155)},{(-29228),16373,(-29319),(-26908)}},{{12427,15586},{(-32663),7103,11875,(-16903)},{(-27128),12784},{21697,2310,(-24916)},{(-20118),(-862)}},{{2777,9638,(-14620),(-7418),(-23735),(-27576)},{(-30759),(-18873),722,18908,30195,(-24106)},{30747,2487,16238}},{{(-31576),26179,(-7603),25915},{(-24219),(-32068),24332,(-2254)},{29793,12238,(-12006)},{(-24879),25771,8525,(-16649),1361},{(-25),7408,(-19916),31585,30959,20990,19978,(-21428)}}}; + static short var_831 = (-1417); + protected static Class_8 var_838 = new Class_8(); + protected static Class_6 var_839 = new Class_6(); + private static double var_847 = (-7.32501584165277E7d); + static boolean var_860 = true; + public static char var_861 = 's'; + static double var_870 = 1.4065118272202453E8d; + public static Class_4 var_871 = new Class_4(); + public static int var_873 = (-1270044071); + public static int var_887 = (-2094184321); + static short var_897 = (-24628); + static char var_898 = 'D'; + private static short var_904 = (-941); + public static short var_905 = 4770; + protected static char var_906 = 'k'; + public static byte var_910 = (-106); + private static MainClass[] array_911 = new MainClass[]{new MainClass(),new MainClass(),new MainClass()}; + public static float[][][] array_912 = new float[][][]{{{(-2.2743752E8f),1.45283328E9f,3.2158448E8f,1.33410342E9f},{(-2.37155744E8f),8.365017E8f,(-7.3644456E7f),9.2439814E8f,(-2.70710336E8f)},{(-1.72869005E9f),7.8472845E8f,(-1.72903712E8f),(-1.24438797E9f),(-1.2874231E9f)},{6.0857555E8f,(-7.33544E8f),(-1.49601216E9f),1.85637504E8f,3.81943136E8f}},{{(-8.8456928E8f),6.4244966E8f,(-2.48974432E8f),8.6099544E7f},{8.9770438E8f,(-1.41548147E9f),(-4.91891328E8f),9.1940064E8f,1.9327528E8f,3.51194944E8f},{(-1.8969257E9f),3.5645532E7f,7.5638016E7f},{(-7.7664595E8f),4.86390304E8f,1.13550234E9f,5.7486808E7f,2.90054624E8f,2.3748008E8f,(-7.7248998E8f),4.00882432E8f},{6.1298208E8f}},{{(-4.95605888E8f),1.21150003E9f},{3.8704404E7f,(-1.62833152E8f)},{1.93896307E9f,6.181049E8f,(-3.42281088E8f),1.7206616E8f,(-3.0580326E7f)},{2.88816416E8f,4.01679808E8f,(-1.14942632E8f)},{2.1512152E8f,7.4206861E8f,4.51490656E8f}},{{(-6.7056576E8f),1.48250512E8f,1759027.0f},{1.5852928E9f,3635921.5f},{3.7024832E8f,(-1.44572109E9f),5549610.5f,4.37338176E8f,(-8.509625E8f),(-1.23811264E9f),(-1.11852824E8f)},{8.3330176E7f,1.74641882E9f,2.80364992E8f,(-1.49436544E9f)}},{{(-5.4918669E8f),8.9951821E8f},{3.03067072E8f,2.49543664E8f,1.9176585E9f,8.3689616E7f,(-2.9432904E7f),2.42578512E8f,5.10321216E8f}}}; + static char var_914 = '3'; + public static Class_4 var_921 = new Class_4(); + int func_11(short args_191, int args_192, byte args_193, boolean args_194, short args_195, char args_196) + { + for (int id_197 = 50;id_197>35;id_197 -= 2) + { + var_175 = ")rz/h(:on"+(var_181/(1|var_174)); + var_174 = var_174; + var_186 = (-8668); + var_198 = 5.0001817717226195E8d; + try + { + --var_199; + --var_199; + for (int id_200 = 70;id_200<87;id_200 += 3) + { + var_173 = (var_186/(1|var_199))>>>var_174; + var_201 = var_201; + var_175 = "Fo|#bS@xp"; + var_202 = var_175; + var_186 = var_186; + int index_204 = ((var_173>>var_186)<=(-6.5437261E8f)) + { + var_201 = var_201; + var_202 = var_202; + } + else + { + var_177 = var_177; + var_173 = +((byte)var_173); + } + var_206 = var_186<<((short)(-67)); + System.out.println( "=======Exception thrown======="+9); + } + var_198 = -(-1794276199); + } + Class_5 var_209 = new Class_5(); + int var_212 = (-862259825); + float var_214 = 5.1491744E8f; + try + { + for (int id_207 = 9;id_207<11;id_207 += 1) + { + short var_208 = (-15206); + if (((short)((short)var_199))==var_208) + { + var_209 = new Class_5(); + int index_210 = var_177&array_203.length-1; + int index_211 = ((char)var_199)&array_203[index_210].length-1; + var_198 = '\''+((char)array_203[index_210][index_211]); + } + else + { + var_212 = ((byte)var_181)-var_206; + var_213 = ((var_199/(1|var_212))!=var_173)^((var_213&var_213)^var_213); + var_201 = var_214; + } + try + { + var_201 = var_173+(( +var_181)>>var_174); + int index_215 = (-251365361)&array_203.length-1; + int index_216 = var_186&array_203[index_215].length-1; + int index_217 = var_177&array_203.length-1; + int index_218 = (-65)&array_203[index_217].length-1; + var_219 = array_203[index_217][index_218]; + } + catch (Exception e_3) + { + var_175 = var_202+var_177; + var_201 = var_214; + var_213 = var_177<((char)(var_206--)); + System.out.println( "=======Exception thrown======="+10); + } + finally + { + var_208 = (short)(var_177+((char)6065596281272651780L)); + var_213 = var_213; + var_212 = var_206; + var_198 = var_214+((byte)var_198); + var_220 = var_220; + var_175 = ("]2#R+F]#j"+var_213)+var_175; + } + if (var_221) + { + var_198 = 1.652991498752337E9d*((byte)var_173); + array_223 = array_222; + var_174 = var_219; + var_213 = var_213; + var_220 = var_220; + int index_224 = var_173&array_203.length-1; + int index_225 = var_219&array_203[index_224].length-1; + int index_226 = index_224&array_222.length-1; + int index_227 = var_177&array_222[index_226].length-1; + int index_228 = var_208&array_222[index_226][index_227].length-1; + array_222[index_226][index_227][index_228] = (short)(array_203[index_224][index_225]++); + } + --var_220; + } + var_186++; + ++var_177; + var_219 = var_219; + } + catch (Exception e_1) + { + if (((byte)var_229)<((char)var_181)) + { + int index_230 = var_174&array_222.length-1; + int index_231 = ((byte)var_232)&array_222[index_230].length-1; + int index_233 = var_232&array_222[index_230][index_231].length-1; + int index_235 = var_177&array_223.length-1; + int index_236 = var_237&array_223[index_235].length-1; + int index_238 = var_239&array_223[index_235][index_236].length-1; + int index_234 = array_223[index_235][index_236][index_238]&array_222.length-1; + int index_240 = ((byte)var_173)&array_222[index_234].length-1; + int index_241 = var_237&array_222[index_234][index_240].length-1; + ++array_222[index_234][index_240][index_241]; + } + else + { + var_213 = var_213; + ++var_219; + } + var_239 = var_239; + System.out.println( "=======Exception thrown======="+11); + } + return (-314111534); + } + protected int func_12(short args_243, int args_244, double args_245, short args_246, String args_247, float args_248) + { + var_213 = var_213||var_213; + if (var_249) + { + ++var_239; + var_232 = var_250; + } + else + { + var_251 = +(var_237/(1|'0')); + if (((var_181++)*var_219)>=var_206) + { + var_198 = 1.13574106E9f+(-9.650495416190547E8d); + int index_254 = (-1369865108)&array_253.length-1; + byte var_256 = (-117); + int index_255 = var_256&array_253.length-1; + array_253[index_255] = (var_252+array_253[index_254])+var_201; + } + else + { + var_181--; + var_173 = (-710100946); + var_213 = !true; + } + if ( !(var_257^var_257)) + { + var_213 = var_213; + var_220 = var_177; + } + } + var_181++; + boolean var_259 = true; + for (int id_258 = 78;id_258>64;id_258 -= 8) + { + try + { + var_181--; + if (var_259) + { + var_174 = 105; + var_198 = var_229--; + var_213 = true; + int index_260 = '-'&array_203.length-1; + int index_261 = (var_206-((short)var_201))&array_203[index_260].length-1; + int index_262 = 32318&array_203.length-1; + int index_263 = var_186&array_203[index_262].length-1; + var_174 = array_203[index_262][index_263]; + } + else + { + var_213 = var_213; + var_206 = var_237; + var_199 = (byte)var_181; + var_175 = var_175+var_239; + array_264 = array_264; + } + } + catch (Exception e_2) + { + var_177 = ' '; + var_220--; + try + { + var_206 = var_206-var_206; + var_266 = var_265; + } + catch (Exception e_3) + { + var_251 = var_201; + int index_267 = var_220&array_264.length-1; + int index_268 = ((char)var_177)&array_264[index_267].length-1; + int index_269 = var_250&array_264[index_267][index_268].length-1; + var_177 = (char)(array_264[index_267][index_268][index_269]--); + System.out.println( "=======Exception thrown======="+13); + } + finally + { + int index_270 = var_173&array_223.length-1; + int index_271 = ((char)var_220)&array_223[index_270].length-1; + int index_272 = var_250&array_223[index_270][index_271].length-1; + array_223[index_270][index_271][index_272] = (short)(var_237>>>8673545371462338027L); + var_199 = var_199; + } + var_177 = (char)((char)(var_186*var_174)); + ++var_229; + System.out.println( "=======Exception thrown======="+13); + } + var_177 = (char)( -var_177); + for (int id_273 = 2;id_273<73;id_273 += 12) + { + int index_274 = ((char)(var_219-var_220))&array_253.length-1; + var_202 = var_175+(array_253[index_274]+96); + } + var_177 = (char)var_251; + } + return var_206; + } + public Class_7 func_15(short args_347, boolean args_348, int args_349, String args_350, short[][][] args_351, int args_352) + { + var_232 = (short)var_198; + var_177++; + char var_371 = ','; + boolean var_421 = false; + Class_6[][][] array_423 = new Class_6[][][]{{{new Class_6(),new Class_6()},{new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6()}},{{new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6()}}}; + try + { + byte var_393 = 31; + try + { + for (int id_353 = 66;id_353<81;id_353 += 4) + { + var_177 = (char)var_177; + var_220 = var_177; + int index_354 = var_206&array_253.length-1; + int index_355 = var_220&array_253.length-1; + array_253[index_355] = array_253[index_354]+(-1555143935); + } + try + { + int index_356 = ((byte)(var_357&var_199))&array_222.length-1; + int index_358 = var_276&array_222[index_356].length-1; + int index_361 = ((short)(var_198/(1|var_362)))&array_203.length-1; + int index_363 = var_364&array_203[index_361].length-1; + int index_360 = array_203[index_361][index_363]&array_203.length-1; + int index_365 = ((var_366&var_367)%(1|var_173))&array_203[index_360].length-1; + int index_359 = array_203[index_360][index_365]&array_222[index_356][index_358].length-1; + array_222[index_356][index_358][index_359] = (-1510); + } + catch (Exception e_3) + { + int index_368 = 127&array_222.length-1; + int index_369 = 31553&array_222[index_368].length-1; + int index_370 = var_371&array_222[index_368][index_369].length-1; + int index_372 = ((short)var_220)&array_222.length-1; + int index_373 = var_374&array_222[index_372].length-1; + int index_375 = (((byte)var_219)>>(var_219>>var_276))&array_222[index_372][index_373].length-1; + var_186 = array_222[index_372][index_373][index_375]; + System.out.println( "=======Exception thrown======="+17); + } + var_376 = var_376; + try + { + var_377 = var_377; + var_252 = var_202; + } + catch (Exception e_3) + { + var_378 = var_206; + int index_379 = ((short)((short)var_251))&array_203.length-1; + int index_380 = var_378&array_203[index_379].length-1; + int index_381 = var_199&array_203.length-1; + int index_382 = var_378&array_203[index_381].length-1; + var_174 = array_203[index_381][index_382]; + System.out.println( "=======Exception thrown======="+18); + } + finally + { + var_232 = (short)var_251; + int index_383 = var_276&array_223.length-1; + int index_384 = var_237&array_223[index_383].length-1; + int index_385 = ((short)var_251)&array_223[index_383][index_384].length-1; + var_386 = +(((byte)var_251)+array_223[index_383][index_384][index_385]); + } + } + catch (Exception e_2) + { + array_264 = array_264; + int index_387 = var_388&array_203.length-1; + int index_389 = var_173&array_203[index_387].length-1; + int index_390 = ((byte)var_357)&array_203.length-1; + char var_392 = '%'; + int index_391 = (var_392^((char)var_251))&array_203[index_390].length-1; + var_393 = array_203[index_390][index_391]; + System.out.println( "=======Exception thrown======="+19); + } + ++var_220; + try + { + for (int id_394 = 4;id_394<12;id_394 += 2) + { + var_232 = var_250; + int index_395 = var_367&array_264.length-1; + int index_396 = (-43)&array_264[index_395].length-1; + int index_397 = var_174&array_264[index_395][index_396].length-1; + array_264[index_395][index_396][index_397] = (short)4634693.5f; + } + var_173--; + char var_399 = '('; + int index_398 = ((char)var_399)&array_264.length-1; + int index_400 = 1122528432&array_264[index_398].length-1; + int index_401 = (var_186--)&array_264[index_398][index_400].length-1; + int index_402 = ((byte)((char)var_393))&array_264.length-1; + int index_403 = var_219&array_264[index_402].length-1; + int index_404 = (((short)var_181)&((short)var_201))&array_264[index_402][index_403].length-1; + array_264[index_402][index_403][index_404]++; + } + catch (Exception e_2) + { + ++var_177; + var_377 = var_377; + var_206++; + for (int id_405 = 46;id_405>7;id_405 -= 20) + { + var_376 = var_376; + var_251 = var_251; + int index_406 = var_206&array_253.length-1; + array_253[index_406] = var_202+var_213; + } + var_364--; + System.out.println( "=======Exception thrown======="+20); + } + var_239--; + --var_186; + } + catch (Exception e_1) + { + var_237--; + for (int id_407 = 18;id_407<94;id_407 += 13) + { + if (var_408) + { + var_220 = (char)var_251; + var_173 = var_378; + } + for (int id_409 = 15;id_409<66;id_409 += 7) + { + var_386 = var_198; + array_222 = array_222; + var_213 = ((char)(-6.4485204E7f))!=((char)var_250); + var_374 = (short)var_201; + var_386 = 3.372427833052212E8d; + var_251 = +var_220; + } + ++var_410; + } + int index_411 = var_206&array_203.length-1; + int index_412 = ((byte)var_220)&array_203[index_411].length-1; + int index_414 = var_177&array_222.length-1; + int index_416 = var_186&array_203.length-1; + int index_417 = var_177&array_203[index_416].length-1; + int index_415 = array_203[index_416][index_417]&array_222[index_414].length-1; + int index_418 = 'k'&array_222[index_414][index_415].length-1; + int index_413 = array_222[index_414][index_415][index_418]&array_203.length-1; + int index_419 = ((char)var_173)&array_203[index_413].length-1; + var_199 = array_203[index_413][index_419]; + System.out.println( "=======Exception thrown======="+21); + } + finally + { + var_276 = var_199; + for (int id_420 = 40;id_420<81;id_420 += 7) + { + var_421 = (var_213^(var_213&var_213))||((var_229--)>var_198); + for (int id_422 = 78;id_422>4;id_422 -= 19) + { + array_223 = array_222; + var_175 = var_175; + var_237 = var_366; + var_421 = var_213; + int index_424 = 14640&array_423.length-1; + int index_425 = var_374&array_423[index_424].length-1; + char[] array_427 = new char[]{'x'}; + int index_428 = ((byte)var_229)&array_427.length-1; + int index_426 = array_427[index_428]&array_423[index_424][index_425].length-1; + int index_429 = (-28214)&array_423.length-1; + int index_430 = 'b'&array_423[index_429].length-1; + int index_431 = var_220&array_423[index_429][index_430].length-1; + int index_432 = ((short)var_433)&array_423.length-1; + int index_434 = var_174&array_423[index_432].length-1; + int index_435 = var_237&array_423[index_432][index_434].length-1; + array_423[index_432][index_434][index_435] = array_423[index_429][index_430][index_431]; + } + } + } + return new Class_7(); + } + char func_16(byte args_445, float args_446, short args_447, short args_448, char args_449, double args_450) + { + var_410 = var_220; + var_367 = var_378; + for (int id_451 = 44;id_451<49;id_451 += 1) + { + var_220++; + int index_452 = var_410&array_203.length-1; + int index_453 = var_206&array_203[index_452].length-1; + int index_454 = var_237&array_203.length-1; + int index_455 = var_232&array_203[index_454].length-1; + array_203[index_454][index_455]--; + } + var_186 = (short)var_198; + var_198 = -var_433; + return (char)var_364; + } + private int func_19(boolean args_702, String args_703, short args_704, float args_705, float args_706, short args_707) + { + var_388 = (byte)8729022337428877858L; + var_202 = "|\"KlI=#[/X"; + var_388 = var_219; + ++var_181; + var_386 = 3.757311328364414E8d; + return +((byte)(var_708^var_232)); + } + private long func_20(char args_710, double args_711, float args_712, int args_713, byte args_714, String args_715) + { + var_250--; + var_239--; + ++var_410; + return var_357; + } + private Class_7 func_22(byte args_805, float args_806, Class_9 args_807, int args_808, String args_809, long[][][] args_810) + { + var_213 = var_437&&false; + int index_811 = 88&array_264.length-1; + int index_812 = ((short)var_239)&array_264[index_811].length-1; + int index_813 = var_439&array_264[index_811][index_812].length-1; + int index_814 = ((byte)var_250)&array_264.length-1; + int index_815 = var_177&array_264[index_814].length-1; + int index_816 = var_410&array_264[index_814][index_815].length-1; + array_264[index_814][index_815][index_816]--; + return new Class_7(); + } + private void func_6(short args_16, byte args_17, double args_18, byte args_19, boolean args_20, boolean args_21) + { + short var_76 = 5645; + short actualArgs_77 = (short)var_76; + Class_5 var_91 = new Class_5(); + double actualArgs_176 = var_172.func_10((short)actualArgs_77, var_173, (byte)var_174, (short)var_76, var_175, var_175); + char actualArgs_178 = ((char)var_177); + long var_179 = (-8855893077027578633L); + double actualArgs_180 = (var_179/(1|actualArgs_178)); + char actualArgs_182 = ((char)var_181); + byte actualArgs_183 = ((byte)var_174); + short actualArgs_184 = var_91.func_9(actualArgs_176, (char)actualArgs_178, 7.712665114879131E8d, actualArgs_180, (char)actualArgs_182, (byte)actualArgs_183); + String actualArgs_185 = (var_175+actualArgs_182); + String actualArgs_187 = var_91.func_8((short)var_76, var_172, actualArgs_180, (byte)actualArgs_183, actualArgs_180, (short)var_186); + double actualArgs_188 = var_172.func_10((short)actualArgs_77, var_173, (byte)var_174, (short)var_76, actualArgs_185, actualArgs_187); + short var_189 = 19667; + String actualArgs_190 = var_91.func_8((short)actualArgs_184, var_172, 1.2158302895585525E9d, (byte)(-44), actualArgs_188, (short)var_189); + short actualArgs_242 = ((short)func_11((short)var_76, var_237, (byte)var_199, var_213, (short)var_76, (char)var_177)); + int index_275 = var_276&array_223.length-1; + int index_277 = (((byte)var_174)&((byte)var_229))&array_223[index_275].length-1; + short actualArgs_436 = ((short)((byte)var_174)); + int index_438 = 1038&array_253.length-1; + float actualArgs_440 = (var_439++); + byte actualArgs_441 = ((byte)var_198); + float actualArgs_442 = ( -index_275); + char actualArgs_443 = ((char)var_276); + byte actualArgs_456 = ((byte)var_198); + float actualArgs_524 = var_523.func_17((char)actualArgs_178, var_237, array_203, (short)var_232, var_201, index_275); + short actualArgs_525 = ((short)actualArgs_443); + char actualArgs_526 = ((char)var_186); + short var_699 = (-31764); + double actualArgs_700 = var_698.func_18(var_175, (byte)var_199, (short)actualArgs_242, (short)var_699, actualArgs_176, (short)var_232); + int index_444 = func_16((byte)actualArgs_456, actualArgs_524, (short)var_76, (short)actualArgs_525, (char)actualArgs_526, actualArgs_700)&array_264.length-1; + int index_701 = (func_19(var_437, "LN1#~Sjeh4", (short)actualArgs_77, 7.6019245E8f, var_251, (short)var_189)>>actualArgs_178)&array_264[index_444].length-1; + double var_716 = (-5.532226442895252E8d); + int index_709 = ((short)func_20((char)actualArgs_443, var_716, var_201, var_206, (byte)actualArgs_441, actualArgs_190))&array_264[index_444][index_701].length-1; + int var_817 = 898016874; + float actualArgs_818 = ( +((byte)var_817)); + short[][][] actualArgs_821 = func_22((byte)actualArgs_441, actualArgs_818, var_698, var_439, var_252, array_819).func_21((short)var_374, var_213, actualArgs_185, actualArgs_818, (byte)var_820, actualArgs_187); + int index_278 = func_15((short)actualArgs_436, var_437, (-70482598), array_253[index_438], array_223, index_438).func_14((char)var_410, actualArgs_440, var_251, (byte)actualArgs_441, (short)actualArgs_77, actualArgs_185).func_13(actualArgs_176, (byte)actualArgs_441, actualArgs_442, (char)actualArgs_443, (short)array_264[index_444][index_701][index_709], actualArgs_821)&array_223[index_275][index_277].length-1; + int actualArgs_822 = (actualArgs_184*var_699); + int index_824 = var_817&array_823.length-1; + int index_825 = var_220&array_823[index_824].length-1; + int index_826 = var_239&array_823[index_824][index_825].length-1; + double actualArgs_827 = (array_823[index_824][index_825][index_826]++); + int index_828 = index_825&array_253.length-1; + int actualArgs_829 = func_12((short)array_223[index_275][index_277][index_278], actualArgs_822, actualArgs_827, (short)(-9461), array_253[index_828], actualArgs_442); + int actualArgs_830 = func_11((short)actualArgs_242, actualArgs_829, (byte)var_276, true, (short)var_250, (char)var_220); + short actualArgs_832 = (short)((char)((byte)var_831)); + var_75.func_7((short)actualArgs_77, actualArgs_190, (char)var_177, actualArgs_830, true, (short)actualArgs_832); + } + public void func_5(byte args_10, boolean args_11, int args_12, short args_13, double args_14, boolean args_15) + { + byte actualArgs_833 = (byte)((char)var_831); + func_6((short)var_374, (byte)var_219, var_433, (byte)actualArgs_833, var_437, var_437); + boolean var_834 = true; + Class_4 var_849 = new Class_4(); + short var_864 = 31832; + boolean var_869 = false; + char var_880 = '*'; + String var_890 = "V!q\":vN2#i"; + long var_901 = (-5366086357255664301L); + if (var_834) + { + try + { + int index_835 = ((char)func_20((char)var_177, var_386, 4.29781056E8f, var_237, (byte)var_276, var_252))&array_222.length-1; + int index_836 = var_831&array_222[index_835].length-1; + int index_837 = var_439&array_222[index_835][index_836].length-1; + index_836 = array_222[index_835][index_836][index_837]<<'7'; + try + { + var_437 = var_437; + var_265 = var_265; + } + catch (Exception e_3) + { + char actualArgs_840 = var_839.func_13(var_386, (byte)var_174, var_251, (char)var_177, (short)var_831, array_223); + int actualArgs_841 = (var_220--); + int actualArgs_842 = (var_366/(1|var_820)); + int index_843 = var_220&array_253.length-1; + array_253[index_843] = var_252+var_838.func_17((char)actualArgs_840, actualArgs_841, array_203, (short)var_250, var_251, actualArgs_842); + System.out.println( "=======Exception thrown======="+37); + } + } + catch (Exception e_2) + { + int index_844 = 12872&array_264.length-1; + int index_845 = var_366&array_264[index_844].length-1; + int index_846 = var_388&array_264[index_844][index_845].length-1; + if ((((short)var_220)-array_264[index_844][index_845][index_846])>var_229) + { + var_177 = var_410; + var_847 = var_198; + } + System.out.println( "=======Exception thrown======="+38); + } + finally + { + int index_848 = var_206&array_253.length-1; + array_253[index_848] = (var_202+(var_250*var_250))+var_199; + short actualArgs_850 = (short)var_374; + char actualArgs_851 = (char)( +(var_206>>>var_831)); + int actualArgs_852 = ( +((byte)actualArgs_851))*((char)var_239); + var_849.func_7((short)actualArgs_850, "H%PGC$s,xG", (char)actualArgs_851, actualArgs_852, var_437, (short)var_831); + } + var_364++; + for (int id_853 = 11;id_853<28;id_853 += 2) + { + int actualArgs_854 = (var_374>>>var_388); + short actualArgs_855 = ((short)var_186); + int actualArgs_856 = (((byte)var_239)>>(-8986)); + var_251 = var_523.func_17((char)'n', actualArgs_854, array_203, (short)actualArgs_855, var_251, actualArgs_856); + } + boolean[] array_857 = new boolean[]{true,true,false,false,false}; + int index_858 = var_237&array_857.length-1; + int index_859 = (((byte)var_198)>>>var_199)&array_857.length-1; + if (array_857[index_858]^array_857[index_859]) + { + var_831 = var_186; + short var_865 = 24394; + if (((var_860||var_860)|var_860)||var_860) + { + var_265 = var_265; + index_859 = -index_859; + var_202 = var_175; + var_861 = var_177; + short actualArgs_862 = ((short)var_199); + float actualArgs_863 = (var_861+actualArgs_862); + var_864 = (short)func_19(var_213, var_252, (short)actualArgs_862, actualArgs_863, 9.133401E8f, (short)actualArgs_862); + } + else + { + var_213 = var_213|var_213; + var_232 = var_865; + var_437 = var_437; + int index_866 = var_364&array_222.length-1; + int index_867 = (-1440363000)&array_222[index_866].length-1; + int index_868 = ((var_374<9;id_893 -= 5) + { + int index_894 = var_177&array_823.length-1; + int index_895 = ((char)var_276)&array_823[index_894].length-1; + int index_896 = ((char)(actualArgs_833/var_251))&array_823[index_894][index_895].length-1; + var_251 = var_181*array_823[index_894][index_895][index_896]; + } + ++var_220; + var_897--; + } + } + else + { + short actualArgs_899 = (short)(var_439^var_266.func_9(var_386, (char)var_177, (-2.5351218510520855E8d), var_847, (char)var_898, (byte)var_219)); + String actualArgs_900 = var_202+var_174; + short actualArgs_902 = (short)((short)var_901); + var_849.func_7((short)actualArgs_899, actualArgs_900, (char)var_177, var_367, var_213, (short)actualArgs_902); + double var_918 = 6.2787500158360206E7d; + for (int id_903 = 16;id_903<48;id_903 += 5) + { + array_823 = array_823; + try + { + var_904 = (-16578); + var_437 = ((var_276==actualArgs_833)&var_213)^var_213; + var_906 = (char)((char)var_905); + int index_907 = var_374&array_253.length-1; + int index_908 = ((short)func_12((short)actualArgs_902, var_367, var_386, (short)var_864, var_252, 3.42730688E8f))&array_253.length-1; + int index_909 = (((short)var_251)*((char)var_198))&array_253.length-1; + array_253[index_909] = array_253[index_908]; + } + catch (Exception e_3) + { + var_904 = var_186; + var_251 = 5.2853552E7f; + var_905 = (short)var_251; + System.out.println( "=======Exception thrown======="+39); + } + var_910--; + var_880 = '?'; + try + { + array_911 = array_911; + int index_913 = var_914&array_912.length-1; + int index_915 = var_378&array_912[index_913].length-1; + int index_916 = var_220&array_912[index_913][index_915].length-1; + array_912[index_913][index_915][index_916] = var_251; + var_880 = (char)((short)(var_250-var_904)); + } + catch (Exception e_3) + { + int actualArgs_917 = (var_831-var_364); + int actualArgs_919 = func_12((short)17168, actualArgs_917, var_918, (short)27058, var_175, var_201); + short actualArgs_920 = ((short)7053616144824893515L); + var_201 = var_838.func_17((char)var_914, actualArgs_919, array_203, (short)actualArgs_920, var_201, var_887); + System.out.println( "=======Exception thrown======="+40); + } + int index_922 = var_250&array_222.length-1; + int index_923 = 'I'&array_222[index_922].length-1; + int index_924 = ((byte)var_904)&array_222[index_922][index_923].length-1; + int actualArgs_925 = var_906^(((char)var_367)&var_904); + boolean actualArgs_926 = (false|var_437)||var_437; + short actualArgs_927 = (short)((char)(-1.56470416E8f)); + var_921.func_7((short)array_222[index_922][index_923][index_924], actualArgs_900, (char)var_220, actualArgs_925, actualArgs_926, (short)actualArgs_927); + } + } + } +} +class Class_4 +{ + static Class_4 var_28 = new Class_4(); + static byte var_29 = (-80); + public static double var_31 = (-8.668386145300348E8d); + private static boolean var_32 = true; + static String var_35 = "b1$QTb49Xt"; + protected static float var_36 = (-2.82479872E8f); + protected static char var_39 = 'y'; + protected static long var_42 = (-2493532710568395261L); + private static short var_60 = 29768; + public static int var_64 = (-1150329757); + public static short[][][] array_66 = new short[][][]{{{29771,5025,5992,1948,32699},{(-27170),5378,(-19559)},{24582,21396,(-11169)},{4074,(-11882)}},{{(-13384),11210,29715,25281,24496},{14348,906},{25917},{7426}},{{(-4719),17480,1384,(-3679)},{(-4180)},{(-16085),13989},{9174,23215,28697,22029},{(-20398),27736,(-7012)},{(-2390),9124,(-512)}},{{(-23985),(-5292),(-11342),(-29923),9175,31225},{27240,(-23334),11684}},{{(-15012)},{16109,(-8058)}}}; + public static int var_70 = (-157386873); + public void func_7(short args_22, String args_23, char args_24, int args_25, boolean args_26, short args_27) + { + var_28 = var_28; + ++var_29; + double var_30 = (-9.619320082523676E8d); + int var_41 = 1325861998; + boolean var_44 = false; + short[][][] array_63 = new short[][][]{{{(-26165),(-7597),1021,(-19598),11823,(-10405)},{5275},{(-25448),15755,(-12134)},{(-19502),(-20957),(-30706),(-18462),(-30426)},{20438,(-18539),(-4728),(-28404),14391}},{{(-21324),16483},{(-24800),31141,18983,(-11843),3247,15672},{17901,(-25610),(-24874)},{(-10870),(-30463),(-21284)},{(-11899),5486,5936,(-10793)}},{{(-3683),2152,(-25483),28506,(-14542)},{(-7584),(-15468)},{(-4687),12760,12391,(-25672)},{2114,13283,26580},{(-25064),15281,(-31326),(-13592),(-29625)}},{{29705,15045,(-16295),(-5203)},{14282,6132,(-17831),8038,23130},{(-30845),(-13453),32260,(-6292),9504},{(-18175),(-20817),(-7425),(-13875),10533,25595,9273}},{{(-26515),(-5473),11709,(-17443),27928},{(-23985),(-23654),9582},{14177,(-29603),(-9264)},{(-17372),6199,15863,(-30544),(-28997),(-8759)}},{{(-14703),(-20129),(-1109)},{(-28076),32032,18760,(-31819),15539},{32693,(-12305),(-11218),(-22889)}}}; + int var_65 = (-400204621); + char var_67 = '1'; + try + { + var_31 = var_30; + short var_33 = 12175; + if (var_32&&( !var_32)) + { + var_33 = 23128; + var_33--; + var_30 = var_31; + } + else + { + for (int id_34 = 84;id_34<86;id_34 += 1) + { + var_35 = var_35; + char var_37 = 'F'; + var_37 = (char)var_36; + var_33 = (short)(var_33-var_37); + } + var_30 = var_30; + var_30 = var_31; + for (int id_38 = 60;id_38>22;id_38 -= 20) + { + var_39 = var_39; + double var_40 = (-5.641564976164553E8d); + var_31 = var_40; + } + } + var_41 = var_41; + var_42++; + } + catch (Exception e_1) + { + for (int id_43 = 39;id_43>16;id_43 -= 4) + { + var_44 = var_44; + var_44 = var_44; + var_39 = var_39; + var_39 = var_39; + var_30 = 1.779267340250082E9d; + } + var_30 = var_31; + System.out.println( "=======Exception thrown======="+1); + } + finally + { + var_36 = -var_29; + var_41++; + short var_62 = (-19363); + try + { + var_31 = var_42++; + for (int id_45 = 0;id_45<48;id_45 += 9) + { + short[][][] array_46 = new short[][][]{{{8222,(-5473)},{2022,(-11357),(-491),(-9998),5200},{31368,29144,6654,(-20602)}},{{30206,24260,(-7344),(-24193),(-1516),(-7435)},{(-27607),(-24400),14324}},{{(-21281),(-16801),(-26145),20632,11242},{24577},{6518,29855,11935,15286}}}; + int index_47 = var_41&array_46.length-1; + int index_48 = (-94)&array_46[index_47].length-1; + int index_49 = ((char)( ~(-105)))&array_46[index_47][index_48].length-1; + int index_50 = (-2041825202)&array_46.length-1; + int index_51 = index_48&array_46[index_50].length-1; + int index_52 = ((char)var_31)&array_46[index_50][index_51].length-1; + int index_53 = index_51&array_46.length-1; + int index_54 = index_47&array_46[index_53].length-1; + int index_56 = ((byte)'S')&array_46.length-1; + int index_57 = (var_29^var_29)&array_46[index_56].length-1; + int index_58 = ((char)var_39)&array_46[index_56][index_57].length-1; + int index_55 = array_46[index_56][index_57][index_58]&array_46[index_53][index_54].length-1; + array_46[index_53][index_54][index_55] = array_46[index_50][index_51][index_52]; + } + var_29 = (byte)var_42; + try + { + var_44 = var_44; + var_31 = +var_29; + var_31 = var_30; + var_41 = 1498570879; + var_39 = (char)var_30; + } + catch (Exception e_3) + { + String var_59 = "3))aOI_CNi"; + var_59 = var_59; + var_59 = ((var_35+var_29)+var_29)+var_44; + var_60 = (short)var_41; + var_44 = var_44; + System.out.println( "=======Exception thrown======="+2); + } + var_60++; + var_60 = 31793; + } + catch (Exception e_2) + { + var_36 = var_39--; + for (int id_61 = 14;id_61<64;id_61 += 17) + { + var_36 = -var_42; + var_29 = var_29; + } + var_30 = var_31; + System.out.println( "=======Exception thrown======="+3); + } + finally + { + --var_41; + try + { + var_41 = var_41; + var_36 = var_39+var_39; + var_29 = var_29; + } + catch (Exception e_3) + { + var_36 = var_62/(1|var_39); + var_39 = var_39; + array_63 = array_63; + var_41 = var_60|var_29; + var_36 = ((char)(var_29+var_42))-var_29; + System.out.println( "=======Exception thrown======="+4); + } + finally + { + var_29 = (byte)((char)1138443180); + var_30 = ((short)var_39)*(-1307819346); + var_41 = (-1873576868); + array_63 = array_63; + } + var_65 = var_64; + try + { + var_62 = var_60; + var_30 = var_31; + array_66 = array_66; + var_60 = var_60; + } + catch (Exception e_3) + { + var_67 = var_67; + var_39 = var_67; + int index_68 = var_29&array_66.length-1; + int index_69 = ((byte)var_70)&array_66[index_68].length-1; + int index_71 = (var_29-var_29)&array_66[index_68][index_69].length-1; + array_66[index_68][index_69][index_71] = (short)var_36; + System.out.println( "=======Exception thrown======="+5); + } + finally + { + var_30 = var_30; + var_67 = var_39; + } + } + int index_72 = ( ~var_70)&array_63.length-1; + int index_73 = ((char)var_31)&array_63[index_72].length-1; + int index_74 = (-2823)&array_63[index_72][index_73].length-1; + var_44 = ( -array_63[index_72][index_73][index_74])!=var_64; + } + } +} +class Class_5 +{ + public static short var_84 = (-10619); + static byte var_85 = 121; + protected static String var_87 = "\"Ze~Ry|ga"; + public static char var_89 = '-'; + public static boolean var_90 = false; + static MainClass var_100 = new MainClass(); + static int var_101 = (-1728568381); + private static float var_102 = 3.8083036E7f; + private static double var_103 = (-1.2889860210764666E9d); + static short[][][] array_104 = new short[][][]{{{30377,27204},{2514,3628,(-16179),5813,20432,23897,13614}},{{(-27523),1176,(-18240)}},{{31326,(-19510),9258,(-15288),(-25845)},{11753,22312,(-5455),(-14390)}},{{(-1533),(-2724),5693,(-13397),28978,(-7097)},{29484,(-32072)}}}; + private static double var_111 = 9.833575350391765E7d; + private static char var_116 = '2'; + static double var_118 = (-3.843113373511055E7d); + public static short var_137 = 24557; + static boolean var_145 = true; + static char var_147 = ''; + public String func_8(short args_78, MainClass args_79, double args_80, byte args_81, double args_82, short args_83) + { + var_84++; + int var_86 = (-165417358); + var_86 = ((short)'h')/(1|((short)var_85)); + long var_88 = (-3019926235079125629L); + var_90 = var_87!=((var_87+var_84)+(var_88/(1|var_89))); + return var_87; + } + public short func_9(double args_92, char args_93, double args_94, double args_95, char args_96, byte args_97) + { + short[][][] array_105 = new short[][][]{{{(-11319),(-10117),(-7714),21068},{32041,(-16718),(-6463),(-31855)}},{{30901,31398,21829},{(-10607)}},{{30885,(-20352),12116}},{{19129,17380},{(-14196)},{22240,1036,16223,24437},{25197},{(-30563),2620,27157},{9604,30750,20519}}}; + char var_121 = 'D'; + long var_127 = (-3541492630411090304L); + for (int id_98 = 20;id_98<80;id_98 += 16) + { + try + { + for (int id_99 = 6;id_99<32;id_99 += 3) + { + var_85 = var_85; + var_87 = "v~Y5`L$M4C"; + } + try + { + var_100 = var_100; + var_101 = var_101; + var_102 = (-3.5908556E7f); + var_103 = var_103; + } + catch (Exception e_3) + { + var_101 = var_101; + array_105 = array_104; + int index_106 = ((short)var_89)&array_104.length-1; + int index_107 = ((short)var_84)&array_104[index_106].length-1; + int index_108 = index_107&array_104[index_106][index_107].length-1; + int index_109 = var_85&array_104.length-1; + int index_110 = ((short)var_111)&array_104[index_109].length-1; + int index_112 = var_89&array_104[index_109][index_110].length-1; + int index_113 = index_106&array_104.length-1; + int index_114 = (-17278)&array_104[index_113].length-1; + int index_115 = ((byte)var_89)&array_104[index_113][index_114].length-1; + array_104[index_113][index_114][index_115] = array_104[index_109][index_110][index_112]; + System.out.println( "=======Exception thrown======="+6); + } + finally + { + var_90 = false; + int index_117 = ((short)var_118)&array_104.length-1; + int index_120 = var_121&array_105.length-1; + int index_122 = var_116&array_105[index_120].length-1; + int index_124 = var_85&array_105.length-1; + int index_125 = var_85&array_105[index_124].length-1; + int index_126 = ((char)( +var_127))&array_105[index_124][index_125].length-1; + int index_123 = array_105[index_124][index_125][index_126]&array_105[index_120][index_122].length-1; + int index_119 = array_105[index_120][index_122][index_123]&array_104[index_117].length-1; + int index_129 = var_116&array_105.length-1; + int index_130 = var_84&array_105[index_129].length-1; + int index_132 = index_123&array_105.length-1; + int index_133 = ((char)((short)var_89))&array_105[index_132].length-1; + int index_134 = var_85&array_105[index_132][index_133].length-1; + int index_131 = ((byte)array_105[index_132][index_133][index_134])&array_105[index_129][index_130].length-1; + int index_128 = array_105[index_129][index_130][index_131]&array_104[index_117][index_119].length-1; + var_118 = (var_101-var_116)/(1|array_104[index_117][index_119][index_128]); + } + try + { + var_87 = "%\"uh;'KJT>"; + int index_136 = var_137&array_104.length-1; + int index_138 = var_85&array_104[index_136].length-1; + int index_139 = ((short)var_121)&array_104[index_136][index_138].length-1; + int index_135 = array_104[index_136][index_138][index_139]&array_104.length-1; + int index_140 = 'z'&array_104[index_135].length-1; + int index_141 = ((byte)var_116)&array_104[index_135][index_140].length-1; + int index_142 = ((byte)((byte)var_85))&array_104.length-1; + int index_143 = ((byte)( ~var_85))&array_104[index_142].length-1; + int index_144 = var_84&array_104[index_142][index_143].length-1; + var_137 = array_104[index_142][index_143][index_144]; + } + catch (Exception e_3) + { + var_145 = var_145; + var_102 = var_102; + var_103 = 9.234317302251928E8d; + System.out.println( "=======Exception thrown======="+7); + } + } + catch (Exception e_2) + { + var_85--; + var_121--; + var_118 = var_103; + for (int id_146 = 28;id_146<46;id_146 += 4) + { + var_102 = var_102; + var_102 = var_102; + } + var_116++; + System.out.println( "=======Exception thrown======="+8); + } + var_101++; + --var_85; + var_87 = ((var_87+var_137)+var_116)+(var_116-var_102); + var_147 = (char)((byte)var_102); + } + return (short)var_121; + } +} +class Class_6 +{ + static Class_5 var_285 = new Class_5(); + static byte var_287 = (-44); + protected static long var_288 = 6249880268095279741L; + private static float var_289 = (-7.838432E8f); + protected static boolean var_292 = false; + public static boolean var_293 = false; + protected static String var_295 = "\"|%s]/fseg"; + public static int var_296 = (-1335477081); + public static short var_297 = (-16431); + static Class_3 var_299 = new Class_3(); + public static short var_300 = 7926; + protected static boolean var_302 = false; + public char func_13(double args_279, byte args_280, float args_281, char args_282, short args_283, short[][][] args_284) + { + var_285 = var_285; + short var_286 = (-758); + if ((var_286++)>var_287) + { + --var_286; + var_287--; + ++var_288; + } + var_289 = var_289; + boolean var_290 = true; + char var_291 = ')'; + short[][][] array_294 = new short[][][]{{{(-28156),15095,(-22695),14395,(-28911),14388},{31710,17751,25269,(-11746)},{(-31321),(-23018),(-29625),(-13453),(-7428),(-19496)}},{{1530,(-23095),32291},{12564,13064,(-30561),(-3869)},{27133,(-26751),(-23599)}},{{(-23615),28122},{(-17818),22705,(-6704),(-21059),23736,16649,19150,16043},{16315,(-2796),(-30298),(-5632),(-16294),30137},{(-19363),2044,14284},{(-21392)}},{{(-26331),734,18514,15415,17798},{(-13459),(-13705),(-5159),15137},{8207,(-6555),31954}}}; + boolean var_298 = false; + double var_307 = (-3.0074334694980245E7d); + double var_308 = (-8.242113894770068E8d); + if (var_290) + { + var_287 = var_287; + ++var_291; + try + { + if (var_292) + { + var_293 = false; + array_294 = array_294; + var_289 = var_289; + var_295 = var_295; + var_293 = var_293; + } + else + { + var_295 = var_295; + var_295 = var_295; + var_296 = ~((byte)var_289); + var_296 = 36<>(var_286--)); + var_291 = 'T'; + } + else + { + float var_309 = (-1.28764128E8f); + var_309 = var_289; + var_291--; + var_296++; + } + return (char)('['/(1|var_287)); + } +} +class Class_7 +{ + protected static int var_317 = (-1786315263); + static short var_318 = (-9162); + public static char var_319 = ';'; + protected static byte[][] array_324 = new byte[][]{{(-125),109,(-54),101},{(-118),120},{(-97),(-88),70,92},{(-62),(-28),(-124),31,85}}; + static char var_326 = 'S'; + static boolean var_329 = true; + private static float var_330 = 6.2670906E8f; + protected static Class_7 var_333 = new Class_7(); + public static int var_334 = 938142778; + protected static String var_335 = "/PgTflr16X"; + public static int var_336 = 184248520; + public static int var_727 = 307852453; + private static byte var_735 = 111; + private static long var_736 = (-4526438577960021506L); + static short var_743 = (-18280); + static boolean var_744 = false; + protected static float var_745 = (-5.2927916E7f); + static boolean var_746 = true; + public static boolean var_754 = false; + public static float var_756 = 8.443092E7f; + private static short var_759 = (-347); + private static String var_761 = "l;S`a?\"qMM"; + protected static long[][][] array_762 = new long[][][]{{{(-1933275158275753280L)},{4096794281753733035L,(-4343287853839144327L),(-5681801071660261646L),(-7913060163461684352L),(-8860178523524534599L),(-8116604124608368674L),6144276751398979251L,(-8176957751568642092L)}},{{(-1169407716608249105L),3512718009858302338L,7316320250092814944L,(-1460517793104822281L)},{(-5085029048420989562L),8184508902250015034L,(-7102123287037626903L),(-4134983061810952791L),8059983496109939923L},{7290500294024745071L,7274305743553421628L,(-2105464802174740364L),1052666965505148077L},{6610864288654832646L}},{{(-4511387142479815122L),12572435156840978L,(-7529057494222394640L),(-3188213391164744477L)},{7076963573926186807L}},{{8600882324640259212L,2856126259528842530L,(-1843739207017478175L),2700272035368986169L,(-3786459743261293755L)}}}; + private static Class_6[][][] array_763 = new Class_6[][][]{{{new Class_6()},{new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()}}}; + public static Class_6[][][] array_764 = new Class_6[][][]{{{new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6()}},{{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()}},{{new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6()},{new Class_6()},{new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6(),new Class_6(),new Class_6()}}}; + private static byte var_765 = 8; + static boolean var_772 = true; + protected static double var_775 = 2.9497107671001613E8d; + static short var_778 = (-31371); + protected static MainClass[] array_785 = new MainClass[]{new MainClass(),new MainClass(),new MainClass()}; + private static boolean var_786 = true; + public static short var_788 = 30066; + public static boolean var_789 = false; + public static Class_8 var_790 = new Class_8(); + private static int var_796 = (-745542579); + static short var_800 = 19460; + private static Class_4 var_803 = new Class_4(); + protected static short[][][] array_804 = new short[][][]{{{15134,(-14261),(-6693),14339},{29156,20998,(-17514)}},{{(-1346),(-16172),4453},{28671,(-26655)},{(-14250),7242,(-32753),11843},{(-24379),(-19417)},{14615},{22614,(-28698),26078},{(-26498),24101,(-21293),(-18983),(-18512),12287}},{{19457,(-715),7423},{25627,(-28696),(-17564),30425,(-8662),(-30636),(-3459)},{(-13825),25720,3653,(-24139),19101},{1692,(-20886)}}}; + public Class_6 func_14(char args_310, float args_311, float args_312, byte args_313, short args_314, String args_315) + { + float var_320 = 3.4369088E8f; + float var_321 = 8.967744E7f; + String var_322 = "8gJVn%#5O"; + double var_331 = (-3.493609250467588E8d); + float var_346 = (-5.0740912E8f); + for (int id_316 = 15;id_316<18;id_316 += 1) + { + boolean var_323 = false; + short var_332 = (-13342); + if (var_317>var_318) + { + var_318 = var_318; + var_319 = var_319; + byte var_327 = (-101); + if (var_317<=var_317) + { + var_319 = var_319; + var_321 = var_320; + var_321 = var_320; + var_322 = var_322+(var_323|(var_320!=var_321)); + var_319 = 'g'; + var_321 = var_320--; + } + else + { + array_324 = array_324; + var_318 = (short)(var_317++); + int index_325 = ((short)(var_326%(1|var_327)))&array_324.length-1; + int index_328 = var_327&array_324[index_325].length-1; + var_321 = var_319-array_324[index_325][index_328]; + } + var_326--; + } + else + { + if (var_329) + { + var_330 = var_321; + var_319 = var_319; + } + else + { + var_326 = var_319; + var_332 = (short)var_331; + var_333 = var_333; + var_331 = var_318-(((char)'9')+var_317); + } + try + { + var_319 = (char)var_334; + var_335 = var_335; + var_323 = ((var_336>>>'z')<<(959731609>>var_336))<(var_332+((char)var_317)); + int index_337 = var_332&array_324.length-1; + int index_338 = var_326&array_324[index_337].length-1; + int index_339 = 2217&array_324.length-1; + long var_341 = (-4400839628209832962L); + int index_340 = ((char)((char)var_341))&array_324[index_339].length-1; + int index_342 = var_319&array_324.length-1; + int index_344 = ((short)var_341)&array_324.length-1; + int index_345 = var_336&array_324[index_344].length-1; + int index_343 = array_324[index_344][index_345]&array_324[index_342].length-1; + array_324[index_342][index_343] = array_324[index_339][index_340]; + } + catch (Exception e_3) + { + var_321 = var_320; + var_322 = var_322; + System.out.println( "=======Exception thrown======="+16); + } + var_321 = var_346; + var_326--; + if (var_336>=var_321) + { + var_320 = -var_318; + var_318 = (short)(-3676503179867973361L); + var_326 = 'A'; + var_331 = (-8964)/(1|( ~((byte)6152081040010670875L))); + var_330 = var_346; + } + } + var_331 = var_331; + } + return new Class_6(); + } + public short[][][] func_21(short args_717, boolean args_718, String args_719, float args_720, byte args_721, String args_722) + { + --var_318; + char var_753 = '0'; + double var_755 = (-7.483141251838535E8d); + float var_757 = (-2.3529664E8f); + double[][] array_779 = new double[][]{{(-2.2666699750268172E7d),(-1.6401425514909036E7d),(-4.089657052506039E8d)},{1.468696704938308E9d,(-4.449567376495188E8d),(-2.3464583710048914E8d),1.5799472990318808E8d},{(-3.259777357431596E8d),7.530045466767126E7d,3.137343310076151E8d},{(-1.808915939392648E8d),1.8222760228312796E8d}}; + try + { + int index_723 = var_336&array_324.length-1; + int index_724 = var_319&array_324[index_723].length-1; + int index_726 = var_727&array_324.length-1; + int index_728 = 'V'&array_324[index_726].length-1; + int index_725 = array_324[index_726][index_728]&array_324.length-1; + int index_730 = var_318&array_324.length-1; + double var_733 = (-1.3315040414295106E9d); + int index_732 = ((short)var_733)&array_324.length-1; + int index_734 = ((byte)(var_735/(1|var_736)))&array_324[index_732].length-1; + int index_731 = array_324[index_732][index_734]&array_324[index_730].length-1; + int index_729 = array_324[index_730][index_731]&array_324[index_725].length-1; + array_324[index_725][index_729]++; + } + catch (Exception e_1) + { + for (int id_737 = 27;id_737<81;id_737 += 6) + { + --var_334; + try + { + var_335 = "Pg'?ar$I;~"; + var_330 = var_330; + int index_738 = var_318&array_324.length-1; + int index_739 = var_326&array_324[index_738].length-1; + var_317 = var_319<<(array_324[index_738][index_739]--); + } + catch (Exception e_3) + { + var_318 = var_318; + double[][] array_740 = new double[][]{{(-8.881389666994952E7d),(-2.0328186865587822E8d)},{(-5.2484752710424757E8d),3.0689435667320126E8d,4.048040066284886E7d,1.0211490506499181E9d,(-387066.6580279299d)},{3.575034744707782E7d,6.655559172383131E8d}}; + int index_741 = var_318&array_740.length-1; + int index_742 = var_743&array_740[index_741].length-1; + array_740[index_741][index_742] = var_334++; + System.out.println( "=======Exception thrown======="+31); + } + try + { + var_744 = var_744; + var_727 = var_319++; + } + catch (Exception e_3) + { + var_318 = (short)var_745; + var_744 = var_746; + System.out.println( "=======Exception thrown======="+32); + } + finally + { + var_326 = '\''; + var_735 = var_735; + } + var_745 = 1.83639347E9f; + } + ++var_318; + for (int id_747 = 93;id_747>1;id_747 -= 19) + { + int index_748 = var_743&array_324.length-1; + int index_749 = var_735&array_324[index_748].length-1; + int index_750 = var_743&array_324.length-1; + char var_752 = 'T'; + int index_751 = var_752&array_324[index_750].length-1; + var_735 = array_324[index_750][index_751]; + } + var_753 = var_319; + System.out.println( "=======Exception thrown======="+32); + } + finally + { + try + { + var_317 = +var_735; + if (var_754) + { + var_755 = var_755; + var_727 = var_334; + var_735 = var_735; + var_330 = (-3.44124992E8f); + var_756 = var_745; + var_757 = var_745; + } + else + { + var_335 = (var_335+var_318)+(var_330==(-3.7170192E7f)); + int index_758 = ((char)var_759)&array_324.length-1; + int index_760 = (((short)var_736)&var_336)&array_324[index_758].length-1; + var_755 = ((byte)(var_727++))-array_324[index_758][index_760]; + var_335 = var_335; + var_743 = (short)var_756; + } + var_761 = var_335; + var_756 = var_745; + try + { + var_334 = var_727; + array_762 = array_762; + array_764 = array_763; + var_326 = var_753; + var_744 = true; + } + catch (Exception e_3) + { + var_761 = var_761+var_765; + var_318 = 27714; + System.out.println( "=======Exception thrown======="+33); + } + } + catch (Exception e_2) + { + var_759 = (short)(-1.73123008E9f); + int index_766 = var_759&array_762.length-1; + int index_767 = var_765&array_762[index_766].length-1; + int index_768 = var_765&array_762[index_766][index_767].length-1; + int index_769 = var_319&array_762.length-1; + int index_770 = var_319&array_762[index_769].length-1; + int index_771 = var_735&array_762[index_769][index_770].length-1; + array_762[index_769][index_770][index_771]++; + System.out.println( "=======Exception thrown======="+34); + } + finally + { + var_335 = var_335; + ++var_319; + } + if ((var_743>>((byte)2.939441558248986E8d); + var_735 = var_735; + } + var_753--; + var_786 = var_744; + } + var_753 = var_753; + boolean var_787 = false; + Class_4 var_802 = new Class_4(); + if (var_787) + { + var_326 = (char)(var_745--); + var_788 = var_318; + var_727++; + array_785 = array_785; + } + else + { + if (var_789) + { + var_753 = (char)((short)var_788); + var_790 = new Class_8(); + int index_791 = var_735&array_785.length-1; + int index_792 = ((var_336+var_735)^((byte)var_334))&array_785.length-1; + int index_793 = ((short)(var_735>>var_778))&array_785.length-1; + array_785[index_793] = array_785[index_792]; + } + else + { + int index_794 = ((short)var_755)&array_779.length-1; + int index_795 = ((byte)((short)935695569))&array_779[index_794].length-1; + array_779[index_794][index_795] = ((short)var_736)-var_317; + } + var_796--; + try + { + int index_797 = ((short)var_756)&array_779.length-1; + int index_798 = var_759&array_779[index_797].length-1; + int index_799 = ((short)var_800)&array_779.length-1; + int index_801 = var_319&array_779[index_799].length-1; + var_775 = array_779[index_799][index_801]; + var_735 = var_735; + } + catch (Exception e_3) + { + var_333 = var_333; + var_803 = var_802; + var_735 = (byte)var_775; + System.out.println( "=======Exception thrown======="+36); + } + var_334++; + } + } + return array_804; + } +} +class Class_8 +{ + public static double var_463 = (-3.1007070833519768E7d); + public static boolean var_464 = false; + protected static float var_472 = 5.13434176E8f; + public static int var_475 = (-324544782); + protected static String var_476 = "DQ>1FP#g3>"; + static boolean var_477 = false; + static long var_478 = (-5807515869718929746L); + static short var_479 = (-32677); + protected static boolean var_480 = true; + public static Class_3 var_482 = new Class_3(); + static long[][][] array_485 = new long[][][]{{{6704474023045039818L,878435750822434380L,(-7065035895010638424L),(-909294796476857064L),6353611833514768009L,(-1986122791251320867L),(-8264040417614138046L)},{(-2736561160205017940L)}},{{(-2422881969579420592L),(-2161669677258637400L),5621803081890654653L,(-4727943859754778120L)},{(-4611407698835854957L)},{(-5341477438471695912L),3192341659384482148L,8891809689190297734L,6071338669825978779L},{504870508531885426L,(-319755734881626181L),2441300255587416511L,5334597816247902208L},{(-283243426319301588L),(-4380293944621097898L),5300364437463891031L,(-9174571884213894577L)}}}; + public static double var_491 = (-1.3215162205170286E8d); + public static char[] array_493 = new char[]{'','R','`'}; + static byte var_496 = 2; + protected static short[][][] array_498 = new short[][][]{{{21967,(-20286),25053},{9205,(-11849)},{6112,(-23341),24617,28946},{(-9464),(-30025),2185,(-27558)}},{{(-24882),(-22927),32050,24292,12263,(-32555),(-25018),11146},{(-12114),(-13),4387},{21738}},{{9128,(-32570)},{22715,3390,17094},{29846,13896,24876,(-22635)},{29461,8034,(-19930)},{2621,10725,25522,6991,(-24731)}},{{20627,(-2178)},{(-225),(-10519),16283},{(-12685)},{(-12370)},{(-8605),30251,31411,943,1725,12203},{13631,(-24275),2972,(-13560),(-29774),(-13112),(-27061)}},{{2309,(-29350),13936},{(-15905),7213,(-30151),31245,11004,15196,(-617)},{(-11229),(-19027),(-356)}}}; + private static byte[][] array_506 = new byte[][]{{(-104),(-108),(-71)},{58,106,(-41),(-86)},{13,13}}; + private static int var_515 = (-433206494); + private static short var_517 = (-19956); + private static short var_522 = 18370; + public float func_17(char args_457, int args_458, byte[][] args_459, short args_460, float args_461, int args_462) + { + var_463 = var_463; + char[][][] array_465 = new char[][][]{{{'3','=','_'},{'\\'},{'K','!'},{'j','N','m','4','b'},{'w'}},{{')','p','9','p'}}}; + byte var_467 = (-85); + boolean var_481 = false; + boolean var_494 = false; + char var_505 = 'a'; + int var_507 = 1664668617; + short var_508 = 16554; + if (var_464^var_464) + { + try + { + int index_466 = var_467&array_465.length-1; + int index_468 = index_466&array_465[index_466].length-1; + int index_469 = var_467&array_465[index_466][index_468].length-1; + int index_470 = index_468&array_465.length-1; + int index_471 = ((short)(var_472-(-355598828)))&array_465[index_470].length-1; + short var_474 = 25530; + int index_473 = var_474&array_465[index_470][index_471].length-1; + ++array_465[index_470][index_471][index_473]; + } + catch (Exception e_2) + { + var_475 = var_475; + var_475 = var_475; + System.out.println( "=======Exception thrown======="+22); + } + finally + { + var_476 = ((var_476+var_477)+(var_478>var_467); + var_479 = (short)var_472; + --var_478; + var_477 = false; + if (var_494) + { + int index_495 = var_475&array_493.length-1; + var_467 = (byte)array_493[index_495]; + index_495 = 1785792666; + } + --var_467; + System.out.println( "=======Exception thrown======="+23); + } + finally + { + var_467 = var_496; + for (int id_497 = 95;id_497>32;id_497 -= 16) + { + var_477 = var_477; + var_479 = var_479; + array_498 = array_498; + int index_499 = var_467&array_465.length-1; + int index_500 = ((short)( -var_467))&array_465[index_499].length-1; + int index_502 = var_479&array_498.length-1; + int index_503 = ((-144074293)>>>var_475)&array_498[index_502].length-1; + int index_504 = ((byte)8753693179981945815L)&array_498[index_502][index_503].length-1; + int index_501 = ((byte)array_498[index_502][index_503][index_504])&array_465[index_499][index_500].length-1; + array_465[index_499][index_500][index_501] = (char)var_491; + } + try + { + var_479 = var_479; + var_476 = var_476; + } + catch (Exception e_3) + { + var_477 = ( !(var_505<=var_467))&(1.418192E9f!=var_472); + var_491 = var_491; + array_506 = array_506; + var_472 = var_507+((byte)var_508); + var_491 = var_491; + System.out.println( "=======Exception thrown======="+24); + } + var_475 = +var_479; + int index_510 = ( -var_505)&array_506.length-1; + int index_511 = ((short)var_507)&array_506[index_510].length-1; + int index_509 = array_506[index_510][index_511]&array_498.length-1; + int index_512 = index_511&array_498[index_509].length-1; + int index_513 = var_508&array_498[index_509][index_512].length-1; + int index_514 = var_515&array_498.length-1; + int index_516 = var_517&array_498[index_514].length-1; + int index_519 = ((short)var_463)&array_465.length-1; + int index_520 = (-13300)&array_465[index_519].length-1; + int index_521 = var_522&array_465[index_519][index_520].length-1; + int index_518 = (array_465[index_519][index_520][index_521]++)&array_498[index_514][index_516].length-1; + var_508 = array_498[index_514][index_516][index_518]; + } + } + return var_472; + } +} +class Class_9 +{ + private static boolean var_533 = false; + public static short var_534 = (-20533); + static byte[][][] array_535 = new byte[][][]{{{28,(-95),111,109,99,(-19)},{(-61),(-53)},{29,(-21)},{24,23,(-73),(-9),23},{(-100),(-49),(-37),21}},{{(-20),37,12},{(-119),(-54),(-118),(-86)},{(-43)},{75,55,122,52,(-52),73},{62,28,(-11)},{(-23),(-17),102}}}; + public static char var_539 = '~'; + private static float var_542 = 1.33460019E9f; + private static boolean var_543 = false; + static double var_546 = (-3.518780316362698E8d); + protected static boolean var_554 = true; + private static int var_558 = 684350059; + protected static double var_560 = 7.009314187568649E8d; + private static int var_588 = (-2065069077); + static int var_589 = (-1432255210); + static short var_590 = 10766; + static Class_5 var_591 = new Class_5(); + static short var_596 = (-25921); + static byte var_617 = 55; + private static boolean var_622 = false; + public static int var_639 = 1905913110; + protected static short[][][] array_642 = new short[][][]{{{22766,(-3678)},{(-7113)}},{{(-6775)},{6196},{(-13077),(-9779),(-31168),(-27354)},{(-20224),(-18076),27707,17551},{(-228),2083,22665,12192,12362,(-31039)},{(-14113),27666,21105}},{{(-14647),(-11203),12747},{29604,(-18127),6036,1409,26870},{5001},{(-8165),24945,(-20834)},{23413,17895,14113,(-19651),3574},{14159,21633}},{{11459,436,6192,(-14159),32395,(-19695),21918},{(-4919),(-25240)}},{{23073,(-20414),24493},{(-9094),9178,18555,(-7870),30642,(-9952)},{29873,(-15779),(-29349),20719,(-10303),(-1616)},{18813,(-22393),(-18655)},{(-11299),(-20570),(-28815),(-16115),10039}}}; + protected static char var_655 = 'v'; + static double var_671 = 9.481415444095507E8d; + static double var_673 = 5.913983359834297E8d; + protected static boolean var_678 = true; + private static boolean var_688 = true; + static float var_689 = (-5.3848352E8f); + public static short[] array_695 = new short[]{(-9119),(-13659),(-8500),(-31969),(-5235),25123}; + public double func_18(String args_527, byte args_528, short args_529, short args_530, double args_531, short args_532) + { + String var_545 = "aliC#xl:R;"; + String[] array_551 = new String[]{"+UX\\Sr> f9","X/k|hBYU; ","JPYqDalti0"}; + long var_552 = 6585914257231356557L; + MainClass[] array_555 = new MainClass[]{new MainClass(),new MainClass(),new MainClass()}; + float var_606 = 1.67428784E8f; + float var_623 = 1.79520848E8f; + int[] array_631 = new int[]{(-366312692),(-898081102),(-1102460863),1349135836}; + short var_640 = (-26724); + Class_6[][][] array_674 = new Class_6[][][]{{{new Class_6(),new Class_6(),new Class_6(),new Class_6(),new Class_6()},{new Class_6(),new Class_6()}},{{new Class_6()},{new Class_6(),new Class_6()},{new Class_6()}},{{new Class_6(),new Class_6(),new Class_6()},{new Class_6()},{new Class_6()},{new Class_6(),new Class_6()}}}; + char var_679 = '4'; + if (var_533) + { + var_534--; + int index_536 = 'P'&array_535.length-1; + int index_537 = ((byte)var_534)&array_535[index_536].length-1; + int index_538 = var_539&array_535[index_536][index_537].length-1; + index_538 = +array_535[index_536][index_537][index_538]; + for (int id_540 = 30;id_540<63;id_540 += 4) + { + index_536 = var_539--; + for (int id_541 = 77;id_541>57;id_541 -= 3) + { + var_543 = ((short)( -var_542))!=var_534; + var_534 = (short)var_534; + } + for (int id_544 = 68;id_544<91;id_544 += 12) + { + var_545 = var_545; + var_546 = var_546; + int index_547 = ((byte)var_542)&array_535.length-1; + int index_548 = ((char)8063737832253251199L)&array_535[index_547].length-1; + int index_549 = var_534&array_535[index_547][index_548].length-1; + var_534 = (short)(array_535[index_547][index_548][index_549]-index_547); + } + var_539++; + for (int id_550 = 57;id_550>34;id_550 -= 5) + { + var_542 = var_542; + var_534 = var_534; + } + var_542 = (((byte)var_539)/(1|28979))+var_534; + } + } + else + { + array_551 = array_551; + var_552--; + for (int id_553 = 58;id_553<92;id_553 += 5) + { + if (var_554) + { + var_539 = var_539; + int index_557 = var_558&array_535.length-1; + int index_559 = ((short)var_560)&array_535[index_557].length-1; + int index_561 = ((char)(var_542--))&array_535[index_557][index_559].length-1; + int index_556 = array_535[index_557][index_559][index_561]&array_555.length-1; + int index_563 = index_561&array_535.length-1; + int index_564 = ((byte)(var_552++))&array_535[index_563].length-1; + int index_566 = var_534&array_535.length-1; + int index_567 = ((char)var_539)&array_535[index_566].length-1; + int index_568 = ((byte)(-106))&array_535[index_566][index_567].length-1; + int index_565 = (((byte)index_557)%(1|array_535[index_566][index_567][index_568]))&array_535[index_563][index_564].length-1; + int index_562 = array_535[index_563][index_564][index_565]&array_555.length-1; + int index_569 = var_539&array_555.length-1; + array_555[index_569] = array_555[index_562]; + } + else + { + int index_570 = var_539&array_535.length-1; + int index_571 = ((byte)var_542)&array_535[index_570].length-1; + int index_572 = var_534&array_535[index_570][index_571].length-1; + int index_574 = 77&array_535.length-1; + int index_575 = (var_534-index_570)&array_535[index_574].length-1; + int index_576 = ((index_574>>(-284777359842977604L))*var_534)&array_535[index_574][index_575].length-1; + int index_573 = (array_535[index_574][index_575][index_576]+21474)&array_535.length-1; + int index_577 = index_576&array_535[index_573].length-1; + int index_579 = (index_574/(1|((short)var_560)))&array_535.length-1; + int index_580 = (var_534|4927)&array_535[index_579].length-1; + int index_581 = index_573&array_535[index_579][index_580].length-1; + int index_578 = array_535[index_579][index_580][index_581]&array_535[index_573][index_577].length-1; + int index_582 = ((byte)var_539)&array_535.length-1; + int index_584 = var_539&array_535.length-1; + int index_585 = index_579&array_535[index_584].length-1; + int index_586 = var_534&array_535[index_584][index_585].length-1; + int index_583 = (array_535[index_584][index_585][index_586]|((byte)index_578))&array_535[index_582].length-1; + int index_587 = var_534&array_535[index_582][index_583].length-1; + array_535[index_582][index_583][index_587] = array_535[index_573][index_577][index_578]; + } + var_558 = var_558; + try + { + var_543 = false; + var_558 = ( ~'=')>>>(-6529619333808464101L); + var_539 = var_539; + var_589 = ((short)var_588)*var_539; + var_560 = -var_590; + var_590 = (short)var_552; + } + catch (Exception e_3) + { + array_555 = new MainClass[]{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()}; + var_591 = var_591; + var_560 = 2.688762748110751E8d; + System.out.println( "=======Exception thrown======="+25); + } + } + char var_682 = '|'; + try + { + ++var_558; + try + { + var_560 = (-1993692104)*var_558; + int index_592 = var_589&array_535.length-1; + int index_593 = ((short)(var_534%(1|var_590)))&array_535[index_592].length-1; + int index_595 = var_596&array_535.length-1; + int index_597 = index_592&array_535[index_595].length-1; + int index_599 = var_539&array_535.length-1; + int index_600 = 1921853969&array_535[index_599].length-1; + int index_601 = var_539&array_535[index_599][index_600].length-1; + int index_598 = array_535[index_599][index_600][index_601]&array_535[index_595][index_597].length-1; + int index_594 = array_535[index_595][index_597][index_598]&array_535[index_592][index_593].length-1; + int index_602 = var_590&array_535.length-1; + int index_604 = var_534&array_535.length-1; + int index_605 = ((char)var_606)&array_535[index_604].length-1; + int index_608 = 49&array_535.length-1; + int index_609 = index_598&array_535[index_608].length-1; + int index_610 = var_596&array_535[index_608][index_609].length-1; + int index_607 = array_535[index_608][index_609][index_610]&array_535[index_604][index_605].length-1; + int index_603 = array_535[index_604][index_605][index_607]&array_535[index_602].length-1; + int index_611 = var_534&array_535[index_602][index_603].length-1; + int index_612 = index_611&array_535.length-1; + int index_613 = var_539&array_535[index_612].length-1; + int index_615 = index_612&array_535.length-1; + int index_616 = var_617&array_535[index_615].length-1; + int index_619 = ( +((char)index_608))&array_535.length-1; + int index_620 = ((byte)(var_552-index_605))&array_535[index_619].length-1; + int index_621 = var_539&array_535[index_619][index_620].length-1; + int index_618 = array_535[index_619][index_620][index_621]&array_535[index_615][index_616].length-1; + int index_614 = (array_535[index_615][index_616][index_618]+var_539)&array_535[index_612][index_613].length-1; + array_535[index_612][index_613][index_614] = array_535[index_602][index_603][index_611]; + } + catch (Exception e_3) + { + var_622 = var_543; + var_590 = (-30363); + System.out.println( "=======Exception thrown======="+26); + } + finally + { + var_623 = var_539--; + var_560 = var_546; + var_534 = (short)(var_617+var_596); + var_539 = var_539; + } + var_552++; + ++var_539; + boolean var_624 = false; + if (var_624|((var_534-var_539)<='!')) + { + var_560 = var_560-(var_617/(1|var_617)); + int index_625 = var_539&array_535.length-1; + int index_626 = var_589&array_535[index_625].length-1; + int index_627 = var_539&array_535[index_625][index_626].length-1; + int index_628 = var_539&array_535.length-1; + int index_629 = var_617&array_535[index_628].length-1; + int index_632 = ((short)var_552)&array_631.length-1; + int index_630 = array_631[index_632]&array_535[index_628][index_629].length-1; + int index_633 = ((char)var_546)&array_535.length-1; + int index_634 = (var_617--)&array_535[index_633].length-1; + int index_635 = ((short)var_606)&array_535[index_633][index_634].length-1; + array_535[index_633][index_634][index_635] = array_535[index_628][index_629][index_630]; + } + else + { + int index_636 = ((byte)var_552)&array_535.length-1; + int index_637 = index_636&array_535[index_636].length-1; + int index_638 = (var_639%(1|(var_558-var_640)))&array_535[index_636][index_637].length-1; + array_535[index_636][index_637][index_638] = (byte)var_546; + } + } + catch (Exception e_2) + { + for (int id_641 = 11;id_641<47;id_641 += 7) + { + array_642 = array_642; + var_596 = (-23117); + int index_643 = ((char)')')&array_535.length-1; + int index_644 = var_617&array_535[index_643].length-1; + int index_645 = var_617&array_535[index_643][index_644].length-1; + int index_646 = var_589&array_535.length-1; + short var_648 = (-1948); + int index_647 = var_648&array_535[index_646].length-1; + int index_649 = ((byte)(-163603369))&array_535[index_646][index_647].length-1; + int index_651 = var_539&array_535.length-1; + int index_652 = 31336&array_535[index_651].length-1; + int index_653 = ((byte)(var_558+var_617))&array_535[index_651][index_652].length-1; + int index_650 = array_535[index_651][index_652][index_653]&array_535.length-1; + int index_654 = var_655&array_535[index_650].length-1; + int index_656 = '4'&array_535[index_650][index_654].length-1; + array_535[index_650][index_654][index_656] = array_535[index_646][index_647][index_649]; + } + try + { + var_655 = var_655; + int index_657 = 21326&array_642.length-1; + int index_658 = ((char)((char)var_552))&array_642[index_657].length-1; + int index_659 = ((char)((byte)var_617))&array_642[index_657][index_658].length-1; + int index_660 = var_617&array_642.length-1; + int index_661 = ((short)var_590)&array_642[index_660].length-1; + int index_662 = var_539&array_642[index_660][index_661].length-1; + var_534 = array_642[index_660][index_661][index_662]; + } + catch (Exception e_3) + { + var_590 = var_596; + int index_663 = 76&array_535.length-1; + int index_664 = ((char)var_589)&array_535[index_663].length-1; + int index_665 = var_617&array_535[index_663][index_664].length-1; + int index_666 = ((short)var_560)&array_535.length-1; + int index_667 = var_617&array_535[index_666].length-1; + int index_668 = var_617&array_535[index_666][index_667].length-1; + int index_669 = var_589&array_535.length-1; + int index_670 = ((short)((byte)var_671))&array_535[index_669].length-1; + int index_672 = index_667&array_535[index_669][index_670].length-1; + array_535[index_669][index_670][index_672] = array_535[index_666][index_667][index_668]; + System.out.println( "=======Exception thrown======="+28); + } + try + { + var_546 = var_546; + var_673 = var_671; + array_674 = array_674; + int index_675 = 1367084271&array_642.length-1; + int index_676 = (-2302)&array_642[index_675].length-1; + int index_677 = ((byte)var_655)&array_642[index_675][index_676].length-1; + var_588 = var_590/(1|array_642[index_675][index_676][index_677]); + } + catch (Exception e_3) + { + var_545 = "~V.Z\")o<("; + var_640 = (short)((char)(var_552*var_588)); + var_678 = false; + var_679 = (char)(2685018844344843262L>>var_617); + int index_680 = var_679&array_551.length-1; + var_545 = array_551[index_680]+((short)'U'); + System.out.println( "=======Exception thrown======="+29); + } + finally + { + var_623 = var_542; + int index_681 = ((short)((byte)var_682))&array_535.length-1; + int index_683 = ((short)var_682)&array_535[index_681].length-1; + int index_684 = var_617&array_535[index_681][index_683].length-1; + int index_685 = ((short)(var_588++))&array_535.length-1; + int index_686 = 'R'&array_535[index_685].length-1; + int index_687 = var_640&array_535[index_685][index_686].length-1; + var_617 = array_535[index_685][index_686][index_687]; + } + var_623 = (-450768.88f); + if (var_688) + { + array_674 = array_674; + var_606 = var_689; + var_678 = var_622; + var_539 = var_679; + var_689 = var_623; + int index_690 = var_640&array_535.length-1; + int index_691 = var_589&array_535[index_690].length-1; + int index_692 = var_539&array_535[index_690][index_691].length-1; + array_535[index_690][index_691][index_692] = var_617; + } + --var_617; + System.out.println( "=======Exception thrown======="+29); + } + finally + { + ++var_640; + int index_693 = ((byte)var_689)&array_642.length-1; + int index_696 = var_617&array_695.length-1; + int index_694 = array_695[index_696]&array_642[index_693].length-1; + int index_697 = var_539&array_642[index_693][index_694].length-1; + array_642[index_693][index_694][index_697] = var_640; + } + } + return -var_671; + } +} +// DEPENDENCE: CrcCheckwithChar.java CrcCheckForObject.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/CrcCheckForObject.java b/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/CrcCheckForObject.java new file mode 100644 index 0000000000000000000000000000000000000000..1c164f2d1a9caca562d3eb44b3f30a9f56805b7b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/CrcCheckForObject.java @@ -0,0 +1,669 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.annotation.Annotation; +import java.io.*; +import java.lang.reflect.*; +import java.util.*; +public class CrcCheckForObject { + /** + * 执行反射方法后返回可观测值,打印到标准输出流 + *

+ * param result1 执行反射方法后返回的Object类型 param method 执行反射需调用的方法 param instance + * 方法调用的对象 param parameters 方法调用的参数列表 return null + */ + private static boolean showDebug = false; + public static int length = 0; + private static List resultlist = new LinkedList<>(); + private static List foundationtypes = new ArrayList<>(); + //apifuzz的whitelist.txt,現在不從文件里讀了 + private static ArrayList whitelist = new ArrayList(Arrays.asList("static final boolean java.util.concurrent.atomic.AtomicLong.VM_SUPPORTS_LONG_CAS", + "java.lang.reflect.AccessibleObject.override", + "private final int java.lang.ThreadLocal.threadLocalHashCode", + "private static java.util.concurrent.atomic.AtomicInteger java.lang.ThreadLocal.nextHashCode", + "int java.lang.ThreadGroup.nthreads", + "private static long java.lang.Thread.threadSeqNumber", + "private long java.lang.Thread.tid", + "private static final long java.util.concurrent.locks.ReentrantReadWriteLock.TID", + "transient java.util.Set java.util.HashMap.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private final long libcore.util.NativeAllocationRegistry.freeFunction", + "private transient long java.math.BigInt.bignum", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.io.File.PREFIX_LENGTH_OFFSET", + "private static final long java.util.concurrent.locks.StampedLock.WSTATUS", + "private static final long java.util.concurrent.locks.StampedLock.WTAIL", + "private static final long java.util.concurrent.locks.StampedLock.STATE", + "private static final long java.util.concurrent.locks.StampedLock.PARKBLOCKER", + "private static final long java.util.concurrent.locks.StampedLock.WNEXT", + "private final long java.util.SplittableRandom.gamma", + "private volatile long java.util.concurrent.atomic.AtomicLong.value", + "private static final java.util.concurrent.atomic.AtomicLong java.util.SplittableRandom.defaultGen", + "private long java.util.SplittableRandom.seed", + "private static final int java.util.concurrent.Exchanger.ABASE", + "private static final long java.util.concurrent.Exchanger.BLOCKER", + "private static final long java.util.concurrent.Exchanger.MATCH", + "private static final long java.util.concurrent.Exchanger.BOUND", + "private transient long java.util.Date.fastTime", + "private transient sun.util.calendar.BaseCalendar$Date java.util.Date.cdate", + "private final java.util.Date java.util.logging.SimpleFormatter.dat", + "private transient int java.lang.Object.shadow$_monitor_", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "private int java.io.BufferedWriter.nextChar", + "private int java.lang.StackTraceElement.lineNumber", + "private java.lang.String java.lang.StackTraceElement.methodName", + "private static final long java.lang.StackTraceElement.serialVersionUID", + "private java.lang.ClassLoader java.lang.Thread.contextClassLoader", + "private static volatile java.lang.Thread$UncaughtExceptionHandler java.lang.Thread.uncaughtExceptionPreHandler ", + "private static final long java.util.concurrent.ConcurrentHashMap.CELLSBUSY", + "private static final long java.util.concurrent.ConcurrentHashMap.SIZECTL", + "private static final long java.util.concurrent.ConcurrentHashMap.TRANSFERINDEX", + "private static final long java.util.concurrent.ConcurrentHashMap.BASECOUNT", + "private volatile long java.util.zip.ZStreamRef.address", + "private static final long java.util.concurrent.PriorityBlockingQueue.ALLOCATIONSPINLOCK", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.lang.String java.util.Locale.languageTag", + "private transient volatile int java.util.Locale.hashCodeValue", + "private static volatile java.util.Locale java.util.Locale.defaultDisplayLocale", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "transient java.util.Set java.util.HashMap.entrySet", + "private transient int java.lang.Object.shadow$_monitor_", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.util.Set java.util.Hashtable.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private volatile long java.lang.Thread.nativePeer", + "java.lang.ThreadLocal$ThreadLocalMap java.lang.Thread.threadLocals", + "private static final int java.util.concurrent.ConcurrentHashMap.ABASE", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final java.util.concurrent.atomic.AtomicLong java.util.Random.seedUniquifier", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed, private static final long java.util.Random.seedOffset", + "private static final long java.util.concurrent.Exchanger.SLOT", + "private static final long java.util.concurrent.locks.StampedLock.WHEAD", + "transient int java.util.HashMap.size", + "transient int java.util.HashMap.modCount", + "private static final long java.util.Random.seedOffset", + "boolean java.lang.reflect.AccessibleObject.override", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed", + "private java.lang.String java.lang.StackTraceElement.fileName", + "private java.lang.String java.lang.StackTraceElement.declaringClass", + "private transient java.lang.Object java.lang.Class.vtable", + "private transient java.lang.Class java.lang.Class.superClass", + "private transient java.lang.String java.lang.Class.name", + "private final java.lang.Class java.lang.reflect.Constructor.serializationClass", + "private transient dalvik.system.ClassExt java.lang.Class.extData", + "private transient long java.util.regex.Pattern.address", + "private transient volatile java.lang.Object java.lang.Throwable.backtrace", + "private transient java.lang.Object java.lang.Class.dexCache", + "private transient java.lang.ClassLoader java.lang.Class.classLoader", + "private transient java.lang.Class java.lang.Class.componentType", + "private transient long java.lang.Class.sFields", + "private transient int java.lang.Class.referenceInstanceOffsets", + "private transient int java.lang.Class.primitiveType", + "private transient int java.lang.Class.objectSizeAllocFastPath", + "private transient int java.lang.Class.objectSize", + "private transient int java.lang.Class.numReferenceStaticFields", + "private transient int java.lang.Class.numReferenceInstanceFields", + "private transient long java.lang.Class.methods", + "private transient java.lang.Object[] java.lang.Class.ifTable", + "private transient long java.lang.Class.iFields", + "private transient volatile int java.lang.Class.dexTypeIndex", + "private transient int java.lang.Class.dexClassDefIndex", + "private transient short java.lang.Class.copiedMethodsOffset", + "private transient int java.lang.Class.clinitThreadId", + "private transient int java.lang.Class.classSize", + "private transient int java.lang.Class.classFlags", + "private transient int java.lang.Class.accessFlags", + "private java.lang.Class java.lang.reflect.Field.declaringClass", + "private final java.lang.Class java.lang.reflect.Constructor.serializationCtor", + "private transient int java.lang.Class.status", + "private transient short java.lang.Class.virtualMethodsOffset", + "private int java.lang.reflect.Field.dexFieldIndex ", + "private int java.lang.reflect.Field.offset", + "private int java.lang.reflect.Field.accessFlags", + "private int fuzzapiinvoke.getInstance.ObjectNewInstance$MyThread1.ticket", + "private long java.util.regex.Matcher.address", + "transient long java.util.regex.Pattern.address", + "private int java.lang.reflect.Field.dexFieldIndex", + "private char[] java.io.BufferedWriter.cb", + "private java.lang.Class java.lang.reflect.Field.type" + )); + private static String[] ss = {"class java.lang.Character","class java.lang.Integer", + "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", + "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", + "class java.lang.Byte", "class java.lang.String", "class java.lang.StringBuffer", + "class java.lang.Character$UnicodeBlock", "class java.util.Locale", + "class java.lang.StringBuilder", "class [I", "class [S", "class [J", "class [F", "class [D", + "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", + "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", + "class [Ljava.lang.StringBuilder;"}; // 该数组存放此类可以处理用于计算CRC的数据类型 + private static ArrayList dealtypes = new ArrayList(); + + //輸出每個Object單獨的CRC值 + public static List CRCListForObjects(Object... results) { + List finalres = new ArrayList<>(); + for (Object result1: results) { + try { + if (showDebug) { + System.out.println("============================== CRCcheck(Param info) =============================="); + System.out.println("| result: "+result1); + System.out.println("==================================================================================="); + } + + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + finalres.add(run(obj)); // used to be "result1", solve the problem of object-array + } else { + finalres.add(1000000000L); + } + } + } else { + finalres.add(run(result1)); // resultthreadgroup is object} + } + } else { + // result1 is null + finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + return null; + } + } + return finalres; + } + + //輸出Object數組總的CRC值 + public static long totalCRCForObjects(boolean showFieldInfo, Object... results){ + showDebug = showFieldInfo; + initialize(); + for (Object result1: results) { + try { + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + calculatecrc(obj); + } else { +// finalres.add(1000000000L); + } + } + } else { + calculatecrc(result1); + } + } else { + // result1 is null +// finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + } + } + return getCRC(); + } + + public static long run(Object obj) throws Exception { + initialize(); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< START GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + calculatecrc(obj); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< END GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + return getCRC(); + } + private static void initialize(){ + Collections.addAll(dealtypes, ss); + String[] strings = {"class java.lang.Character","class java.lang.Integer", "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", "class java.lang.Byte"}; + Collections.addAll(foundationtypes, strings); + resultlist.clear(); + } + + private static void calculatecrc(Object result) throws Exception { + // deal with Object + if(result != null){ + String resulttype = result.getClass().toString(); + // deal with the problem of class StringBuilder, StringBuffer and String + // we can`t get the specific fields we wanted, cast these to string by toString + if(resulttype.equals("class java.lang.String") || + resulttype.equals("class java.lang.StringBuilder") || + resulttype.equals("class java.lang.StringBuffer") || + resulttype.equals("class java.lang.Character$UnicodeBlock") || + resulttype.equals("class java.util.Locale") || result instanceof Annotation){ + String ostring = result.toString(); + byte[] bytes = ostring.getBytes("UTF-8"); + calculatecrc(bytes); + return; + } + if (foundationtypes.contains(result.getClass().toString())){ + // if basic types: + resultlist.add(result); + switch (result.getClass().toString()) { + case "class java.lang.Byte": + length += 1; + break; + case "class java.lang.Short": + length += 2; + break; + case "class java.lang.Integer": + length += 4; + break; + case "class java.lang.Long": + length += 8; + break; + case "class java.lang.Float": + length += 4; + break; + case "class java.lang.Double": + length += 8; + break; + case "class java.lang.Char": + length += 2; + break; + case "class java.lang.Character": + length += 2; + break; + case "class java.lang.Boolean": + length += 1; + break;} + } else if(resulttype.startsWith("class [")) { + // array(contains multidimensional array) + if ("class [I".equals(resulttype)) { + //int[] + int[] intparam = (int[]) result; + for (int i : intparam) { + resultlist.add(i); + length += 4; + } + } else if ("class [S".equals(resulttype)) { + //short[] + short[] shortparam = (short[]) result; + for (short s : shortparam) { + resultlist.add(s); + length += 2; + } + } else if ("class [J".equals(resulttype)) { + //long[] + long[] longparam = (long[]) result; + for (long l : longparam) { + resultlist.add(l); + length += 8; + } + } else if ("class [F".equals(resulttype)) { + //float[] + float[] floatparam = (float[]) result; + for (float f : floatparam) { + resultlist.add(f); + length += 4; + } + } else if ("class [D".equals(resulttype)) { + //double[] + double[] doubleparam = (double[]) result; + for (double d : doubleparam) { + resultlist.add(d); + length += 8; + } + } else if ("class [Z".equals(resulttype)) { + //boolean[] + boolean[] booleanparam = (boolean[]) result; + for (boolean b : booleanparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [B".equals(resulttype)) { + //byte[] + byte[] byteparam = (byte[]) result; + for (byte b : byteparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [C".equals(resulttype)) { + //char[] + char[] charparam = (char[]) result; + for (char c : charparam) { + resultlist.add(c); + length += 2; + } + } else if ("class [Ljava.lang.Character;".equals(resulttype)) { + // Character[] + Character[] charparam = (Character[]) result; + for (Character c : charparam) { + resultlist.add((char)c); + length += 2; + } + }else if (resulttype.startsWith("class [[")){ + // 多维数组,降维 + for (Object o: (Object[]) result){ + calculatecrc(o); + } + }else if (resulttype.equals("[Ljava.lang.String")){ + // string类型的数组 + for(String s:(String[]) result){ + calculatecrc(s); + } + + } + else if(resulttype.startsWith("class [L")){ + // 非基础类型数组 + for(Object o:(Object[])result){ + calculatecrc(o); + } + } + }else{ + // 该分支处理非基础类型对象, 先获取对象下指定层数的域和值,将最终结果中可用于计算CRC校验的值作为参数递归调用本方法 + // 首先取得首次传入的实例的域,若域的值可直接用于(包括基础类型和在本方法中特殊处理的其他类型)CRC计算,则不进入下一次获取域的循环 + // 最终获取的域和对应的值都有序的存放在getfaieldvalue()返回的map中 + // 接着对map进行遍历获取其中的值如若是本方法除此分支之外的其他分支可处理的类型则以value为参数递归调用,否则只将其输出在运行日志中 + //System.out.println("```````````````````````````get field`````````````````````````````````````````````"); + Mapmap = getFieldValue(result, 3); + //System.out.println("`````````````````````````get field end```````````````````````````````````````````"); + for(Map.Entry entry: map.entrySet()) { + Field key = entry.getKey(); + Object value = entry.getValue(); + //当field为基础类型或者string stringbu*** character数组时将数组信息打印出来 + String[] basicarray = new String[]{"class [I", "class [S", "class [J", "class [F", "class [D", "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", "class [Ljava.lang.StringBuilder;"}; + List basiclist = Arrays.asList(basicarray); + if(showDebug) { + if (basiclist.contains(key.getType().toString())) { + String str = key.getType().toString(); + switch (str) { + case "class [I": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((int[]) value)); + break; + case "class [S": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((short[]) value)); + break; + case "class [J": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((long[]) value)); + break; + case "class [F": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((float[]) value)); + break; + case "class [D": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((double[]) value)); + break; + case "class [Z": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((boolean[]) value)); + break; + case "class [B": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((byte[]) value)); + break; + case "class [C": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((char[]) value)); + break; + case "class [Ljava.lang.Character;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((Character[]) value)); + break; + case "class [Ljava.lang.String;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((String[]) value)); + break; + case "class [Ljava.lang.StringBuffer;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuffer[]) value)); + break; + case "class [Ljava.lang.StringBuilder;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuilder[]) value)); + break; + } + } else if (key.getType().toString().contains("[[")) { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.deepToString((Object[]) value)); + } else { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + value); + } + } + + if(value != null && dealtypes.contains(value.getClass().toString())){ + if(!whitelist.contains(key.toString())){ + // 如果为基础类型或者需要特殊处理的object类型且没在whitelist中则再次调用本身,否则只在控制台打印出来对象信息 + calculatecrc(value); + } + } + } + } + } + } + /* + 接受object类型参数,向下获取实例类的域两次 + : reutrn 返回包含域对象和对应的value的键值对的map + */ + private static Map getFieldValue(java.lang.Object obj, int length){ + Map map = new LinkedHashMap<>(); + Field[] rootf = obj.getClass().getDeclaredFields(); + //sort + rootf = CrcCheckForObject.sortFieldArray(rootf); + if(rootf == null){ + return map; + } + List cur_objs = new ArrayList<>(); + List next_objs = new ArrayList<>(); + // 先获取传入参数的域和对应的值, 放入map中, value 放入 cur_objs中 + //System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^root field : value^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); + for(Field f: rootf){ + if(whitelist.contains(f.toString())){ + continue; + } + //System.out.println("< which field: >" + f.toString()); + f.setAccessible(true); + java.lang.Object o; + try { + o = f.get(obj); + map.put(f,o); + } catch (IllegalAccessException e) { + o = null; + map.put(f, null); + } + next_objs.add(o); + //System.out.println("< field value: >" + o); + } + //System.out.println("------------------------------root end------------------------------------"); + while( length > 1){ + cur_objs.clear(); + cur_objs.addAll(next_objs); + next_objs.clear(); + for(Object o:cur_objs){ + if(o == null ){ + continue; + } + if(dealtypes.contains(o.getClass().toString())){ + //如果为基础类型则不向下获取实例的域 + continue; + } + Field[] fs = o.getClass().getDeclaredFields(); + fs = sortFieldArray(fs); + if(fs == null){ + continue; + } + for(Field fi: fs){ + + //System.out.println("< which field: >" + fi.toString()); + if(whitelist.contains(fi.toString())){ + continue; + } + fi.setAccessible(true); + Object oc; + try{ + oc = fi.get(o); + }catch(IllegalAccessException e){ + oc = null; + } + //System.out.println("< field value: >" + oc); + + map.put(fi, oc); + next_objs.add(oc); + } + } + length -= 1; + } + + return map; + } + + private static long getCRC () { + CrcBuffer b = new CrcBuffer(length); + for (Object obj:resultlist){ + if (obj.getClass().toString().equals("class java.lang.Byte")) { + CrcCheckwithChar.ToByteArray((byte) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Short")) { + CrcCheckwithChar.ToByteArray((short) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Integer")) { + CrcCheckwithChar.ToByteArray((int) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Long")) { + CrcCheckwithChar.ToByteArray((long) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Float")) { + CrcCheckwithChar.ToByteArray((float) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Double")) { + CrcCheckwithChar.ToByteArray((double) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Boolean")) { + CrcCheckwithChar.ToByteArray((boolean) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Character")) { + CrcCheckwithChar.ToByteArray((char) obj, b); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer, 0, b.i); + return c.getValue(); + } + + /** + * 进行Field[]排序 + */ + public static Field[] sortFieldArray (Field[] fields){ + if (fields == null || fields.length == 0) { + return null; + } + List flist = Arrays.asList(fields); + Collections.sort(flist, new FieldComparator()); + + return (Field[]) flist.toArray(); + } +} +/* + * sort the field array by field`s name + * + * */ +class FieldComparator implements Comparator{ + @Override + public int compare(Field f1, Field f2){ + return (f1.toString()).compareTo(f2.toString()); + } + +} + + +class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf(" +Fail to Get CRC! + Calculation=%d LookupTable=%d +",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xffffffffL; + } + +} diff --git a/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/CrcCheckwithChar.java b/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/CrcCheckwithChar.java new file mode 100644 index 0000000000000000000000000000000000000000..6b2e64a2d7f8dbf3f7513433b8de5fd9032cd52b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/CrcCheckwithChar.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.Double; + +class CrcBuffer { + int i = 0; + static int buffer_counter = 0; + byte[] buffer; + + CrcBuffer(int size) { + this.buffer = new byte[size]; + buffer_counter++; + //System.out.printf("Buffer-Counter=%d\tLength=%d\n", buffer_counter, size); + } +} + +public class CrcCheckwithChar { + /**************************************************************/ + static boolean isVerbose = false; + + public static void ToByteArray(char args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(byte args, CrcBuffer b) { + b.buffer[b.i] = args; + b.i++; + } + + public static void ToByteArray(short args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(int args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(long args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(boolean args, CrcBuffer b) { + if (args) { + b.buffer[b.i] = 0x01; + } else { + b.buffer[b.i] = 0x00; + } + b.i++; + } + + public static void ToByteArray(float args, CrcBuffer b) { + int iargs = Float.floatToIntBits(args); + b.buffer[b.i] = (byte) ((iargs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (iargs & 0xff); + b.i++; + } + + public static void ToByteArray(double args, CrcBuffer b) { + long largs = Double.doubleToLongBits(args); + b.buffer[b.i] = (byte) ((largs >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (largs & 0xff); + b.i++; + } +} diff --git a/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/Start.java b/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..85e553208d0080f33d785ea7e27b03330dc91a8d --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/2779_2019091603087/Start.java @@ -0,0 +1,1464 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +// this is a test!!!!!!! +// seed : 1568086607831 +import java.util.*; +public class Start +{ + static MainClass var_684 = new MainClass(); + public static void getCheckSum() + { + System.out.println( "=======getCheckSum======="); + long crc = CrcCheckForObject.totalCRCForObjects(false, var_684, new Class_3(), new Class_4(), new Class_5()); + System.out.println("CheckSum:"+crc); + } + public static void main(String[] args_0) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + var_684.run(); + getCheckSum(); + //这是一个空语句 + } +} +class MainClass +{ + private static byte var_1 = 32; + private static int var_2 = (-796941072); + protected static double var_3 = 1.1910681644078393E9d; + private static boolean var_10 = false; + public static short var_12 = (-2425); + private static long var_48 = (-7267876460110698719L); + private static boolean[][][] array_49 = new boolean[][][]{{{false,false,false,false,false},{false},{true,false,true},{false,true,true},{true,true,true,true,false,true,true,false}},{{true},{false,false}}}; + public static Class_5 var_69 = new Class_5(); + public static long[][][] array_70 = new long[][][]{{{(-4021443384810037856L),(-5013788164888506635L),1527340901324147328L},{(-3623401466682887684L),4017550437530443232L,6139396366744352891L},{7243222740918745709L,8466348183893942603L,(-289486677888361960L),6768911336186307395L},{(-3258652508227583755L),2451058206973352204L,(-9191590816643786180L),(-3100717585123713007L)},{(-1435350190066863265L),5508412421370629268L,8893560283959164758L}},{{6830335008360728551L},{6332355197843905644L,(-7268925306130125000L),(-1298874790538997483L),(-599068979859584332L),(-7718185881781910487L),(-3277746425421452392L)}},{{(-4554254177249311567L),877359193270629852L,1269969587972050959L,2873049825477626805L,(-70426850503046972L),(-2059600450104911452L)},{5320451719960095010L,7692628629287818986L,(-73386305889752534L),(-3832853681183698797L)},{(-1985180132216091524L)},{(-1590245459484603922L),2768537365255717642L,2740568670938758898L,(-3667504148215989141L),1525005544878655951L},{8958039981773129271L,4605911162099864027L,(-9086219211366125545L)},{4068519529106312105L},{(-3537722637002522864L),2328116099065565976L,9114356352197722140L,8879598152522937281L,7215125147746504140L}}}; + static float var_79 = 5876356.5f; + protected static char var_81 = '+'; + public static int[][][] array_82 = new int[][][]{{{2047528615,(-875690900)},{(-1293884533),(-1556908271),1776022734,(-1153282261),75313044,(-1245315221)}},{{(-1690717739),(-269625377),(-1064648226),(-1517959800),(-1832891860),1616015402,(-937394971)},{1615068007},{1556171389,(-1158398193),(-912337459),1433281568,538785429}},{{115638186},{2061888109,2062989678,872572874,517565571,1767989538},{(-1759997023),(-813463493)},{854688579,(-1333223194),(-1829160139),1004214563,(-969509539)}},{{(-436175966),725399746},{145025647,(-868958812),(-41049632),2084212101,595296817,1939740948,(-1124718946),(-2142639963)}},{{(-1190782764),(-665012246),1291382341},{1716269262,(-479489789),(-2045656622)}}}; + protected static boolean var_89 = true; + public static boolean[][][] array_91 = new boolean[][][]{{{true,true,false,true},{false,false},{true,true,true,false,true,true,false,true},{true,true,false,false,false,false},{true,false,false,true,true}},{{false,false,false,true,false},{true,false,false,false}},{{false,false},{false,true,true,false,true}},{{true,true},{false,false,true},{true,true,false,true},{false,true,false,false},{false,false},{true,false,false,true,true}},{{true,false,false,true,false,false,true},{true,true}}}; + protected static short var_98 = (-12924); + static int var_99 = (-1667612203); + private static char var_100 = 'n'; + public static boolean var_102 = false; + protected static boolean var_103 = false; + static float var_105 = (-3.66404896E8f); + private static char var_106 = 'l'; + public static boolean var_110 = false; + private static char var_114 = 'G'; + public static short var_115 = (-1159); + private static short var_119 = (-6149); + public static Class_3 var_159 = new Class_3(); + private static Class_4[][] array_204 = new Class_4[][]{{new Class_4(),new Class_4(),new Class_4(),new Class_4(),new Class_4(),new Class_4()},{new Class_4(),new Class_4(),new Class_4()},{new Class_4(),new Class_4(),new Class_4(),new Class_4(),new Class_4()}}; + static double[][][] array_212 = new double[][][]{{{(-4.002747333767119E8d),(-6.714962171071918E7d),(-2.734759057161311E8d)},{3.0072616047547597E8d,(-2.2711559523293748E8d),8.442016240507622E8d,(-9.943107211915638E7d),(-8.540862059322443E8d)},{4.464944907897606E8d,1.569590011709818E8d,5.761576345026456E8d,4.396624267757843E7d},{(-1.3088992334907424E7d),2.9983555656694657E8d,(-1.1518164155796714E9d),2.2204637663186258E8d,1.3288457072985988E9d}},{{4.6551239480305123E8d,7.279185654267927E8d,(-2.4809012329515928E8d),4.974224444392789E7d,(-1.4076643320870752E9d)}},{{(-6.458653934257479E8d)},{(-5.172557228736377E8d),(-1.0186651223314E8d),1.208743567782366E9d},{6.525260511374868E8d,(-1.1017318259297931E9d),(-5.8954522169538446E7d),(-1.026815138457015E8d),(-3.3920658700982714E8d)}},{{7.242292598393545E7d,(-2.4132770345742637E8d),6.583298508812171E8d,4.198645522321002E8d},{(-5.914621487726747E8d),1.4127042496648033E9d},{3.0353332696281046E7d},{(-9.71842940385347E7d),4.2769894976711884E7d,(-3.4373438082796925E8d),(-7.875182274223742E8d),1.216762082641134E8d,2.5950203701462626E8d}},{{2.415291177502811E8d,2.645994224984633E7d},{(-1.4428651931041965E9d)},{1.7981954395451086E9d,(-1.51201015152743E7d),(-6.272479732637428E8d)},{1434562.6223752932d,8.463785431040864E8d,2.9954420740935326E8d},{4.3909246798757493E8d,(-1.985415016231152E8d),(-1.2020435452128994E9d)}}}; + protected static byte var_216 = 52; + static int var_220 = 320970048; + private static String var_221 = "gAd4L|IS(M"; + protected static short var_243 = (-13158); + private static Class_4 var_300 = new Class_4(); + private static float var_422 = (-1.98089616E8f); + public static double var_436 = 4368102.778609097d; + protected static int var_445 = 94796636; + public static short var_452 = (-30921); + protected static float var_505 = 1.23814824E8f; + protected static float var_506 = (-6.7481747E8f); + protected static boolean var_518 = false; + private static char[][] array_529 = new char[][]{{'`','V','y'},{'?','D','r','Y'},{'B','3','M','m'},{'o','c','S','U','m','9'},{'s','d','l','3'}}; + private static byte var_531 = (-90); + static int var_536 = 1242775811; + private static boolean var_537 = true; + protected static String var_544 = "VuT,6;$92|"; + static short var_549 = 28659; + static char var_550 = '6'; + private static Class_4[] array_560 = new Class_4[]{new Class_4(),new Class_4(),new Class_4(),new Class_4()}; + public static double[][][] array_564 = new double[][][]{{{1.7681741390863252E8d,6.190647892927486E8d},{4.213818304399317E8d,(-4.9561360007263035E8d),(-1.2120796539642296E9d),3.4950376596708995E8d,(-2.5872513610805786E8d),1.54756672272163E9d,1.5267576945724929E7d,(-1.0247798242273997E9d)},{(-1.9998301577942854E8d),(-1.08408900801299E9d),1.8861417717512088E9d}},{{(-9.363212140413942E8d),(-7.300942138212645E8d),8.471233200027084E8d,(-2.486643582439168E8d)},{2.863564824845831E8d,(-8.211559220034708E8d),(-1.0541899382437046E8d),1.0991413017457211E7d,(-5712027.104351457d)},{1.5890523045389998E9d,(-2.429214072548577E8d),(-1.836501800663197E8d)},{(-1.491305872340855E9d),(-1.14830861268542E9d),2.7076104405584025E8d,1.941000423254971E7d},{(-2.917596913350877E8d),(-2.2334881075460684E7d)}},{{(-8.154018822196363E7d),8.276774770532565E7d,(-1.8155705023886555E8d)},{(-1.4241708442443857E9d)},{(-7.073483290993658E8d),3.45332495644483E7d,(-1.389961811967159E9d),1.5271172554528296E9d}},{{4.297458808340382E8d,2.817127942047294E7d,3.870866045303598E8d,5.859176055853217E8d,(-4.288420573530225E8d),(-3.2378172667633444E8d),(-1.4490931166130962E9d)},{2.5036700671655577E8d,4.230292407063223E8d,3.784302843070422E8d},{1.8158584275984946E8d},{(-2.1420811183072323E8d),2.8649452584442444E7d,(-8.577942022567168E8d)},{(-1.9437958928707702E9d),(-4.9822988795341945E8d),1.0316029350675139E8d,(-1.076855611780564E8d)}}}; + private static short var_566 = 6107; + static float var_625 = 1.1514473E9f; + private static int var_626 = 1601905538; + static short var_629 = (-25292); + public static int[] array_633 = new int[]{792086306,(-573648604)}; + public static long[][][] array_642 = new long[][][]{{{(-5961912958293596253L),8256525091840235764L},{4402600060802399709L,5497563224567797587L,1426851784250720101L,(-6410855260847135013L),5226839491835095962L,1584399400270666963L}},{{3085768137542994590L,2718181567933139824L,4021166380235371413L,4132923791136724649L,4852839772425369491L,(-3583267152758905994L)},{(-6861804973894664016L),(-6619528043200358419L)},{(-5799748949474941626L),109799059930709513L,4301144837103509014L,(-1200986917780937129L),8625439084169290065L},{(-1598968947510315250L),2695465487425204895L}},{{(-6920188823550430952L)},{(-2663562525317195641L),1877835859201379691L,(-7962403199075220359L),3799848658753001938L,(-5264504853259501416L)},{(-4755347569061435574L),(-1657047431938238564L),(-5931444033171614566L),(-7900042143188866118L)},{(-6086307425733154839L),7846279310907340734L,3978166682479760430L},{4491621947937819295L,(-4976845204323803718L)},{(-7278784214112896979L),(-6061729773387237224L),8168002408932239434L},{(-8195270605217043634L),5165505581506998472L,1903897704303263788L},{(-527102357116198834L),1605216021069613308L},{(-883133665551838050L),(-2587326105401831106L)}},{{8779774240204228346L},{4591954716554485066L,(-8392882577894798734L),(-6172085592745640392L),(-7377314548749073668L),8409395539261644027L},{(-2603827404688095655L),(-1841772533280325353L),(-271462720459027734L),7943177006391766049L}},{{(-8973341921957137857L),(-6642565650158575800L),(-6979879729553791488L)},{(-3692075851158733374L),(-118638527649596253L)},{2678333930021773314L,2067770316731490881L}}}; + static char var_656 = '.'; + private static short var_660 = (-1587); + private static int var_668 = 213342990; + public static int var_669 = (-1812901617); + public static boolean[][][] array_677 = new boolean[][][]{{{true,false},{false,true,true,true,true,false},{false,false,true,true,true,false,false},{false,true,false,true,false,true},{true,true,true,false}},{{true,false,false,true,false,false,false},{false,true,true},{true},{false},{false,false,true,false,false},{true,false,true},{false}},{{false,true,true,true},{false,true,true,true},{true,true},{false,true,true,false}},{{true,true,false,true},{false,true,true,false,false,false},{true,true}}}; + static short var_681 = 25258; + private void func_4(short args_4, String args_5, float args_6, short args_7, byte args_8, String args_9) + { + var_10 = var_10; + long var_11 = (-4764523687302608705L); + ++var_11; + } + public short func_9(float args_73, boolean args_74, int args_75, double args_76, short args_77, short args_78) + { + var_1 = var_1; + String var_90 = ",MKny~jB_&"; + short var_101 = (-30419); + try + { + var_79 = ((byte)var_2)-var_79; + var_12 = var_12; + } + catch (Exception e_1) + { + for (int id_80 = 36;id_80>31;id_80 -= 2) + { + if (var_1>((byte)( ~var_81))) + { + array_82 = array_82; + int index_83 = var_2&array_82.length-1; + int index_84 = var_12&array_82[index_83].length-1; + int index_85 = var_12&array_82[index_83][index_84].length-1; + int index_86 = (((short)var_48)>>>'7')&array_82.length-1; + int index_87 = ((byte)( +var_1))&array_82[index_86].length-1; + int index_88 = var_12&array_82[index_86][index_87].length-1; + index_86 = array_82[index_86][index_87][index_88]; + } + else + { + var_81 = var_81; + var_79 = var_12++; + var_10 = var_10; + var_12 = var_12; + var_10 = var_89; + var_90 = (var_90+var_3)+var_12; + } + int index_92 = ((char)( ~var_1))&array_91.length-1; + int index_93 = ((char)((char)var_79))&array_91[index_92].length-1; + int index_94 = var_12&array_91[index_92][index_93].length-1; + int index_95 = var_2&array_91.length-1; + int index_96 = ((short)(var_12+var_81))&array_91[index_95].length-1; + int index_97 = var_12&array_91[index_95][index_96].length-1; + if (array_91[index_95][index_96][index_97]) + { + var_89 = var_81<=((-1382516944)*((char)index_92)); + var_12 = var_98; + var_79 = var_79; + var_79 = -var_99; + var_1 = (byte)( +var_48); + } + else + { + var_100 = var_100; + var_101 = var_98; + index_97 = index_94; + var_90 = var_90; + var_102 = var_10; + var_81 = var_100; + } + } + --var_99; + System.out.println( "=======Exception thrown======="+1); + } + finally + { + --var_98; + if (var_103&&var_103) + { + var_3 = +var_3; + try + { + int var_104 = (-386028920); + var_99 = var_104; + var_12 = var_12; + var_10 = var_102; + var_1 = var_1; + var_102 = var_10|var_102; + } + catch (Exception e_3) + { + var_105 = var_105; + var_12 = (short)var_101; + var_106 = var_106; + var_10 = var_106>=var_106; + var_90 = var_90; + System.out.println( "=======Exception thrown======="+2); + } + finally + { + var_3 = (-1.0943622415711918E9d); + int index_107 = var_81&array_82.length-1; + int index_108 = var_12&array_82[index_107].length-1; + int index_109 = var_2&array_82[index_107][index_108].length-1; + var_1 = (byte)(array_82[index_107][index_108][index_109]--); + } + } + else + { + ++var_2; + var_98 = (short)'B'; + try + { + var_106 = var_81; + var_110 = var_12<=((short)var_99); + var_79 = var_105; + var_105 = 7.1872608E8f; + int index_111 = var_1&array_82.length-1; + int index_112 = var_106&array_82[index_111].length-1; + int index_113 = var_114&array_82[index_111][index_112].length-1; + var_98 = (short)( ~array_82[index_111][index_112][index_113]); + } + catch (Exception e_3) + { + int index_116 = ((char)((char)var_81))&array_70.length-1; + int index_117 = var_1&array_70[index_116].length-1; + int index_118 = ((byte)var_79)&array_70[index_116][index_117].length-1; + var_102 = ((var_115++)>>var_1)>=((short)array_70[index_116][index_117][index_118]); + System.out.println( "=======Exception thrown======="+3); + } + finally + { + var_1 = (byte)var_81; + var_90 = var_90; + var_90 = var_90; + } + } + var_114 = var_100; + } + ++var_1; + return var_101; + } + protected char func_12(int args_206, String args_207, double args_208, byte args_209, String args_210, double args_211) + { + int index_213 = var_106&array_212.length-1; + int index_215 = var_216&array_82.length-1; + int index_217 = var_216&array_82[index_215].length-1; + int index_218 = index_213&array_82[index_215][index_217].length-1; + int index_214 = array_82[index_215][index_217][index_218]&array_212[index_213].length-1; + int index_219 = 'y'&array_212[index_213][index_214].length-1; + array_212[index_213][index_214][index_219] = var_3; + return (char)var_3; + } + protected double func_13(double args_227, char args_228, short args_229, short args_230, String args_231, String args_232) + { + var_98++; + var_79 = var_81*var_98; + MainClass[][][] array_233 = new MainClass[][][]{{{new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass()}}}; + int index_234 = var_2&array_233.length-1; + int var_236 = (-791989709); + int index_235 = var_236&array_233[index_234].length-1; + int index_237 = 'm'&array_233[index_234][index_235].length-1; + int index_238 = (var_1<<(-27026))&array_233.length-1; + int index_239 = ((byte)((short)var_1))&array_233[index_238].length-1; + int index_240 = var_1&array_233[index_238][index_239].length-1; + int index_241 = var_1&array_233.length-1; + int index_242 = var_243&array_233[index_241].length-1; + int index_244 = var_243&array_233[index_241][index_242].length-1; + array_233[index_241][index_242][index_244] = array_233[index_238][index_239][index_240]; + int index_245 = ((byte)var_216)&array_212.length-1; + int index_246 = var_119&array_212[index_245].length-1; + int var_248 = (-1867665503); + int index_247 = var_248&array_212[index_245][index_246].length-1; + int index_249 = index_239&array_212.length-1; + int index_250 = var_81&array_212[index_249].length-1; + int index_251 = var_236&array_212[index_249][index_250].length-1; + return array_212[index_249][index_250][index_251]; + } + public int func_17(boolean args_425, short args_426, double args_427, byte args_428, double args_429, byte args_430) + { + int index_431 = 443872502&array_70.length-1; + int index_432 = var_114&array_70[index_431].length-1; + int index_433 = ((short)var_99)&array_70[index_431][index_432].length-1; + var_220 = ((char)array_70[index_431][index_432][index_433])/(1|((byte)var_48)); + return var_119&((char)11); + } + byte func_18(int args_438, int args_439, short args_440, int args_441, boolean args_442, byte args_443) + { + int index_444 = var_445&array_204.length-1; + int index_446 = ((short)var_98)&array_204[index_444].length-1; + array_204[index_444][index_446] = new Class_4(); + --var_216; + var_48--; + int index_447 = (((char)var_98)/(1|var_115))&array_70.length-1; + int index_448 = var_106&array_70[index_447].length-1; + char var_450 = '3'; + int index_449 = var_450&array_70[index_447][index_448].length-1; + return (byte)array_70[index_447][index_448][index_449]; + } + public Class_3 func_20(Class_4 args_487, float args_488, short args_489, int args_490, byte args_491, boolean args_492) + { + var_105 = var_422; + var_98--; + var_221 = var_221; + return var_159; + } + String func_21(int args_495, byte args_496, boolean[][][] args_497, char args_498, char args_499, byte args_500) + { + var_48--; + for (int id_501 = 1;id_501<51;id_501 += 13) + { + ++var_114; + array_212 = array_212; + var_2--; + var_99 = ((short)var_100)>>>( -((byte)var_436)); + } + float[] array_502 = new float[]{(-1.42370918E9f),3.50964E8f,(-1.21630234E9f)}; + array_502 = array_502; + return "(X^mmPk#!s"+var_114; + } + short func_22(Class_4 args_510, String args_511, double args_512, boolean args_513, float args_514, double args_515) + { + for (int id_516 = 50;id_516<74;id_516 += 25) + { + var_99 = +107; + for (int id_517 = 56;id_517>8;id_517 -= 13) + { + if (var_518) + { + var_100 = (char)(-29950); + var_1 = 70; + var_505 = var_422; + } + try + { + var_10 = var_10; + int index_519 = (var_220>>var_48)&array_212.length-1; + int index_520 = ((char)var_99)&array_212[index_519].length-1; + int index_521 = ( -(var_12^var_452))&array_212[index_519][index_520].length-1; + array_212[index_519][index_520][index_521] = var_436; + } + catch (Exception e_3) + { + int index_522 = var_445&array_82.length-1; + int index_523 = var_99&array_82[index_522].length-1; + int index_524 = var_98&array_82[index_522][index_523].length-1; + int index_525 = var_216&array_82.length-1; + int index_526 = var_98&array_82[index_525].length-1; + int index_527 = var_243&array_82[index_525][index_526].length-1; + index_527 = array_82[index_525][index_526][index_527]; + System.out.println( "=======Exception thrown======="+21); + } + for (int id_528 = 32;id_528<89;id_528 += 58) + { + array_91 = array_91; + var_436 = var_100/(1|var_106); + } + } + --var_99; + } + int index_530 = var_531&array_529.length-1; + int index_532 = ((short)var_105)&array_529[index_530].length-1; + int index_533 = ((byte)0)&array_529.length-1; + int index_534 = ((char)var_12)&array_529[index_533].length-1; + array_529[index_533][index_534]++; + return 15384; + } + public short func_7(boolean args_42, boolean args_43, char args_44, float args_45, boolean args_46, String args_47) + { + char var_71 = '/'; + int var_541 = (-2026218352); + short var_547 = (-7967); + long var_556 = 6894989187172310990L; + if (((byte)(var_2+var_48))==((byte)( +var_1))) + { + int index_50 = (var_69.func_8(array_70, (byte)(-106), var_10, (char)var_71, (short)var_12, (-7.2163565E8f))*((byte)var_3))&array_49.length-1; + int index_72 = ((short)func_9(var_105, var_10, var_99, var_3, (short)var_98, (short)var_119))&array_49[index_50].length-1; + int index_120 = var_2&array_49[index_50][index_72].length-1; + int index_121 = ((short)(-7734365910720922344L))&array_49.length-1; + int index_122 = (((short)var_1)-((char)index_120))&array_49[index_121].length-1; + int actualArgs_160 = var_159.func_10(index_121, (byte)var_1, (short)var_115, index_72, index_72, var_89); + byte actualArgs_161 = ((byte)var_48); + int actualArgs_162 = ( ~var_1); + int actualArgs_163 = ( +var_81); + int index_123 = var_159.func_10(actualArgs_160, (byte)actualArgs_161, (short)var_12, actualArgs_162, actualArgs_163, var_102)&array_49[index_121][index_122].length-1; + float var_558 = 2.36966832E8f; + if (array_49[index_121][index_122][index_123]) + { + int index_205 = (actualArgs_161*func_12(var_220, var_221, var_3, (byte)actualArgs_161, var_221, var_3))&array_204.length-1; + int index_223 = (((byte)var_216)/(1|((byte)var_216)))&array_212.length-1; + int index_224 = actualArgs_160&array_212[index_223].length-1; + int index_225 = actualArgs_162&array_212[index_223][index_224].length-1; + int index_222 = ((char)array_212[index_223][index_224][index_225])&array_204[index_205].length-1; + int index_226 = ((short)func_13(var_3, (char)var_106, (short)var_115, (short)var_243, var_221, var_221))&array_204.length-1; + int index_252 = actualArgs_161&array_204[index_226].length-1; + float actualArgs_301 = (actualArgs_161-var_105); + boolean actualArgs_302 = (var_3!=var_3); + boolean actualArgs_303 = (var_48>=var_105); + float actualArgs_304 = (var_48/(1|var_216)); + boolean actualArgs_305 = var_10&var_69.func_14(var_300, var_220, actualArgs_301, actualArgs_302, actualArgs_303, actualArgs_304); + String actualArgs_421 = ((var_221+var_105)+func_13(var_3, (char)var_81, (short)var_12, (short)var_98, var_221, var_221)); + int index_423 = ((short)(var_48-actualArgs_161))&array_212.length-1; + boolean actualArgs_434 = (var_220>var_48); + short actualArgs_435 = ((short)var_115); + int actualArgs_451 = (var_216^var_12); + int actualArgs_453 = (index_226>>>var_452); + boolean actualArgs_454 = (var_89&&actualArgs_305); + byte actualArgs_455 = ((byte)var_71); + int index_437 = func_18(index_223, actualArgs_451, (short)actualArgs_435, actualArgs_453, actualArgs_454, (byte)actualArgs_455)&array_212.length-1; + int actualArgs_457 = (var_119--); + short actualArgs_458 = ((short)var_436); + int index_456 = func_9(actualArgs_301, var_102, actualArgs_457, var_436, (short)var_98, (short)actualArgs_458)&array_212[index_437].length-1; + int index_493 = index_205&array_204.length-1; + int index_494 = ((byte)func_9(actualArgs_304, actualArgs_305, var_99, var_436, (short)var_115, (short)var_119))&array_204[index_493].length-1; + String actualArgs_503 = func_21(index_493, (byte)actualArgs_161, array_91, (char)var_100, (char)var_81, (byte)var_216); + boolean actualArgs_504 = (actualArgs_454^actualArgs_454); + double actualArgs_507 = (var_505*var_506); + float actualArgs_508 = var_159.func_19(actualArgs_503, (char)var_100, (short)var_119, actualArgs_504, actualArgs_507, "9HN0x%fI%/"); + byte actualArgs_509 = ((byte)var_106); + short actualArgs_535 = func_22(var_300, actualArgs_503, var_436, actualArgs_305, var_422, actualArgs_507); + int actualArgs_538 = var_159.func_10(var_536, (byte)actualArgs_455, (short)var_12, var_445, index_120, var_537); + boolean actualArgs_539 = (var_1>=var_216); + int actualArgs_540 = var_159.func_10(var_220, (byte)actualArgs_509, (short)actualArgs_535, actualArgs_538, (-873640622), actualArgs_539); + byte actualArgs_542 = ((byte)((char)var_541)); + boolean actualArgs_543 = (actualArgs_302||true); + float actualArgs_545 = func_20(array_204[index_493][index_494], actualArgs_508, (short)actualArgs_435, actualArgs_540, (byte)actualArgs_542, actualArgs_543).func_19(var_544, (char)var_106, (short)var_12, actualArgs_454, actualArgs_507, actualArgs_421); + double actualArgs_546 = ( +actualArgs_455); + short actualArgs_548 = ((short)var_547); + int index_459 = func_9(actualArgs_545, actualArgs_454, 1323651056, actualArgs_546, (short)actualArgs_548, (short)var_549)&array_212[index_437][index_456].length-1; + byte actualArgs_551 = ((byte)var_550); + int index_424 = func_17(actualArgs_434, (short)actualArgs_435, var_436, (byte)var_1, array_212[index_437][index_456][index_459], (byte)actualArgs_551)&array_212[index_423].length-1; + int index_552 = var_549&array_212[index_423][index_424].length-1; + String actualArgs_553 = ((actualArgs_421+var_422)+array_212[index_423][index_424][index_552]); + long var_554 = 5688515518191210181L; + double actualArgs_555 = (var_554++); + boolean actualArgs_557 = ((var_556<=actualArgs_546)&var_69.func_14(var_300, var_99, actualArgs_545, actualArgs_543, var_537, actualArgs_301)); + String actualArgs_559 = "jf3fp+Um-R"+(var_159.func_16(actualArgs_421, "O\\PKXAV&. ", actualArgs_553, var_436, actualArgs_555, actualArgs_557).func_15(var_558, (char)var_81, (short)var_452, actualArgs_302, var_544, index_120)/(1|((char)actualArgs_546))); + array_204[index_226][index_252].func_11(actualArgs_305, var_159, actualArgs_559, array_70, (char)var_81, actualArgs_555); + } + else + { + array_212 = array_212; + int index_561 = ((short)var_506)&array_560.length-1; + int index_562 = var_106&array_560.length-1; + boolean actualArgs_563 = ( -actualArgs_161)>=var_506; + int index_565 = var_566&array_564.length-1; + int index_567 = var_549&array_564[index_565].length-1; + int index_568 = var_531&array_564[index_565][index_567].length-1; + double actualArgs_569 = array_564[index_565][index_567][index_568]++; + array_560[index_562].func_11(actualArgs_563, var_159, var_221, array_70, (char)var_100, actualArgs_569); + } + } + return (short)((var_550--)/(1|((char)var_422))); + } + public strictfp void run() + { + float var_13 = (-2.014623E7f); + String var_14 = "d&W72cQ@1"; + byte var_15 = 4; + try + { + --var_1; + var_2--; + if (( ~var_1)>=var_3) + { + String actualArgs_16 = var_14+(var_10&&(var_12<=var_15)); + func_4((short)var_12, "�```%%-c", var_13, (short)(-27269), (byte)var_1, actualArgs_16); + } + boolean var_17 = false; + char actualArgs_627 = ((char)var_626); + int index_628 = ((short)(var_629/(1|var_243)))&array_529.length-1; + int actualArgs_631 = (var_629&var_536); + byte actualArgs_632 = ((byte)var_81); + int index_634 = ((char)var_79)&array_633.length-1; + int index_630 = var_159.func_10(actualArgs_631, (byte)actualArgs_632, (short)var_115, array_633[index_634], var_99, var_537)&array_529[index_628].length-1; + byte actualArgs_635 = ((byte)var_505); + int actualArgs_636 = (var_100--); + if (var_17|var_159.func_5(var_625, (char)actualArgs_627, (short)var_98, (char)array_529[index_628][index_630], (byte)actualArgs_635, actualArgs_636)) + { + int index_637 = ']'&array_560.length-1; + int actualArgs_638 = (((short)var_549)<<(var_566&var_100)); + boolean actualArgs_639 = ( !var_89); + float actualArgs_640 = ( -8656214); + boolean actualArgs_641 = var_69.func_14(array_560[index_637], actualArgs_638, var_13, actualArgs_639, var_110, actualArgs_640); + int index_643 = var_531&array_564.length-1; + int index_644 = ((char)((byte)var_506))&array_564[index_643].length-1; + int index_645 = index_644&array_564[index_643][index_644].length-1; + char actualArgs_646 = func_12(var_2, var_14, array_564[index_643][index_644][index_645], (byte)var_1, var_544, var_3); + char actualArgs_647 = ((char)(-6138693247492833598L)); + double actualArgs_648 = ( +(-1.5434439643711786E9d)); + short actualArgs_649 = ((short)var_550); + short actualArgs_650 = func_9(var_422, var_10, index_630, actualArgs_648, (short)var_12, (short)actualArgs_649); + int actualArgs_651 = (actualArgs_649^index_634); + char actualArgs_652 = ((char)var_81); + byte actualArgs_653 = ((byte)var_114); + String actualArgs_654 = func_21(actualArgs_651, (byte)var_216, array_91, (char)var_550, (char)actualArgs_652, (byte)actualArgs_653); + double actualArgs_655 = func_13(var_3, (char)actualArgs_647, (short)actualArgs_650, (short)(-17949), var_221, actualArgs_654); + var_300.func_11(actualArgs_641, var_159, var_221, array_642, (char)actualArgs_646, actualArgs_655); + } + else + { + var_243 = var_12; + --var_12; + var_656 = var_106; + } + } + catch (Exception e_1) + { + int index_657 = var_1&array_560.length-1; + int index_658 = var_114&array_560.length-1; + byte var_661 = 48; + int index_659 = (var_660*((char)var_661))&array_204.length-1; + int index_662 = (-39965570)&array_204[index_659].length-1; + array_204[index_659][index_662] = array_560[index_658]; + System.out.println( "=======Exception thrown======="+26); + } + int index_664 = ((byte)((byte)var_436))&array_212.length-1; + int index_666 = (((byte)1.0971161E7f)>>var_243)&array_82.length-1; + int index_667 = (var_115%(1|var_159.func_10(var_626, (byte)var_1, (short)var_549, var_668, var_669, var_110)))&array_82[index_666].length-1; + int index_670 = (var_216>>var_531)&array_82[index_666][index_667].length-1; + int index_665 = ((byte)array_82[index_666][index_667][index_670])&array_212[index_664].length-1; + int index_671 = '4'&array_212[index_664][index_665].length-1; + int index_663 = ((short)array_212[index_664][index_665][index_671])&array_204.length-1; + int index_672 = var_12&array_204[index_663].length-1; + int index_673 = index_667&array_204.length-1; + int index_674 = var_656&array_204[index_673].length-1; + int actualArgs_675 = (var_656&index_666); + float actualArgs_676 = (var_48+(-3691046.5f)); + int index_678 = index_671&array_677.length-1; + int index_679 = ((char)((char)var_15))&array_677[index_678].length-1; + int index_680 = var_681&array_677[index_678][index_679].length-1; + boolean actualArgs_682 = var_69.func_14(var_300, actualArgs_675, actualArgs_676, var_89, var_102, var_105)||array_677[index_678][index_679][index_680]; + double actualArgs_683 = -var_13; + array_204[index_673][index_674].func_11(actualArgs_682, var_159, var_544, array_642, (char)']', actualArgs_683); + } +} +class Class_3 +{ + protected static long var_25 = (-6358162239151764945L); + private static char var_26 = '~'; + static int var_27 = 1034539197; + protected static byte var_28 = 40; + private static double var_131 = (-1.6131315151944172E8d); + protected static short var_134 = (-18818); + static char var_135 = 't'; + protected static boolean var_142 = true; + static Class_4 var_143 = new Class_4(); + static boolean[][] array_144 = new boolean[][]{{true,true,false,false,false,true},{false,true,false}}; + public static int var_149 = 1952704871; + static Class_3 var_151 = new Class_3(); + private static Class_3 var_152 = new Class_3(); + public static long var_153 = (-1508173957066102890L); + private static boolean var_156 = false; + private static byte var_158 = (-32); + private static float[] array_416 = new float[]{(-7.0510618E8f),(-5.6408504E7f)}; + protected static Class_5 var_420 = new Class_5(); + public static String var_466 = "1OqmO@cV<+"; + static boolean var_468 = true; + private static float var_470 = 1.83936848E8f; + static short var_471 = 20739; + private static byte var_472 = 95; + public static short var_475 = 29588; + public static boolean[][][] array_477 = new boolean[][][]{{{false,false,false,true,false,true,false,false},{false,false,false,true,false},{true,false},{true,true,true}},{{false,false,true,false},{true,true,false,true,true,false,false,false},{false,false,false}},{{true,false,false},{false,true},{true,true,false,true},{true,false,true,false,false,false},{true,true,true},{true,true},{true}},{{true,false,false,false},{false,true},{true,false},{false,false,true,false,false,false}},{{true,false,true,true},{true,true,true},{false,true,true}},{{true},{true,true,true},{true,true,true,false},{true,false,true,false,true},{true,true,false},{true,true,false,false,true},{true,true,true},{true,false}}}; + private static char var_486 = '<'; + protected static MainClass var_589 = new MainClass(); + protected static double var_592 = 829801.3363060354d; + public static byte var_595 = 51; + private static double var_599 = 4.6891329119927394E8d; + static byte var_600 = 89; + public static float var_601 = (-2.26174544E8f); + public static char var_603 = 'k'; + public static boolean[][] array_616 = new boolean[][]{{true,false,true,true,false},{true,true,true,true,true},{false,false,false},{true,false,false,false,true}}; + public static String var_619 = "P2;&eJmLiw"; + protected static boolean var_622 = true; + public int func_10(int args_124, byte args_125, short args_126, int args_127, int args_128, boolean args_129) + { + boolean var_136 = true; + int var_137 = (-84593594); + boolean var_140 = false; + float var_141 = 7.911544E7f; + char var_150 = '#'; + boolean var_154 = false; + try + { + String var_130 = "4kFQ_#cB3o"; + var_130 = ((var_130+var_27)+(var_130+var_28))+var_131; + } + catch (Exception e_1) + { + try + { + for (int id_132 = 5;id_132<29;id_132 += 5) + { + float var_133 = (-1.57862566E9f); + var_26 = (char)var_133; + var_131 = var_134+var_131; + var_28 = (byte)((short)var_131); + var_28 = 75; + } + var_131 = var_131; + if ((var_28++)<=((var_27+var_27)-(var_27&var_28))) + { + var_135 = var_26; + var_26 = var_26; + var_26 = 'r'; + var_136 = var_136; + var_135 = var_135; + var_28 = var_28; + } + var_134 = (short)var_131; + var_137--; + for (int id_138 = 71;id_138>65;id_138 -= 1) + { + byte var_139 = 48; + var_140 = !(var_26>var_139); + var_135 = (char)var_141; + } + } + catch (Exception e_2) + { + ++var_26; + if (var_142) + { + var_143 = var_143; + var_136 = true; + } + int index_145 = ((short)var_134)&array_144.length-1; + int index_146 = var_134&array_144[index_145].length-1; + int index_147 = (-17076)&array_144.length-1; + int index_148 = index_146&array_144[index_147].length-1; + if (array_144[index_147][index_148]) + { + var_149 = var_137; + var_141 = var_141; + var_135 = var_26; + var_150 = 'E'; + } + else + { + var_136 = var_136; + var_152 = var_151; + var_136 = (var_153>=(-2138))|(var_141==var_141); + } + System.out.println( "=======Exception thrown======="+5); + } + var_141 = var_28+var_25; + if (var_154) + { + for (int id_155 = 2;id_155<18;id_155 += 3) + { + var_134 = var_134; + var_156 = (((byte)var_25)&((short)var_131))<=( +(var_27&var_150)); + var_136 = ((char)var_131)>=(((short)var_141)|((char)var_137)); + var_134 = (short)((byte)var_153); + var_131 = +var_153; + var_28 = (byte)var_137; + } + --var_26; + for (int id_157 = 42;id_157<72;id_157 += 5) + { + var_28 = var_158; + var_136 = var_156; + var_140 = var_156; + var_131 = var_131; + var_141 = var_141; + var_131 = var_131; + } + } + var_134 = (short)var_141; + System.out.println( "=======Exception thrown======="+5); + } + return ((char)var_158)/(1|var_158); + } + public Class_5 func_16(String args_410, String args_411, String args_412, double args_413, double args_414, boolean args_415) + { + int index_417 = ((short)((short)var_28))&array_416.length-1; + int index_418 = (-18920)&array_416.length-1; + int index_419 = 11901&array_416.length-1; + array_416[index_419] = array_416[index_418]; + return var_420; + } + public float func_19(String args_460, char args_461, short args_462, boolean args_463, double args_464, String args_465) + { + var_466 = "*\"cA`46@a|"; + for (int id_467 = 48;id_467<72;id_467 += 4) + { + var_149 = var_27; + try + { + var_134 = var_134; + if (var_468) + { + var_28 = (byte)(-1.4395657E9f); + var_134 = (short)var_135; + } + else + { + var_156 = (-974594564)>=((byte)':'); + int index_469 = var_28&array_416.length-1; + var_466 = var_466+array_416[index_469]; + var_158 = var_28; + } + try + { + var_420 = var_420; + var_131 = var_131; + } + catch (Exception e_3) + { + var_466 = ((var_466+var_470)+var_471)+var_131; + var_472 = var_28; + var_134 = var_134; + array_144 = array_144; + System.out.println( "=======Exception thrown======="+19); + } + finally + { + var_158 = 82; + int index_473 = ((char)8)&array_416.length-1; + array_416[index_473] = var_470; + } + var_131 = var_131; + ++var_28; + } + catch (Exception e_2) + { + for (int id_474 = 98;id_474>36;id_474 -= 11) + { + var_466 = var_466; + var_135 = (char)((char)((byte)var_472)); + var_158 = (byte)var_28; + var_149 = ((short)((char)var_131))<<(var_475-var_158); + var_466 = "exy[d;0iE]"; + } + for (int id_476 = 26;id_476>2;id_476 -= 3) + { + var_471 = var_134; + var_28 = var_472; + array_477 = array_477; + int index_478 = (var_27--)&array_416.length-1; + var_26 = (char)((byte)array_416[index_478]); + } + for (int id_479 = 37;id_479<67;id_479 += 6) + { + var_134 = (short)(var_28*var_26); + var_131 = var_131; + } + if (var_131>>((char)var_486))/(var_475++); + var_143.func_6((char)actualArgs_576, var_466, (char)actualArgs_577, actualArgs_578, var_466, var_27); + } + catch (Exception e_3) + { + int actualArgs_579 = func_10(var_149, (byte)var_28, (short)var_475, var_149, var_149, var_30); + boolean actualArgs_580 = (var_30|var_30); + int actualArgs_581 = func_10(actualArgs_579, (byte)var_28, (short)(-11106), actualArgs_579, var_149, actualArgs_580); + int index_582 = ((char)((short)var_153))&array_416.length-1; + int index_583 = var_486&array_416.length-1; + boolean actualArgs_584 = var_420.func_14(var_143, actualArgs_579, array_416[index_582], var_30, actualArgs_580, array_416[index_583]); + actualArgs_579 = func_10(actualArgs_581, (byte)var_472, (short)var_471, var_149, actualArgs_579, actualArgs_584); + System.out.println( "=======Exception thrown======="+22); + } + } + catch (Exception e_2) + { + for (int id_585 = 59;id_585>50;id_585 -= 2) + { + int index_586 = (-1734250678)&array_416.length-1; + var_471 = (short)array_416[index_586]; + var_471 = (short)var_486; + boolean actualArgs_587 = ((var_135<=var_486)&var_30); + int index_588 = ((char)((-4028704758170825419L)|var_149))&array_416.length-1; + array_416[index_588] = func_19(var_466, (char)var_26, (short)var_134, actualArgs_587, 4.6891182760015243E8d, var_466); + } + boolean actualArgs_590 = (var_470>var_27); + short actualArgs_591 = ((short)var_29); + int actualArgs_593 = var_589.func_17(var_156, (short)actualArgs_591, var_592, (byte)var_472, var_131, (byte)(-17)); + byte actualArgs_594 = ((byte)var_153); + int actualArgs_596 = var_589.func_17(var_156, (short)var_475, var_131, (byte)var_595, var_131, (byte)var_472); + boolean actualArgs_597 = (var_466==var_466); + if (var_589.func_17(actualArgs_590, (short)actualArgs_591, var_29, (byte)10, (-2.76130455028274E8d), (byte)var_28)!=func_10(actualArgs_593, (byte)actualArgs_594, (short)(-11673), actualArgs_596, var_149, actualArgs_597)) + { + var_26 = '('; + var_134 = (short)( -((short)var_134)); + var_598 = (-26470); + } + System.out.println( "=======Exception thrown======="+23); + } + try + { + var_599 = -var_158; + try + { + var_27 = var_475--; + var_471 = var_598; + var_472 = var_600; + var_470 = var_601; + } + catch (Exception e_3) + { + boolean actualArgs_602 = ((var_27>>>var_598)B%uzc4B"+"'odw|I\"b$h"); + double actualArgs_609 = var_486/func_19(var_466, (char)var_603, (short)actualArgs_607, var_30, var_592, actualArgs_608); + String actualArgs_610 = actualArgs_608+var_592; + boolean actualArgs_611 = (var_30&var_420.func_14(var_143, var_27, var_601, var_156, var_30, var_470)); + short actualArgs_612 = ((short)var_600); + byte actualArgs_613 = ((byte)(-6852)); + double actualArgs_614 = ( +var_592); + int actualArgs_615 = var_589.func_17(actualArgs_611, (short)actualArgs_612, var_605, (byte)actualArgs_613, actualArgs_614, (byte)(-62)); + var_143.func_6((char)actualArgs_606, var_466, (char)var_26, actualArgs_609, actualArgs_610, actualArgs_615); + } + catch (Exception e_2) + { + ++var_472; + var_420 = var_420; + System.out.println( "=======Exception thrown======="+25); + } + } + int index_617 = ((char)var_471)&array_616.length-1; + double actualArgs_620 = ( -var_25); + double actualArgs_621 = (var_600++); + int index_618 = (func_16(var_466, var_466, var_619, actualArgs_620, actualArgs_621, var_156).func_15(var_601, (char)var_26, (short)var_475, var_622, var_466, var_149)^((char)var_26))&array_616[index_617].length-1; + int index_623 = var_27&array_616.length-1; + int index_624 = (var_600/(1|var_158))&array_616[index_623].length-1; + return array_616[index_623][index_624]; + } +} +class Class_4 +{ + protected static boolean var_170 = true; + public static boolean var_171 = false; + private static short var_173 = (-16103); + protected static boolean var_177 = true; + static boolean var_178 = false; + static float var_181 = 2.38961648E8f; + private static long var_182 = 1905703223216191981L; + private static boolean var_184 = true; + static String var_185 = "B):k$E DR7"; + protected static byte var_186 = 70; + private static boolean var_187 = true; + private static String var_188 = "8UQ;R/!&j>"; + public static boolean var_193 = true; + protected static long var_194 = (-2223517682611670322L); + public static char var_195 = 'y'; + protected static char var_200 = '!'; + static boolean var_203 = false; + static MainClass var_570 = new MainClass(); + public void func_11(boolean args_164, Class_3 args_165, String args_166, long[][][] args_167, char args_168, double args_169) + { + char var_174 = 'H'; + double var_175 = (-3.030057161468428E8d); + int var_179 = (-2118498694); + String var_189 = "YF_xG.HY9-"; + boolean var_199 = false; + try + { + try + { + char var_172 = 'u'; + if (var_170|var_170) + { + var_171 = (var_171||var_171)&&(var_172>=(-3.9803744E7f)); + var_173 = var_173; + var_173 = (short)((byte)(-15369)); + var_172 = var_174; + var_172 = ','; + var_173 = (short)(var_173+var_175); + } + try + { + boolean var_176 = false; + var_177 = var_176; + var_178 = var_177; + var_179 = var_174++; + var_174 = 'e'; + } + catch (Exception e_3) + { + var_179 = var_179; + long var_180 = 4679973830121166825L; + var_181 = ( +var_180)/(1|var_172); + var_178 = var_177||var_171; + System.out.println( "=======Exception thrown======="+6); + } + finally + { + var_174 = (char)var_173; + var_181 = var_181; + double var_183 = 4.407874812082347E8d; + var_183 = ( +var_179)*var_182; + var_177 = var_171; + var_181 = var_181; + } + var_173++; + var_177 = var_184&&var_177; + var_185 = var_185; + } + catch (Exception e_2) + { + ++var_186; + var_177 = '*'<(((short)var_173)/(1|(var_182/(1|var_179)))); + System.out.println( "=======Exception thrown======="+7); + } + finally + { + if (var_187) + { + var_179 = var_186<( +(var_186*var_186)); + System.out.println( "=======Exception thrown======="+9); + } + } + try + { + ++var_186; + short var_201 = 32751; + var_200 = (char)(var_200%(1|((byte)var_201))); + var_171 = var_178; + var_185 = var_185+var_173; + var_179--; + } + catch (Exception e_2) + { + Class_3 var_202 = new Class_3(); + var_202 = var_202; + var_181 = var_181; + var_200 = (char)6.010252973898292E8d; + var_188 = var_189; + if (var_203) + { + var_181 = var_181-var_186; + var_173 = var_173; + var_181 = 4.86807552E8f; + var_173 = (short)((byte)((byte)(-99))); + } + System.out.println( "=======Exception thrown======="+10); + } + var_195 = 'x'; + --var_179; + var_181 = (-1412582677)+var_195; + System.out.println( "=======Exception thrown======="+10); + } + } + public void func_6(char args_31, String args_32, char args_33, double args_34, String args_35, int args_36) + { + long[][][] array_37 = new long[][][]{{{(-1610562277992882L),(-2350092617358295527L),2876028475313602481L,(-5839391022029606824L)},{(-5922350007816697249L)}},{{1992772422230079858L,(-3017830074979892973L),5854625054175242244L,(-7653411936555848907L)},{(-6383928498802879697L),(-5983526110343118262L)},{(-2551396870828437127L),(-5143652891669935654L),(-340214588741374372L),(-5718441379221779544L),7991869798007008703L,(-6665170465153569696L),(-2290469341215048094L)}},{{(-2919802547273078264L),(-679977959595791134L),8064211835666736973L,156230343013132185L},{(-1337240245880537078L),(-7919866096047620110L),(-7243044344061969831L)}},{{4465227142976642463L,(-472786574377805076L),(-7452028456063730953L),(-7358667745779758488L),(-3049013011791436030L),5268961169072265821L},{(-5746572926128386240L)},{(-4185896337371981155L),(-3604076573667533897L),1535220368960163427L,(-5865412108862433435L)},{(-2018668447443505849L),1177990461899180701L,89468342254494105L},{(-4208537940192391595L),(-8409523999069658431L)},{7301057568320117223L,7340085167259850026L,1649461819706841319L,8486834139159143700L,(-527545489025251671L),6609632170267399553L,(-2252796712089879942L)}},{{7353685962827831295L,7214652785953800267L,3787293945162216943L,4458386164252420340L,(-5467551383528158136L),(-134356210614846524L)},{7759916566172094931L,6517267846427368606L,5175865787832464919L,2678057230477765457L},{(-6131063585674579908L),(-2159140875430942914L),357142228024405651L,(-7509066768495486284L),(-6787520636198295530L),5434405021764559185L},{8657022393667877687L,978053890910422047L,6069762469630302204L,479174411330038638L,(-8209069631009096852L)}},{{(-2830711330122754960L),4914651182077547824L,5049271357611501167L,(-2155959155141448267L),(-9022778741452808313L),(-8203911235377379303L),670010942349934033L},{(-7930278292216098771L),(-6455805125713541708L),7141661648709506171L,(-7253700145343704679L),3020741935025231849L,6918431757655134613L},{(-6888548793420231270L),4875774186671484745L,(-9138159667102195230L)},{541914956464759148L,(-7877865367924468299L),1053162538740151608L,2839588450799879692L}}}; + int index_38 = ((byte)1806800951)&array_37.length-1; + int index_39 = (-723530870)&array_37[index_38].length-1; + int index_40 = index_38&array_37[index_38][index_39].length-1; + boolean actualArgs_571 = (var_177||var_178); + char actualArgs_572 = ((char)var_173); + boolean actualArgs_573 = ( !var_184); + int index_41 = var_570.func_7(actualArgs_571, true, (char)actualArgs_572, var_181, actualArgs_573, var_188)&array_37.length-1; + int index_574 = var_195&array_37[index_41].length-1; + int index_575 = index_40&array_37[index_41][index_574].length-1; + --array_37[index_41][index_574][index_575]; + } +} +class Class_5 +{ + static int[][][] array_58 = new int[][][]{{{(-969008332)},{1920087429,(-329339199),876404289,(-1928081792),1022480836},{2003632327,(-1833105669)}},{{231398381,(-1406658980),1758435741},{(-802026738),1509244688,(-1925711732),(-784158399)},{737937750,(-2101269001),(-954325871),(-2030674771)},{1593085610}},{{608417721,(-1927004058),(-1583846314),1366625160},{9495648,422080482,492868856,1153163026},{1767615846,(-1776389946),2057953255,1978900516,367899232}},{{(-178666982),276095584},{(-1708878601)},{(-1147689588),362765226,(-1651322595),(-993615671),(-1790384353),616362811},{(-1942235162),(-2086280218),(-1841154029),(-189871831),(-159744927)}},{{(-409988495),1481147663,660054312},{(-270191394)},{(-601811549),(-1412968908)},{(-1025074535),2143582801},{1401250828,2123940067},{(-1662775738),(-1539788593),(-1161002183),(-574012003)}},{{1820070710,(-69758757),(-1401085992),286808748},{1992876682,(-1587984008),(-1812734399)},{(-1028443605),1155855056,(-1346451335)},{(-1019147821),(-1642883332),1965148964,190841323,548521134,(-1668466095),2007885412},{(-332194440),1895488724}},{{(-2022830846),1988017345,689898968},{(-1537148749),419588358,(-497628040)},{(-69127932),793027525,(-895046268),2001723111}},{{1239474756,(-1276819368),(-1145206831),457952322,392980819},{1886564644},{1150344482,(-718402407),790456774}}}; + protected static char var_60 = '*'; + static short var_62 = 13231; + private static byte var_64 = (-44); + static byte var_66 = 4; + protected static String var_259 = "y+nt'8V3+&"; + public static float var_263 = (-3.2305712E8f); + public static Class_4 var_264 = new Class_4(); + private static boolean var_266 = false; + static boolean[][] array_267 = new boolean[][]{{true,false,false},{true,true,true,true},{true,true}}; + private static char var_275 = 'S'; + private static short var_277 = 10225; + public static long var_298 = (-7520375043116274936L); + protected static char var_312 = '7'; + private static byte var_314 = 1; + protected static byte var_315 = (-28); + protected static short var_322 = 24737; + private static double var_323 = 1.4693227226090908E8d; + private static char var_334 = '('; + public static Class_5 var_336 = new Class_5(); + static float[][] array_343 = new float[][]{{2.11407248E8f,1.07349848E8f,3.39130976E8f},{(-9.195472E8f),8.3450643E8f,1.2610252E7f},{(-2.50872464E8f),(-1.25880128E9f),(-4.4737084E7f),5.351048E8f,(-5.9720556E7f),1.03747418E9f,(-9.859632E8f)}}; + protected static float var_349 = 4.93829E7f; + private static MainClass[][][] array_350 = new MainClass[][][]{{{new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass()}},{{new MainClass(),new MainClass(),new MainClass(),new MainClass()}},{{new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass()},{new MainClass(),new MainClass(),new MainClass(),new MainClass()}}}; + static boolean var_351 = false; + public static boolean var_352 = false; + protected static boolean var_353 = true; + protected static boolean var_367 = true; + protected static char var_368 = 'X'; + static byte var_370 = 96; + protected static int var_373 = (-312346575); + protected static short var_405 = 15842; + private static long var_408 = 4084895343524330675L; + public static short var_409 = (-8720); + public byte func_8(long[][][] args_51, byte args_52, boolean args_53, char args_54, short args_55, float args_56) + { + char var_57 = '7'; + int index_59 = var_60&array_58.length-1; + int index_61 = var_62&array_58[index_59].length-1; + int index_63 = var_64&array_58[index_59][index_61].length-1; + array_58[index_59][index_61][index_63] = +((byte)var_57); + int index_65 = (var_66++)&array_58.length-1; + int index_67 = ((byte)var_66)&array_58[index_65].length-1; + int index_68 = ((short)(var_62%(1|var_60)))&array_58[index_65][index_67].length-1; + return (byte)(array_58[index_65][index_67][index_68]--); + } + public boolean func_14(Class_4 args_253, int args_254, float args_255, boolean args_256, boolean args_257, float args_258) + { + int index_260 = var_66&array_58.length-1; + int index_261 = var_66&array_58[index_260].length-1; + int index_262 = ((char)((short)var_263))&array_58[index_260][index_261].length-1; + var_259 = (var_259+array_58[index_260][index_261][index_262])+var_263; + var_264 = new Class_4(); + double var_280 = 1082376.7389681493d; + int var_290 = (-520947175); + for (int id_265 = 54;id_265>23;id_265 -= 16) + { + if (var_266) + { + var_66 = 33; + var_66 = var_64; + int index_268 = 26208&array_267.length-1; + int index_269 = ((char)(-1.02637344E9f))&array_267[index_268].length-1; + array_267[index_268][index_269] = false; + } + else + { + var_60 = (char)var_263; + int index_270 = var_60&array_58.length-1; + int index_271 = var_66&array_58[index_270].length-1; + int index_272 = index_261&array_58[index_270][index_271].length-1; + int index_273 = 1668847719&array_58.length-1; + int index_274 = (var_275+var_275)&array_58[index_273].length-1; + int index_276 = index_272&array_58[index_273][index_274].length-1; + array_58[index_273][index_274][index_276]--; + } + var_66 = (byte)2648849.7191664767d; + long var_278 = 4020853298505434500L; + try + { + --var_66; + --var_277; + var_66--; + var_263 = +var_60; + } + catch (Exception e_2) + { + ++var_278; + try + { + var_64 = (byte)var_263; + int index_279 = ((char)(var_278/var_280))&array_58.length-1; + int index_281 = ((char)var_278)&array_58[index_279].length-1; + int index_282 = index_261&array_58[index_279][index_281].length-1; + array_58[index_279][index_281][index_282] = index_261; + var_277 = var_62; + } + catch (Exception e_3) + { + var_280 = var_280; + var_275 = (char)(var_60>>>(var_277>>'W')); + System.out.println( "=======Exception thrown======="+12); + } + var_60 = var_275; + var_259 = var_259+var_263; + try + { + var_263 = var_263; + String[][][] array_283 = new String[][][]{{{"|qcum.6|P*","'%b-2`0_C~","-7tr%iSQ?"}},{{"tkR)Fwp\".4","xeISg|8mWE","2IAbMlg`+P"},{"rWrwu:'S2L"},{"*$m*d1'@iO","ij8s.]Xpr","ob:G9r9bp?","(#t'kWs^|?","nQSS)b0'*."}},{{"[`ZDW\\hbX!","WDUn+]&p","lNA\"gFx)T\\"},{"1qi)b*oTv7"},{"\"k:%a38G(s"," Nl\";Zy&|k",";OA1:~+hJ\\"},{"~.GsiJ","w_`.<-YLx","|9CiG^tE9J"},{"R-l03t\"ptU","cG4g\"nx !z"},{".|[^bflP$A","]Xj@>@b]"}}}; + int index_284 = index_261&array_283.length-1; + int index_285 = 26174&array_283[index_284].length-1; + int index_286 = (var_66-(-11546))&array_283[index_284][index_285].length-1; + int index_287 = index_285&array_283.length-1; + int index_288 = index_262&array_283[index_287].length-1; + int index_289 = ((char)((char)var_290))&array_283[index_287][index_288].length-1; + int index_291 = var_60&array_283.length-1; + int index_292 = var_62&array_283[index_291].length-1; + int index_293 = var_66&array_283[index_291][index_292].length-1; + array_283[index_291][index_292][index_293] = array_283[index_287][index_288][index_289]; + } + catch (Exception e_3) + { + var_275 = var_60; + var_66 = (byte)var_280; + var_60 = (char)var_278; + System.out.println( "=======Exception thrown======="+13); + } + for (int id_294 = 3;id_294<36;id_294 += 6) + { + int index_295 = var_64&array_267.length-1; + int index_296 = var_60&array_267[index_295].length-1; + array_267[index_295][index_296] = false; + var_259 = var_259; + var_263 = +var_62; + var_263 = var_263; + } + System.out.println( "=======Exception thrown======="+13); + } + finally + { + --var_275; + var_259 = var_259; + for (int id_297 = 60;id_297>57;id_297 -= 4) + { + var_263 = var_263; + var_280 = var_280; + var_259 = var_259; + var_259 = (var_259+((char)var_278))+((char)var_62); + } + } + } + int var_299 = 1898282387; + return (((short)var_298)%(1|var_66))>(var_299%(1|var_64)); + } + public byte func_15(float args_306, char args_307, short args_308, boolean args_309, String args_310, int args_311) + { + var_277 = (short)var_312; + boolean var_333 = true; + MainClass var_335 = new MainClass(); + int var_354 = (-764612381); + char var_357 = '0'; + double var_360 = 4.307368593507513E8d; + float var_363 = 3.1149488E8f; + Class_4[][] array_377 = new Class_4[][]{{new Class_4(),new Class_4(),new Class_4(),new Class_4(),new Class_4(),new Class_4()},{new Class_4(),new Class_4(),new Class_4()}}; + boolean[][] array_387 = new boolean[][]{{false,false,true,false},{true},{false,false,false,false,false},{true,true,false},{false,true,true,true}}; + double var_393 = 1.4354984618902931E9d; + String[][][] array_407 = new String[][][]{{{"IwG!Rv6Qe?","78#\\U%Y*S*","eS9?=#CfCK","p]&+GBMQk8"},{"G~%Q9AUTq/","GfTw6z+WQ;","fiujb8qK]="},{"D|6~$/n)\"%","TT7?n u@xA","KL+,qKFF%!","$t6=Qss6PP"},{"*v ]us?ud","<$02!Nd,FA","!mc%F|dL=4","HAduUe)7aI","5BrvX*.?9Y","AX,^s4tKqm"},{"4>XPK6,[~s","*>h:VvDuL,","Si6pBEutv,",",rguF0:<;m","^!tN<6e7`~","I6EvRce\"*F"},{"Ith4c_C.N9","kaU)HIT@VI","|^JvJ~ j'1","$(M'!EfB4@","WCv\"[/@5bj"},{"-!mwAkMa;&","|%%2-w;BSE","(i2WIWbj_5"}},{{"Ehl2X","^?M\"UdKYT*","~/lqgt$6s*","P+\"gPC|h)","P3Wo+L4is4","YfIwdb(8G4","nM^tU!$CJ]"},{"@O:X8A28","$/,D.tl2)=","Sv6A4&+QuX","xp/j4[/U|C","a)xP,ah?eB","Gx(>qa[S?b"},{"pyAYg$`~]M","14I3b)Ph]j"},{"%f_o[#?;S="}},{{"u)Ly%OVVgm","&LPf/dy'|]","NEyxsF*$rK"},{"MAA|vBt)a&","E~Sbpp;0Mx","cOm[Y_BZ;M","xo07'c[]!*","6bdW> 5t?(","e'5k\"TOkU2"},{"1%G;C","Oj^|6|!ZIx","@MGByI+(k2","_iQIIErSla","8)&hSvnPd:"},{"%+<8JcGDYH","`=,t@o&\"MU","=)[8lO,aN9","Cc|V%ZNn^W"},{" FaRe+W|J!","|3>9TkBNE0"}},{{"pPvE+EKJVL","WC/# e=8SS","Az|79~B|(%","bn|m~i/b7#"},{"<)r@osqw#f","[pBIYLYO8r","[Nmz96FiF9","aI,cdmfiO"},{"K1>nsu5#I|","oo.&7exM=liz"}},{{">8Kmh<)~?9","&&a|Pr\"9ij","._w;JdgX.r"}},{{"/q3nV\\H xw","_dlXd$Jn>u",".R2=F,,mCA","/&#^*Q@7Gb"},{"6wHvoV|c0k","ZeJhG_9yw~","t|&x`~S.M~","y)gd323ph%","Q0VMb)Y~zq"},{"~wO$y<%6~)","sh=vR;fj0T","3PFZUCq;?#"},{"9KCf>VME?)"}}}; + try + { + for (int id_313 = 39;id_313<58;id_313 += 7) + { + try + { + var_62 = var_62; + var_263 = var_263; + var_314 = var_64; + var_64 = var_315; + } + catch (Exception e_3) + { + int index_316 = var_315&array_58.length-1; + int index_317 = (var_66-((byte)(-1831653886)))&array_58[index_316].length-1; + int index_318 = (-25)&array_58[index_316][index_317].length-1; + int index_319 = var_277&array_58.length-1; + int index_320 = ((byte)var_66)&array_58[index_319].length-1; + int index_321 = var_275&array_58[index_319][index_320].length-1; + index_319 = array_58[index_319][index_320][index_321]; + System.out.println( "=======Exception thrown======="+14); + } + finally + { + var_275 = var_60; + var_323 = -var_322; + int index_324 = var_66&array_267.length-1; + int index_325 = ((short)var_66)&array_267[index_324].length-1; + array_267[index_324][index_325] = var_263==var_263; + } + int index_326 = ((char)var_315)&array_267.length-1; + int index_327 = var_62&array_267[index_326].length-1; + int index_328 = var_62&array_267.length-1; + int index_329 = 552&array_267[index_328].length-1; + int index_330 = ((byte)((byte)var_263))&array_267.length-1; + int index_331 = ((byte)((char)var_64))&array_267[index_330].length-1; + array_267[index_330][index_331] = array_267[index_328][index_329]; + } + for (int id_332 = 97;id_332>71;id_332 -= 14) + { + if (var_333) + { + var_314 = var_66; + var_314 = var_314; + var_334 = var_334; + var_335 = var_335; + var_275 = (char)((short)(var_60&var_312)); + var_336 = var_336; + } + try + { + int index_337 = var_60&array_267.length-1; + int index_338 = var_64&array_267[index_337].length-1; + array_267[index_337][index_338] = true; + var_323 = +(var_298--); + int index_339 = var_315&array_267.length-1; + int index_340 = var_275&array_267[index_339].length-1; + array_267[index_339][index_340] = var_263>var_322; + } + catch (Exception e_3) + { + int index_341 = var_312&array_267.length-1; + int index_342 = ((char)var_263)&array_267[index_341].length-1; + array_267[index_341][index_342] = var_323<(var_298++); + int index_344 = (var_62-((byte)var_298))&array_343.length-1; + int index_345 = ((char)(var_323++))&array_343[index_344].length-1; + int index_346 = ((short)((byte)var_298))&array_267.length-1; + int index_347 = var_60&array_267[index_346].length-1; + array_267[index_346][index_347] = array_343[index_344][index_345]>=var_66; + System.out.println( "=======Exception thrown======="+15); + } + var_259 = var_259; + var_298--; + for (int id_348 = 32;id_348<69;id_348 += 5) + { + var_323 = var_349++; + var_62 = var_322; + array_350 = array_350; + var_312 = var_334; + var_323 = var_323; + var_351 = var_351; + } + } + try + { + --var_298; + if (var_352) + { + var_351 = var_353; + var_353 = var_351; + var_62 = var_62; + var_353 = false; + var_354 = ((char)((short)var_354))>>>var_277; + } + else + { + var_323 = -var_323; + int index_355 = var_315&array_343.length-1; + int index_356 = ((byte)var_357)&array_343[index_355].length-1; + array_343[index_355][index_356] = var_263; + int index_358 = ((short)((byte)var_263))&array_58.length-1; + int index_359 = (((short)var_360)>>>var_62)&array_58[index_358].length-1; + int index_361 = index_356&array_58[index_358][index_359].length-1; + array_58[index_358][index_359][index_361] = index_355; + } + var_277++; + for (int id_362 = 9;id_362<85;id_362 += 8) + { + var_277 = (short)var_363; + var_277 = var_62; + var_60 = var_357; + var_363 = var_277+((var_64>>>var_312)-(var_277&var_62)); + int index_364 = ((byte)var_60)&array_58.length-1; + int index_365 = var_334&array_58[index_364].length-1; + int index_366 = index_364&array_58[index_364][index_365].length-1; + var_259 = "65`s1\\mI26"+array_58[index_364][index_365][index_366]; + } + } + catch (Exception e_2) + { + var_259 = var_259; + ++var_62; + --var_314; + System.out.println( "=======Exception thrown======="+16); + } + finally + { + if (var_367&var_367) + { + var_334 = var_368; + int index_369 = ((byte)var_370)&array_58.length-1; + int index_371 = index_369&array_58[index_369].length-1; + int index_372 = var_373&array_58[index_369][index_371].length-1; + int index_374 = ((char)var_298)&array_58.length-1; + int index_375 = var_373&array_58[index_374].length-1; + int index_376 = var_368&array_58[index_374][index_375].length-1; + index_371 = array_58[index_374][index_375][index_376]; + } + else + { + int index_378 = (var_373/(1|(-1838057813)))&array_377.length-1; + int index_379 = ((char)var_60)&array_377[index_378].length-1; + array_377[index_378][index_379] = var_264; + } + var_349 = var_363; + try + { + double var_380 = 6.623941887889807E8d; + var_259 = (var_259+var_360)+(((byte)var_275)+var_380); + var_373 = var_373; + } + catch (Exception e_3) + { + var_336 = var_336; + var_62 = var_322; + var_64 = (-122); + var_277 = var_322; + var_363 = var_363; + System.out.println( "=======Exception thrown======="+17); + } + int index_381 = var_277&array_58.length-1; + int index_382 = var_368&array_58[index_381].length-1; + int index_383 = ((byte)index_382)&array_58[index_381][index_382].length-1; + array_58[index_381][index_382][index_383] = var_373; + } + for (int id_384 = 11;id_384<70;id_384 += 30) + { + var_357--; + ++var_373; + var_323 = var_360; + } + --var_334; + int index_385 = var_322&array_267.length-1; + int index_386 = '"'&array_267[index_385].length-1; + array_267[index_385][index_386] = true; + } + catch (Exception e_1) + { + if (((short)( -var_349))==var_62) + { + ++var_368; + var_62 = (short)((short)var_360); + var_360 = var_360; + } + int index_388 = ((char)var_363)&array_387.length-1; + int index_389 = var_357&array_387[index_388].length-1; + int index_390 = (-90)&array_387.length-1; + int index_391 = (((byte)var_315)>>>((short)var_64))&array_387[index_390].length-1; + if (array_387[index_390][index_391]) + { + var_277--; + ++var_277; + for (int id_392 = 51;id_392>31;id_392 -= 3) + { + var_393 = var_360; + int index_394 = ((char)var_315)&array_58.length-1; + int index_395 = var_312&array_58[index_394].length-1; + int index_396 = 1239381015&array_58[index_394][index_395].length-1; + array_58[index_394][index_395][index_396] = ((char)((byte)var_349))>>>var_312; + var_323 = var_315/(1|var_64); + } + int index_398 = var_277&array_343.length-1; + int index_399 = ((char)((short)var_368))&array_343[index_398].length-1; + int index_397 = ((byte)array_343[index_398][index_399])&array_350.length-1; + int index_400 = ((short)((short)var_370))&array_350[index_397].length-1; + byte var_402 = (-24); + int index_401 = var_402&array_350[index_397][index_400].length-1; + int index_403 = ((char)((char)var_323))&array_350.length-1; + int index_404 = ((char)((byte)var_405))&array_350[index_403].length-1; + int index_406 = (((char)3.85197248E8f)^17228)&array_350[index_403][index_404].length-1; + var_335 = array_350[index_403][index_404][index_406]; + } + else + { + array_407 = array_407; + --var_357; + var_408++; + --var_275; + --var_409; + } + System.out.println( "=======Exception thrown======="+18); + } + return (byte)var_360; + } +} +// DEPENDENCE: CrcCheckwithChar.java CrcCheckForObject.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/langfuzz/375_2019091603087/CrcCheckForObject.java b/test/testsuite/fuzz_test/langfuzz/375_2019091603087/CrcCheckForObject.java new file mode 100644 index 0000000000000000000000000000000000000000..1c164f2d1a9caca562d3eb44b3f30a9f56805b7b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/375_2019091603087/CrcCheckForObject.java @@ -0,0 +1,669 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.annotation.Annotation; +import java.io.*; +import java.lang.reflect.*; +import java.util.*; +public class CrcCheckForObject { + /** + * 执行反射方法后返回可观测值,打印到标准输出流 + *

+ * param result1 执行反射方法后返回的Object类型 param method 执行反射需调用的方法 param instance + * 方法调用的对象 param parameters 方法调用的参数列表 return null + */ + private static boolean showDebug = false; + public static int length = 0; + private static List resultlist = new LinkedList<>(); + private static List foundationtypes = new ArrayList<>(); + //apifuzz的whitelist.txt,現在不從文件里讀了 + private static ArrayList whitelist = new ArrayList(Arrays.asList("static final boolean java.util.concurrent.atomic.AtomicLong.VM_SUPPORTS_LONG_CAS", + "java.lang.reflect.AccessibleObject.override", + "private final int java.lang.ThreadLocal.threadLocalHashCode", + "private static java.util.concurrent.atomic.AtomicInteger java.lang.ThreadLocal.nextHashCode", + "int java.lang.ThreadGroup.nthreads", + "private static long java.lang.Thread.threadSeqNumber", + "private long java.lang.Thread.tid", + "private static final long java.util.concurrent.locks.ReentrantReadWriteLock.TID", + "transient java.util.Set java.util.HashMap.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private final long libcore.util.NativeAllocationRegistry.freeFunction", + "private transient long java.math.BigInt.bignum", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.io.File.PREFIX_LENGTH_OFFSET", + "private static final long java.util.concurrent.locks.StampedLock.WSTATUS", + "private static final long java.util.concurrent.locks.StampedLock.WTAIL", + "private static final long java.util.concurrent.locks.StampedLock.STATE", + "private static final long java.util.concurrent.locks.StampedLock.PARKBLOCKER", + "private static final long java.util.concurrent.locks.StampedLock.WNEXT", + "private final long java.util.SplittableRandom.gamma", + "private volatile long java.util.concurrent.atomic.AtomicLong.value", + "private static final java.util.concurrent.atomic.AtomicLong java.util.SplittableRandom.defaultGen", + "private long java.util.SplittableRandom.seed", + "private static final int java.util.concurrent.Exchanger.ABASE", + "private static final long java.util.concurrent.Exchanger.BLOCKER", + "private static final long java.util.concurrent.Exchanger.MATCH", + "private static final long java.util.concurrent.Exchanger.BOUND", + "private transient long java.util.Date.fastTime", + "private transient sun.util.calendar.BaseCalendar$Date java.util.Date.cdate", + "private final java.util.Date java.util.logging.SimpleFormatter.dat", + "private transient int java.lang.Object.shadow$_monitor_", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "private int java.io.BufferedWriter.nextChar", + "private int java.lang.StackTraceElement.lineNumber", + "private java.lang.String java.lang.StackTraceElement.methodName", + "private static final long java.lang.StackTraceElement.serialVersionUID", + "private java.lang.ClassLoader java.lang.Thread.contextClassLoader", + "private static volatile java.lang.Thread$UncaughtExceptionHandler java.lang.Thread.uncaughtExceptionPreHandler ", + "private static final long java.util.concurrent.ConcurrentHashMap.CELLSBUSY", + "private static final long java.util.concurrent.ConcurrentHashMap.SIZECTL", + "private static final long java.util.concurrent.ConcurrentHashMap.TRANSFERINDEX", + "private static final long java.util.concurrent.ConcurrentHashMap.BASECOUNT", + "private volatile long java.util.zip.ZStreamRef.address", + "private static final long java.util.concurrent.PriorityBlockingQueue.ALLOCATIONSPINLOCK", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.lang.String java.util.Locale.languageTag", + "private transient volatile int java.util.Locale.hashCodeValue", + "private static volatile java.util.Locale java.util.Locale.defaultDisplayLocale", + "private static final long java.util.concurrent.LinkedTransferQueue.TAIL", + "private static final long java.util.concurrent.LinkedTransferQueue.SWEEPVOTES", + "private static final long java.util.concurrent.ForkJoinPool.RUNSTATE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.NEXT", + "private static final long java.util.concurrent.SynchronousQueue$TransferQueue$QNode.ITEM", + "transient java.util.Set java.util.HashMap.entrySet", + "private transient int java.lang.Object.shadow$_monitor_", + "private transient java.util.TreeMap$KeySet java.util.TreeMap.navigableKeySet", + "private transient volatile java.util.Set java.util.Hashtable.entrySet", + "private static java.lang.Throwable[] java.lang.Throwable.EMPTY_THROWABLE_ARRAY", + "private volatile long java.lang.Thread.nativePeer", + "java.lang.ThreadLocal$ThreadLocalMap java.lang.Thread.threadLocals", + "private static final int java.util.concurrent.ConcurrentHashMap.ABASE", + "private static final int java.util.concurrent.ForkJoinPool.ABASE", + "private static final long java.util.concurrent.ForkJoinPool.CTL", + "private static final java.util.concurrent.atomic.AtomicLong java.util.Random.seedUniquifier", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed, private static final long java.util.Random.seedOffset", + "private static final long java.util.concurrent.Exchanger.SLOT", + "private static final long java.util.concurrent.locks.StampedLock.WHEAD", + "transient int java.util.HashMap.size", + "transient int java.util.HashMap.modCount", + "private static final long java.util.Random.seedOffset", + "boolean java.lang.reflect.AccessibleObject.override", + "private final java.util.concurrent.atomic.AtomicLong java.util.Random.seed", + "private java.lang.String java.lang.StackTraceElement.fileName", + "private java.lang.String java.lang.StackTraceElement.declaringClass", + "private transient java.lang.Object java.lang.Class.vtable", + "private transient java.lang.Class java.lang.Class.superClass", + "private transient java.lang.String java.lang.Class.name", + "private final java.lang.Class java.lang.reflect.Constructor.serializationClass", + "private transient dalvik.system.ClassExt java.lang.Class.extData", + "private transient long java.util.regex.Pattern.address", + "private transient volatile java.lang.Object java.lang.Throwable.backtrace", + "private transient java.lang.Object java.lang.Class.dexCache", + "private transient java.lang.ClassLoader java.lang.Class.classLoader", + "private transient java.lang.Class java.lang.Class.componentType", + "private transient long java.lang.Class.sFields", + "private transient int java.lang.Class.referenceInstanceOffsets", + "private transient int java.lang.Class.primitiveType", + "private transient int java.lang.Class.objectSizeAllocFastPath", + "private transient int java.lang.Class.objectSize", + "private transient int java.lang.Class.numReferenceStaticFields", + "private transient int java.lang.Class.numReferenceInstanceFields", + "private transient long java.lang.Class.methods", + "private transient java.lang.Object[] java.lang.Class.ifTable", + "private transient long java.lang.Class.iFields", + "private transient volatile int java.lang.Class.dexTypeIndex", + "private transient int java.lang.Class.dexClassDefIndex", + "private transient short java.lang.Class.copiedMethodsOffset", + "private transient int java.lang.Class.clinitThreadId", + "private transient int java.lang.Class.classSize", + "private transient int java.lang.Class.classFlags", + "private transient int java.lang.Class.accessFlags", + "private java.lang.Class java.lang.reflect.Field.declaringClass", + "private final java.lang.Class java.lang.reflect.Constructor.serializationCtor", + "private transient int java.lang.Class.status", + "private transient short java.lang.Class.virtualMethodsOffset", + "private int java.lang.reflect.Field.dexFieldIndex ", + "private int java.lang.reflect.Field.offset", + "private int java.lang.reflect.Field.accessFlags", + "private int fuzzapiinvoke.getInstance.ObjectNewInstance$MyThread1.ticket", + "private long java.util.regex.Matcher.address", + "transient long java.util.regex.Pattern.address", + "private int java.lang.reflect.Field.dexFieldIndex", + "private char[] java.io.BufferedWriter.cb", + "private java.lang.Class java.lang.reflect.Field.type" + )); + private static String[] ss = {"class java.lang.Character","class java.lang.Integer", + "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", + "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", + "class java.lang.Byte", "class java.lang.String", "class java.lang.StringBuffer", + "class java.lang.Character$UnicodeBlock", "class java.util.Locale", + "class java.lang.StringBuilder", "class [I", "class [S", "class [J", "class [F", "class [D", + "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", + "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", + "class [Ljava.lang.StringBuilder;"}; // 该数组存放此类可以处理用于计算CRC的数据类型 + private static ArrayList dealtypes = new ArrayList(); + + //輸出每個Object單獨的CRC值 + public static List CRCListForObjects(Object... results) { + List finalres = new ArrayList<>(); + for (Object result1: results) { + try { + if (showDebug) { + System.out.println("============================== CRCcheck(Param info) =============================="); + System.out.println("| result: "+result1); + System.out.println("==================================================================================="); + } + + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + finalres.add(run(obj)); // used to be "result1", solve the problem of object-array + } else { + finalres.add(1000000000L); + } + } + } else { + finalres.add(run(result1)); // resultthreadgroup is object} + } + } else { + // result1 is null + finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + return null; + } + } + return finalres; + } + + //輸出Object數組總的CRC值 + public static long totalCRCForObjects(boolean showFieldInfo, Object... results){ + showDebug = showFieldInfo; + initialize(); + for (Object result1: results) { + try { + if (result1 != null) { // resultthreadgroup isnot null, might be(object object[]) + if (result1.getClass().toString().startsWith("class [L") || result1.getClass().toString().startsWith("[L")) { // resultthreadgroup is object[] + for (Object obj : (Object[]) result1) { + if (obj != null) { + calculatecrc(obj); + } else { +// finalres.add(1000000000L); + } + } + } else { + calculatecrc(result1); + } + } else { + // result1 is null +// finalres.add(1000000000L); + } + } catch (Exception e) { + e.printStackTrace(System.out); + System.exit(234); + } + } + return getCRC(); + } + + public static long run(Object obj) throws Exception { + initialize(); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< START GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + calculatecrc(obj); + //System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< END GetDeclaredFields >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + return getCRC(); + } + private static void initialize(){ + Collections.addAll(dealtypes, ss); + String[] strings = {"class java.lang.Character","class java.lang.Integer", "class java.lang.Short", "class java.lang.Long", "class java.lang.Float", "class java.lang.Double", "class java.lang.Char", "class java.lang.Boolean", "class java.lang.Byte"}; + Collections.addAll(foundationtypes, strings); + resultlist.clear(); + } + + private static void calculatecrc(Object result) throws Exception { + // deal with Object + if(result != null){ + String resulttype = result.getClass().toString(); + // deal with the problem of class StringBuilder, StringBuffer and String + // we can`t get the specific fields we wanted, cast these to string by toString + if(resulttype.equals("class java.lang.String") || + resulttype.equals("class java.lang.StringBuilder") || + resulttype.equals("class java.lang.StringBuffer") || + resulttype.equals("class java.lang.Character$UnicodeBlock") || + resulttype.equals("class java.util.Locale") || result instanceof Annotation){ + String ostring = result.toString(); + byte[] bytes = ostring.getBytes("UTF-8"); + calculatecrc(bytes); + return; + } + if (foundationtypes.contains(result.getClass().toString())){ + // if basic types: + resultlist.add(result); + switch (result.getClass().toString()) { + case "class java.lang.Byte": + length += 1; + break; + case "class java.lang.Short": + length += 2; + break; + case "class java.lang.Integer": + length += 4; + break; + case "class java.lang.Long": + length += 8; + break; + case "class java.lang.Float": + length += 4; + break; + case "class java.lang.Double": + length += 8; + break; + case "class java.lang.Char": + length += 2; + break; + case "class java.lang.Character": + length += 2; + break; + case "class java.lang.Boolean": + length += 1; + break;} + } else if(resulttype.startsWith("class [")) { + // array(contains multidimensional array) + if ("class [I".equals(resulttype)) { + //int[] + int[] intparam = (int[]) result; + for (int i : intparam) { + resultlist.add(i); + length += 4; + } + } else if ("class [S".equals(resulttype)) { + //short[] + short[] shortparam = (short[]) result; + for (short s : shortparam) { + resultlist.add(s); + length += 2; + } + } else if ("class [J".equals(resulttype)) { + //long[] + long[] longparam = (long[]) result; + for (long l : longparam) { + resultlist.add(l); + length += 8; + } + } else if ("class [F".equals(resulttype)) { + //float[] + float[] floatparam = (float[]) result; + for (float f : floatparam) { + resultlist.add(f); + length += 4; + } + } else if ("class [D".equals(resulttype)) { + //double[] + double[] doubleparam = (double[]) result; + for (double d : doubleparam) { + resultlist.add(d); + length += 8; + } + } else if ("class [Z".equals(resulttype)) { + //boolean[] + boolean[] booleanparam = (boolean[]) result; + for (boolean b : booleanparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [B".equals(resulttype)) { + //byte[] + byte[] byteparam = (byte[]) result; + for (byte b : byteparam) { + resultlist.add(b); + length += 1; + } + } else if ("class [C".equals(resulttype)) { + //char[] + char[] charparam = (char[]) result; + for (char c : charparam) { + resultlist.add(c); + length += 2; + } + } else if ("class [Ljava.lang.Character;".equals(resulttype)) { + // Character[] + Character[] charparam = (Character[]) result; + for (Character c : charparam) { + resultlist.add((char)c); + length += 2; + } + }else if (resulttype.startsWith("class [[")){ + // 多维数组,降维 + for (Object o: (Object[]) result){ + calculatecrc(o); + } + }else if (resulttype.equals("[Ljava.lang.String")){ + // string类型的数组 + for(String s:(String[]) result){ + calculatecrc(s); + } + + } + else if(resulttype.startsWith("class [L")){ + // 非基础类型数组 + for(Object o:(Object[])result){ + calculatecrc(o); + } + } + }else{ + // 该分支处理非基础类型对象, 先获取对象下指定层数的域和值,将最终结果中可用于计算CRC校验的值作为参数递归调用本方法 + // 首先取得首次传入的实例的域,若域的值可直接用于(包括基础类型和在本方法中特殊处理的其他类型)CRC计算,则不进入下一次获取域的循环 + // 最终获取的域和对应的值都有序的存放在getfaieldvalue()返回的map中 + // 接着对map进行遍历获取其中的值如若是本方法除此分支之外的其他分支可处理的类型则以value为参数递归调用,否则只将其输出在运行日志中 + //System.out.println("```````````````````````````get field`````````````````````````````````````````````"); + Mapmap = getFieldValue(result, 3); + //System.out.println("`````````````````````````get field end```````````````````````````````````````````"); + for(Map.Entry entry: map.entrySet()) { + Field key = entry.getKey(); + Object value = entry.getValue(); + //当field为基础类型或者string stringbu*** character数组时将数组信息打印出来 + String[] basicarray = new String[]{"class [I", "class [S", "class [J", "class [F", "class [D", "class [Z", "class [B", "class [C", "class [Ljava.lang.Character;", "class [Ljava.lang.String;", "class [Ljava.lang.StringBuffer;", "class [Ljava.lang.StringBuilder;"}; + List basiclist = Arrays.asList(basicarray); + if(showDebug) { + if (basiclist.contains(key.getType().toString())) { + String str = key.getType().toString(); + switch (str) { + case "class [I": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((int[]) value)); + break; + case "class [S": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((short[]) value)); + break; + case "class [J": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((long[]) value)); + break; + case "class [F": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((float[]) value)); + break; + case "class [D": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((double[]) value)); + break; + case "class [Z": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((boolean[]) value)); + break; + case "class [B": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((byte[]) value)); + break; + case "class [C": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((char[]) value)); + break; + case "class [Ljava.lang.Character;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((Character[]) value)); + break; + case "class [Ljava.lang.String;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((String[]) value)); + break; + case "class [Ljava.lang.StringBuffer;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuffer[]) value)); + break; + case "class [Ljava.lang.StringBuilder;": + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.toString((StringBuilder[]) value)); + break; + } + } else if (key.getType().toString().contains("[[")) { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + Arrays.deepToString((Object[]) value)); + } else { + System.out.println("< Which Field: >" + key + "; < Field's Value: >" + value); + } + } + + if(value != null && dealtypes.contains(value.getClass().toString())){ + if(!whitelist.contains(key.toString())){ + // 如果为基础类型或者需要特殊处理的object类型且没在whitelist中则再次调用本身,否则只在控制台打印出来对象信息 + calculatecrc(value); + } + } + } + } + } + } + /* + 接受object类型参数,向下获取实例类的域两次 + : reutrn 返回包含域对象和对应的value的键值对的map + */ + private static Map getFieldValue(java.lang.Object obj, int length){ + Map map = new LinkedHashMap<>(); + Field[] rootf = obj.getClass().getDeclaredFields(); + //sort + rootf = CrcCheckForObject.sortFieldArray(rootf); + if(rootf == null){ + return map; + } + List cur_objs = new ArrayList<>(); + List next_objs = new ArrayList<>(); + // 先获取传入参数的域和对应的值, 放入map中, value 放入 cur_objs中 + //System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^root field : value^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); + for(Field f: rootf){ + if(whitelist.contains(f.toString())){ + continue; + } + //System.out.println("< which field: >" + f.toString()); + f.setAccessible(true); + java.lang.Object o; + try { + o = f.get(obj); + map.put(f,o); + } catch (IllegalAccessException e) { + o = null; + map.put(f, null); + } + next_objs.add(o); + //System.out.println("< field value: >" + o); + } + //System.out.println("------------------------------root end------------------------------------"); + while( length > 1){ + cur_objs.clear(); + cur_objs.addAll(next_objs); + next_objs.clear(); + for(Object o:cur_objs){ + if(o == null ){ + continue; + } + if(dealtypes.contains(o.getClass().toString())){ + //如果为基础类型则不向下获取实例的域 + continue; + } + Field[] fs = o.getClass().getDeclaredFields(); + fs = sortFieldArray(fs); + if(fs == null){ + continue; + } + for(Field fi: fs){ + + //System.out.println("< which field: >" + fi.toString()); + if(whitelist.contains(fi.toString())){ + continue; + } + fi.setAccessible(true); + Object oc; + try{ + oc = fi.get(o); + }catch(IllegalAccessException e){ + oc = null; + } + //System.out.println("< field value: >" + oc); + + map.put(fi, oc); + next_objs.add(oc); + } + } + length -= 1; + } + + return map; + } + + private static long getCRC () { + CrcBuffer b = new CrcBuffer(length); + for (Object obj:resultlist){ + if (obj.getClass().toString().equals("class java.lang.Byte")) { + CrcCheckwithChar.ToByteArray((byte) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Short")) { + CrcCheckwithChar.ToByteArray((short) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Integer")) { + CrcCheckwithChar.ToByteArray((int) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Long")) { + CrcCheckwithChar.ToByteArray((long) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Float")) { + CrcCheckwithChar.ToByteArray((float) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Double")) { + CrcCheckwithChar.ToByteArray((double) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Boolean")) { + CrcCheckwithChar.ToByteArray((boolean) obj, b); + } else if (obj.getClass().toString().equals("class java.lang.Character")) { + CrcCheckwithChar.ToByteArray((char) obj, b); + } + } + CRC32 c = new CRC32(); + c.update(b.buffer, 0, b.i); + return c.getValue(); + } + + /** + * 进行Field[]排序 + */ + public static Field[] sortFieldArray (Field[] fields){ + if (fields == null || fields.length == 0) { + return null; + } + List flist = Arrays.asList(fields); + Collections.sort(flist, new FieldComparator()); + + return (Field[]) flist.toArray(); + } +} +/* + * sort the field array by field`s name + * + * */ +class FieldComparator implements Comparator{ + @Override + public int compare(Field f1, Field f2){ + return (f1.toString()).compareTo(f2.toString()); + } + +} + + +class CRC32 { + byte[] buffer; + int crc ; + public void CRC32() { + this.buffer = null; + } + + + public void update(byte[] b, int off, int len) { + + this.buffer = new byte[len]; + for (int i = 0; i < len; i++) { + this.buffer[i] = b[i + off]; + } + + } + + private int getCrcByLookupTable() { + + int[] table = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + + int crc = 0xFFFFFFFF; + for (byte b : this.buffer) { + crc = table[(crc ^ b) & 0xFF] ^ (crc >>> 8); + } + return crc ^ 0xFFFFFFFF; + } + + + public int getCrcByCalculation() { + + int poly = 0xEDB88320; + int crc = 0xFFFFFFFF; + + for (byte b : this.buffer) { + int value = (crc ^ b) & 0xFF; + for (int i = 0; i < 8; i++) { + if (1 == (value & 1)) { + value = (value >>> 1) ^ poly; + } else { + value = value >>> 1; + } + } + crc = (crc >>> 8) ^ value; + } + return crc ^ 0xFFFFFFFF; + } + + public long getValue() { + int crcTable = getCrcByLookupTable(); + /* + int crcCal = getCrcByCalculation(); + if( crcCal != crcTable) { + System.err.printf(" +Fail to Get CRC! + Calculation=%d LookupTable=%d +",crcCal,crcValue); + System.exit(2); + } + */ + return (long) crcTable & 0xffffffffL; + } + +} diff --git a/test/testsuite/fuzz_test/langfuzz/375_2019091603087/CrcCheckwithChar.java b/test/testsuite/fuzz_test/langfuzz/375_2019091603087/CrcCheckwithChar.java new file mode 100644 index 0000000000000000000000000000000000000000..6b2e64a2d7f8dbf3f7513433b8de5fd9032cd52b --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/375_2019091603087/CrcCheckwithChar.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +import java.lang.Double; + +class CrcBuffer { + int i = 0; + static int buffer_counter = 0; + byte[] buffer; + + CrcBuffer(int size) { + this.buffer = new byte[size]; + buffer_counter++; + //System.out.printf("Buffer-Counter=%d\tLength=%d\n", buffer_counter, size); + } +} + +public class CrcCheckwithChar { + /**************************************************************/ + static boolean isVerbose = false; + + public static void ToByteArray(char args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(byte args, CrcBuffer b) { + b.buffer[b.i] = args; + b.i++; + } + + public static void ToByteArray(short args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(int args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(long args, CrcBuffer b) { + b.buffer[b.i] = (byte) ((args >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((args >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (args & 0xff); + b.i++; + } + + public static void ToByteArray(boolean args, CrcBuffer b) { + if (args) { + b.buffer[b.i] = 0x01; + } else { + b.buffer[b.i] = 0x00; + } + b.i++; + } + + public static void ToByteArray(float args, CrcBuffer b) { + int iargs = Float.floatToIntBits(args); + b.buffer[b.i] = (byte) ((iargs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((iargs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (iargs & 0xff); + b.i++; + } + + public static void ToByteArray(double args, CrcBuffer b) { + long largs = Double.doubleToLongBits(args); + b.buffer[b.i] = (byte) ((largs >> 56) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 48) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 40) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 32) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 24) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 16) & 0xff); + b.i++; + b.buffer[b.i] = (byte) ((largs >> 8) & 0xff); + b.i++; + b.buffer[b.i] = (byte) (largs & 0xff); + b.i++; + } +} diff --git a/test/testsuite/fuzz_test/langfuzz/375_2019091603087/Start.java b/test/testsuite/fuzz_test/langfuzz/375_2019091603087/Start.java new file mode 100644 index 0000000000000000000000000000000000000000..a39ea9f78af4e8ede206d533a1d08e084349c625 --- /dev/null +++ b/test/testsuite/fuzz_test/langfuzz/375_2019091603087/Start.java @@ -0,0 +1,2181 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ + +// this is a test!!!!!!! +// seed : 1568086531411 +import java.util.*; +public class Start +{ + private static MainClass var_933 = new MainClass(); + public static void getCheckSum() + { + System.out.println( "=======getCheckSum======="); + long crc = CrcCheckForObject.totalCRCForObjects(false, var_933, new Class_3(), new Class_4(), new Class_5(), new Class_6(), new Class_7(), new Class_8(), new Class_9()); + System.out.println("CheckSum:"+crc); + } + public static void main(String[] args_0) + { + System.out.printf("FIGO-FUZZ-START-FLAG\n"); + var_933.run(); + getCheckSum(); + //这是一个空语句 + } +} +class MainClass +{ + protected static short var_1 = 8035; + static char var_12 = '='; + protected static Class_3 var_275 = new Class_3(); + private static Class_5 var_371 = new Class_5(); + private static Class_8 var_465 = new Class_8(); + private static String var_467 = "*>j#>A\\obB"; + protected static Class_6 var_468 = new Class_6(); + public static byte var_469 = 33; + protected static String[][] array_472 = new String[][]{{"r?~F2tZ*50","CdJ/r#G|Le"},{"L7Tk|bQ1zE","*f~DNR$~V^","X[2?b]7Px`","OE0~m9EE@)",":X]7Vp;f.!","BmPptS'\\wj"},{"@~hHFv60dK","GvXfV'EbjI","yTnV~I'oX*"},{">qKwzvxMC%","2K_6L7YIP!"},{"y~>afT`HK|","!$eELox(4(","w~MR[j`2/(","!SZ~nZaR8>"}}; + public static char var_488 = 'o'; + private static int var_493 = (-1677525601); + static boolean var_494 = false; + static Class_9 var_548 = new Class_9(); + protected static long var_549 = (-5620893980551989230L); + protected static boolean var_557 = true; + static float var_559 = 4.07663872E8f; + public static char var_560 = '"'; + protected static double var_561 = (-8.792550602730278E8d); + public static char[][][] array_563 = new char[][][]{{{'%','a'},{'6','G','N','4'},{'~','x','l'}},{{'3','m'},{'6','f'},{'q','@','H'},{'u','1','D','+','v','d'}}}; + private static byte var_568 = (-51); + private static double[] array_572 = new double[]{1.8194721019109156E9d,2.2551100994690856E8d,4.500602116314226E8d,(-1.3531531054813883E8d)}; + private static short var_582 = (-26399); + protected static String var_583 = "/EL\"nUg/NK"; + static String var_584 = "U?\"y=:t,rm"; + public static boolean[][][] array_592 = new boolean[][][]{{{false,false,true,false},{true,true,true,false,true},{true}},{{true,true,false,true,false},{false,true,true},{true,false,false}},{{true,false,true,false},{true,true,false,false,false,false},{true,true,false,false,true,true,false}},{{false,false,true,true,false,true},{false,false,false,false,false},{true,true,true,false,true,true},{false,true},{false,true,false,true,false,false},{false,false,false},{false}},{{true,false,false,true},{false,true,true,false,false},{false,false},{false,false},{false,false,false,false},{false,false,true,false}}}; + protected static byte var_600 = 10; + static byte var_607 = 74; + static short var_608 = 13732; + private static Class_7 var_611 = new Class_7(); + private static int var_619 = (-1361393966); + protected static float var_622 = 4.40381888E8f; + private static boolean var_628 = true; + static int var_629 = 2014574950; + static char var_631 = 'V'; + protected static long[][][] array_632 = new long[][][]{{{(-6855126634003095957L)},{(-4233125100675314730L),(-6896725396906551713L),6298440926216653140L}},{{4782079038854912256L,3032637908918313965L,(-3764291468195405857L)},{(-6909023306131478720L),1115213706892586763L,5788045668628300617L,(-4785378377202002766L),3143762780067249892L}},{{(-1863605850178195678L),3343476145657070690L,1737273096847823263L,(-8152305588002253068L)},{(-8512811452464285898L)},{7758312274214187097L,3445297139582856417L,(-5704379741506636782L),3208541269972651584L},{4049110016935279835L,7765625067249439322L,(-8438703603865489749L),1630237652417174543L},{(-8687938833618706789L),(-581175792655197538L),3740852123023270355L,1375000673898591977L,6146164489693422474L},{(-943143754044889418L),(-9143333626905410443L),4685163074437519626L,(-7198583350956830546L),7055758322584797458L,(-6841394763597883967L)}},{{5816805028214169927L,1443195390934954292L,(-8364622839983892827L),1523175279554756726L},{6509556987272299296L,875678463407124433L,(-6005709944251746881L)},{2056211971153588478L,4723677279067916075L,4897823415976566976L,(-8333476869153602411L)},{8484774085637609103L,(-7941163677758099473L),(-4047344022863970646L),(-7962731987627168009L),(-3466269973599746689L),7541388301643455042L},{(-6041494641472608890L),(-5126610516726003024L),6026811625179783154L,5787791535737204656L},{(-9157678765242977431L),(-3887534308793755013L),5190342143958341214L,(-4919470608369884514L),(-1276968449692494707L)},{(-2768764487333989192L),6595489524714122532L}}}; + static char var_640 = '7'; + protected static long var_641 = 579391625302583812L; + protected static boolean[][] array_642 = new boolean[][]{{false,false,false,true,false},{false,true,false},{false,true,true}}; + protected static short var_653 = 6234; + private static char var_670 = '.'; + private static char var_671 = 'U'; + private static byte var_672 = (-70); + public static boolean var_673 = true; + protected static char var_678 = 'T'; + static char var_680 = '5'; + public static int[] array_681 = new int[]{853142174,(-1856894361),(-780984576),(-411251864)}; + static boolean var_687 = true; + public static char[][][] array_688 = new char[][][]{{{')','s','=','J'},{'l','!',' ',''},{'u','a'},{'L',')','E'}},{{' '}},{{'7','l'},{'Y','7','U',' ','/','d'}}}; + private static byte var_693 = (-125); + protected static double var_695 = (-1.1113394885392529E8d); + public static byte var_696 = 102; + private static char var_699 = '\\'; + public static short var_701 = (-12566); + static char[][] array_710 = new char[][]{{'C','('},{'U'}}; + public static boolean[] array_715 = new boolean[]{false,false,true,false,true}; + public static char var_831 = 'e'; + public static String[][] array_832 = new String[][]{{"dS*lFO$0cj","rPiN]||27G","Rjdl,@j9G","76t1r.$2g&"},{"\"3ly<&P@hI","|!]:$5BE_AI!","M`HcP+kVa_","sf'M1@!J t","NRv�t1lm","rwk6AIS+\\"}}; + private static byte var_833 = (-67); + public static String var_841 = "k<#='uh|Z["; + protected static char[][] array_842 = new char[][]{{'.','t','+','b','2'},{'D','X','X',';',';'},{'A','4'},{'9','X'}}; + public static float var_843 = 8.1303501E8f; + protected static short var_850 = 22944; + protected static float var_852 = 1.11423552E8f; + protected static short var_854 = 14339; + public static boolean var_859 = true; + private static char var_860 = 'e'; + private static char var_866 = '~'; + public static boolean var_869 = false; + public static char var_872 = 'o'; + protected static byte var_879 = (-27); + static char var_883 = '['; + private static String[][] array_887 = new String[][]{{"\\'C&VzQ*''","W-vGE~ 8g!"},{"yH[3b|]BU.","CFvv$l[JI`",">8?28!*>_H","01QhX/\"Pv"},{".(D'N$x<-D","leaT;~chg","cH^]o]M6*x"}}; + static boolean[][] array_890 = new boolean[][]{{false},{true,false,true,true},{true,false,true,true,false},{false,true,false,true,false,false},{false,false,true},{false,true,true,true,true,true}}; + private static boolean var_895 = true; + protected static short var_899 = (-3409); + private static boolean var_904 = true; + public static int var_905 = 1904650315; + private static boolean var_913 = false; + static byte var_919 = (-124); + public static int[] array_924 = new int[]{813409762}; + public static int var_928 = (-263523783); + public String func_18(char args_551, double args_552, char args_553, boolean[][] args_554, char args_555, String[][] args_556) + { + short var_571 = (-8191); + if (var_557) + { + var_493 = ((char)var_549)/(1|var_469); + char var_562 = 't'; + for (int id_558 = 71;id_558>25;id_558 -= 16) + { + var_559 = var_559; + var_467 = "sCg;gf5J%4"; + if (var_560>=var_561) + { + var_562 = var_562; + int index_564 = var_1&array_563.length-1; + int index_565 = index_564&array_563[index_564].length-1; + int index_566 = var_469&array_563[index_564][index_565].length-1; + int index_567 = var_568&array_563.length-1; + int index_569 = ((char)((char)var_561))&array_563[index_567].length-1; + int index_570 = var_571&array_563[index_567][index_569].length-1; + var_560 = array_563[index_567][index_569][index_570]; + } + else + { + var_559 = var_559; + array_572 = array_572; + var_559 = var_559; + var_467 = var_467; + var_469 = (byte)var_571; + var_494 = var_494; + } + } + } + array_572 = array_572; + double[][] array_599 = new double[][]{{1.4450234808566073E8d},{5.217672709494252E8d,1.4278979856512656E9d,(-9.757844908489202E7d),(-517119.46513555065d),5.2459729311821526E8d,(-4.393303175534884E7d)},{(-1.2723546459429867E9d),8.878509206499457E8d,(-1.0366692739861572E8d),(-2.708913782342213E8d),(-3.7726873786177605E7d)}}; + byte var_637 = 58; + try + { + try + { + for (int id_573 = 57;id_573<59;id_573 += 1) + { + int index_574 = var_488&array_563.length-1; + int index_575 = (var_571--)&array_563[index_574].length-1; + int index_576 = var_12&array_563[index_574][index_575].length-1; + int index_577 = ((byte)(var_493%(1|var_571)))&array_563.length-1; + int index_578 = ((char)var_549)&array_563[index_577].length-1; + int index_579 = var_488&array_563[index_577][index_578].length-1; + var_560 = array_563[index_577][index_578][index_579]; + } + var_469 = var_469; + try + { + int index_580 = (var_493|var_1)&array_472.length-1; + int index_581 = (-1534)&array_472[index_580].length-1; + array_472[index_580][index_581] = "[I.#a|;q?)"; + } + catch (Exception e_3) + { + var_559 = var_559; + var_582 = var_582; + var_582 = var_582; + System.out.println( "=======Exception thrown======="+24); + } + var_469++; + } + catch (Exception e_2) + { + var_12--; + var_571 = var_1; + System.out.println( "=======Exception thrown======="+25); + } + finally + { + var_549++; + var_469 = 81; + --var_549; + if (var_469==((byte)(var_493++))) + { + var_583 = var_583+71; + var_568 = (byte)1001085198; + } + else + { + var_584 = var_584; + int index_585 = var_582&array_563.length-1; + int index_587 = var_571&array_563.length-1; + int index_588 = 234747688&array_563[index_587].length-1; + int index_589 = ((short)var_549)&array_563[index_587][index_588].length-1; + int index_586 = array_563[index_587][index_588][index_589]&array_563[index_585].length-1; + int index_590 = ((char)'0')&array_563[index_585][index_586].length-1; + int index_591 = var_560&array_572.length-1; + array_572[index_591] = (-8.770402243795389E7d)*array_563[index_585][index_586][index_590]; + } + var_469--; + } + try + { + ++var_493; + int index_593 = var_568&array_592.length-1; + int index_594 = var_560&array_592[index_593].length-1; + int index_595 = var_12&array_592[index_593][index_594].length-1; + int index_596 = '0'&array_592.length-1; + int index_597 = var_469&array_592[index_596].length-1; + int index_598 = var_568&array_592[index_596][index_597].length-1; + if (array_592[index_596][index_597][index_598]) + { + var_559 = var_12--; + var_12 = var_488; + array_599 = array_599; + var_582 = var_582; + } + else + { + var_600 = (byte)var_559; + var_494 = var_494; + var_582 = 13721; + var_559 = +var_571; + } + } + catch (Exception e_2) + { + ++var_493; + for (int id_601 = 9;id_601<82;id_601 += 8) + { + var_568 = (byte)( -('q'&var_493)); + var_494 = var_494; + var_468 = var_468; + var_584 = var_583; + var_494 = var_494; + } + try + { + int index_602 = var_560&array_472.length-1; + int index_603 = var_560&array_472[index_602].length-1; + var_584 = array_472[index_602][index_603]+var_467; + var_560 = var_12; + int index_604 = var_600&array_472.length-1; + int index_605 = var_488&array_472[index_604].length-1; + String var_606 = "vjJ$E5T~cQ"; + var_606 = array_472[index_604][index_605]+(var_469+var_582); + } + catch (Exception e_3) + { + var_12 = (char)((short)(var_493--)); + var_582 = var_571; + var_469 = var_469; + var_607 = var_607; + var_608 = var_582; + int index_609 = ((char)var_488)&array_472.length-1; + int index_610 = index_609&array_472[index_609].length-1; + array_472[index_609][index_610] = var_467; + System.out.println( "=======Exception thrown======="+27); + } + finally + { + var_493 = var_493; + var_561 = var_561; + var_493 = var_493; + var_611 = var_611; + var_493 = var_493; + int index_612 = (-13862)&array_572.length-1; + array_572[index_612] = var_561; + } + short var_613 = 17649; + var_559 = 17740*(((short)var_613)<<( -var_488)); + System.out.println( "=======Exception thrown======="+27); + } + int index_614 = var_571&array_572.length-1; + array_572[index_614] = +var_561; + var_559 = ((short)((byte)var_600))-var_559; + } + catch (Exception e_1) + { + int var_630 = 257874789; + for (int id_615 = 22;id_615<65;id_615 += 22) + { + try + { + var_493 = var_493; + int index_616 = (-523300681)&array_472.length-1; + int index_617 = var_1&array_472[index_616].length-1; + var_467 = array_472[index_616][index_617]+var_494; + } + catch (Exception e_3) + { + var_1 = var_571; + int var_618 = 1004547313; + var_618 = (-1012111817); + System.out.println( "=======Exception thrown======="+29); + } + finally + { + var_493 = var_619; + var_488 = (char)9.164191548022857E8d; + } + for (int id_620 = 41;id_620<66;id_620 += 26) + { + float var_621 = 4.20594464E8f; + var_622 = var_621; + int index_624 = var_560&array_563.length-1; + int index_625 = var_608&array_563[index_624].length-1; + int index_626 = index_625&array_563[index_624][index_625].length-1; + int index_623 = array_563[index_624][index_625][index_626]&array_572.length-1; + int index_627 = (-53)&array_572.length-1; + var_561 = array_572[index_627]; + } + if (var_628) + { + var_494 = var_494|var_494; + var_467 = var_583+(var_62940;id_667 -= 2) + { + Class_3 var_668 = new Class_3(); + var_668 = new Class_3(); + var_561 = ((char)(-24048))/(1|var_488); + var_640 = var_631; + var_619 = var_619; + } + boolean var_669 = true; + if ((var_561==(var_631*var_622))&var_669) + { + var_622 = var_559; + var_671 = var_670; + } + else + { + var_559 = var_559; + var_568 = var_672; + var_493 = var_493; + } + } + catch (Exception e_2) + { + if (var_673) + { + int index_674 = var_568&array_472.length-1; + int index_675 = ((short)((short)var_568))&array_472[index_674].length-1; + int index_676 = ((short)1.65434982E9f)&array_472.length-1; + int index_677 = var_678&array_472[index_676].length-1; + var_584 = array_472[index_676][index_677]; + } + if (var_679) + { + var_582 = (-15351); + var_371 = var_371; + var_1 = var_608; + var_493 = var_619; + } + else + { + var_680 = (char)((short)'T'); + var_583 = var_583; + } + System.out.println( "=======Exception thrown======="+30); + } + finally + { + var_671 = var_488; + var_494 = var_494; + var_671++; + array_681 = array_681; + for (int id_682 = 67;id_682>33;id_682 -= 4) + { + var_561 = var_561; + var_494 = var_494; + int index_684 = var_568&array_681.length-1; + int index_683 = array_681[index_684]&array_681.length-1; + int index_685 = ((byte)var_469)&array_681.length-1; + index_683 = array_681[index_685]; + } + for (int id_686 = 96;id_686>55;id_686 -= 9) + { + var_494 = var_494; + var_494 = var_494; + } + } + if (var_687) + { + try + { + array_688 = array_563; + var_622 = var_622; + var_494 = var_494&var_494; + } + catch (Exception e_3) + { + var_607 = 127; + int index_689 = var_607&array_632.length-1; + int index_690 = ((byte)var_561)&array_632[index_689].length-1; + int index_691 = index_690&array_632[index_689][index_690].length-1; + var_631 = (char)array_632[index_689][index_690][index_691]; + var_653 = (short)( -(var_629+var_561)); + System.out.println( "=======Exception thrown======="+31); + } + finally + { + var_680 = 'f'; + int index_692 = ((char)((char)var_561))&array_681.length-1; + array_681[index_692] = 1428317662; + var_693 = var_469; + array_694 = array_694; + } + --var_12; + var_561 = var_695; + } + ++var_560; + --var_619; + } + return (short)var_608; + } + private byte func_21(boolean[] args_704, char args_705, double args_706, String args_707, byte args_708, byte[] args_709) + { + var_600 = (byte)var_559; + int index_711 = var_568&array_710.length-1; + int index_712 = (var_670^(var_488+var_582))&array_710[index_711].length-1; + int index_713 = var_670&array_710.length-1; + int index_714 = index_712&array_710[index_713].length-1; + var_678 = array_710[index_713][index_714]; + return (byte)var_600; + } + public byte func_11(double args_280, int args_281, double args_282, String[][] args_283, boolean args_284, String args_285) + { + MainClass var_466 = new MainClass(); + String actualArgs_470 = (var_467+var_469); + char actualArgs_471 = ((char)var_12); + double var_489 = (-3.3333449334383946E7d); + byte actualArgs_490 = var_371.func_16((char)var_488, var_489, (byte)var_469, (short)var_1, (char)var_488, (char)var_488); + char actualArgs_491 = var_468.func_10(actualArgs_470, actualArgs_470, (char)actualArgs_471, array_472, (byte)actualArgs_490, new Class_5()); + float actualArgs_492 = (actualArgs_490--); + String actualArgs_495 = (actualArgs_470+var_494); + short actualArgs_496 = ((short)actualArgs_492); + long[][][] actualArgs_497 = var_465.func_15(var_466, var_467, (char)actualArgs_491, actualArgs_492, var_493, (-689069865)).func_14(var_489, actualArgs_495, (short)actualArgs_496, (byte)var_469, actualArgs_492, (char)actualArgs_471); + byte actualArgs_550 = ((byte)var_549); + char var_643 = '|'; + String actualArgs_644 = func_18((char)actualArgs_491, var_489, (char)actualArgs_491, array_642, (char)var_643, array_472); + boolean actualArgs_645 = (var_494^var_494); + float var_646 = (-3.18820192E8f); + char[][] array_655 = new char[][]{{'S','M','"'},{'L','+','7','K'},{'j','3','W','P'}}; + int actualArgs_656 = func_19(var_583, var_494, var_584, (byte)var_600, array_655, var_646); + int actualArgs_657 = (var_640&(-11118)); + double actualArgs_658 = var_548.func_17((byte)actualArgs_550, actualArgs_644, actualArgs_645, var_646, actualArgs_656, actualArgs_657); + Class_4 var_659 = new Class_4(); + short actualArgs_697 = func_20((byte)var_696, actualArgs_644, actualArgs_645, (byte)var_693, var_622, actualArgs_645); + char actualArgs_698 = ((char)var_695); + String actualArgs_700 = func_18((char)'R', actualArgs_658, (char)var_699, array_642, (char)var_670, array_472); + float actualArgs_702 = (var_701-var_549); + double actualArgs_703 = var_559-var_659.func_8(var_494, var_559, (short)actualArgs_697, (char)actualArgs_698, actualArgs_700, actualArgs_702); + float var_716 = 1.75506944E9f; + char actualArgs_717 = ((char)var_716); + byte actualArgs_718 = ((byte)var_653); + short var_811 = 22681; + byte[] actualArgs_812 = var_659.func_22(var_622, (short)var_811, (short)var_811, var_489, var_489, actualArgs_644); + byte actualArgs_813 = func_21(array_715, (char)actualArgs_717, actualArgs_703, var_583, (byte)actualArgs_718, actualArgs_812); + int index_814 = actualArgs_656&array_472.length-1; + int index_815 = ((byte)((byte)actualArgs_496))&array_472[index_814].length-1; + byte actualArgs_816 = ((byte)var_631); + float actualArgs_817 = var_659.func_8(true, actualArgs_492, (short)var_653, (char)var_631, var_583, actualArgs_492); + int actualArgs_818 = func_19(actualArgs_470, actualArgs_645, array_472[index_814][index_815], (byte)actualArgs_816, new char[][]{{'>','J'},{'<','c','<','c','K'},{'P','~','i','~','|'},{'L',','},{'[','|','6','j'}}, actualArgs_817); + double actualArgs_819 = ( -actualArgs_817); + short actualArgs_820 = var_371.func_9((byte)actualArgs_813, actualArgs_644, actualArgs_818, var_494, actualArgs_819, index_814); + short actualArgs_821 = (short)1.9876432E8f; + var_371.func_13("`/].1;id_19 -= 2) + { + var_12 = var_12; + float var_276 = 3.24694464E8f; + short actualArgs_277 = ((short)((short)var_276)); + double var_278 = 9.493355162886883E8d; + boolean actualArgs_279 = (((char)actualArgs_277)!=((char)var_12)); + int actualArgs_829 = func_19(var_467, var_494, var_584, (byte)var_696, array_828, (-3.5298656E8f)); + int index_830 = var_831&array_572.length-1; + boolean actualArgs_834 = var_275.func_6(var_622, (short)actualArgs_277, var_695, var_494, (byte)var_568, (byte)var_833); + String actualArgs_835 = (var_467+actualArgs_834); + byte actualArgs_836 = func_11(5.615784532928725E8d, actualArgs_829, array_572[index_830], array_832, actualArgs_834, actualArgs_835); + if (var_275.func_6(var_276, (short)actualArgs_277, var_278, actualArgs_279, (byte)(-33), (byte)actualArgs_836)) + { + int index_837 = actualArgs_836&array_710.length-1; + int index_838 = ( ~(var_469--))&array_710[index_837].length-1; + int index_839 = index_837&array_710.length-1; + int index_840 = actualArgs_277&array_710[index_839].length-1; + ++array_710[index_839][index_840]; + --actualArgs_277; + } + } + } + boolean func_4(float args_2, short args_3, double args_4, byte args_5, String args_6, int args_7) + { + int var_8 = 1458214032; + --var_8; + String var_11 = "4NoZtX&(qU"; + String var_888 = "~VuQcG&:P*"; + int var_901 = (-1239998425); + for (int id_9 = 17;id_9<49;id_9 += 5) + { + for (int id_10 = 38;id_10>36;id_10 -= 1) + { + var_11 = "!ejs:D\\t)1"; + var_12++; + boolean actualArgs_844 = (var_608++)==(func_19("f^#xvrj]|D", var_494, var_841, (byte)var_600, array_842, var_843)%(1|var_640)); + boolean actualArgs_845 = !var_494; + char actualArgs_846 = (char)var_12; + func_5(actualArgs_844, var_8, (char)'^', var_695, actualArgs_845, (char)actualArgs_846); + } + try + { + int index_847 = var_488&array_681.length-1; + array_681[index_847] = var_619; + int actualArgs_848 = +((char)(var_641<<3206154235815008753L)); + char actualArgs_849 = (char)1.14915112E8f; + double actualArgs_851 = var_622+(var_850++); + short actualArgs_853 = ((short)var_582); + double actualArgs_855 = (((char)var_854)/(1|((byte)var_549))); + boolean actualArgs_856 = var_275.func_6(var_852, (short)actualArgs_853, actualArgs_855, var_494, (byte)var_600, (byte)var_600); + char actualArgs_857 = (char)3.627128133156532E8d; + func_5(var_494, actualArgs_848, (char)actualArgs_849, actualArgs_851, actualArgs_856, (char)actualArgs_857); + } + catch (Exception e_2) + { + byte[] array_884 = new byte[]{(-35),22,17,96}; + try + { + var_8 = var_8; + int index_858 = var_493&array_681.length-1; + func_5(var_494, array_681[index_858], (char)var_640, var_561, var_859, (char)var_860); + var_494 = var_494; + var_859 = var_494; + } + catch (Exception e_3) + { + var_1 = 19011; + int index_861 = var_607&array_832.length-1; + byte actualArgs_865 = ((byte)var_695); + String actualArgs_867 = func_18((char)var_488, var_695, (char)var_866, array_642, (char)var_560, array_832); + int actualArgs_868 = ((-157169418)-var_866); + int actualArgs_870 = (index_861++); + int index_864 = var_371.func_9((byte)actualArgs_865, actualArgs_867, actualArgs_868, var_869, var_561, actualArgs_870)&array_688.length-1; + String actualArgs_873 = (var_467+var_872); + float actualArgs_874 = (var_860/(1|actualArgs_870)); + int index_871 = func_19(var_11, var_494, actualArgs_873, (byte)var_607, array_842, actualArgs_874)&array_688[index_864].length-1; + int index_875 = var_653&array_688[index_864][index_871].length-1; + int index_863 = array_688[index_864][index_871][index_875]&array_563.length-1; + int index_876 = var_640&array_563[index_863].length-1; + int index_878 = var_879&array_832.length-1; + int index_880 = ((char)var_701)&array_832[index_878].length-1; + String actualArgs_881 = (var_584+true); + byte actualArgs_882 = ((byte)var_670); + int index_877 = var_468.func_10(array_832[index_878][index_880], actualArgs_881, (char)var_640, array_472, (byte)actualArgs_882, var_371)&array_563[index_863][index_876].length-1; + int index_862 = array_563[index_863][index_876][index_877]&array_832[index_861].length-1; + float actualArgs_885 = (func_21(array_715, (char)var_883, var_561, "DR*m|[BV~w", (byte)var_469, array_884)-((short)var_561)); + index_880 = func_19(var_467, var_859, array_832[index_861][index_862], (byte)var_879, array_842, actualArgs_885); + System.out.println( "=======Exception thrown======="+37); + } + finally + { + Class_4 var_886 = new Class_4(); + byte actualArgs_889 = func_11((-1.3375044565358321E8d), 907881508, var_695, array_887, var_494, var_888); + String actualArgs_891 = func_18((char)var_678, var_695, (char)var_678, array_890, (char)'4', array_832); + boolean actualArgs_892 = (var_641>var_641); + byte actualArgs_893 = ((byte)var_831); + float actualArgs_894 = (var_1/(1|var_854)); + short actualArgs_896 = func_20((byte)actualArgs_889, actualArgs_891, actualArgs_892, (byte)actualArgs_893, actualArgs_894, var_895); + var_559 = var_886.func_8(var_859, var_622, (short)actualArgs_896, (char)var_699, actualArgs_891, actualArgs_894); + } + for (int id_897 = 89;id_897>16;id_897 -= 74) + { + var_622 = var_559; + int index_898 = var_899&array_472.length-1; + int index_900 = (((short)var_901)/(1|((char)var_641)))&array_472[index_898].length-1; + int index_902 = var_493&array_472.length-1; + int index_903 = ((short)var_549)&array_472[index_902].length-1; + var_888 = array_472[index_902][index_903]; + } + var_680 = (char)((byte)var_568); + if (var_904) + { + var_905 = ( +var_371.func_9((byte)var_833, var_584, var_493, false, var_561, var_901))^((short)var_371.func_9((byte)22, var_888, var_905, var_869, var_695, var_8)); + int index_906 = 127&array_832.length-1; + int index_907 = var_860&array_832[index_906].length-1; + int index_908 = var_631&array_832.length-1; + int index_909 = ((char)((short)var_12))&array_832[index_908].length-1; + var_841 = array_832[index_908][index_909]; + } + else + { + var_850 = var_582; + var_854 = (short)(var_701|106130038); + } + System.out.println( "=======Exception thrown======="+37); + } + finally + { + --var_696; + int index_910 = ((byte)( -var_693))&array_572.length-1; + if (array_572[index_910]>var_854) + { + int index_911 = 'F'&array_887.length-1; + int index_912 = var_560&array_887[index_911].length-1; + array_887[index_911][index_912] = var_467+48; + var_494 = var_494; + } + } + } + return var_913; + } + public strictfp void run() + { + ++var_1; + int index_914 = 2987&array_572.length-1; + byte actualArgs_915 = ((byte)(var_1-var_672)); + int actualArgs_916 = (var_672&var_653); + byte[] array_917 = new byte[]{(-81),(-45),(-44),2}; + short var_930 = (-873); + long var_931 = (-8246015254706388528L); + if (func_4(var_622, (short)var_653, array_572[index_914], (byte)actualArgs_915, var_583, actualArgs_916)) + { + var_693--; + array_917 = array_917; + var_869 = var_869; + } + else + { + float actualArgs_918 = '\''/(1|var_582); + int index_920 = var_653&array_710.length-1; + int index_921 = 1776881489&array_710[index_920].length-1; + int index_922 = var_872&array_632.length-1; + int index_925 = ((short)var_879)&array_924.length-1; + int index_923 = array_924[index_925]&array_632[index_922].length-1; + int index_926 = var_631&array_632[index_922][index_923].length-1; + float actualArgs_927 = ((array_710[index_920][index_921]--)/(1|array_632[index_922][index_923][index_926])); + double actualArgs_929 = var_548.func_17((byte)var_919, "cu_<~59;id_32 -= 4) + { + --var_33; + var_33 = (short)var_34; + } + --var_35; + } + public boolean func_6(float args_20, short args_21, double args_22, boolean args_23, byte args_24, byte args_25) + { + Class_4 var_167 = new Class_4(); + Class_5 var_190 = new Class_5(); + char var_259 = 'g'; + long[][][] array_267 = new long[][][]{{{(-9179925154322014906L),(-8967885302973835420L),(-7766074404177249094L),1510873017721986864L},{(-8632584904701141047L)},{(-3341845622270981422L),4708402060649080618L},{7845127894065713406L,(-8995496057407568514L)}},{{(-3836721009636634981L),(-7954162349071018167L),(-5138458103773391537L),(-4507939969511882517L),(-985045695730671111L),(-4929984989267030704L)},{7757907752731380615L,(-2266563947680394983L),242771810228760125L},{1759917744551618524L,(-701090438022485833L),7436079038185689749L},{17469728494652774L,(-6515852153902384825L),(-4609176742979974282L),(-3430060162855065175L),(-4472066053322141824L)}}}; + try + { + boolean actualArgs_168 = (var_35<=var_34); + float var_169 = 1.65192435E9f; + short actualArgs_192 = var_190.func_9((byte)var_36, var_37, 1635555186, var_191, var_34, var_35); + char actualArgs_261 = var_258.func_10(var_37, var_37, (char)var_259, array_260, (byte)var_36, var_190); + int index_262 = ( ~actualArgs_261)&array_260.length-1; + int index_263 = ((short)index_262)&array_260[index_262].length-1; + String actualArgs_264 = var_37+var_167.func_8(actualArgs_168, var_169, (short)actualArgs_192, (char)actualArgs_261, array_260[index_262][index_263], var_169); + func_7((byte)var_36, (byte)var_36, (short)var_33, actualArgs_264, var_265, (char)actualArgs_261); + } + catch (Exception e_1) + { + byte var_266 = (-74); + var_266--; + int index_268 = 2667&array_267.length-1; + int index_269 = var_270&array_267[index_268].length-1; + int index_271 = (-116)&array_267[index_268][index_269].length-1; + int index_272 = var_33&array_267.length-1; + int index_273 = var_259&array_267[index_272].length-1; + int index_274 = var_35&array_267[index_272][index_273].length-1; + --array_267[index_272][index_273][index_274]; + System.out.println( "=======Exception thrown======="+12); + } + return false; + } +} +class Class_4 +{ + static float var_44 = (-2.97994272E8f); + public static int var_47 = (-682266085); + public static char[][] array_49 = new char[][]{{'T','$','b','r','~'},{'i','r','I','<'}}; + private static byte var_51 = 88; + public static long var_54 = (-8031916697561846327L); + public static short var_65 = 14089; + public static boolean var_67 = true; + static char var_68 = '~'; + private static int var_69 = 1100662789; + private static boolean[][][] array_73 = new boolean[][][]{{{true,true},{true,false},{false,true},{false,true,true},{false,false},{true,true,false,true,false},{false,false,true,false,true,false,true}},{{true,true,true},{false,false,true,true,true},{true,true,true,false,false,true}},{{false,false,true,true},{false,false,false,true,false,false},{false,false,true,true,false},{true}},{{false,false,true,true},{true,false,false,false,true},{false,false,false,true,true},{true,false,true,false,false,true,false},{false,true},{true,false,false,true,true},{false,false,false}}}; + protected static long var_80 = (-2009995243991317484L); + public static double var_81 = 1.623444196776081E9d; + private static boolean var_83 = false; + static Class_4 var_87 = new Class_4(); + protected static float var_92 = (-1.29758528E8f); + protected static byte var_96 = 36; + public static MainClass var_99 = new MainClass(); + private static int var_105 = 785534625; + protected static String[][] array_110 = new String[][]{{"4aV~l^_~nq"}}; + static char var_114 = '0'; + private static boolean var_122 = true; + public static boolean var_123 = false; + protected static float var_126 = (-6.849268E7f); + static boolean var_132 = true; + protected static char var_133 = '*'; + public static char[][] array_134 = new char[][]{{':'}}; + public static int var_138 = 1008983671; + protected static boolean var_139 = true; + protected static float var_140 = (-1.17858072E8f); + static long var_144 = 448454497048378213L; + private static Class_3 var_150 = new Class_3(); + protected static int var_155 = (-15840061); + private static double var_156 = (-3.489913368682448E7d); + static byte var_157 = (-88); + protected static float var_158 = (-1.22057805E9f); + public static char var_732 = '<'; + private static double var_743 = 4.538728267650356E8d; + private static int var_755 = 495512320; + protected static boolean[][][] array_757 = new boolean[][][]{{{false,true,true,true},{false,true,true,true}},{{false,true,false},{true,true}},{{false,false,true,true,false,false}},{{true,false,true},{true,false,false},{false,true,true},{true,true,true,false,true,false},{true,false,false},{true,false,false,true,false,true},{false,false,false,false}},{{true,false,false,false},{true,false},{false,true,false},{false}},{{false,false,false,true,true},{true,true,true,true,true},{false},{true,true},{true},{true},{true,false,true,true,false,true,false}}}; + static double var_766 = 2789892.1208486427d; + static int var_770 = (-1285602146); + public static int var_772 = 1780987423; + static int var_776 = (-763462675); + public static long var_779 = (-5684479306140265672L); + protected static char var_789 = '*'; + static char var_791 = ']'; + static boolean[][][] array_792 = new boolean[][][]{{{true,false,true,true,false}},{{false,true,true,true,true},{true,false,false,false,true},{true,true,true,false,false,false,true,false,false,true},{false,true,false,true,false}},{{false,false},{true,false,true,false}},{{false},{false},{true,true,false,true},{false,true,false},{false,false}}}; + private static boolean var_796 = false; + private static byte[] array_810 = new byte[]{97,(-92),2}; + public float func_8(boolean args_38, float args_39, short args_40, char args_41, String args_42, float args_43) + { + var_44 = var_44; + boolean var_70 = true; + String var_84 = ":3#bvxv&az"; + MainClass var_98 = new MainClass(); + boolean var_100 = true; + short var_131 = (-14442); + short var_147 = 31664; + short var_159 = (-10385); + char var_166 = '3'; + try + { + for (int id_45 = 30;id_45>0;id_45 -= 11) + { + for (int id_46 = 92;id_46>26;id_46 -= 67) + { + var_47 = var_47--; + short var_48 = 31880; + var_48 = var_48; + } + int index_50 = var_51&array_49.length-1; + int index_53 = (((short)var_54)/(1|(-110)))&array_49.length-1; + int index_56 = index_53&array_49.length-1; + short var_60 = (-5441); + int index_59 = var_60&array_49.length-1; + int index_61 = index_50&array_49[index_59].length-1; + int index_58 = array_49[index_59][index_61]&array_49.length-1; + int index_62 = var_60&array_49[index_58].length-1; + int index_57 = array_49[index_58][index_62]&array_49[index_56].length-1; + int index_55 = array_49[index_56][index_57]&array_49[index_53].length-1; + int index_52 = (array_49[index_53][index_55]&((short)var_44))&array_49[index_50].length-1; + int index_63 = var_51&array_49.length-1; + int index_64 = var_65&array_49[index_63].length-1; + --array_49[index_63][index_64]; + } + var_47--; + for (int id_66 = 65;id_66>38;id_66 -= 10) + { + var_44 = var_44; + if (var_67) + { + var_70 = ((var_68>var_69)^var_70)^(( +var_65)!=(var_51+var_44)); + var_47 = ((short)var_44)/(1|var_68); + } + else + { + int index_71 = var_68&array_49.length-1; + int index_72 = (-20)&array_49[index_71].length-1; + array_49[index_71][index_72] = var_68; + } + int index_74 = var_51&array_73.length-1; + int index_75 = (-30578)&array_73[index_74].length-1; + int index_76 = var_51&array_73[index_74][index_75].length-1; + int index_77 = var_51&array_73.length-1; + int index_78 = var_51&array_73[index_77].length-1; + int index_79 = '!'&array_73[index_77][index_78].length-1; + if (array_73[index_77][index_78][index_79]) + { + var_70 = false&(var_65>var_54); + var_65 = (short)var_80; + var_70 = var_70; + var_81 = var_81; + float var_82 = (-3.03384608E8f); + var_81 = var_82--; + } + } + } + catch (Exception e_1) + { + var_70 = false; + --var_65; + var_54--; + try + { + if (var_83) + { + var_84 = var_84; + var_84 = ",TEk']v1xd"; + var_65 = var_65; + } + else + { + int index_85 = (var_69++)&array_49.length-1; + int index_86 = var_51&array_49[index_85].length-1; + array_49[index_85][index_86] = var_68; + var_51 = var_51; + var_87 = new Class_4(); + } + for (int id_88 = 83;id_88>25;id_88 -= 7) + { + var_65 = var_65; + var_51 = var_51; + var_81 = var_81; + var_47 = var_69; + } + } + catch (Exception e_2) + { + var_51 = (byte)var_47; + var_68--; + System.out.println( "=======Exception thrown======="+2); + } + finally + { + int index_89 = ((byte)(var_65++))&array_49.length-1; + int index_91 = ((char)var_92)&array_49.length-1; + int index_93 = (-1879607917)&array_49[index_91].length-1; + int index_90 = array_49[index_91][index_93]&array_49[index_89].length-1; + int index_94 = var_68&array_49.length-1; + int index_95 = var_96&array_49[index_94].length-1; + array_49[index_94][index_95]++; + } + System.out.println( "=======Exception thrown======="+2); + } + finally + { + short var_120 = 3614; + try + { + boolean var_97 = false; + if (var_97) + { + var_44 = +var_54; + var_69 = var_47; + var_98 = var_98; + var_68 = var_68; + } + else + { + var_99 = var_98; + var_51 = var_51; + var_81 = var_81; + var_68 = (char)var_81; + } + var_92 = 35783345504797054L/(1|var_69); + try + { + var_100 = var_96>=var_81; + var_92 = var_44; + var_81 = var_81; + } + catch (Exception e_3) + { + int index_102 = ((byte)var_51)&array_49.length-1; + int index_103 = ((char)((char)var_51))&array_49[index_102].length-1; + int index_101 = array_49[index_102][index_103]&array_49.length-1; + int index_104 = ( +var_105)&array_49[index_101].length-1; + int index_106 = var_96&array_49.length-1; + int index_108 = '>'&array_49.length-1; + int index_109 = var_68&array_49[index_108].length-1; + int index_107 = (array_49[index_108][index_109]|((short)var_92))&array_49[index_106].length-1; + var_68 = array_49[index_106][index_107]; + System.out.println( "=======Exception thrown======="+3); + } + finally + { + int index_111 = var_51&array_110.length-1; + int index_112 = var_68&array_110[index_111].length-1; + int index_113 = (var_114&var_65)&array_110.length-1; + int index_115 = (-910730927)&array_110[index_113].length-1; + array_110[index_113][index_115] = array_110[index_111][index_112]+((short)1439707727); + } + } + catch (Exception e_2) + { + for (int id_116 = 25;id_116<61;id_116 += 37) + { + var_100 = var_70; + var_98 = var_98; + } + int index_117 = (var_51&(var_65-var_51))&array_110.length-1; + int index_118 = ((var_51-var_65)/(1|var_96))&array_110[index_117].length-1; + int index_119 = var_120&array_110.length-1; + int index_121 = var_51&array_110[index_119].length-1; + array_110[index_119][index_121] = array_110[index_117][index_118]+var_81; + System.out.println( "=======Exception thrown======="+4); + } + if (((var_51>var_69)^var_122)^var_123) + { + var_81 = var_81; + try + { + var_47 = var_96%(1|var_69); + var_105 = var_105; + } + catch (Exception e_3) + { + var_92 = var_47/(1|var_80); + var_81 = var_81; + var_68 = (char)2.568791226142984E7d; + var_100 = false; + var_87 = var_87; + System.out.println( "=======Exception thrown======="+5); + } + var_51++; + } + else + { + int index_124 = var_69&array_110.length-1; + int index_125 = var_96&array_110[index_124].length-1; + array_110[index_124][index_125] = var_84; + var_114 = (char)var_126; + int index_127 = ((short)var_126)&array_110.length-1; + int index_128 = var_68&array_110[index_127].length-1; + int index_129 = (((byte)var_65)-var_65)&array_110.length-1; + int index_130 = ((byte)var_131)&array_110[index_129].length-1; + var_84 = array_110[index_129][index_130]; + } + ++var_54; + if ((true&&var_132)||var_132) + { + var_68--; + var_65 = var_120; + var_87 = new Class_4(); + var_96 = var_51; + --var_54; + try + { + var_100 = var_100; + var_81 = var_81; + array_49 = array_49; + var_131 = var_120; + var_92 = var_44++; + } + catch (Exception e_3) + { + var_133 = (char)var_80; + var_96 = var_96; + var_84 = var_84; + var_99 = var_99; + var_96 = (-56); + var_96 = var_96; + System.out.println( "=======Exception thrown======="+6); + } + } + else + { + int index_135 = var_69&array_134.length-1; + int index_136 = var_96&array_134[index_135].length-1; + index_135 = array_134[index_135][index_136]%(1|var_120); + char[][] array_137 = new char[][]{{'X'},{'|','o','B','r','~'},{'F','(','v','>','3'},{'-','v','~','.'},{'|','x','J','G'},{'z','R','g'},{'\\',':','!','3','Z','e'}}; + array_134 = array_137; + var_65 = var_65; + } + short[][] array_141 = new short[][]{{22974,21945,1341,5670,(-9429),2297},{24661,27674}}; + try + { + array_49 = array_49; + try + { + var_138 = var_47; + var_99 = var_98; + var_68 = (char)(var_131--); + var_100 = var_70; + var_81 = var_80++; + } + catch (Exception e_3) + { + var_92 = 1.12703629E9f; + var_81 = (-1.7409490552211228E8d); + var_68 = (char)((byte)'c'); + var_44 = var_126; + var_138 = var_138; + System.out.println( "=======Exception thrown======="+7); + } + var_105--; + var_139 = (var_70||(var_100^var_139))==((var_65!=var_131)||true); + if (var_81>var_140) + { + var_131 = var_131; + var_138 = var_69; + int index_142 = var_138&array_141.length-1; + int index_143 = ((byte)(var_96/(1|var_144)))&array_141[index_142].length-1; + array_141[index_142][index_143] = var_131; + int index_145 = ((char)var_140)&array_110.length-1; + int index_146 = ((short)((char)var_138))&array_110[index_145].length-1; + array_110[index_145][index_146] = var_84; + } + if (var_147!=var_147) + { + int index_148 = ((char)var_144)&array_110.length-1; + int index_149 = var_51&array_110[index_148].length-1; + array_110[index_148][index_149] = var_84; + } + else + { + var_51 = (byte)var_47; + var_150 = var_150; + var_114 = '~'; + var_84 = ((var_84+var_68)+(-1829655446))+(-453659095); + var_47 = ((short)((byte)(-104)))|(-14297); + } + } + catch (Exception e_2) + { + try + { + int index_151 = var_96&array_110.length-1; + int index_152 = ((short)(var_68-var_68))&array_110[index_151].length-1; + int index_153 = ((char)var_96)&array_110.length-1; + int index_154 = var_155&array_110[index_153].length-1; + var_84 = array_110[index_153][index_154]; + } + catch (Exception e_3) + { + var_155 = var_69; + var_81 = var_156; + var_157 = (byte)(-8879); + array_110 = array_110; + var_140 = 8.1373747E8f; + var_155 = var_69; + System.out.println( "=======Exception thrown======="+9); + } + finally + { + var_140 = (-4.30779552E8f); + var_105 = var_47; + var_159 = (short)var_158; + var_120 = (short)(((char)var_65)*((byte)var_156)); + var_114 = (char)var_126; + } + int index_160 = var_65&array_49.length-1; + int index_161 = ((byte)var_105)&array_49[index_160].length-1; + int index_162 = var_69&array_49.length-1; + int index_163 = var_147&array_49[index_162].length-1; + int index_164 = var_68&array_134.length-1; + int index_165 = var_166&array_134[index_164].length-1; + array_134[index_164][index_165] = array_49[index_162][index_163]; + System.out.println( "=======Exception thrown======="+9); + } + } + return var_140++; + } + public byte[] func_22(float args_719, short args_720, short args_721, double args_722, double args_723, String args_724) + { + boolean var_725 = false; + try + { + if (var_725) + { + for (int id_726 = 74;id_726<76;id_726 += 1) + { + var_44 = var_65/(1|var_65); + var_65 = (short)var_138; + } + for (int id_727 = 29;id_727<62;id_727 += 5) + { + var_138 = ~var_65; + var_65 = (short)var_114; + var_81 = var_81; + var_47 = var_69; + int index_728 = var_69&array_134.length-1; + byte var_730 = (-82); + int index_729 = var_730&array_134[index_728].length-1; + int index_731 = var_732&array_134.length-1; + int index_733 = var_65&array_134[index_731].length-1; + var_114 = array_134[index_731][index_733]; + } + --var_138; + try + { + var_92 = var_51++; + int index_734 = (-106)&array_134.length-1; + int index_735 = var_157&array_134[index_734].length-1; + array_134[index_734][index_735] = var_133; + } + catch (Exception e_3) + { + var_133 = var_114; + var_81 = var_156; + System.out.println( "=======Exception thrown======="+32); + } + finally + { + var_157 = (byte)var_156; + var_133 = var_133; + var_140 = var_140; + var_47 = var_155; + var_138 = var_138; + } + var_69 = ((byte)var_81)&var_65; + short var_738 = (-12784); + try + { + var_140 = var_140; + long var_736 = (-6785638458812396880L); + var_126 = var_736--; + var_81 = var_81; + var_92 = var_44; + } + catch (Exception e_3) + { + var_96 = 83; + var_65 = var_65; + int index_737 = var_738&array_110.length-1; + int index_739 = ((char)(var_156/(1|index_737)))&array_110[index_737].length-1; + int index_740 = var_51&array_49.length-1; + int index_741 = var_738&array_49[index_740].length-1; + int index_742 = (((byte)var_743)|var_69)&array_110.length-1; + int index_744 = (var_69--)&array_110[index_742].length-1; + array_110[index_742][index_744] = array_110[index_737][index_739]+(array_49[index_740][index_741]>var_81); + System.out.println( "=======Exception thrown======="+33); + } + finally + { + var_92 = +((byte)118); + var_140 = var_44; + int index_745 = var_738&array_110.length-1; + int index_746 = var_738&array_110[index_745].length-1; + int index_747 = var_114&array_110.length-1; + int index_748 = ((byte)var_96)&array_110[index_747].length-1; + int index_749 = var_157&array_110.length-1; + int index_750 = index_749&array_110[index_749].length-1; + array_110[index_749][index_750] = array_110[index_747][index_748]; + } + } + var_65--; + int index_751 = ((short)(var_65--))&array_134.length-1; + int index_752 = var_65&array_134[index_751].length-1; + int index_753 = var_69&array_134.length-1; + int index_754 = var_96&array_134[index_753].length-1; + array_134[index_753][index_754]--; + } + catch (Exception e_1) + { + var_81 = var_81; + var_755++; + for (int id_756 = 96;id_756>75;id_756 -= 22) + { + int index_758 = var_68&array_757.length-1; + int index_759 = var_51&array_757[index_758].length-1; + int index_761 = ((var_65>>var_155)|var_69)&array_49.length-1; + int index_762 = var_68&array_49[index_761].length-1; + int index_760 = array_49[index_761][index_762]&array_757[index_758][index_759].length-1; + int index_763 = var_732&array_757.length-1; + int index_764 = var_96&array_757[index_763].length-1; + int index_765 = var_65&array_757[index_763][index_764].length-1; + if (array_757[index_763][index_764][index_765]) + { + var_65 = var_65; + var_743 = var_81; + var_139 = ((var_157-var_144)<=(-4.1395744E7f))|var_139; + var_743 = var_766; + var_44 = var_140; + } + else + { + int index_767 = var_96&array_110.length-1; + int index_768 = var_65&array_110[index_767].length-1; + int index_769 = var_770&array_110.length-1; + int index_771 = var_157&array_110[index_769].length-1; + array_110[index_769][index_771] = array_110[index_767][index_768]+( -var_80); + } + } + --var_772; + System.out.println( "=======Exception thrown======="+34); + } + finally + { + for (int id_773 = 21;id_773<58;id_773 += 38) + { + for (int id_774 = 17;id_774<86;id_774 += 70) + { + int index_775 = ((short)(var_776/(1|var_155)))&array_110.length-1; + int index_777 = var_155&array_110[index_775].length-1; + int index_778 = ((short)var_779)&array_110.length-1; + int index_780 = '+'&array_110[index_778].length-1; + int index_781 = ((short)(-5.11157408E8f))&array_110.length-1; + int index_782 = var_96&array_110[index_781].length-1; + array_110[index_781][index_782] = array_110[index_778][index_780]; + } + ++var_133; + var_157 = (byte)'3'; + var_779--; + boolean var_790 = true; + try + { + int index_783 = ((char)var_156)&array_110.length-1; + int index_784 = (-42)&array_110[index_783].length-1; + int index_785 = var_65&array_110.length-1; + int index_786 = var_47&array_110[index_785].length-1; + int index_787 = ((char)var_157)&array_110.length-1; + int index_788 = (15462>>>290412369971950515L)&array_110[index_787].length-1; + array_110[index_787][index_788] = array_110[index_785][index_786]; + } + catch (Exception e_3) + { + var_51 = var_96; + var_133 = (char)var_96; + var_81 = var_114-(var_732--); + var_158 = var_755++; + var_65 = (-23521); + System.out.println( "=======Exception thrown======="+35); + } + finally + { + var_105 = var_65&((short)var_96); + var_790 = (var_92/(1|var_789))<=((byte)( -var_80)); + var_44 = (-28)/(1|(((short)var_791)>>((-92)+var_789))); + } + } + var_157++; + } + int index_793 = var_51&array_792.length-1; + int index_794 = 1120477575&array_792[index_793].length-1; + int index_795 = (-8331)&array_792[index_793][index_794].length-1; + char var_808 = 't'; + if (array_792[index_793][index_794][index_795]||var_796) + { + for (int id_797 = 29;id_797<58;id_797 += 10) + { + var_81 = var_766; + int index_798 = (var_133++)&array_110.length-1; + int index_799 = var_68&array_110[index_798].length-1; + int index_800 = ((byte)(var_157--))&array_110.length-1; + int index_801 = index_793&array_110[index_800].length-1; + array_110[index_800][index_801] = array_110[index_798][index_799]+var_156; + } + var_138++; + ++index_794; + for (int id_802 = 32;id_802<38;id_802 += 2) + { + int index_803 = var_65&array_49.length-1; + int index_804 = ((short)var_144)&array_49[index_803].length-1; + int index_805 = var_65&array_49.length-1; + int index_807 = ((short)(var_51+var_808))&array_134.length-1; + int index_809 = ((byte)var_65)&array_134[index_807].length-1; + int index_806 = (array_134[index_807][index_809]^index_807)&array_49[index_805].length-1; + array_49[index_805][index_806]--; + } + } + return array_810; + } +} +class Class_5 +{ + private static boolean[][] array_176 = new boolean[][]{{true,false,false},{true,true,false,false,false,false,false},{true,false}}; + protected static char var_179 = 'N'; + protected static byte[] array_181 = new byte[]{58,103,(-48),59}; + public static float var_187 = 9.6821811E8f; + private static short var_309 = 28701; + private static long var_310 = (-2830839212923601272L); + static int var_311 = (-180068807); + private static boolean var_312 = true; + protected static MainClass var_314 = new MainClass(); + private static byte var_320 = (-85); + private static boolean var_323 = true; + static double var_324 = 2.692891904407956E8d; + protected static String var_325 = "W,|56!!a*u"; + protected static boolean var_336 = false; + static long var_342 = 925599354579209889L; + protected static boolean var_343 = false; + public static short var_348 = (-9647); + private static byte var_349 = (-7); + private static boolean var_350 = true; + static boolean var_353 = true; + static long var_355 = 9139785221047373621L; + private static boolean var_356 = true; + static double[] array_357 = new double[]{5.175757856750822E7d,7.198302370606635E8d,4.285461757233656E8d,(-6.223397472322643E8d),(-5.518832349452838E8d)}; + private static int var_359 = (-919671564); + static String[][][] array_364 = new String[][][]{{{"K5m?0&-E@!","nD6*A-i):R","&Qk@L[=)h32rh","?ZKk#pkO]\\","KfoPx+6k0F","'pX;yEcMQ"}}}; + protected static short var_366 = (-31863); + public static int var_368 = 1838363926; + protected static Class_6 var_370 = new Class_6(); + protected static boolean var_479 = true; + protected static char var_482 = 'J'; + public short func_9(byte args_170, String args_171, int args_172, boolean args_173, double args_174, int args_175) + { + long var_178 = 7897022654636571586L; + int index_177 = (((short)var_178)|var_179)&array_176.length-1; + byte var_183 = (-41); + int index_182 = var_183&array_181.length-1; + int index_180 = array_181[index_182]&array_176[index_177].length-1; + int index_184 = var_179&array_176.length-1; + int index_185 = (-49)&array_176[index_184].length-1; + int index_186 = ((short)var_187)&array_176.length-1; + int index_188 = var_183&array_176[index_186].length-1; + array_176[index_186][index_188] = array_176[index_184][index_185]; + short var_189 = 1244; + return var_189; + } + public Class_6 func_13(String args_302, long[][][] args_303, double args_304, char args_305, float args_306, double args_307) + { + var_187 = var_187; + boolean var_308 = false; + int var_322 = (-1272622883); + byte var_329 = (-122); + Class_5 var_354 = new Class_5(); + if (var_308) + { + var_179 = var_179; + var_187 = ((short)(var_187-(-7558058971104583934L)))-(var_309--); + var_310--; + var_311--; + if (var_312) + { + for (int id_313 = 16;id_313<41;id_313 += 5) + { + var_314 = var_314; + int index_315 = var_311&array_176.length-1; + int index_316 = var_311&array_176[index_315].length-1; + int index_317 = index_315&array_176.length-1; + int index_318 = var_309&array_176[index_317].length-1; + int index_319 = ((byte)((byte)var_320))&array_176.length-1; + int index_321 = (var_322++)&array_176[index_319].length-1; + array_176[index_319][index_321] = array_176[index_317][index_318]; + } + if (var_323^(var_309==var_309)) + { + var_309 = var_309; + var_324 = var_324; + var_187 = var_187; + } + else + { + var_322 = var_322; + var_325 = var_325; + } + if (var_187!=var_187) + { + var_324 = var_324; + var_187 = var_187; + var_325 = "r!TX_&= sK"; + var_187 = var_320+var_310; + } + else + { + var_325 = var_325; + var_324 = var_324; + int index_326 = var_179&array_176.length-1; + int index_328 = var_329&array_181.length-1; + int index_327 = array_181[index_328]&array_176[index_326].length-1; + array_176[index_326][index_327] = !true; + } + try + { + int index_330 = var_320&array_176.length-1; + int index_331 = var_309&array_176[index_330].length-1; + int index_332 = ((-85)>>>var_309)&array_176.length-1; + int index_333 = ((short)((short)var_309))&array_176[index_332].length-1; + int index_334 = var_311&array_176.length-1; + int index_335 = var_329&array_176[index_334].length-1; + array_176[index_334][index_335] = array_176[index_332][index_333]; + } + catch (Exception e_3) + { + var_324 = var_324; + var_324 = var_324; + var_324 = 'W'-var_311; + var_325 = var_325; + var_179 = var_179; + var_311 = var_322; + System.out.println( "=======Exception thrown======="+13); + } + finally + { + var_325 = var_325; + var_336 = var_336; + } + var_329 = (byte)var_310; + --var_311; + } + else + { + var_309 = (short)var_309; + int index_337 = var_322&array_176.length-1; + int index_338 = (-1979043183)&array_176[index_337].length-1; + int index_339 = var_329&array_176.length-1; + int index_340 = ((char)((short)var_187))&array_176[index_339].length-1; + var_336 = array_176[index_339][index_340]; + } + try + { + for (int id_341 = 36;id_341<39;id_341 += 2) + { + var_322 = var_322; + var_187 = var_342-var_342; + } + if (var_343) + { + var_325 = "$Tta|5ZX,["; + var_309 = var_309; + var_324 = (-1.120646418196866E9d)/(1|var_320); + int index_344 = (-21632)&array_181.length-1; + int index_346 = var_309&array_181.length-1; + int index_345 = array_181[index_346]&array_181.length-1; + int index_347 = (var_329%(1|((short)var_311)))&array_181.length-1; + array_181[index_347] = array_181[index_345]; + } + else + { + var_348 = var_309; + var_324 = var_324; + var_349 = var_320; + var_311 = var_179/(1|((byte)var_348)); + var_325 = var_325; + } + var_348 = var_348; + var_311 = var_322; + if (var_350) + { + int index_351 = '#'&array_176.length-1; + int index_352 = var_348&array_176[index_351].length-1; + var_325 = var_325+array_176[index_351][index_352]; + var_348 = var_309; + var_329 = var_329; + } + else + { + var_353 = true; + var_322 = var_311; + var_320 = (byte)var_349; + var_324 = var_324; + var_187 = var_187; + } + --var_311; + } + catch (Exception e_2) + { + ++var_179; + var_354 = var_354; + var_348 = (short)((byte)var_355); + var_179--; + try + { + var_325 = "~1y6Yux-'"; + var_353 = var_356; + var_348 = 9348; + var_349 = var_320; + } + catch (Exception e_3) + { + var_325 = var_325+var_322; + var_329 = var_329; + int index_358 = var_309&array_357.length-1; + array_357[index_358] = (-4.1400079563755846E8d); + System.out.println( "=======Exception thrown======="+15); + } + finally + { + var_179 = var_179; + var_349 = (byte)var_359; + var_309 = var_348; + int index_360 = var_309&array_181.length-1; + int index_361 = var_179&array_181.length-1; + int index_362 = var_309&array_181.length-1; + array_181[index_362] = array_181[index_361]; + } + for (int id_363 = 26;id_363<84;id_363 += 30) + { + int index_365 = var_366&array_364.length-1; + int index_367 = var_368&array_364[index_365].length-1; + int index_369 = index_367&array_364[index_365][index_367].length-1; + array_364[index_365][index_367][index_369] = var_325; + } + System.out.println( "=======Exception thrown======="+15); + } + finally + { + --var_322; + var_348++; + var_349 = var_329; + } + } + return var_370; + } + public byte func_16(char args_473, double args_474, byte args_475, short args_476, char args_477, char args_478) + { + if ((var_311!=var_368)&&var_479) + { + var_311++; + int index_480 = ((short)(var_348-var_368))&array_357.length-1; + int index_481 = var_482&array_357.length-1; + int index_483 = var_179&array_357.length-1; + array_357[index_483] = array_357[index_481]; + } + int index_484 = var_366&array_181.length-1; + int index_485 = (( -25610)|var_482)&array_181.length-1; + int index_486 = var_366&array_181.length-1; + array_181[index_486] = array_181[index_485]; + byte var_487 = 38; + return var_487; + } +} +class Class_6 +{ + static boolean var_199 = true; + static short var_201 = 27026; + static byte var_202 = 82; + protected static float var_203 = 2.1355128E8f; + static boolean var_204 = false; + private static boolean var_205 = true; + public static boolean var_206 = true; + protected static char var_207 = '`'; + static String var_208 = "1|akn:8s["; + protected static boolean var_210 = false; + static float var_212 = 2.98679488E8f; + private static long var_213 = 743943823954486585L; + private static String var_215 = "-*V>|Jhmq<"; + protected static byte[][] array_216 = new byte[][]{{82,8,24},{61,(-127),5,122,(-104)},{37,116,7,70,(-37),83,(-12)}}; + protected static double[][] array_219 = new double[][]{{(-5.353745579867916E8d),(-4.025404543602473E8d),2.858410001153146E7d,3.5945939762331957E8d,8.51194168918532E7d,7.324881819869002E8d,(-3.601415101099933E8d)},{(-9.56861900855252E7d),1.890996975505194E7d,(-1.0495633365795023E9d),3.512369698852291E8d,9.991069822525535E8d},{1.376366212417729E8d},{(-1.232871927911174E9d),(-5.202881815410356E7d),1.6075752804084978E9d,(-2.256716602799641E8d)},{1.7012351415202063E7d,7.442803437478853E8d,3.26639879190412E8d},{(-1.0299123925008789E9d),(-1.4337750262534835E9d),(-2.34673086540118E8d),4.687060555793907E8d,1.5275411409870229E9d},{5.540694190975527E8d,4.796256950266613E8d,5.624070060104104E8d,(-1.1577599801478488E9d),(-1.8388199536574984E9d),5.819403094909192E8d}}; + static int[] array_222 = new int[]{(-1286989564)}; + static short var_244 = 29993; + protected static boolean var_257 = true; + public char func_10(String args_193, String args_194, char args_195, String[][] args_196, byte args_197, Class_5 args_198) + { + int var_200 = 2096265299; + String var_209 = "G\\q 2E^+&]"; + String var_214 = "77DKw;t)g;"; + double var_226 = 6.341273594263328E8d; + if (var_199) + { + if (((var_200&var_201)|(var_201<(var_203-var_200)) + { + var_200++; + try + { + var_204 = var_204; + var_206 = var_205; + var_203 = var_203; + var_206 = var_204; + } + catch (Exception e_3) + { + var_200 = (-887614851); + var_207 = (char)((-111)*var_203); + var_205 = var_204; + var_210 = var_208==(var_209+var_204); + var_207 = var_207; + System.out.println( "=======Exception thrown======="+10); + } + } + else + { + var_202 = var_202; + var_200 = var_207+((short)var_203); + for (int id_211 = 14;id_211<43;id_211 += 10) + { + var_209 = ((var_209+var_212)+var_202)+(var_212*var_213); + var_215 = var_214; + int index_217 = var_200&array_216.length-1; + int index_218 = var_207&array_216[index_217].length-1; + var_201 = (short)((byte)array_216[index_217][index_218]); + int index_220 = 91&array_219.length-1; + int index_221 = (-84)&array_219[index_220].length-1; + index_217 = ((char)array_219[index_220][index_221])&var_201; + } + int index_223 = ((short)(var_202%(1|var_207)))&array_222.length-1; + int index_224 = ( -var_207)&array_222.length-1; + array_222[index_224]++; + } + for (int id_225 = 33;id_225>23;id_225 -= 2) + { + int index_227 = var_201&array_219.length-1; + int index_228 = var_202&array_219[index_227].length-1; + array_219[index_227][index_228] = var_226; + } + int index_229 = ((byte)var_202)&array_222.length-1; + int index_230 = var_207&array_222.length-1; + array_222[index_230]--; + } + else + { + for (int id_231 = 16;id_231<54;id_231 += 20) + { + try + { + int index_232 = (var_207>>>var_201)&array_219.length-1; + int index_233 = index_232&array_219[index_232].length-1; + int index_235 = ((short)(-151737703))&array_216.length-1; + int index_236 = var_207&array_216[index_235].length-1; + int index_234 = array_216[index_235][index_236]&array_219.length-1; + int index_238 = ((byte)var_203)&array_216.length-1; + int index_239 = (var_201^var_201)&array_216[index_238].length-1; + int index_237 = (array_216[index_238][index_239]<<((byte)var_226))&array_219[index_234].length-1; + var_226 = array_219[index_234][index_237]; + } + catch (Exception e_3) + { + var_207 = (char)(1210188377900964625L*((short)var_226)); + var_226 = var_201+var_207; + int index_240 = (var_200%(1|var_202))&array_216.length-1; + int index_242 = ((byte)var_202)&array_216.length-1; + int index_243 = var_244&array_216[index_242].length-1; + int index_241 = array_216[index_242][index_243]&array_216[index_240].length-1; + array_216[index_240][index_241] = (byte)var_226; + System.out.println( "=======Exception thrown======="+11); + } + int index_245 = var_207&array_222.length-1; + var_207 = (char)array_222[index_245]; + int index_247 = var_202&array_216.length-1; + int index_248 = var_207&array_216[index_247].length-1; + int index_246 = array_216[index_247][index_248]&array_216.length-1; + int index_249 = var_207&array_216[index_246].length-1; + int index_250 = 102&array_216.length-1; + int index_251 = index_248&array_216[index_250].length-1; + int index_253 = '7'&array_219.length-1; + int index_254 = var_201&array_219[index_253].length-1; + int index_252 = ((byte)array_219[index_253][index_254])&array_216.length-1; + int index_255 = index_245&array_216[index_252].length-1; + array_216[index_252][index_255] = array_216[index_250][index_251]; + } + int index_256 = var_201&array_222.length-1; + var_257 = ( +7481805810502052685L)<=array_222[index_256]; + var_207 = var_207; + } + return var_207; + } + public void func_12(float args_286, double args_287, short args_288, int[] args_289, short args_290, byte args_291) + { + int index_292 = ((short)((byte)var_202))&array_216.length-1; + int index_293 = ( ~var_201)&array_216[index_292].length-1; + int index_294 = 102845898&array_216.length-1; + int index_295 = index_293&array_216[index_294].length-1; + int index_297 = var_202&array_219.length-1; + int index_298 = var_207&array_219[index_297].length-1; + int index_296 = ((byte)(array_219[index_297][index_298]++))&array_216.length-1; + int index_300 = var_244&array_216.length-1; + int index_301 = index_297&array_216[index_300].length-1; + int index_299 = ((char)array_216[index_300][index_301])&array_216[index_296].length-1; + array_216[index_296][index_299] = array_216[index_294][index_295]; + } +} +class Class_7 +{ + private static double var_382 = 7434189.382390862d; + public static boolean var_383 = true; + protected static byte var_384 = (-89); + protected static double var_385 = (-1.0163613546120602E8d); + public static float var_386 = (-3.83542656E8f); + private static Class_5 var_387 = new Class_5(); + protected static long var_389 = (-7568347762951548441L); + public static double[][] array_393 = new double[][]{{(-3653467.0162186474d),(-6.228709423124883E8d),8.48159433493196E8d},{(-6.895052318246441E8d),(-1.2546572631893501E9d),6.6257274563198015E7d,7.149854916851075E8d,(-7.982566962312996E8d)},{(-2.0100267608359227E8d),(-1.4843795906091794E7d)},{(-1.1154269827704332E9d),1.260324863111839E9d,2.6296638476123318E8d,(-9.191317472344723E8d)},{(-1.6731607688569033E8d),5.1195571811215684E7d,6.070856775096208E8d}}; + static char var_396 = 'M'; + static float var_397 = 1.40432304E8f; + protected static Class_7 var_399 = new Class_7(); + protected static boolean var_400 = false; + private static boolean var_401 = true; + private static char[] array_403 = new char[]{'y',']','T','*','B'}; + public static String var_407 = "J'6x.L7gWH"; + private static boolean[][] array_408 = new boolean[][]{{false,false,false},{false,false,false,true,true},{false,false,true,true,true,true,true},{true,false,true,false,false}}; + public static double var_414 = 4.0252746051483464E8d; + static boolean var_417 = false; + public static double var_419 = 1.7026546103857462E9d; + protected static long var_424 = 8792683007074113851L; + public static String var_429 = "Y)j^w2+EAZ"; + protected static MainClass var_432 = new MainClass(); + protected static double var_436 = (-1416970.8794949702d); + private static byte var_439 = 122; + private static float var_441 = 6.7856E8f; + static byte var_443 = 20; + protected static boolean[] array_444 = new boolean[]{false,false,false,true,true}; + protected static int var_448 = 129418747; + public static char var_450 = 'y'; + public static byte var_451 = (-42); + public long[][][] func_14(double args_372, String args_373, short args_374, byte args_375, float args_376, char args_377) + { + boolean var_378 = false; + short var_381 = (-31476); + int var_388 = 811647961; + char var_391 = '/'; + double var_392 = 1.469479747585641E9d; + float var_394 = (-4.12631008E8f); + float var_415 = 6.3581843E8f; + boolean var_418 = true; + boolean[][] array_420 = new boolean[][]{{true,false,true,false},{false,true,false,true},{true,false,true},{false,false,true}}; + char[][] array_452 = new char[][]{{'\'','c','Q','r','M','Q'},{'y','(','f','a','g','2','>'},{'Z'},{'o','^','/'}}; + if (var_378|var_378) + { + String var_379 = "_.>z:X[wJv"; + var_379 = "QTts@a*;<4"; + Class_3 var_390 = new Class_3(); + try + { + for (int id_380 = 0;id_380<69;id_380 += 7) + { + var_383 = ((char)((char)var_381))>=((short)var_382); + var_384 = var_384; + var_385 = var_385; + var_383 = var_383; + } + var_383 = var_383; + try + { + var_386 = var_386; + var_387 = var_387; + var_388 = var_388; + } + catch (Exception e_3) + { + var_384 = (byte)var_389; + var_390 = var_390; + var_383 = var_383&&true; + var_384 = var_384; + var_391 = (char)var_388; + System.out.println( "=======Exception thrown======="+16); + } + finally + { + var_383 = var_383; + var_392 = var_382; + var_386 = var_386; + array_393 = array_393; + var_386 = var_394; + } + } + catch (Exception e_2) + { + for (int id_395 = 91;id_395>48;id_395 -= 6) + { + var_394 = var_386; + var_397 = var_381-var_396; + var_381 = var_381; + } + var_388 = var_388; + System.out.println( "=======Exception thrown======="+17); + } + for (int id_398 = 50;id_398>48;id_398 -= 1) + { + --var_388; + --var_391; + var_399 = var_399; + if (var_400) + { + var_388 = var_388; + var_401 = var_383; + } + else + { + var_390 = var_390; + var_383 = var_401; + var_379 = var_379+var_388; + } + var_401 = var_383; + } + } + else + { + for (int id_402 = 30;id_402<62;id_402 += 33) + { + var_384--; + var_381 = var_381; + int index_404 = ((short)(var_384+var_389))&array_403.length-1; + int index_405 = (-100)&array_403.length-1; + array_403[index_405]--; + } + try + { + --var_388; + for (int id_406 = 5;id_406<12;id_406 += 2) + { + var_407 = var_407; + var_392 = ( +var_384)+((byte)(var_384-var_396)); + var_407 = var_407; + var_388 = 1902177477; + var_392 = +(-1.6482945126352003E8d); + } + var_381 = var_381; + int index_409 = ((byte)8)&array_408.length-1; + int index_410 = (var_391--)&array_408[index_409].length-1; + int index_411 = ((char)var_381)&array_408.length-1; + int index_413 = (var_381-((char)var_397))&array_403.length-1; + int index_412 = array_403[index_413]&array_408[index_411].length-1; + if (array_408[index_411][index_412]) + { + var_382 = -var_382; + var_388 = var_391*( -((short)(-9160646377260018905L))); + var_383 = var_401; + var_414 = var_385; + } + } + catch (Exception e_2) + { + var_415 = var_394; + for (int id_416 = 12;id_416<17;id_416 += 6) + { + var_383 = (-31367)!=var_381; + var_401 = var_401; + var_388 = var_388; + } + System.out.println( "=======Exception thrown======="+18); + } + if (var_417) + { + if ((var_384<=var_381)|var_418) + { + var_385 = var_414; + var_381 = (short)var_419; + var_385 = var_414; + var_399 = var_399; + } + var_381 = var_381; + var_389--; + } + else + { + var_388++; + var_384 = var_384; + var_397 = (-1.7940582E7f); + } + int index_423 = ((short)var_424)&array_403.length-1; + int index_422 = array_403[index_423]&array_403.length-1; + int index_421 = array_403[index_422]&array_420.length-1; + int index_425 = ( ~(-23581))&array_420[index_421].length-1; + int index_426 = (var_384++)&array_420.length-1; + int index_428 = var_381&array_403.length-1; + int index_427 = (var_391|array_403[index_428])&array_420[index_426].length-1; + if (array_420[index_426][index_427]) + { + try + { + var_401 = (var_407==var_429)||(76>=var_381); + int index_430 = var_381&array_403.length-1; + var_385 = var_394+array_403[index_430]; + var_401 = var_383; + } + catch (Exception e_3) + { + var_384 = (byte)((char)var_384); + var_381 = var_381; + var_384 = (byte)var_424; + int index_431 = ((char)((byte)var_384))&array_403.length-1; + var_414 = var_382*array_403[index_431]; + System.out.println( "=======Exception thrown======="+19); + } + Class_6 var_438 = new Class_6(); + try + { + var_384 = 60; + var_407 = var_429+var_384; + var_392 = var_392; + var_407 = (var_429+var_382)+var_407; + var_386 = var_397; + } + catch (Exception e_3) + { + var_432 = var_432; + int index_433 = ((byte)(var_381*var_389))&array_403.length-1; + array_403[index_433] = var_391; + var_383 = var_383==var_401; + int index_435 = (((char)var_436)>>((byte)var_381))&array_393.length-1; + int index_437 = index_433&array_393[index_435].length-1; + int index_434 = ((short)array_393[index_435][index_437])&array_403.length-1; + var_401 = array_403[index_434]<((short)var_382); + System.out.println( "=======Exception thrown======="+20); + } + finally + { + var_438 = var_438; + var_414 = var_414; + index_427 = ((byte)var_381)|var_439; + var_385 = var_385; + var_394 = (-7.267641E8f); + } + for (int id_440 = 2;id_440<73;id_440 += 9) + { + var_385 = var_419; + var_394 = var_396-var_441; + var_439 = (byte)4941972690227539090L; + var_384 = (byte)var_439; + } + for (int id_442 = 21;id_442<96;id_442 += 38) + { + var_384 = (byte)var_419; + var_443 = var_384; + index_423 = index_427; + } + int index_445 = var_381&array_444.length-1; + int index_446 = var_396&array_444.length-1; + if (array_444[index_446]) + { + var_397 = var_415; + int index_447 = var_448&array_403.length-1; + int index_449 = ((short)((short)var_391))&array_403.length-1; + var_450 = array_403[index_449]; + var_441 = var_415; + var_394 = var_441; + } + else + { + var_443 = var_443; + var_429 = ((var_429+var_381)+(var_384(var_381--)) + { + var_441 = -var_424; + array_452 = array_452; + var_382 = var_386--; + var_415 = var_441; + var_381 = 26127; + var_429 = var_429; + } + int index_453 = var_396&array_403.length-1; + int index_454 = var_381&array_403.length-1; + --array_403[index_454]; + } + } + long[][][] array_455 = new long[][][]{{{5341717479542693414L,(-49742076745650788L),(-2979653739436293122L),7232981973350861477L,(-6669575051893263862L),(-7021568772248916095L)},{8458790440762337071L,1610523510025291999L,274230927107280483L,2456938603473245413L,(-7970399282616914207L),(-8722935401824762548L),(-8529493640903725954L)},{4753225256265426993L,48560381185697400L,(-6251600724556155474L),(-3438860028313600345L)},{(-5712061763856197513L),(-8568315804135250080L),(-6782637611851862822L),8390505900461886430L}}}; + return array_455; + } +} +class Class_8 +{ + protected static Class_7 var_464 = new Class_7(); + public Class_7 func_15(MainClass args_456, String args_457, char args_458, float args_459, int args_460, int args_461) + { + byte var_462 = (-85); + short var_463 = (-17428); + var_463 = (short)var_462; + var_463++; + return var_464; + } +} +class Class_9 +{ + private static float var_504 = 9.6081968E7f; + static short var_506 = 6580; + static byte var_507 = 0; + static boolean var_508 = false; + static String var_509 = "l(^83#u~p~"; + private static char var_510 = '-'; + static int var_511 = (-445622935); + public static String[][] array_513 = new String[][]{{"+jlq7Idg!G","T~u\"AZA3AE","SCzedAlxtu","\"O+b\\Q5Ga",":.ECk'b~5Y",") X2Q~+0Sk","nIet:C+ej7","ENNmUu_Xr?"},{"Zz~P<=0U[P","6,CZfV|H`r","sn\"lC'+Z:r",">biLx5:k$'"},{"t-:@Ba$4r6","()\\)Mu\"gB?","5Gl?siNI~|"}}; + static short var_514 = (-31613); + private static double var_515 = 7.97193445544558E8d; + private static boolean var_516 = true; + protected static boolean var_518 = true; + public static double[][] array_519 = new double[][]{{8.063065448754426E8d},{3.327586915131732E8d},{6.4045667093261234E7d,4.522203074199878E8d,1.7639318743586895E8d},{3.423655727707813E7d,(-1.4354619598112997E7d),(-3.677189710867787E8d)},{3.0327273785388652E7d}}; + public static int var_525 = (-566261304); + public static long var_529 = (-2905149531476440185L); + static float var_530 = 2.60118176E8f; + public static boolean var_538 = true; + private static Class_8 var_539 = new Class_8(); + public static double var_540 = 3.295750193031188E8d; + protected static double var_541 = 7.7494724174915E7d; + public double func_17(byte args_498, String args_499, boolean args_500, float args_501, int args_502, int args_503) + { + var_504 = var_504; + boolean var_517 = true; + boolean var_537 = false; + long var_547 = 6346093290776937213L; + try + { + boolean var_505 = false; + var_505 = var_505; + } + catch (Exception e_1) + { + var_504 = var_504; + try + { + ++var_506; + var_506 = (short)var_504; + var_507 = var_507; + if ( !var_508) + { + var_509 = var_509+(var_504--); + var_510 = (char)var_506; + var_511 = var_511; + } + } + catch (Exception e_2) + { + var_509 = var_509; + for (int id_512 = 58;id_512>53;id_512 -= 2) + { + array_513 = array_513; + var_504 = var_504; + var_514 = var_514; + var_510 = var_510; + } + var_515 = var_515; + System.out.println( "=======Exception thrown======="+22); + } + finally + { + var_516 = ((var_510+var_514)<=var_506)||true; + var_511 = var_511; + } + System.out.println( "=======Exception thrown======="+22); + } + finally + { + Class_5 var_542 = new Class_5(); + if (var_517) + { + if (var_518&(var_504==var_504)) + { + var_504 = var_504; + array_519 = array_519; + int index_520 = '.'&array_519.length-1; + int index_521 = ((short)'.')&array_519[index_520].length-1; + array_519[index_520][index_521] = var_515; + var_509 = var_509+var_516; + } + else + { + int index_522 = 14244&array_519.length-1; + int index_523 = var_510&array_519[index_522].length-1; + int index_524 = var_525&array_519.length-1; + int index_526 = ((char)var_504)&array_519[index_524].length-1; + int index_527 = (var_507--)&array_519.length-1; + int index_528 = ((short)var_529)&array_519[index_527].length-1; + array_519[index_527][index_528] = array_519[index_524][index_526]; + } + try + { + var_509 = "Nw-0_F['c="; + var_530 = var_530; + var_516 = var_516; + } + catch (Exception e_3) + { + Class_8 var_531 = new Class_8(); + var_531 = var_531; + int index_532 = ( ~((byte)var_515))&array_519.length-1; + int index_533 = ((byte)(-431751737))&array_519[index_532].length-1; + array_519[index_532][index_533] = 1.433470850736682E9d; + System.out.println( "=======Exception thrown======="+23); + } + ++var_506; + for (int id_534 = 26;id_534<74;id_534 += 6) + { + int index_535 = var_510&array_513.length-1; + int index_536 = 17610&array_513[index_535].length-1; + var_509 = array_513[index_535][index_536]+(index_536/(1|((short)var_506))); + } + } + else + { + if (var_537) + { + var_538 = var_538; + var_539 = var_539; + var_541 = var_540; + var_542 = var_542; + var_510 = (char)var_507; + int index_543 = ((char)var_510)&array_513.length-1; + int index_544 = var_507&array_513[index_543].length-1; + int index_545 = ((char)(var_507>>var_510))&array_513.length-1; + int index_546 = ((char)var_514)&array_513[index_545].length-1; + var_509 = array_513[index_545][index_546]; + } + var_514 = 16284; + var_514++; + var_547--; + } + } + return var_541; + } +} +// DEPENDENCE: CrcCheckwithChar.java CrcCheckForObject.java +// EXEC:%maple *.java %build_option -o %n.so diff --git a/test/testsuite/fuzz_test/test.cfg b/test/testsuite/fuzz_test/test.cfg new file mode 100644 index 0000000000000000000000000000000000000000..732eb63760fa674cd82b8c577a470b9044ba7282 --- /dev/null +++ b/test/testsuite/fuzz_test/test.cfg @@ -0,0 +1,12 @@ +[suffix] +java = // + +[internal-var] +maple = python3 ${MAPLE_ROOT}/test/testsuite/maple.py +run = # +build_option = --javac="-bootclasspath ${MAPLE_ROOT}/libjava-core/java-core.jar" --maple="-O0 --mplt=${MAPLE_ROOT}/libjava-core/java-core.mplt --option=\"-use-string-factory::: \"" -s maple +run_option = + +[description] +title = Maple Fuzz Test + diff --git a/test/testsuite/fuzz_test/testlist b/test/testsuite/fuzz_test/testlist new file mode 100644 index 0000000000000000000000000000000000000000..2623c4c75564558611e1ba13a3966a3294240233 --- /dev/null +++ b/test/testsuite/fuzz_test/testlist @@ -0,0 +1,5 @@ +[ALL-TEST-CASE] + fuzz/*/Start.java + langfuzz/*/Start.java + +[EXCLUDE-TEST-CASE] diff --git a/test/testsuite/maple.py b/test/testsuite/maple.py index cf52f1f56eaded76d41348d677d83f5b90a64ce5..2f197642786fa7090fbf8f9cce24b7f7f4ff5335 100644 --- a/test/testsuite/maple.py +++ b/test/testsuite/maple.py @@ -215,7 +215,7 @@ def do_init(components): parser.add_argument("-p", "--platform", dest="target", choices=["aarch64"], default="aarch64", help="choose toolchain target, default is aarch64") # Select compile phase - parser.add_argument("-s", "--stage", dest='stage', choices=["javac", "jar", "maple", "as", "ld"], default="ld", + parser.add_argument("-s", "--stage", dest="stage", choices=["javac", "jar", "maple", "as", "ld"], default="ld", help="Select the compiler stage, default is ld") # set timeout limitation parser.add_argument("--timeout", metavar="TIMEOUT", dest="timeout", default=None, type=int, @@ -249,6 +249,8 @@ def do_prepare(components, info, maple_root): javac_options = "-g -d . " jar_options = "-cvf " as_options = "-g3 -O2 -x assembler-with-cpp -march=armv8-a -target aarch64-linux-gnu -c " + cc_options = "-g3 -O2 -c -march=armv8-a -target aarch64-linux-gnu" + cxx_options = "-g3 -O2 -c -fPIC -march=armv8-a -target aarch64-linux-gnu" linker_options = "-g3 -O2 -march=armv8-a -target aarch64-linux-gnu -fPIC -shared -o "\ + output_name + " " + maple_out_lib_path + "/mrt_module_init.o "\ + "-fuse-ld=lld -rdynamic -lcore-all -lcommon-bridge -Wl,-z,notext -Wl,-T"\ @@ -258,11 +260,15 @@ def do_prepare(components, info, maple_root): components["jar"].update_info(None, info["jar"]) components["maple"].update_info(maple_out_bin_path, info["maple"]) components["as"].update_info(gnu_bin_path, info["as"]) + components["cc"].update_info(gnu_bin_path, info["cc"]) + components["cxx"].update_info(gnu_bin_path, info["cxx"]) components["ld"].update_info(gnu_bin_path, info["ld"]) components["javac"].update_info(None, javac_options) components["jar"].update_info(None, jar_options) components["as"].update_info(None, as_options) + components["cc"].update_info(None, cc_options) + components["cxx"].update_info(None, cxx_options) components["ld"].update_info(None, linker_options) @@ -273,19 +279,25 @@ def do_prepare(components, info, maple_root): # ----------------------------------------------------------------------- def do_update(components, file_type): if file_type == "javac": - components.pop('jar') - components.pop('maple') - components.pop('as') - components.pop('ld') + components.pop("jar") + components.pop("maple") + components.pop("as") + components.pop("cc") + components.pop("cxx") + components.pop("ld") elif file_type == "jar": - components.pop('maple') - components.pop('as') - components.pop('ld') + components.pop("maple") + components.pop("as") + components.pop("cc") + components.pop("cxx") + components.pop("ld") elif file_type == "maple": - components.pop('as') - components.pop('ld') + components.pop("as") + components.pop("cc") + components.pop("cxx") + components.pop("ld") elif file_type == "as": - components.pop('ld') + components.pop("ld") # ------------------------------------------------------------------------ @@ -323,6 +335,8 @@ def main(): components["jar"] = Jar("/usr/bin/jar", ".class", ".jar", "") components["maple"] = SingleCompiler("maple", ".jar", ".VtableImpl.s", "") components["as"] = MultiCompiler("clang++", ".s", ".o", "") + components["cc"] = MultiCompiler("clang", ".c", ".o", "") + components["cxx"] = MultiCompiler("clang++", ".cpp", ".o", "") components["ld"] = Ld("clang++", ".o", ".so", "") # set the parser and collect the args diff --git a/test/testsuite/ouroboros/eh_test/RT0023-rt-eh-NativeCatchExceptionTest/NativeCatchExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0023-rt-eh-NativeCatchExceptionTest/NativeCatchExceptionTest.java new file mode 100644 index 0000000000000000000000000000000000000000..d97d269600858429f88a1c375176183df4c6bf5b --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0023-rt-eh-NativeCatchExceptionTest/NativeCatchExceptionTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: NativeCatchExceptionTest.java + * -@TestCaseName: Asynchronous: Native(exception at callback from Java), captured by Java. + * -@TestCaseType: Function Test + * -@RequirementName: [运行时需求]支持Java异常处理 + * -@Brief: + * -#step1: Declare a native method, Create the native method in C file. + * -#step2: The C file Method will Call java method callback, the callback will throw NumberFormatException. + * -#step3: Invoke this native method. + * -#step4: Check NumberFormatException is thrown. + * -@Expect: expected.txt + * -@Priority: High + * -@Source: NativeCatchExceptionTest.java jniNativeCatchExceptionTest.cpp + * -@ExecuteClass: NativeCatchExceptionTest + * -@ExecuteArgs: + */ + +import java.io.PrintStream; + +public class NativeCatchExceptionTest extends Exception { + private static int processResult = 99; + + public static void main(String[] argv) { + System.exit(run(argv, System.out)); + } + + private native void nativeNativeCatchExceptionTest() throws IllegalStateException; + + private void callback() throws NumberFormatException { + throw new NumberFormatException("JavaMethodThrows"); + } + + /** + * main test fun + * @return status code + */ + public static int run(String[] argv, PrintStream out) { + int result = 2; /* STATUS_FAILED */ + + try { + result = nativeCatchExceptionTest(); + } catch (Exception e) { + processResult -= 10; + } + if (result == 1 && processResult == 95) { + result = 0; + } + return result; + } + + /** + * Asynchronous: Native(exception at callback from Java), captured by Java. + * @return status code + */ + public static int nativeCatchExceptionTest() { + int result1 = 4; /* STATUS_FAILED */ + + NativeCatchExceptionTest cTest = new NativeCatchExceptionTest(); + try { + cTest.nativeNativeCatchExceptionTest(); + processResult -= 10; + } catch (NumberFormatException e1) { + result1 = 1; + processResult--; + } catch (IllegalStateException e2) { + processResult -= 10; + } catch (StringIndexOutOfBoundsException e3) { + processResult -= 10; + } + + processResult -= 3; + return result1; + } +} + +// DEPENDENCE: jniNativeCatchExceptionTest.cpp +// EXEC:%maple NativeCatchExceptionTest.java jniNativeCatchExceptionTest.cpp %build_option -o %n.so +// EXEC:%run %n.so NativeCatchExceptionTest %run_option | compare %f +// ASSERT: scan \-\-\-\-\-\-\>CheckPoint\:CcanContinue \ No newline at end of file diff --git a/test/testsuite/ouroboros/eh_test/RT0023-rt-eh-NativeCatchExceptionTest/jniNativeCatchExceptionTest.cpp b/test/testsuite/ouroboros/eh_test/RT0023-rt-eh-NativeCatchExceptionTest/jniNativeCatchExceptionTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..72b3b8e08f82fd775038d3112e6de497b2e62310 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0023-rt-eh-NativeCatchExceptionTest/jniNativeCatchExceptionTest.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +#include +#include + +extern "C" { +JNIEXPORT void JNICALL Java_NativeCatchExceptionTest_nativeNativeCatchExceptionTest__ +(JNIEnv *env, jobject j_obj) +{ + jclass cls = NULL; + jmethodID mid = NULL; + + cls = env->GetObjectClass(j_obj); + if ( cls == NULL ) { + return; + } + + mid = env->GetMethodID(cls, "callback", "()V"); + if ( mid == NULL ) { + return; + } + + env->CallVoidMethod(j_obj, mid); + printf("------>CheckPoint:CcanContinue\n"); +} +} diff --git a/test/testsuite/ouroboros/eh_test/RT0024-rt-eh-NativeCodeCheckExceptionTest/NativeCodeCheckExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0024-rt-eh-NativeCodeCheckExceptionTest/NativeCodeCheckExceptionTest.java new file mode 100644 index 0000000000000000000000000000000000000000..e98b09c62f1317da7b5df2cf03125f95e11990de --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0024-rt-eh-NativeCodeCheckExceptionTest/NativeCodeCheckExceptionTest.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: NativeCodeCheckExceptionTest.java + * -@TestCaseName: Asynchronous: Native(exception at callback from Java, then throw),captured by Java. + * -@TestCaseType: Function Test + * -@RequirementName: [运行时需求]支持Java异常处理 + * -@Brief: + * -#step1: Declare a native method, Create the native method in C file. + * -#step2: The C file Method will Call java method callback, the callback will throw NumberFormatException. + * -#step3: Invoke this native method. + * -#step4: Check NumberFormatException is thrown. + * -@Expect: expected.txt + * -@Priority: High + * -@Source: NativeCodeCheckExceptionTest.java jniNativeCodeCheckExceptionTest.cpp + * -@ExecuteClass: NativeCodeCheckExceptionTest + * -@ExecuteArgs: + */ + +import java.io.PrintStream; + +public class NativeCodeCheckExceptionTest extends Exception { + private static int processResult = 99; + + public static void main(String[] argv) { + System.exit(run(argv, System.out)); + } + + private native void nativeNativeCodeCheckExceptionTest() throws IllegalStateException; + + private void callback() throws NumberFormatException { + throw new NumberFormatException("JavaMethodThrows"); + } + + /** + * main test fun + * @return status code + */ + public static int run(String[] argv, PrintStream out) { + int result = 2; /* STATUS_FAILED */ + try { + result = nativeCodeCheckExceptionTest(); + } catch (Exception e) { + processResult -= 10; + } + + if (result == 3 && processResult == 95) { + result = 0; + } + return result; + } + + /** + * Asynchronous: Native(exception at callback from Java, then throw),captured by Java. + * @return status code + */ + public static int nativeCodeCheckExceptionTest() { + int result1 = 4; /* STATUS_FAILED */ + NativeCodeCheckExceptionTest cTest = new NativeCodeCheckExceptionTest(); + try { + cTest.nativeNativeCodeCheckExceptionTest(); + processResult -= 10; + } catch (NumberFormatException e1) { + result1 = 3; + processResult -= 1; + } catch (IllegalStateException e2) { + processResult -= 10; + } catch (StringIndexOutOfBoundsException e3) { + processResult -= 10; + } finally { + processResult -= 3; + return result1; + } + } +} + +// DEPENDENCE: jniNativeCodeCheckExceptionTest.cpp +// EXEC:%maple NativeCodeCheckExceptionTest.java jniNativeCodeCheckExceptionTest.cpp %build_option -o %n.so +// EXEC:%run %n.so NativeCodeCheckExceptionTest %run_option | compare %f +// ASSERT: scan \-\-\-\-\-\-\>CheckPoint\:CcanContinue \ No newline at end of file diff --git a/test/testsuite/ouroboros/eh_test/RT0024-rt-eh-NativeCodeCheckExceptionTest/jniNativeCodeCheckExceptionTest.cpp b/test/testsuite/ouroboros/eh_test/RT0024-rt-eh-NativeCodeCheckExceptionTest/jniNativeCodeCheckExceptionTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8267d9601bcb4e752f92794f9df1cd9429ea193f --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0024-rt-eh-NativeCodeCheckExceptionTest/jniNativeCodeCheckExceptionTest.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +#include +#include + +extern "C" { +JNIEXPORT void JNICALL Java_NativeCodeCheckExceptionTest_nativeNativeCodeCheckExceptionTest__ +(JNIEnv *env, jobject j_obj) +{ + jclass cls = NULL; + jmethodID mid = NULL; + + cls = env->GetObjectClass(j_obj); + if (cls == NULL){ + return; + } + mid = env->GetMethodID(cls,"callback", "()V"); + if (mid == NULL){ + return; + } + + env->CallVoidMethod(j_obj, mid); + + jthrowable j_exc = NULL; + j_exc = env->ExceptionOccurred(); + + if(j_exc){ + env->Throw(j_exc); + } + + printf("------>CheckPoint:CcanContinue\n"); +} +} diff --git a/test/testsuite/ouroboros/eh_test/RT0025-rt-eh-NativeNewExceptionTest/NativeNewExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0025-rt-eh-NativeNewExceptionTest/NativeNewExceptionTest.java new file mode 100644 index 0000000000000000000000000000000000000000..c217996b24ea3494c14ba6285292e1bec5a7c02e --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0025-rt-eh-NativeNewExceptionTest/NativeNewExceptionTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: NativeNewExceptionTest.java + * -@TestCaseName: Asynchronous: Native(exception-throw new), captured by Java. + * -@TestCaseType: Function Test + * -@RequirementName: [运行时需求]支持Java异常处理 + * -@Brief: + * -#step1: Declare a native method that throws an exception, Create the native method throws new exception in C file. + * -#step2: The C file Method will Call java method callback. + * -#step3: Invoke this native method. + * -#step4: Check new Exception StringIndexOutOfBoundsException is thrown. + * -@Expect: expected.txt + * -@Priority: High + * -@Source: NativeNewExceptionTest.java jniNativeNewExceptionTest.cpp + * -@ExecuteClass: NativeNewExceptionTest + * -@ExecuteArgs: + */ + +import java.io.PrintStream; + +public class NativeNewExceptionTest extends Exception { + private static int processResult = 99; + + public static void main(String[] argv) { + System.exit(run(argv, System.out)); + } + + private native void nativeNativeNewExceptionTest() throws IllegalStateException; + + private void callback() throws NumberFormatException { + throw new NumberFormatException("JavaMethodThrows"); + } + + /** + * main test fun + * @return status code + */ + public static int run(String[] argv, PrintStream out) { + int result = 2; /* STATUS_FAILED */ + try { + result = nativeNewExceptionTest(); + } catch (Exception e) { + processResult -= 10; + } + + if (result == 3 && processResult == 95) { + result = 0; + } + + return result; + } + + /** + * Asynchronous: Native(exception-throw new), captured by Java. + * @return status code + */ + public static int nativeNewExceptionTest() { + int result1 = 4; /* STATUS_FAILED */ + + NativeNewExceptionTest cTest = new NativeNewExceptionTest(); + try { + cTest.nativeNativeNewExceptionTest(); + processResult -= 10; + } catch (NumberFormatException e1) { + processResult -= 10; + } catch (IllegalStateException e2) { + processResult -= 10; + } catch (StringIndexOutOfBoundsException e3) { + result1 = 3; + processResult--; + } + processResult -= 3; + return result1; + } +} + +// DEPENDENCE: jniNativeNewExceptionTest.cpp +// EXEC:%maple NativeNewExceptionTest.java jniNativeNewExceptionTest.cpp %build_option -o %n.so +// EXEC:%run %n.so NativeNewExceptionTest %run_option | compare %f +// ASSERT: scan \-\-\-\-\-\-\>CheckPoint\:CcanContinue \ No newline at end of file diff --git a/test/testsuite/ouroboros/eh_test/RT0025-rt-eh-NativeNewExceptionTest/jniNativeNewExceptionTest.cpp b/test/testsuite/ouroboros/eh_test/RT0025-rt-eh-NativeNewExceptionTest/jniNativeNewExceptionTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4fa3db51b0f392582bc3d18cfd5a71df5850eb29 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0025-rt-eh-NativeNewExceptionTest/jniNativeNewExceptionTest.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +#include +#include + +extern "C" { +JNIEXPORT void JNICALL Java_NativeNewExceptionTest_nativeNativeNewExceptionTest__ +(JNIEnv *env, jobject j_obj) +{ + jclass cls = NULL; + jmethodID mid = NULL; + + cls = env->GetObjectClass(j_obj); + if (cls == NULL){ + return; + } + mid = env->GetMethodID(cls,"callback", "()V"); + if (mid == NULL){ + return; + } + + env->CallVoidMethod(j_obj, mid); + jclass newExcCls = NULL; + newExcCls = env->FindClass("java/lang/StringIndexOutOfBoundsException"); + if (newExcCls == NULL){ + return; + } + + env->ThrowNew(newExcCls,"NativeThrowNew"); + printf("------>CheckPoint:CcanContinue\n"); +} +} diff --git a/test/testsuite/ouroboros/eh_test/RT0026-rt-eh-NativeTryCatchNewExceptionTest/NativeTryCatchNewExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0026-rt-eh-NativeTryCatchNewExceptionTest/NativeTryCatchNewExceptionTest.java new file mode 100644 index 0000000000000000000000000000000000000000..599c12b57d83765033a1b3ec76e61b161a90f229 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0026-rt-eh-NativeTryCatchNewExceptionTest/NativeTryCatchNewExceptionTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:NativeTryCatchNewExceptionTest.java + * -@TestCaseName: Asynchronous: Native(exception at callback from Java-throw new), captured by Java(try-catch). + * -@TestCaseType: Function Test + * -@RequirementName: [运行时需求]支持Java异常处理 + * -@Brief: + * -#step1: Declare a native method that throws an exception, Create the native method throws new exception in C file. + * -#step2: The C file Method will Call java method callback. + * -#step3: Invoke this native method. + * -#step4: Check new Exception StringIndexOutOfBoundsException is thrown by Java(try-catch). + * -@Expect: expected.txt + * -@Priority: High + * -@Source:NativeTryCatchNewExceptionTest.java jniNativeTryCatchNewExceptionTest.cpp + * -@ExecuteClass: NativeTryCatchNewExceptionTest + * -@ExecuteArgs: + */ + +import java.io.PrintStream; + +public class NativeTryCatchNewExceptionTest extends Exception { + private static int processResult = 99; + + public static void main(String[] argv) { + System.exit(run(argv, System.out)); + } + + private native void nativeNativeTryCatchNewExceptionTest() throws IllegalArgumentException; + + private void callback() throws NumberFormatException { + throw new NumberFormatException("JavaMethodThrows"); + } + + /** + * main test fun + * @return status code + */ + public static int run(String[] argv, PrintStream out) { + int result = 2; /* STATUS_FAILED */ + try { + result = nativeTryCatchNewExceptionTest(); + } catch (Exception e) { + processResult--; + } + + if (result == 2 && processResult == 95) { + result = 0; + } + return result; + } + + /** + * Asynchronous: Native(exception at callback from Java-throw new), captured by Java(try-catch). + * @return status code + */ + public static int nativeTryCatchNewExceptionTest() { + int result1 = 4; /* STATUS_FAILED */ + + NativeTryCatchNewExceptionTest cTest = new NativeTryCatchNewExceptionTest(); + try { + cTest.nativeNativeTryCatchNewExceptionTest(); + processResult -= 10; + } catch (NumberFormatException e1) { + processResult -= 10; + } catch (IllegalStateException e2) { + processResult -= 10; + } finally { + processResult -= 3; + } + return result1; + } +} + +// DEPENDENCE: jniNativeTryCatchNewExceptionTest.cpp +// EXEC:%maple NativeTryCatchNewExceptionTest.java jniNativeTryCatchNewExceptionTest.cpp %build_option -o %n.so +// EXEC:%run %n.so NativeTryCatchNewExceptionTest %run_option | compare %f +// ASSERT: scan \-\-\-\-\-\-\>CheckPoint\:CcanContinue \ No newline at end of file diff --git a/test/testsuite/ouroboros/eh_test/RT0026-rt-eh-NativeTryCatchNewExceptionTest/jniNativeTryCatchNewExceptionTest.cpp b/test/testsuite/ouroboros/eh_test/RT0026-rt-eh-NativeTryCatchNewExceptionTest/jniNativeTryCatchNewExceptionTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..888e5f7e3a2712544b9e8af32e57f951ae2311e6 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0026-rt-eh-NativeTryCatchNewExceptionTest/jniNativeTryCatchNewExceptionTest.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +#include +#include + +extern "C" { +JNIEXPORT void JNICALL Java_NativeTryCatchNewExceptionTest_nativeNativeTryCatchNewExceptionTest__ +(JNIEnv *env, jobject j_obj) +{ + jclass cls = NULL; + jmethodID mid = NULL; + + cls = env->GetObjectClass(j_obj); + if (cls == NULL){ + return; + } + mid = env->GetMethodID(cls,"callback", "()V"); + if (mid == NULL){ + return; + } + + env->CallVoidMethod(j_obj, mid); + + jclass newExcCls = NULL; + newExcCls = env->FindClass("java/lang/StringIndexOutOfBoundsException"); + if (newExcCls == NULL){ + return; + } + + env->ThrowNew(newExcCls,"NativeThrowNew"); + + printf("------>CheckPoint:CcanContinue\n"); +} +} diff --git a/test/testsuite/ouroboros/eh_test/RT0027-rt-eh-NativeCodeCheckNewExceptionTest/NativeCodeCheckNewExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0027-rt-eh-NativeCodeCheckNewExceptionTest/NativeCodeCheckNewExceptionTest.java new file mode 100644 index 0000000000000000000000000000000000000000..5d88dbdfca7538031ec4f1c1539277d37ebad2b6 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0027-rt-eh-NativeCodeCheckNewExceptionTest/NativeCodeCheckNewExceptionTest.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: NativeCodeCheckNewExceptionTest.java + * -@TestCaseName: Asynchronous: Native(exception at callback from Java, then Occurred-throw new), catch by Java. + * -@TestCaseType: Function Test + * -@RequirementName: [运行时需求]支持Java异常处理 + * -@Brief: + * -#step1: Declare a native method that throws an exception, Create the native method throws new exception in C file. + * -#step2: The C file Method will Call java method callback, use ExceptionOccurred check Exception. + * -#step3: Invoke this native method. + * -#step4: Check new Exception StringIndexOutOfBoundsException is thrown. + * -@Expect: expected.txt + * -@Priority: High + * -@Source: NativeCodeCheckNewExceptionTest.java jniNativeCodeCheckNewExceptionTest.cpp + * -@ExecuteClass: NativeCodeCheckNewExceptionTest + * -@ExecuteArgs: + */ + +import java.io.PrintStream; +import java.nio.file.InvalidPathException; + +public class NativeCodeCheckNewExceptionTest extends Exception { + private static int processResult = 99; + + public static void main(String[] argv) { + System.exit(run(argv, System.out)); + } + + private native void nativeNativeCodeCheckNewExceptionTest() throws InvalidPathException; + + private void callback() throws NumberFormatException { + throw new NumberFormatException("JavaMethodThrows"); + } + + /** + * main test fun + * @return status code + */ + public static int run(String[] argv, PrintStream out) { + int result = 2; /* STATUS_FAILED */ + try { + result = nativeCodeCheckNewExceptionTest(); + } catch (Exception e) { + processResult -= 10; + } + + if (result == 1 && processResult == 95) { + result = 0; + } + + return result; + } + + /** + * Asynchronous: Native(exception at callback from Java, then Occurred-throw new), catch by Java. + * @return status code + */ + public static int nativeCodeCheckNewExceptionTest() { + int result1 = 4; /* STATUS_FAILED */ + + NativeCodeCheckNewExceptionTest cTest = new NativeCodeCheckNewExceptionTest(); + try { + cTest.nativeNativeCodeCheckNewExceptionTest(); + processResult -= 10; + } catch (NumberFormatException e1) { + result1 = 3; + System.out.println("======>" + e1.getMessage()); + processResult -= 10; + } catch (InvalidPathException e2) { + result1 = 3; + System.out.println("======>" + e2.getMessage()); + processResult -= 10; + } catch (StringIndexOutOfBoundsException e3) { + result1 = 1; + processResult--; + } + processResult -= 3; + return result1; + } +} + +// DEPENDENCE: jniNativeCodeCheckNewExceptionTest.cpp +// EXEC:%maple NativeCodeCheckNewExceptionTest.java jniNativeCodeCheckNewExceptionTest.cpp %build_option -o %n.so +// EXEC:%run %n.so NativeCodeCheckNewExceptionTest %run_option | compare %f +// ASSERT: scan \-\-\-\-\-\-\>CheckPoint\:CcanContinue \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0158-rt-thread-ThreadgetStackTrace/ThreadGetStackTraceTest.java_bak b/test/testsuite/ouroboros/eh_test/RT0027-rt-eh-NativeCodeCheckNewExceptionTest/jniNativeCodeCheckNewExceptionTest.cpp similarity index 35% rename from test/testsuite/ouroboros/thread_test/RT0158-rt-thread-ThreadgetStackTrace/ThreadGetStackTraceTest.java_bak rename to test/testsuite/ouroboros/eh_test/RT0027-rt-eh-NativeCodeCheckNewExceptionTest/jniNativeCodeCheckNewExceptionTest.cpp index 1bcd2b77dd29b459ad4bf07603f8969ba8428127..be7dabe23d809056c0fadc1a4102a61762e5214d 100644 --- a/test/testsuite/ouroboros/thread_test/RT0158-rt-thread-ThreadgetStackTrace/ThreadGetStackTraceTest.java_bak +++ b/test/testsuite/ouroboros/eh_test/RT0027-rt-eh-NativeCodeCheckNewExceptionTest/jniNativeCodeCheckNewExceptionTest.cpp @@ -1,41 +1,52 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadGetStackTraceTest - *- @TestCaseName: Thread_ThreadGetStackTraceTest.java_bak - *- @RequirementName: Java Thread - *- @Title/Destination: Test getStackTrace(). - *- @Brief: see below - * -#step1: 调用Thread.currentThread()获取Thread 实例。 - * -#step2:调用getStackTrace()获取对应的StackTraceElement数组。 - * -#step3:确认获取的StackTraceElement数组成员内容正确。 - *- @Expect: 0\n - *- @Priority: High - *- @Remark: - *- @Source: ThreadGetStackTraceTest.java - *- @ExecuteClass: ThreadGetStackTraceTest - *- @ExecuteArgs: - */ - -public class ThreadGetStackTraceTest extends Thread { - public static void main(String[] args) { - StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); - int l = stackTraceElements.length; - if (stackTraceElements[l - 1].toString().contains("main") && stackTraceElements[l - 2].toString().contains("run") - && stackTraceElements[l - 3].toString().contains("ThreadGetStackTraceTest")) { - System.out.println(0); - return; - } - System.out.println(2); - } -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +#include +#include + +extern "C" { +JNIEXPORT void JNICALL Java_NativeCodeCheckNewExceptionTest_nativeNativeCodeCheckNewExceptionTest__ +(JNIEnv *env, jobject j_obj) +{ + jclass cls = NULL; + jmethodID mid = NULL; + + cls = env->GetObjectClass(j_obj); + if (cls == NULL){ + return; + } + mid = env->GetMethodID(cls,"callback", "()V"); + if (mid == NULL){ + return; + } + + env->CallVoidMethod(j_obj, mid); + + jthrowable j_exc =NULL; + j_exc=env->ExceptionOccurred(); + if (j_exc == NULL){ + return; + } + + if (j_exc){ + jclass newExcCls = NULL; + newExcCls = env->FindClass("java/lang/StringIndexOutOfBoundsException"); + if (newExcCls == NULL){ + return; + } + env->ThrowNew(newExcCls,"NativeThrowNew"); + } + printf("------>CheckPoint:CcanContinue\n"); +} +} diff --git a/test/testsuite/ouroboros/eh_test/RT0028-rt-eh-NativeClearExceptionTest/NativeClearExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0028-rt-eh-NativeClearExceptionTest/NativeClearExceptionTest.java new file mode 100644 index 0000000000000000000000000000000000000000..6509a99a5fa28407f65665f09c354c62ae255226 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0028-rt-eh-NativeClearExceptionTest/NativeClearExceptionTest.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: NativeClearExceptionTest.java + * -@TestCaseName: Asynchronous: Native(exception at callback from Java, then Occurred-throw new-clear). + * -@TestCaseType: Function Test + * -@RequirementName: [运行时需求]支持Java异常处理 + * -@Brief: + * -#step1: Declare a native method that throws an exception. + * -#step2: Create the native method throws new exception in C file. + * -#step3: The C file Method will Call java method callback, use ExceptionOccurred check Exception, use ExceptionClear + * clear Exception. + * -#step4: Invoke this native method. + * -#step5: Check new Exception StringIndexOutOfBoundsException is not thrown. + * -@Expect: expected.txt + * -@Priority: High + * -@Source: NativeClearExceptionTest.java jniNativeClearExceptionTest.cpp + * -@ExecuteClass: NativeClearExceptionTest + * -@ExecuteArgs: + */ + +import java.io.PrintStream; +import java.nio.file.InvalidPathException; + +public class NativeClearExceptionTest extends Exception { + private static int processResult = 99; + + public static void main(String[] argv) { + System.exit(run(argv, System.out)); + } + + private native void nativeNativeClearExceptionTest() throws InvalidPathException; + + private void callback() throws NumberFormatException { + throw new NumberFormatException("JavaMethodThrows"); + } + + /** + * main test fun + * @return status code + */ + public static int run(String[] argv, PrintStream out) { + int result = 2; /* STATUS_FAILED */ + try { + result = nativeClearExceptionTest(); + } catch (Exception e) { + processResult -= 10; + } + + if (result == 4 && processResult == 95) { + result = 0; + } + + return result; + } + + /** + * Asynchronous: Native(exception at callback from Java, then Occurred-throw new-clear). + * @return status code + */ + public static int nativeClearExceptionTest() { + int result1 = 4; /* STATUS_FAILED */ + + NativeClearExceptionTest cTest = new NativeClearExceptionTest(); + try { + cTest.nativeNativeClearExceptionTest(); + processResult -= 1; + } catch (NumberFormatException e1) { + result1 = 3; + System.out.println("======>" + e1.getMessage()); + processResult -= 10; + } catch (InvalidPathException e2) { + result1 = 3; + System.out.println("======>" + e2.getMessage()); + processResult -= 10; + } catch (StringIndexOutOfBoundsException e3) { + result1 = 3; + System.out.println("======>" + e3.getMessage()); + processResult -= 10; + } + processResult -= 3; + return result1; + } +} + +// DEPENDENCE: jniNativeClearExceptionTest.cpp +// EXEC:%maple NativeClearExceptionTest.java jniNativeClearExceptionTest.cpp %build_option -o %n.so +// EXEC:%run %n.so NativeClearExceptionTest %run_option | compare %f +// ASSERT: scan \-\-\-\-\-\-\>CheckPoint\:CcanContinue \ No newline at end of file diff --git a/test/testsuite/ouroboros/eh_test/RT0028-rt-eh-NativeClearExceptionTest/jniNativeClearExceptionTest.cpp b/test/testsuite/ouroboros/eh_test/RT0028-rt-eh-NativeClearExceptionTest/jniNativeClearExceptionTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7de6df1fd6a76ebb0e923641dbd069fe08ad1109 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0028-rt-eh-NativeClearExceptionTest/jniNativeClearExceptionTest.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +#include +#include + +extern "C" { +JNIEXPORT void JNICALL Java_NativeClearExceptionTest_nativeNativeClearExceptionTest__ +(JNIEnv *env, jobject j_obj) +{ + jclass cls = NULL; + jmethodID mid = NULL; + + cls = env->GetObjectClass(j_obj); + if (cls == NULL){ + return; + } + mid = env->GetMethodID(cls,"callback", "()V"); + if (mid == NULL){ + return; + } + + env->CallVoidMethod(j_obj, mid); + + jthrowable j_exc =NULL; + j_exc=env->ExceptionOccurred(); + if (j_exc == NULL){ + return; + } + + if (j_exc){ + jclass newExcCls = NULL; + newExcCls = env->FindClass("java/lang/StringIndexOutOfBoundsException"); + if (newExcCls == NULL){ + return; + } + env->ThrowNew(newExcCls,"NativeThrowNew"); + env->ExceptionClear(); + } + + printf("------>CheckPoint:CcanContinue\n"); + +} +} diff --git a/test/testsuite/ouroboros/eh_test/RT0029-rt-eh-NativeCodeCatchThrowNewExceptionTest/NativeCodeCatchThrowNewExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0029-rt-eh-NativeCodeCatchThrowNewExceptionTest/NativeCodeCatchThrowNewExceptionTest.java new file mode 100644 index 0000000000000000000000000000000000000000..5f69c4294af4c3cc817cf01a5fd9fc7abcb4559c --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0029-rt-eh-NativeCodeCatchThrowNewExceptionTest/NativeCodeCatchThrowNewExceptionTest.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: NativeCodeCatchThrowNewExceptionTest.java + * -@TestCaseName: Asynchronous: Native(exception at callback from Java, then check-throw new), captured by Java. + * -@TestCaseType: Function Test + * -@RequirementName: [运行时需求]支持Java异常处理 + * -@Brief: + * -#step1: Declare a native method that throws an exception e1. + * -#step2: Invoke this native method. + * -#step3: The exception e1 is captured by C code, when e1 get, then new Exception e2 is thrown. + * -#step4: Check new Exception e2 is captured by java(try/catch). + * -@Expect: expected.txt + * -@Priority: High + * -@Source: NativeCodeCatchThrowNewExceptionTest.java jniNativeCodeCatchThrowNewExceptionTest.cpp + * -@ExecuteClass: NativeCodeCatchThrowNewExceptionTest + * -@ExecuteArgs: + */ + +import java.io.PrintStream; +import java.nio.file.InvalidPathException; + +public class NativeCodeCatchThrowNewExceptionTest extends Exception { + private static int processResult = 99; + + public static void main(String[] argv) { + System.exit(run(argv, System.out)); + } + + private native void nativeNativeCodeCatchThrowNewExceptionTest() throws InvalidPathException; + + private void callback() throws NumberFormatException { + throw new NumberFormatException("JavaMethodThrows"); + } + + /** + * main test fun + * @return status code + */ + public static int run(String[] argv, PrintStream out) { + int result = 2; /* STATUS_FAILED */ + try { + result = nativeCodeCatchThrowNewExceptionTest(); + } catch (Exception e) { + processResult -= 10; + } + + if (result == 1 && processResult == 95) { + result = 0; + } + return result; + } + + /** + * Asynchronous: Native(exception at callback from Java, then check-throw new), captured by Java. + * @return status code + */ + public static int nativeCodeCatchThrowNewExceptionTest() { + int result1 = 4; /* STATUS_FAILED */ + + NativeCodeCatchThrowNewExceptionTest cTest = new NativeCodeCatchThrowNewExceptionTest(); + try { + cTest.nativeNativeCodeCatchThrowNewExceptionTest(); + processResult -= 10; + } catch (NumberFormatException e1) { + result1 = 3; + System.out.println("======>" + e1.getMessage()); + processResult -= 10; + } catch (InvalidPathException e2) { + result1 = 3; + System.out.println("======>" + e2.getMessage()); + processResult -= 10; + } catch (StringIndexOutOfBoundsException e3) { + result1 = 1; + processResult--; + } + processResult -= 3; + return result1; + } +} + +// DEPENDENCE: jniNativeCodeCatchThrowNewExceptionTest.cpp +// EXEC:%maple NativeCodeCatchThrowNewExceptionTest.java jniNativeCodeCatchThrowNewExceptionTest.cpp %build_option -o %n.so +// EXEC:%run %n.so NativeCodeCatchThrowNewExceptionTest %run_option | compare %f +// ASSERT: scan \-\-\-\-\-\-\>CheckPoint\:CcanContinue \ No newline at end of file diff --git a/test/testsuite/ouroboros/eh_test/RT0029-rt-eh-NativeCodeCatchThrowNewExceptionTest/jniNativeCodeCatchThrowNewExceptionTest.cpp b/test/testsuite/ouroboros/eh_test/RT0029-rt-eh-NativeCodeCatchThrowNewExceptionTest/jniNativeCodeCatchThrowNewExceptionTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c03e3b963843af64bdbd7c0c6516461198ff1e8f --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0029-rt-eh-NativeCodeCatchThrowNewExceptionTest/jniNativeCodeCatchThrowNewExceptionTest.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +#include +#include + +extern "C" { +JNIEXPORT void JNICALL Java_NativeCodeCatchThrowNewExceptionTest_nativeNativeCodeCatchThrowNewExceptionTest__ +(JNIEnv *env, jobject j_obj) +{ + jclass cls = NULL; + jmethodID mid = NULL; + + cls = env->GetObjectClass(j_obj); + if (cls == NULL){ + return; + } + mid = env->GetMethodID(cls,"callback", "()V"); + if (mid == NULL){ + return; + } + + env->CallVoidMethod(j_obj, mid); + + jboolean chk = NULL; + chk = env->ExceptionCheck(); + if (chk == NULL){ + return; + } + + if (chk){ + jclass newExcCls = NULL; + newExcCls = env->FindClass("java/lang/StringIndexOutOfBoundsException"); + if (newExcCls == NULL){ + return; + } + env->ThrowNew(newExcCls,"NativeThrowNew"); + } + + printf("------>CheckPoint:CcanContinue\n"); +} +} diff --git a/test/testsuite/ouroboros/eh_test/RT0030-rt-eh-NativeCheckFatalErrorExceptionTest/NativeCheckFatalErrorExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0030-rt-eh-NativeCheckFatalErrorExceptionTest/NativeCheckFatalErrorExceptionTest.java new file mode 100644 index 0000000000000000000000000000000000000000..1eab4238d7f3e73674ec72b52a3d6d3a629562e5 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0030-rt-eh-NativeCheckFatalErrorExceptionTest/NativeCheckFatalErrorExceptionTest.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: NativeCheckFatalErrorExceptionTest.java + * -@TestCaseName: Asynchronous: Native(exception at callback from Java, then FatalError), catch by Java. + * -@TestCaseType: Function Test + * -@RequirementName: [运行时需求]支持Java异常处理 + * -@Brief: + * -#step1: Declare a native method that throws an exception NumberFormatException. + * -#step2: Invoke this native method. + * -#step3: Use FatalError to check FatalError. + * -#step4: Check Exception NumberFormatException is captured by java(try/catch). + * -@Expect: expected.txt + * -@Priority: High + * -@Source: NativeCheckFatalErrorExceptionTest.java jniNativeCheckFatalErrorExceptionTest.cpp + * -@ExecuteClass: NativeCheckFatalErrorExceptionTest + * -@ExecuteArgs: + */ + +import java.io.PrintStream; +import java.nio.file.InvalidPathException; + +public class NativeCheckFatalErrorExceptionTest extends Exception { + private static int processResult = 99; + + public static void main(String[] argv) { + System.exit(run(argv, System.out)); + } + + private native void nativeNativeCheckFatalErrorExceptionTest() throws InvalidPathException; + + private void callback() throws NumberFormatException { + throw new NumberFormatException("JavaMethodThrows"); + } + + /** + * main test fun + * @return status code + */ + public static int run(String[] argv, PrintStream out) { + int result = 2; /* STATUS_FAILED */ + try { + result = nativeCheckFatalErrorExceptionTest(); + } catch (Exception e) { + processResult -= 10; + } + + if (result == 1 && processResult == 95) { + result = 0; + } + return result; + } + + /** + * Asynchronous: Native(exception at callback from Java, then FatalError), catch by Java. + * @return status code + */ + public static int nativeCheckFatalErrorExceptionTest() { + int result1 = 4; /* STATUS_FAILED */ + + NativeCheckFatalErrorExceptionTest cTest = new NativeCheckFatalErrorExceptionTest(); + try { + cTest.nativeNativeCheckFatalErrorExceptionTest(); + processResult -= 10; + } catch (NumberFormatException e1) { + result1 = 1; + System.out.println("======>" + e1.getMessage()); + processResult--; + } catch (InvalidPathException e2) { + result1 = 3; + System.out.println("======>" + e2.getMessage()); + processResult -= 10; + } catch (StringIndexOutOfBoundsException e3) { + result1 = 3; + processResult -= 10; + } + processResult -= 3; + return result1; + } +} + +// DEPENDENCE: jniNativeCheckFatalErrorExceptionTest.cpp +// EXEC:%maple NativeCheckFatalErrorExceptionTest.java jniNativeCheckFatalErrorExceptionTest.cpp %build_option -o %n.so +// EXEC:%run %n.so NativeCheckFatalErrorExceptionTest 2>&1 %run_option | compare %f +// ASSERT: scan \-\-\-\-\-\-\>CheckPoint\:CcanContinue\s*\=\=\=\=\=\=\>JavaMethodThrows \ No newline at end of file diff --git a/test/testsuite/ouroboros/eh_test/RT0030-rt-eh-NativeCheckFatalErrorExceptionTest/jniNativeCheckFatalErrorExceptionTest.cpp b/test/testsuite/ouroboros/eh_test/RT0030-rt-eh-NativeCheckFatalErrorExceptionTest/jniNativeCheckFatalErrorExceptionTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..56f8a5b753766a3b85a7caca55caab9e38329137 --- /dev/null +++ b/test/testsuite/ouroboros/eh_test/RT0030-rt-eh-NativeCheckFatalErrorExceptionTest/jniNativeCheckFatalErrorExceptionTest.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +#include +#include + +extern "C" { +JNIEXPORT void JNICALL Java_NativeCheckFatalErrorExceptionTest_nativeNativeCheckFatalErrorExceptionTest__ +(JNIEnv *env, jobject j_obj) +{ + jclass cls = NULL; + jmethodID mid = NULL; + + cls = env->GetObjectClass(j_obj); + if (cls == NULL){ + return; + } + mid = env->GetMethodID(cls,"callback", "()V"); + if (mid == NULL){ + return; + } + + env->CallVoidMethod(j_obj, mid); + env->FatalError("------>CheckPoint:FatalError"); + + printf("------>CheckPoint:CcanContinue\n"); +} +} diff --git a/test/testsuite/ouroboros/eh_test/RT0032-rt-eh-TryFinallyExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0032-rt-eh-TryFinallyExceptionTest/Makefile deleted file mode 100644 index bbc1445ae95d764c543a46588e9e7498796a5fce..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0032-rt-eh-TryFinallyExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryFinallyExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0033-rt-eh-TryCatchExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0033-rt-eh-TryCatchExceptionTest/Makefile deleted file mode 100644 index 02287bb722a7c361f7e400708fd9eaa4a324515b..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0033-rt-eh-TryCatchExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0034-rt-eh-TryMultiCatchExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0034-rt-eh-TryMultiCatchExceptionTest/Makefile deleted file mode 100644 index 411253a927ce104d506a705a8ce1b7b5c29beabc..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0034-rt-eh-TryMultiCatchExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryMultiCatchExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0035-rt-eh-TryMultiCatchMatchFirstExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0035-rt-eh-TryMultiCatchMatchFirstExceptionTest/Makefile deleted file mode 100644 index 36249b5cc0c2ddcf73940b31736d91bd5dae5e86..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0035-rt-eh-TryMultiCatchMatchFirstExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryMultiCatchMatchFirstExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0036-rt-eh-TryCatchPipelineExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0036-rt-eh-TryCatchPipelineExceptionTest/Makefile deleted file mode 100644 index 60642207118d34402338b95397fbba362721a454..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0036-rt-eh-TryCatchPipelineExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchPipelineExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0037-rt-eh-TryMultiCatchFinallyExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0037-rt-eh-TryMultiCatchFinallyExceptionTest/Makefile deleted file mode 100644 index 97c86220b7dfead7a867887676adc01b32ebef4b..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0037-rt-eh-TryMultiCatchFinallyExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryMultiCatchFinallyExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0038-rt-eh-TryCatchResourceExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0038-rt-eh-TryCatchResourceExceptionTest/Makefile deleted file mode 100644 index f58de1da5f50880da3edd3be5e84b58c6975743d..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0038-rt-eh-TryCatchResourceExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchResourceExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0039-rt-eh-TryCatchThrowExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0039-rt-eh-TryCatchThrowExceptionTest/Makefile deleted file mode 100644 index 82dd463b4f6048800c0c345f329c86f944a82415..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0039-rt-eh-TryCatchThrowExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchThrowExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0040-rt-eh-TryExceptionFinallyExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0040-rt-eh-TryExceptionFinallyExceptionTest/Makefile deleted file mode 100644 index 0bebfc85469438608ffce55232f7b628c0641575..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0040-rt-eh-TryExceptionFinallyExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryExceptionFinallyExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0041-rt-eh-TryTryThrowExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0041-rt-eh-TryTryThrowExceptionTest/Makefile deleted file mode 100644 index 86a0a1389ad9d8fbecff82e6105e8f7156864448..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0041-rt-eh-TryTryThrowExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryTryThrowExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0042-rt-eh-TryTryCatchExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0042-rt-eh-TryTryCatchExceptionTest/Makefile deleted file mode 100644 index ad2b4d98921ba3d37b6ade7371f33d0841481f61..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0042-rt-eh-TryTryCatchExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryTryCatchExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0043-rt-eh-TryCatchTryExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0043-rt-eh-TryCatchTryExceptionTest/Makefile deleted file mode 100644 index 99d97b9b7161c9b09f1806da68fc4ed748866a0c..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0043-rt-eh-TryCatchTryExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchTryExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0044-rt-eh-DoubleTryCatchFinallyExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0044-rt-eh-DoubleTryCatchFinallyExceptionTest/Makefile deleted file mode 100644 index 287617a681d904cdddad639c4cfcd38dfe91800a..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0044-rt-eh-DoubleTryCatchFinallyExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=DoubleTryCatchFinallyExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0045-rt-eh-TryCatchTryCatchFinallyExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0045-rt-eh-TryCatchTryCatchFinallyExceptionTest/Makefile deleted file mode 100644 index 7e9a7629f95f28b7cd0f281a1ed288ae9ebc7f22..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0045-rt-eh-TryCatchTryCatchFinallyExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchTryCatchFinallyExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0046-rt-eh-TryCatchTryCatchExceptionFinallyTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0046-rt-eh-TryCatchTryCatchExceptionFinallyTest/Makefile deleted file mode 100644 index ee99bde64aa880601fe9ff1904b47d88bff752f5..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0046-rt-eh-TryCatchTryCatchExceptionFinallyTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchTryCatchExceptionFinallyTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0047-rt-eh-CatchThrowNewExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0047-rt-eh-CatchThrowNewExceptionTest/Makefile deleted file mode 100644 index 7be907bc8548238d845e2e72343c4e25c3309eea..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0047-rt-eh-CatchThrowNewExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=CatchThrowNewExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0048-rt-eh-CatchTryCatchNewExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0048-rt-eh-CatchTryCatchNewExceptionTest/Makefile deleted file mode 100644 index 6b35a01c30408e7a6f683764872125b8f7d9da45..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0048-rt-eh-CatchTryCatchNewExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=CatchTryCatchNewExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0049-rt-eh-CatchTryThrowNewExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0049-rt-eh-CatchTryThrowNewExceptionTest/Makefile deleted file mode 100644 index a09e7a1307e51650dbd0b4a18b6377ea571c81af..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0049-rt-eh-CatchTryThrowNewExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=CatchTryThrowNewExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0050-rt-eh-FinallyThrowExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0050-rt-eh-FinallyThrowExceptionTest/Makefile deleted file mode 100644 index 6d14a037d656b44cea08cc36067ed6c9cc54ddbb..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0050-rt-eh-FinallyThrowExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FinallyThrowExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0051-rt-eh-FinallyTryCatchExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0051-rt-eh-FinallyTryCatchExceptionTest/Makefile deleted file mode 100644 index 19f19b01803f32387ada9696a6e2c25653086b76..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0051-rt-eh-FinallyTryCatchExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FinallyTryCatchExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0052-rt-eh-FinallyTryThrowExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0052-rt-eh-FinallyTryThrowExceptionTest/Makefile deleted file mode 100644 index c42fb183f5341fc6e0a717e9714d74e41778f09d..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0052-rt-eh-FinallyTryThrowExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FinallyTryThrowExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0053-rt-eh-TryResourceStartThrowExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0053-rt-eh-TryResourceStartThrowExceptionTest/Makefile deleted file mode 100644 index 4bc70773d04f1c74670b931b86f5d090c12cc336..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0053-rt-eh-TryResourceStartThrowExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryResourceStartThrowExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0054-rt-eh-TryResourceCloseThrowExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0054-rt-eh-TryResourceCloseThrowExceptionTest/Makefile deleted file mode 100644 index b86fc1e9468d477f3ab62098fb352d1531fe879d..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0054-rt-eh-TryResourceCloseThrowExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryResourceCloseThrowExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0055-rt-eh-TryResourceStartAndCloseExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0055-rt-eh-TryResourceStartAndCloseExceptionTest/Makefile deleted file mode 100644 index a88ae007b87565d618f1a747791329192195fc6b..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0055-rt-eh-TryResourceStartAndCloseExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryResourceStartAndCloseExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0066-rt-eh-JvmArrayIndexOutOfBoundsExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0066-rt-eh-JvmArrayIndexOutOfBoundsExceptionTest/Makefile deleted file mode 100644 index fec4f7efc1f3b0bd44c6edb8808c5c18f8e4705d..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0066-rt-eh-JvmArrayIndexOutOfBoundsExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=JvmArrayIndexOutOfBoundsExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0067-rt-eh-JvmStaticExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0067-rt-eh-JvmStaticExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 36ed09bfc64ae963c10b0ecc26cfce3f2a97a47c..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0067-rt-eh-JvmStaticExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=JvmStaticExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0073-rt-eh-MultiTryNoExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0073-rt-eh-MultiTryNoExceptionTest/Makefile deleted file mode 100644 index c4c05eb6aae4cf0ad30e626e87a462916980902c..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0073-rt-eh-MultiTryNoExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=MultiTryNoExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0074-rt-eh-TryCatchReturnExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0074-rt-eh-TryCatchReturnExceptionTest/Makefile deleted file mode 100644 index bbb6a233d1d594485b7b18d05d6aa4a6e1182f00..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0074-rt-eh-TryCatchReturnExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchReturnExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0075-rt-eh-TryReturnValueExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0075-rt-eh-TryReturnValueExceptionTest/Makefile deleted file mode 100644 index 8561302de6676f47587f9ab0cb13f608fd4ea435..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0075-rt-eh-TryReturnValueExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryReturnValueExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0076-rt-eh-TryCatchReturnValueExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0076-rt-eh-TryCatchReturnValueExceptionTest/Makefile deleted file mode 100644 index 8742b51a7bf67e005fba4af73579f5bf9601ffe6..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0076-rt-eh-TryCatchReturnValueExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=TryCatchReturnValueExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0077-rt-eh-ExcpReturn04140/Makefile b/test/testsuite/ouroboros/eh_test/RT0077-rt-eh-ExcpReturn04140/Makefile deleted file mode 100644 index b9b4e683a67e8a655e5f9eb9fcad24cb04fe8c15..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0077-rt-eh-ExcpReturn04140/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ExcpReturn04140 -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0078-rt-eh-ExcpReturn04150/Makefile b/test/testsuite/ouroboros/eh_test/RT0078-rt-eh-ExcpReturn04150/Makefile deleted file mode 100644 index b896dcd7f196b5e133dedb098feebcbebf3f02ff..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0078-rt-eh-ExcpReturn04150/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ExcpReturn04150 -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0079-rt-eh-ExcpReturn04160/Makefile b/test/testsuite/ouroboros/eh_test/RT0079-rt-eh-ExcpReturn04160/Makefile deleted file mode 100644 index 81d0f96a55fff8e7ea0458377b415894561b8454..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0079-rt-eh-ExcpReturn04160/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ExcpReturn04160 -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0516-rt-eh-AccessibleObjectGetAnnotationsByTypeNullPointerExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0516-rt-eh-AccessibleObjectGetAnnotationsByTypeNullPointerExceptionTest/Makefile deleted file mode 100644 index 0d18d38e773feab835f3cc1b2760f9f25dfc55e7..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0516-rt-eh-AccessibleObjectGetAnnotationsByTypeNullPointerExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=AccessibleObjectGetAnnotationsByTypeNullPointerExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0517-rt-eh-AccessibleObjectGetDeclaredAnnotationExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0517-rt-eh-AccessibleObjectGetDeclaredAnnotationExceptionTest/Makefile deleted file mode 100644 index 74c6069c32017bbb29ca77516c156cdfc9d2ab3b..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0517-rt-eh-AccessibleObjectGetDeclaredAnnotationExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=AccessibleObjectGetDeclaredAnnotationExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0518-rt-eh-AccessibleObjectGetDeclaredAnnotationsByTypeExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0518-rt-eh-AccessibleObjectGetDeclaredAnnotationsByTypeExceptionTest/Makefile deleted file mode 100644 index 64bee33a2e476ddffc93514c7180ad9e7dbc31f2..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0518-rt-eh-AccessibleObjectGetDeclaredAnnotationsByTypeExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=AccessibleObjectGetDeclaredAnnotationsByTypeExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0519-rt-eh-CharacterCodePointCountIndexOutOfBoundsExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0519-rt-eh-CharacterCodePointCountIndexOutOfBoundsExceptionTest/Makefile deleted file mode 100644 index e348668215c9bba8d297c8ed3c9b008e3f0f92f4..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0519-rt-eh-CharacterCodePointCountIndexOutOfBoundsExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=CharacterCodePointCountIndexOutOfBoundsExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0520-rt-eh-CharactercodePointCountNullPointerException/Makefile b/test/testsuite/ouroboros/eh_test/RT0520-rt-eh-CharactercodePointCountNullPointerException/Makefile deleted file mode 100644 index 67175ee35a0c09165df455832864a127c1874769..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0520-rt-eh-CharactercodePointCountNullPointerException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=CharactercodePointCountNullPointerException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0521-rt-eh-CharacteroffsetByCodePointsIndexOutOfBoundsException/Makefile b/test/testsuite/ouroboros/eh_test/RT0521-rt-eh-CharacteroffsetByCodePointsIndexOutOfBoundsException/Makefile deleted file mode 100644 index 69ed48a4fc240d0eccd0291cb05e0cec79021017..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0521-rt-eh-CharacteroffsetByCodePointsIndexOutOfBoundsException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=CharacteroffsetByCodePointsIndexOutOfBoundsException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0522-rt-eh-CharacteroffsetByCodePointsNullPointerException/Makefile b/test/testsuite/ouroboros/eh_test/RT0522-rt-eh-CharacteroffsetByCodePointsNullPointerException/Makefile deleted file mode 100644 index 7206fab20cd84bb951ec050add0df11becacbf44..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0522-rt-eh-CharacteroffsetByCodePointsNullPointerException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=CharacteroffsetByCodePointsNullPointerException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0523-rt-eh-ClassasSubclassClassCastException/Makefile b/test/testsuite/ouroboros/eh_test/RT0523-rt-eh-ClassasSubclassClassCastException/Makefile deleted file mode 100644 index 8e2f739fa9a737d34e5d149ba6142176bc49f791..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0523-rt-eh-ClassasSubclassClassCastException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ClassasSubclassClassCastException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0524-rt-eh-ClasscastClassCastException/Makefile b/test/testsuite/ouroboros/eh_test/RT0524-rt-eh-ClasscastClassCastException/Makefile deleted file mode 100644 index 2eb20ed8f2d54f9afb8f4b4909438178e3eb8b4a..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0524-rt-eh-ClasscastClassCastException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ClasscastClassCastException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0525-rt-eh-ClassforName1ParExceptionInInitializerError/Makefile b/test/testsuite/ouroboros/eh_test/RT0525-rt-eh-ClassforName1ParExceptionInInitializerError/Makefile deleted file mode 100644 index 6f9221ce147dae2aceeea0fa496d52f24749d2a7..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0525-rt-eh-ClassforName1ParExceptionInInitializerError/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ClassforName1ParExceptionInInitializerError -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0526-rt-eh-ClassforNameExceptionInInitializerError/Makefile b/test/testsuite/ouroboros/eh_test/RT0526-rt-eh-ClassforNameExceptionInInitializerError/Makefile deleted file mode 100644 index cee6ea8f06fbf06fee2144d44eb0786e2c6bf3ec..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0526-rt-eh-ClassforNameExceptionInInitializerError/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ClassforNameExceptionInInitializerError -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0527-rt-eh-ClassgAnnotationsByTypeNullPointerException/Makefile b/test/testsuite/ouroboros/eh_test/RT0527-rt-eh-ClassgAnnotationsByTypeNullPointerException/Makefile deleted file mode 100644 index a9261e8cf54cd78e08e0de7d1bf2592c62fb77fd..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0527-rt-eh-ClassgAnnotationsByTypeNullPointerException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ClassgAnnotationsByTypeNullPointerException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0528-rt-eh-ClassgetDeclaredAnnotationNullPointerException/Makefile b/test/testsuite/ouroboros/eh_test/RT0528-rt-eh-ClassgetDeclaredAnnotationNullPointerException/Makefile deleted file mode 100644 index 4871c63bc57448e296b83026d054e97128e2982b..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0528-rt-eh-ClassgetDeclaredAnnotationNullPointerException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ClassgetDeclaredAnnotationNullPointerException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0529-rt-eh-ClassgetDeclaredFieldNoSuchFieldException/Makefile b/test/testsuite/ouroboros/eh_test/RT0529-rt-eh-ClassgetDeclaredFieldNoSuchFieldException/Makefile deleted file mode 100644 index b48a8cc12429e5e058e221177b9db6664ca82528..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0529-rt-eh-ClassgetDeclaredFieldNoSuchFieldException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ClassgetDeclaredFieldNoSuchFieldException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0530-rt-eh-ClassgetDeclaredFieldNullPointerException/Makefile b/test/testsuite/ouroboros/eh_test/RT0530-rt-eh-ClassgetDeclaredFieldNullPointerException/Makefile deleted file mode 100644 index a6a8ab399e78328c93ec2d7cd3db0ebf212110e9..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0530-rt-eh-ClassgetDeclaredFieldNullPointerException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ClassgetDeclaredFieldNullPointerException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0531-rt-eh-ConstructorgAnnotationNullPointerException/Makefile b/test/testsuite/ouroboros/eh_test/RT0531-rt-eh-ConstructorgAnnotationNullPointerException/Makefile deleted file mode 100644 index bedfba78e7e9a31f93f1a5485b476be8309c26bb..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0531-rt-eh-ConstructorgAnnotationNullPointerException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ConstructorgAnnotationNullPointerException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0532-rt-eh-ConstructornewInstanceExceptionInInitializerError/Makefile b/test/testsuite/ouroboros/eh_test/RT0532-rt-eh-ConstructornewInstanceExceptionInInitializerError/Makefile deleted file mode 100644 index 6f8ae2e2a8a9540ed745a753899b809fca91b84f..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0532-rt-eh-ConstructornewInstanceExceptionInInitializerError/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ConstructornewInstanceExceptionInInitializerError -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0533-rt-eh-FieldgetAnnotationNullPointerException/Makefile b/test/testsuite/ouroboros/eh_test/RT0533-rt-eh-FieldgetAnnotationNullPointerException/Makefile deleted file mode 100644 index e5026f80df53b339f5c95f6a334a0fc34460ff57..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0533-rt-eh-FieldgetAnnotationNullPointerException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldgetAnnotationNullPointerException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0534-rt-eh-FieldgetAnnotationsByTypeNullPointerException/Makefile b/test/testsuite/ouroboros/eh_test/RT0534-rt-eh-FieldgetAnnotationsByTypeNullPointerException/Makefile deleted file mode 100644 index b465b887b9be49251a6c2b27e57c3e98c979dfb7..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0534-rt-eh-FieldgetAnnotationsByTypeNullPointerException/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldgetAnnotationsByTypeNullPointerException -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0535-rt-eh-FieldgetByteExceptionInInitializerError/Makefile b/test/testsuite/ouroboros/eh_test/RT0535-rt-eh-FieldgetByteExceptionInInitializerError/Makefile deleted file mode 100644 index 83dc97502fcce0d3988b4f1511ed55dd10537793..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0535-rt-eh-FieldgetByteExceptionInInitializerError/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldgetByteExceptionInInitializerError -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0536-rt-eh-FieldgetCharExceptionInInitializerError/Makefile b/test/testsuite/ouroboros/eh_test/RT0536-rt-eh-FieldgetCharExceptionInInitializerError/Makefile deleted file mode 100644 index 40102c635a7a843f1bdfbfdd4a1a936ab3fe349d..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0536-rt-eh-FieldgetCharExceptionInInitializerError/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldgetCharExceptionInInitializerError -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0537-rt-eh-FieldgetDoubleExceptionInInitializerError/Makefile b/test/testsuite/ouroboros/eh_test/RT0537-rt-eh-FieldgetDoubleExceptionInInitializerError/Makefile deleted file mode 100644 index 098e12ee811b507b7820594b8172111a21eb0b67..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0537-rt-eh-FieldgetDoubleExceptionInInitializerError/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldgetDoubleExceptionInInitializerError -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0538-rt-eh-FieldgetExceptionInInitializerError/Makefile b/test/testsuite/ouroboros/eh_test/RT0538-rt-eh-FieldgetExceptionInInitializerError/Makefile deleted file mode 100644 index b0fbaea30a85765913aac7f82f97e924e92da5bf..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0538-rt-eh-FieldgetExceptionInInitializerError/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldgetExceptionInInitializerError -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0539-rt-eh-FieldgetFloatExceptionInInitializerError/Makefile b/test/testsuite/ouroboros/eh_test/RT0539-rt-eh-FieldgetFloatExceptionInInitializerError/Makefile deleted file mode 100644 index 953c65dfeb03237832dd8e8f7a8bd2f9062d533d..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0539-rt-eh-FieldgetFloatExceptionInInitializerError/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldgetFloatExceptionInInitializerError -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0541-rt-eh-FieldGetIntExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0541-rt-eh-FieldGetIntExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 80b5e39598ff4f7dd0d396a88e8167ff9799a93b..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0541-rt-eh-FieldGetIntExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldGetIntExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0542-rt-eh-FieldGetLongExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0542-rt-eh-FieldGetLongExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 5d1da03ed7bed1907281b3ad49b045445bd80bcf..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0542-rt-eh-FieldGetLongExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldGetLongExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0543-rt-eh-FieldGetShortExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0543-rt-eh-FieldGetShortExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 9e8453f9704b169d934ae8c06963e3aaf1753216..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0543-rt-eh-FieldGetShortExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldGetShortExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0544-rt-eh-FieldSetBooleanExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0544-rt-eh-FieldSetBooleanExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index c9dac9d7c616f6f709237d2c030165bb36c5f838..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0544-rt-eh-FieldSetBooleanExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetBooleanExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0545-rt-eh-FieldSetByteExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0545-rt-eh-FieldSetByteExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 41f5b4e23008aae1a29b1c0149cad85356fe9f9e..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0545-rt-eh-FieldSetByteExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetByteExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0546-rt-eh-FieldSetCharExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0546-rt-eh-FieldSetCharExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 27c966fa77a7fc68308e73a096f7ed65fa5d03b8..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0546-rt-eh-FieldSetCharExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetCharExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0547-rt-eh-FieldSetDoubleExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0547-rt-eh-FieldSetDoubleExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 57a70fd66bd0030d95cec99ea59aabc03a2358ed..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0547-rt-eh-FieldSetDoubleExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetDoubleExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0548-rt-eh-FieldsetExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0548-rt-eh-FieldsetExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index ed781e5e30f80fed0fb710522863047094b18a7b..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0548-rt-eh-FieldsetExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0549-rt-eh-FieldSetFloatExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0549-rt-eh-FieldSetFloatExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 193877cdfb32d04cf9efe28ee9285ed6d9fe0ec3..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0549-rt-eh-FieldSetFloatExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetFloatExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0550-rt-eh-FieldSetIntExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0550-rt-eh-FieldSetIntExceptionTest/Makefile deleted file mode 100644 index 80f6da403b074b68de073209c92c2e4b338a8444..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0550-rt-eh-FieldSetIntExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetIntExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0551-rt-eh-FieldSetLongExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0551-rt-eh-FieldSetLongExceptionTest/Makefile deleted file mode 100644 index 0e6b397199751ab7525892d2ee9bce7aeaa8e841..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0551-rt-eh-FieldSetLongExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetLongExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0552-rt-eh-FieldSetShortExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0552-rt-eh-FieldSetShortExceptionTest/Makefile deleted file mode 100644 index 75c50cdf7922f46ca9751818e2c4a653763c2613..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0552-rt-eh-FieldSetShortExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=FieldSetShortExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0553-rt-eh-MethodGetAnnotationExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0553-rt-eh-MethodGetAnnotationExceptionTest/Makefile deleted file mode 100644 index aa2bea66ff431f48901d9d49ff9ebd60a1053adf..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0553-rt-eh-MethodGetAnnotationExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=MethodGetAnnotationExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0555-rt-eh-MethodInvokeExceptionInInitializerErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0555-rt-eh-MethodInvokeExceptionInInitializerErrorTest/Makefile deleted file mode 100644 index 637c4a37780deaf872ffcc76cb095950246f0885..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0555-rt-eh-MethodInvokeExceptionInInitializerErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=MethodInvokeExceptionInInitializerErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0556-rt-eh-ParameterGetAnnotationNullPointerExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0556-rt-eh-ParameterGetAnnotationNullPointerExceptionTest/Makefile deleted file mode 100644 index acd112e2ac104ba6222ce7fcae7a74afefbfbc9a..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0556-rt-eh-ParameterGetAnnotationNullPointerExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ParameterGetAnnotationNullPointerExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0557-rt-eh-ParameterGetAnnotationsByTypeNullPointerExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0557-rt-eh-ParameterGetAnnotationsByTypeNullPointerExceptionTest/Makefile deleted file mode 100644 index 3065f4fdd436821fa5ab4999201235e53dea7a00..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0557-rt-eh-ParameterGetAnnotationsByTypeNullPointerExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ParameterGetAnnotationsByTypeNullPointerExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0558-rt-eh-ParameterGetDeclaredAnnotationNullPointerExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0558-rt-eh-ParameterGetDeclaredAnnotationNullPointerExceptionTest/Makefile deleted file mode 100644 index f4064f2b6ebb1d75c750c151dbd8f61e0e46cce7..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0558-rt-eh-ParameterGetDeclaredAnnotationNullPointerExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ParameterGetDeclaredAnnotationNullPointerExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0559-rt-eh-ParameterGetDeclaredAnnotationsByTypeExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0559-rt-eh-ParameterGetDeclaredAnnotationsByTypeExceptionTest/Makefile deleted file mode 100644 index fb236eeb2c84e9fd073456690283b3bc41c69120..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0559-rt-eh-ParameterGetDeclaredAnnotationsByTypeExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ParameterGetDeclaredAnnotationsByTypeExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0560-rt-eh-ThrowableAddSuppressedExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0560-rt-eh-ThrowableAddSuppressedExceptionTest/Makefile deleted file mode 100644 index 00baa35ee6d79ddf1c8f6422dcbec43149196067..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0560-rt-eh-ThrowableAddSuppressedExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ThrowableAddSuppressedExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0561-rt-eh-ThrowableAddSuppressedNullPointerExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0561-rt-eh-ThrowableAddSuppressedNullPointerExceptionTest/Makefile deleted file mode 100644 index c86bf4af7b63ed54af9eab2b0a09b60cf0918601..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0561-rt-eh-ThrowableAddSuppressedNullPointerExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=ThrowableAddSuppressedNullPointerExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/Makefile deleted file mode 100644 index 13cb8d7742de0a810e349a62a9fcf45c11a430e1..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=MethodInvokeExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/MethodInvokeExceptionTest.java b/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/MethodInvokeExceptionTest.java index 3450d075813ca3bbccd2829f28cfd81678092dee..1b633d64fd21d37ec8440dc3cf25f1be3bc62dea 100644 --- a/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/MethodInvokeExceptionTest.java +++ b/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/MethodInvokeExceptionTest.java @@ -109,7 +109,6 @@ public class MethodInvokeExceptionTest { } } -// DEPENDENCE: old_result_figo.log // EXEC:%maple %f %build_option -o %n.so // EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan 1\s*3\s*6\s*0 \ No newline at end of file +// ASSERT: scan 1\s*3\s*6\s*0 diff --git a/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/old_result_figo.log b/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/old_result_figo.log deleted file mode 100644 index 2bdf79d1340d622634a928845f9dd9084ce5e1f9..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0817-rt-mrtUT-MethodInvokeExceptionTest/old_result_figo.log +++ /dev/null @@ -1,2 +0,0 @@ -/home/chenliliu/emui/maple/cll/important/RT0817-runtime-mrtUT-MethodInvokeExceptionTest/ -MethodInvokeException.java Failed 0 run check unexpected output diff --git a/test/testsuite/ouroboros/eh_test/RT0904-rt-fuzzapi-MethodInvokeObjectObjectsTest/Makefile b/test/testsuite/ouroboros/eh_test/RT0904-rt-fuzzapi-MethodInvokeObjectObjectsTest/Makefile deleted file mode 100644 index e1160bfdc6096db3a460d09955c33951eec1bd41..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT0904-rt-fuzzapi-MethodInvokeObjectObjectsTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=MethodInvokeObjectObjectsTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/RT1075-rt-EH-MethodInvokeInvocationTargetExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/RT1075-rt-EH-MethodInvokeInvocationTargetExceptionTest/Makefile deleted file mode 100644 index 7d8afa9e893572e79b9892cc8b7650054e9056e7..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/RT1075-rt-EH-MethodInvokeInvocationTargetExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=MethodInvokeInvocationTargetExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/issue-RT0065-rt-eh-UninitializedExNullPointerExceptionTest/Makefile b/test/testsuite/ouroboros/eh_test/issue-RT0065-rt-eh-UninitializedExNullPointerExceptionTest/Makefile deleted file mode 100644 index b0170801966668ad0b9176f5d76799ae4c0861e2..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/issue-RT0065-rt-eh-UninitializedExNullPointerExceptionTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=UninitializedExNullPointerExceptionTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/eh_test/issue-RT0068-rt-eh-JvmInitializeOutOfMemoryErrorTest/Makefile b/test/testsuite/ouroboros/eh_test/issue-RT0068-rt-eh-JvmInitializeOutOfMemoryErrorTest/Makefile deleted file mode 100644 index 8164fada0f4bfef161e5ecb958f2b1fabfdd1a83..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/eh_test/issue-RT0068-rt-eh-JvmInitializeOutOfMemoryErrorTest/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -APP=JvmInitializeOutOfMemoryErrorTest -include $(MAPLE_BUILD_CORE)/config/common_test.mk -include $(MAPLE_BUILD_CORE)/Maple.common_test.mk diff --git a/test/testsuite/ouroboros/fuzzapi_test/RT0002-rt-fuzzapi-EHOrder/Message011706.java b/test/testsuite/ouroboros/fuzzapi_test/RT0002-rt-fuzzapi-EHOrder/Message011706.java index 3717d429d50e83d13732243dce96832c64d1719d..5b90fecbb636a3f8f03c283c339edb9d0ddafd5b 100644 --- a/test/testsuite/ouroboros/fuzzapi_test/RT0002-rt-fuzzapi-EHOrder/Message011706.java +++ b/test/testsuite/ouroboros/fuzzapi_test/RT0002-rt-fuzzapi-EHOrder/Message011706.java @@ -1,97 +1,97 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Message011706.java - *- @Title/Destination: java.lang.reflect.Method/invoke/ObjectAndObject[],check EH order - *- @Brief: - *- @Expect:expected.txt - *- @Priority: High - *- @Source: Message011706.java - *- @ExecuteClass: Message011706 - *- @ExecuteArgs: - */ - -import java.lang.reflect.*; -import java.util.*; - -public class Message011706 { - public static Class clazz; - private static List resultlist = new LinkedList<>(); - - public static void main(String[] args) { - try { - System.out.println(messageCommonUse()); - } catch (Exception e) { - System.out.println(e); - } - } - - - public static int messageCommonUse() { - try { - clazz = Class.forName("java.lang.reflect.Method"); - Method method = clazz.getMethod("invoke",Object.class,Object[].class); - String fcn2 = "java.util.concurrent.ConcurrentHashMap"; - int mIndex6 = 1; - Method[] methods2 = Class.forName(fcn2).getDeclaredMethods(); - Arrays.sort(methods2, new ConstructorComparator()); - Object instance = methods2[mIndex6]; - Constructor con = java.lang.StringBuffer.class.getDeclaredConstructor(); - Object param1 = con.newInstance(); - Object param2[] = new Object[4]; - Constructor con0 = java.lang.StringBuffer.class.getDeclaredConstructor(); - param2[0] = con0.newInstance(); - Constructor con1 = java.security.spec.MGF1ParameterSpec.class.getDeclaredConstructor(java.lang.String.class); - param2[1] = con1.newInstance("abcdefghijklmnopqrstuvwxxzABCDEFGHIJKLMNOPQRSTUVWXYZ-9223372036854775551"); - Constructor con2 = java.util.Stack.class.getDeclaredConstructor(); - param2[2] = con2.newInstance(); - Constructor con3 = java.security.spec.ECGenParameterSpec.class.getDeclaredConstructor(java.lang.String.class); - param2[3] = con3.newInstance("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); - Object Result = method.invoke(instance,param1,param2); - System.out.println(Result); - } catch (Exception e) { - if (e.toString().equals("java.lang.reflect.InvocationTargetException") && - e.getCause().getClass().getName().toString().equals("java.lang.IllegalArgumentException")) { - return 0; - } - } - return -1; - } -} - -class ConstructorComparator implements Comparator{ - @Override - public int compare(Object c1, Object c2) { - byte[] b1 = c1.toString().getBytes(); - byte[] b2 = c2.toString().getBytes(); - int len = (b1.lengthb2[i]) { - return -1; - } - } - if (b1.length > b2.length) { - return -1; - } else if (b1.length < b2.length) { - return 1; - } - return 1; - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Message011706.java + *- @Title/Destination: java.lang.reflect.Method/invoke/ObjectAndObject[],check EH order + *- @Brief: + *- @Expect:expected.txt + *- @Priority: High + *- @Source: Message011706.java + *- @ExecuteClass: Message011706 + *- @ExecuteArgs: + */ + +import java.lang.reflect.*; +import java.util.*; + +public class Message011706 { + public static Class clazz; + private static List resultlist = new LinkedList<>(); + + public static void main(String[] args) { + try { + System.out.println(messageCommonUse()); + } catch (Exception e) { + System.out.println(e); + } + } + + + public static int messageCommonUse() { + try { + clazz = Class.forName("java.lang.reflect.Method"); + Method method = clazz.getMethod("invoke",Object.class,Object[].class); + String fcn2 = "java.util.concurrent.ConcurrentHashMap"; + int mIndex6 = 1; + Method[] methods2 = Class.forName(fcn2).getDeclaredMethods(); + Arrays.sort(methods2, new ConstructorComparator()); + Object instance = methods2[mIndex6]; + Constructor con = java.lang.StringBuffer.class.getDeclaredConstructor(); + Object param1 = con.newInstance(); + Object param2[] = new Object[4]; + Constructor con0 = java.lang.StringBuffer.class.getDeclaredConstructor(); + param2[0] = con0.newInstance(); + Constructor con1 = java.security.spec.MGF1ParameterSpec.class.getDeclaredConstructor(java.lang.String.class); + param2[1] = con1.newInstance("abcdefghijklmnopqrstuvwxxzABCDEFGHIJKLMNOPQRSTUVWXYZ-9223372036854775551"); + Constructor con2 = java.util.Stack.class.getDeclaredConstructor(); + param2[2] = con2.newInstance(); + Constructor con3 = java.security.spec.ECGenParameterSpec.class.getDeclaredConstructor(java.lang.String.class); + param2[3] = con3.newInstance("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); + Object Result = method.invoke(instance,param1,param2); + System.out.println(Result); + } catch (Exception e) { + if (e.toString().equals("java.lang.reflect.InvocationTargetException") && + e.getCause().getClass().getName().toString().equals("java.lang.IllegalArgumentException")) { + return 0; + } + } + return -1; + } +} + +class ConstructorComparator implements Comparator{ + @Override + public int compare(Object c1, Object c2) { + byte[] b1 = c1.toString().getBytes(); + byte[] b2 = c2.toString().getBytes(); + int len = (b1.lengthb2[i]) { + return -1; + } + } + if (b1.length > b2.length) { + return -1; + } else if (b1.length < b2.length) { + return 1; + } + return 1; + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/fuzzapi_test/RT0003-rt-fuzzapi-noStartThreadInfo/ThreadcountStackFramesTest.java b/test/testsuite/ouroboros/fuzzapi_test/RT0003-rt-fuzzapi-noStartThreadInfo/ThreadcountStackFramesTest.java index e75832197b087feb0ddf31b2d80fb4966267cf3f..16e0a063613b8edec20afa8cf8896206cd127a7c 100644 --- a/test/testsuite/ouroboros/fuzzapi_test/RT0003-rt-fuzzapi-noStartThreadInfo/ThreadcountStackFramesTest.java +++ b/test/testsuite/ouroboros/fuzzapi_test/RT0003-rt-fuzzapi-noStartThreadInfo/ThreadcountStackFramesTest.java @@ -1,88 +1,88 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadcountStackFramesTest.java - *- @Title/Destination: Thread api: countStackFrames() - *- @Brief: - *- @Expect:expected.txt - *- @Priority: High - *- @Source: ThreadcountStackFramesTest.java - *- @ExecuteClass: ThreadcountStackFramesTest - *- @ExecuteArgs: - */ - -public class ThreadcountStackFramesTest { - static int RES = 99; - public static void main(String[] args) { - System.out.println(run()); - } - - private static int run() { - int result; - result = countStackFramesTest(); - if (result == 4 && ThreadcountStackFramesTest.RES == 89) { - result = 0; - } - return result; - } - - private static int countStackFramesTest() { - Runnable ra = new MyThread1(); - String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ4294967295"; - Thread t = new Thread(ra, str); - @SuppressWarnings("deprecation") - int i = t.countStackFrames(); - if (i == 0) { - ThreadcountStackFramesTest.RES -= 10; - } - return 4; - } -} - -class MyThread1 implements Runnable { - private int ticket = 10; - @SuppressWarnings("unused") - private String name; - - public void run() { - for (int i = 0; i < 500; i++) { - if (this.ticket > 0) { - System.out.println(Thread.currentThread().getName() + "---->" + (this.ticket--)); - } - } - } - - public Object handler() { - Thread thread = new Thread(new MyThread1()); - thread.setUncaughtExceptionHandler(new MyExceptionHandler()); - thread.start(); - return thread.getUncaughtExceptionHandler(); - } - - class MyExceptionHandler implements Thread.UncaughtExceptionHandler { - - public void uncaughtException(Thread t, Throwable e) { - System.out.printf("An exception has been captured\n"); - System.out.printf("Thread:%s\n", t.getName()); - System.out.printf("Exception: %s: %s:\n", e.getClass().getName(), e.getMessage()); - System.out.printf("Stack Trace:\n"); - e.printStackTrace(); - System.out.printf("Thread status:%s\n", t.getState()); - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadcountStackFramesTest.java + *- @Title/Destination: Thread api: countStackFrames() + *- @Brief: + *- @Expect:expected.txt + *- @Priority: High + *- @Source: ThreadcountStackFramesTest.java + *- @ExecuteClass: ThreadcountStackFramesTest + *- @ExecuteArgs: + */ + +public class ThreadcountStackFramesTest { + static int RES = 99; + public static void main(String[] args) { + System.out.println(run()); + } + + private static int run() { + int result; + result = countStackFramesTest(); + if (result == 4 && ThreadcountStackFramesTest.RES == 89) { + result = 0; + } + return result; + } + + private static int countStackFramesTest() { + Runnable ra = new MyThread1(); + String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ4294967295"; + Thread t = new Thread(ra, str); + @SuppressWarnings("deprecation") + int i = t.countStackFrames(); + if (i == 0) { + ThreadcountStackFramesTest.RES -= 10; + } + return 4; + } +} + +class MyThread1 implements Runnable { + private int ticket = 10; + @SuppressWarnings("unused") + private String name; + + public void run() { + for (int i = 0; i < 500; i++) { + if (this.ticket > 0) { + System.out.println(Thread.currentThread().getName() + "---->" + (this.ticket--)); + } + } + } + + public Object handler() { + Thread thread = new Thread(new MyThread1()); + thread.setUncaughtExceptionHandler(new MyExceptionHandler()); + thread.start(); + return thread.getUncaughtExceptionHandler(); + } + + class MyExceptionHandler implements Thread.UncaughtExceptionHandler { + + public void uncaughtException(Thread t, Throwable e) { + System.out.printf("An exception has been captured\n"); + System.out.printf("Thread:%s\n", t.getName()); + System.out.printf("Exception: %s: %s:\n", e.getClass().getName(), e.getMessage()); + System.out.printf("Stack Trace:\n"); + e.printStackTrace(); + System.out.printf("Thread status:%s\n", t.getState()); + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/fuzzapi_test/RT0004-rt-fuzzapi-stackframeless/Message021404.java b/test/testsuite/ouroboros/fuzzapi_test/RT0004-rt-fuzzapi-stackframeless/Message021404.java index 603834850fade1aaa05b18ec5b61dbc44c533129..4edd9625de7694ff653acf8052432745b95159f9 100644 --- a/test/testsuite/ouroboros/fuzzapi_test/RT0004-rt-fuzzapi-stackframeless/Message021404.java +++ b/test/testsuite/ouroboros/fuzzapi_test/RT0004-rt-fuzzapi-stackframeless/Message021404.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Message021404.java - *- @Title/Destination: Unsafe api: getUnsafe().when invoke use reflect,stack frame will miss one - *- @Brief: - *- @Expect:expected.txt - *- @Priority: High - *- @Source: Message021404.java - *- @ExecuteClass: Message021404 - *- @ExecuteArgs: - */ - - -import sun.misc.Unsafe; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -public class Message021404 { - private static int res = 99; - public static void main(String[] args) { - try { - System.out.println(run()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static int run() throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { - int result; - result = message021404(); - if (result == 4 && Message021404.res == 89) { - result = 0; - } - return result; - } - - private static int message021404() throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { - Field f = Unsafe.class.getDeclaredField("theUnsafe"); - f.setAccessible(true); - Unsafe s = (Unsafe)f.get(null); - Method m = Unsafe.class.getDeclaredMethod("getUnsafe"); - m.invoke(s); - Message021404.res -= 10; - return 4; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Message021404.java + *- @Title/Destination: Unsafe api: getUnsafe().when invoke use reflect,stack frame will miss one + *- @Brief: + *- @Expect:expected.txt + *- @Priority: High + *- @Source: Message021404.java + *- @ExecuteClass: Message021404 + *- @ExecuteArgs: + */ + + +import sun.misc.Unsafe; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class Message021404 { + private static int res = 99; + public static void main(String[] args) { + try { + System.out.println(run()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static int run() throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + int result; + result = message021404(); + if (result == 4 && Message021404.res == 89) { + result = 0; + } + return result; + } + + private static int message021404() throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + Field f = Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + Unsafe s = (Unsafe)f.get(null); + Method m = Unsafe.class.getDeclaredMethod("getUnsafe"); + m.invoke(s); + Message021404.res -= 10; + return 4; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0383-rc-Annotation-RCWeakRefTest4/RCWeakRefTest4.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0383-rc-Annotation-RCWeakRefTest4/RCWeakRefTest4.java index 1f514c6d4a095b4a9786dda072aa3326c475633f..8a7fadda0104224e237072408b3d28add2f2d72d 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0383-rc-Annotation-RCWeakRefTest4/RCWeakRefTest4.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0383-rc-Annotation-RCWeakRefTest4/RCWeakRefTest4.java @@ -1,64 +1,64 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RCWeakRefTest4.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_B_1_00010 for @Weak Test - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCWeakRefTest4.java - *- @ExecuteClass: RCWeakRefTest4 - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Weak; - -class Cycle_B_1_00010_A1 { - @Weak - Cycle_B_1_00010_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00010_A1() { - a1_0 = null; - a = 123; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - -public class RCWeakRefTest4 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_B_1_00010_A1 a1_0 = new Cycle_B_1_00010_A1(); - a1_0.a1_0 = a1_0; - a1_0.add(); - int nsum = a1_0.sum; - if (nsum == 246) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RCWeakRefTest4.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_B_1_00010 for @Weak Test + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCWeakRefTest4.java + *- @ExecuteClass: RCWeakRefTest4 + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Weak; + +class Cycle_B_1_00010_A1 { + @Weak + Cycle_B_1_00010_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00010_A1() { + a1_0 = null; + a = 123; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + +public class RCWeakRefTest4 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_B_1_00010_A1 a1_0 = new Cycle_B_1_00010_A1(); + a1_0.a1_0 = a1_0; + a1_0.add(); + int nsum = a1_0.sum; + if (nsum == 246) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0384-rc-Annotation-RCWeakRefThreadTest/RCWeakRefThreadTest.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0384-rc-Annotation-RCWeakRefThreadTest/RCWeakRefThreadTest.java index 6c7a1fd5218688287aefa462813109e3e99d161a..2aed109c0b521014dc7718a8d7226efa3e2c6fe4 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0384-rc-Annotation-RCWeakRefThreadTest/RCWeakRefThreadTest.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0384-rc-Annotation-RCWeakRefThreadTest/RCWeakRefThreadTest.java @@ -1,104 +1,104 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCWeakRefThreadTest.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change RCWeakRefTest4 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCWeakRefThreadTest.java - *- @ExecuteClass: RCWeakRefThreadTest - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Weak; - -class ThreadRc_Cycle_Bm_1_00010 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00010_A1 a1_0 = new Cycle_B_1_00010_A1(); - a1_0.a1_0 = a1_0; - a1_0.add(); - int nsum = a1_0.sum; - //System.out.println(nsum); - - if (nsum == 246) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00010_A1 { - @Weak - Cycle_B_1_00010_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00010_A1() { - a1_0 = null; - a = 123; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class RCWeakRefThreadTest { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00010 A1_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A2_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A3_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A4_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A5_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A6_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - - A1_Cycle_Bm_1_00010.start(); - A2_Cycle_Bm_1_00010.start(); - A3_Cycle_Bm_1_00010.start(); - A4_Cycle_Bm_1_00010.start(); - A5_Cycle_Bm_1_00010.start(); - A6_Cycle_Bm_1_00010.start(); - - try { - A1_Cycle_Bm_1_00010.join(); - A2_Cycle_Bm_1_00010.join(); - A3_Cycle_Bm_1_00010.join(); - A4_Cycle_Bm_1_00010.join(); - A5_Cycle_Bm_1_00010.join(); - A6_Cycle_Bm_1_00010.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00010.check() && A2_Cycle_Bm_1_00010.check() && A3_Cycle_Bm_1_00010.check() && A4_Cycle_Bm_1_00010.check() && A5_Cycle_Bm_1_00010.check() && A6_Cycle_Bm_1_00010.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCWeakRefThreadTest.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change RCWeakRefTest4 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCWeakRefThreadTest.java + *- @ExecuteClass: RCWeakRefThreadTest + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Weak; + +class ThreadRc_Cycle_Bm_1_00010 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00010_A1 a1_0 = new Cycle_B_1_00010_A1(); + a1_0.a1_0 = a1_0; + a1_0.add(); + int nsum = a1_0.sum; + //System.out.println(nsum); + + if (nsum == 246) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00010_A1 { + @Weak + Cycle_B_1_00010_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00010_A1() { + a1_0 = null; + a = 123; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class RCWeakRefThreadTest { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00010 A1_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A2_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A3_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A4_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A5_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A6_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + + A1_Cycle_Bm_1_00010.start(); + A2_Cycle_Bm_1_00010.start(); + A3_Cycle_Bm_1_00010.start(); + A4_Cycle_Bm_1_00010.start(); + A5_Cycle_Bm_1_00010.start(); + A6_Cycle_Bm_1_00010.start(); + + try { + A1_Cycle_Bm_1_00010.join(); + A2_Cycle_Bm_1_00010.join(); + A3_Cycle_Bm_1_00010.join(); + A4_Cycle_Bm_1_00010.join(); + A5_Cycle_Bm_1_00010.join(); + A6_Cycle_Bm_1_00010.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00010.check() && A2_Cycle_Bm_1_00010.check() && A3_Cycle_Bm_1_00010.check() && A4_Cycle_Bm_1_00010.check() && A5_Cycle_Bm_1_00010.check() && A6_Cycle_Bm_1_00010.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0387-rc-Annotation-RCUnownedRefUnCycle/RCUnownedRefUnCycle.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0387-rc-Annotation-RCUnownedRefUnCycle/RCUnownedRefUnCycle.java index 82381e51264eabb237787ac5db8e3b4c5f8e2f6c..35cdfccb0aa206709f49c3f2673de312684df0c7 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0387-rc-Annotation-RCUnownedRefUnCycle/RCUnownedRefUnCycle.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0387-rc-Annotation-RCUnownedRefUnCycle/RCUnownedRefUnCycle.java @@ -1,136 +1,136 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RCUnownedRefUnCycle.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00150 for @Unowned function Test - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCUnownedRefUnCycle.java - *- @ExecuteClass: RCUnownedRefUnCycle - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; - -class Nocycle_a_00150_A1 { - Nocycle_a_00150_B1 b1_0; - @Unowned - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - -class Nocycle_a_00150_A2 { - @Unowned - Nocycle_a_00150_B1 b1_0; - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - - -class Nocycle_a_00150_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00150_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class RCUnownedRefUnCycle { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); - Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); - a1_main.b2_0 = a2_main.b2_0; - a2_main.b1_0 = a1_main.b1_0; - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - if (result == 1815) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RCUnownedRefUnCycle.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00150 for @Unowned function Test + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCUnownedRefUnCycle.java + *- @ExecuteClass: RCUnownedRefUnCycle + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; + +class Nocycle_a_00150_A1 { + Nocycle_a_00150_B1 b1_0; + @Unowned + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + +class Nocycle_a_00150_A2 { + @Unowned + Nocycle_a_00150_B1 b1_0; + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + + +class Nocycle_a_00150_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00150_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class RCUnownedRefUnCycle { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); + Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); + a1_main.b2_0 = a2_main.b2_0; + a2_main.b1_0 = a1_main.b1_0; + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + if (result == 1815) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0389-rc-Annotation-RCUnownedRefUncycleThread/RCUnownedRefUncycleThread.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0389-rc-Annotation-RCUnownedRefUncycleThread/RCUnownedRefUncycleThread.java index 41902c5cec81a131db32154e4fed613e2dc17c8e..0e8915602cacfee908c76969b0c3f847d0ee81bf 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0389-rc-Annotation-RCUnownedRefUncycleThread/RCUnownedRefUncycleThread.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0389-rc-Annotation-RCUnownedRefUncycleThread/RCUnownedRefUncycleThread.java @@ -1,176 +1,176 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCUnownedRefUncycleThread.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change RCUnownedRefUncycle to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCUnownedRefUncycleThread.java - *- @ExecuteClass: RCUnownedRefUncycleThread - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; - -class ThreadRc_00150 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); - Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); - a2_main.b1_0 = a1_main.b1_0; - a1_main.b2_0 = a2_main.b2_0; - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1815) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00150_A1 { - Nocycle_a_00150_B1 b1_0; - @Unowned - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00150_A2 { - @Unowned - Nocycle_a_00150_B1 b1_0; - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00150_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00150_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class RCUnownedRefUncycleThread { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00150 A1_00150 = new ThreadRc_00150(); - ThreadRc_00150 A2_00150 = new ThreadRc_00150(); - ThreadRc_00150 A3_00150 = new ThreadRc_00150(); - ThreadRc_00150 A4_00150 = new ThreadRc_00150(); - ThreadRc_00150 A5_00150 = new ThreadRc_00150(); - ThreadRc_00150 A6_00150 = new ThreadRc_00150(); - - A1_00150.start(); - A2_00150.start(); - A3_00150.start(); - A4_00150.start(); - A5_00150.start(); - A6_00150.start(); - - try { - A1_00150.join(); - A2_00150.join(); - A3_00150.join(); - A4_00150.join(); - A5_00150.join(); - A6_00150.join(); - - } catch (InterruptedException e) { - } - if (A1_00150.check() && A2_00150.check() && A3_00150.check() && A4_00150.check() && A5_00150.check() && A6_00150.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCUnownedRefUncycleThread.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change RCUnownedRefUncycle to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCUnownedRefUncycleThread.java + *- @ExecuteClass: RCUnownedRefUncycleThread + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; + +class ThreadRc_00150 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); + Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); + a2_main.b1_0 = a1_main.b1_0; + a1_main.b2_0 = a2_main.b2_0; + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1815) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00150_A1 { + Nocycle_a_00150_B1 b1_0; + @Unowned + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00150_A2 { + @Unowned + Nocycle_a_00150_B1 b1_0; + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00150_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00150_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class RCUnownedRefUncycleThread { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00150 A1_00150 = new ThreadRc_00150(); + ThreadRc_00150 A2_00150 = new ThreadRc_00150(); + ThreadRc_00150 A3_00150 = new ThreadRc_00150(); + ThreadRc_00150 A4_00150 = new ThreadRc_00150(); + ThreadRc_00150 A5_00150 = new ThreadRc_00150(); + ThreadRc_00150 A6_00150 = new ThreadRc_00150(); + + A1_00150.start(); + A2_00150.start(); + A3_00150.start(); + A4_00150.start(); + A5_00150.start(); + A6_00150.start(); + + try { + A1_00150.join(); + A2_00150.join(); + A3_00150.join(); + A4_00150.join(); + A5_00150.join(); + A6_00150.join(); + + } catch (InterruptedException e) { + } + if (A1_00150.check() && A2_00150.check() && A3_00150.check() && A4_00150.check() && A5_00150.check() && A6_00150.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0391-rc-Annotation-RCAnnotationThread01/RCAnnotationThread01.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0391-rc-Annotation-RCAnnotationThread01/RCAnnotationThread01.java index ad108a2f378d0a575d07df809a3594176d1168c0..077563b77fdffb5296128881292fcb1e4fcc510c 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0391-rc-Annotation-RCAnnotationThread01/RCAnnotationThread01.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0391-rc-Annotation-RCAnnotationThread01/RCAnnotationThread01.java @@ -1,445 +1,445 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread01.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationThread01.java - *- @ExecuteClass: RCAnnotationThread01 - *- @ExecuteArgs: - - * - */ - -import com.huawei.ark.annotation.Unowned; - -class RCAnnotationThread01_1 extends Thread { - public void run() { - RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread01_2 extends Thread { - public void run() { - RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); - try { - rcth01.setA2null(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread01_3 extends Thread { - public void run() { - RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); - try { - rcth01.setA3(); - } catch (NullPointerException e) { - - } - - } -} - -class RCAnnotationThread01_4 extends Thread { - public void run() { - RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread01_5 extends Thread { - public void run() { - RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - - -public class RCAnnotationThread01 { - private volatile static RCAnnotationThread01_A1 a1_main = null; - private volatile static RCAnnotationThread01_A2 a2_main = null; - private volatile static RCAnnotationThread01_A3 a3_main = null; - private volatile static RCAnnotationThread01_A4 a4_main = null; - - RCAnnotationThread01() { - synchronized (this) { - try { - a1_main = new RCAnnotationThread01_A1("a1_main"); - a2_main = new RCAnnotationThread01_A2("a2_main"); - a3_main = new RCAnnotationThread01_A3("a3_main"); - a4_main = new RCAnnotationThread01_A4("a4_main"); - a1_main.b1_0 = new RCAnnotationThread01_B1("b1_0"); - a1_main.d1_0 = new RCAnnotationThread01_D1("d1_0"); - a1_main.b1_0.d2_0 = new RCAnnotationThread01_D2("d2_0"); - - a2_main.b2_0 = new RCAnnotationThread01_B2("b2_0"); - a2_main.b2_0.c1_0 = new RCAnnotationThread01_C1("c1_0"); - a2_main.b2_0.d1_0 = a1_main.d1_0; - a2_main.b2_0.d2_0 = a1_main.b1_0.d2_0; - a2_main.b2_0.d3_0 = new RCAnnotationThread01_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - - a3_main.b2_0 = a2_main.b2_0; - a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; - a3_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - a3_main.b2_0.d1_0 = a1_main.d1_0; - a3_main.b2_0.d2_0 = a1_main.b1_0.d2_0; - a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; - - a3_main.c2_0 = new RCAnnotationThread01_C2("c2_0"); - a3_main.c2_0.d2_0 = a1_main.b1_0.d2_0; - a3_main.c2_0.d3_0 = a2_main.b2_0.d3_0; - - a4_main.b3_0 = new RCAnnotationThread01_B3("b3_0"); - a4_main.b3_0.c1_0 = a2_main.b2_0.c1_0; - a4_main.b3_0.c1_0.d1_0 = a1_main.d1_0; - a4_main.c2_0 = a3_main.c2_0; - a4_main.c2_0.d2_0 = a1_main.b1_0.d2_0; - a4_main.c2_0.d3_0 = a2_main.b2_0.d3_0; - } catch (NullPointerException e) { - - } - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - - } - - private static void rc_testcase_main_wrapper() { - RCAnnotationThread01_1 t1 = new RCAnnotationThread01_1(); - RCAnnotationThread01_2 t2 = new RCAnnotationThread01_2(); - RCAnnotationThread01_3 t3 = new RCAnnotationThread01_3(); - RCAnnotationThread01_4 t4 = new RCAnnotationThread01_4(); - RCAnnotationThread01_5 t5 = new RCAnnotationThread01_5(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - t5.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - } catch (InterruptedException e) { - } - - } - - - public void setA1null() { - a1_main = null; - } - - public void setA2null() { - a2_main = null; - } - - public void setA3() { - try { - a3_main.c2_0.d2_0 = new RCAnnotationThread01_D2("new"); - a3_main = new RCAnnotationThread01_A3("a3_new"); - a3_main = null; - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - a3_main = null; - } - - public void setA4null() { - a4_main = null; - } - - class RCAnnotationThread01_A1 { - volatile RCAnnotationThread01_B1 b1_0; - volatile RCAnnotationThread01_D1 d1_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - - class RCAnnotationThread01_A2 { - volatile RCAnnotationThread01_B2 b2_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - - class RCAnnotationThread01_A3 { - @Unowned - volatile RCAnnotationThread01_B2 b2_0; - volatile RCAnnotationThread01_C2 c2_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class RCAnnotationThread01_A4 { - volatile RCAnnotationThread01_B3 b3_0; - @Unowned - volatile RCAnnotationThread01_C2 c2_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - - class RCAnnotationThread01_B1 { - volatile RCAnnotationThread01_D2 d2_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - - class RCAnnotationThread01_B2 { - volatile RCAnnotationThread01_C1 c1_0; - @Unowned - volatile RCAnnotationThread01_D1 d1_0; - @Unowned - volatile RCAnnotationThread01_D2 d2_0; - volatile RCAnnotationThread01_D3 d3_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - - class RCAnnotationThread01_B3 { - @Unowned - volatile RCAnnotationThread01_C1 c1_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - - class RCAnnotationThread01_C1 { - @Unowned - volatile RCAnnotationThread01_D1 d1_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class RCAnnotationThread01_C2 { - @Unowned - volatile RCAnnotationThread01_D2 d2_0; - @Unowned - volatile RCAnnotationThread01_D3 d3_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - - class RCAnnotationThread01_D1 { - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RCAnnotationThread01_D2 { - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RCAnnotationThread01_D3 { - int a; - int sum; - String strObjectName; - - RCAnnotationThread01_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread01.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationThread01.java + *- @ExecuteClass: RCAnnotationThread01 + *- @ExecuteArgs: + + * + */ + +import com.huawei.ark.annotation.Unowned; + +class RCAnnotationThread01_1 extends Thread { + public void run() { + RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread01_2 extends Thread { + public void run() { + RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); + try { + rcth01.setA2null(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread01_3 extends Thread { + public void run() { + RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); + try { + rcth01.setA3(); + } catch (NullPointerException e) { + + } + + } +} + +class RCAnnotationThread01_4 extends Thread { + public void run() { + RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread01_5 extends Thread { + public void run() { + RCAnnotationThread01 rcth01 = new RCAnnotationThread01(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + + +public class RCAnnotationThread01 { + private volatile static RCAnnotationThread01_A1 a1_main = null; + private volatile static RCAnnotationThread01_A2 a2_main = null; + private volatile static RCAnnotationThread01_A3 a3_main = null; + private volatile static RCAnnotationThread01_A4 a4_main = null; + + RCAnnotationThread01() { + synchronized (this) { + try { + a1_main = new RCAnnotationThread01_A1("a1_main"); + a2_main = new RCAnnotationThread01_A2("a2_main"); + a3_main = new RCAnnotationThread01_A3("a3_main"); + a4_main = new RCAnnotationThread01_A4("a4_main"); + a1_main.b1_0 = new RCAnnotationThread01_B1("b1_0"); + a1_main.d1_0 = new RCAnnotationThread01_D1("d1_0"); + a1_main.b1_0.d2_0 = new RCAnnotationThread01_D2("d2_0"); + + a2_main.b2_0 = new RCAnnotationThread01_B2("b2_0"); + a2_main.b2_0.c1_0 = new RCAnnotationThread01_C1("c1_0"); + a2_main.b2_0.d1_0 = a1_main.d1_0; + a2_main.b2_0.d2_0 = a1_main.b1_0.d2_0; + a2_main.b2_0.d3_0 = new RCAnnotationThread01_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + + a3_main.b2_0 = a2_main.b2_0; + a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; + a3_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + a3_main.b2_0.d1_0 = a1_main.d1_0; + a3_main.b2_0.d2_0 = a1_main.b1_0.d2_0; + a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; + + a3_main.c2_0 = new RCAnnotationThread01_C2("c2_0"); + a3_main.c2_0.d2_0 = a1_main.b1_0.d2_0; + a3_main.c2_0.d3_0 = a2_main.b2_0.d3_0; + + a4_main.b3_0 = new RCAnnotationThread01_B3("b3_0"); + a4_main.b3_0.c1_0 = a2_main.b2_0.c1_0; + a4_main.b3_0.c1_0.d1_0 = a1_main.d1_0; + a4_main.c2_0 = a3_main.c2_0; + a4_main.c2_0.d2_0 = a1_main.b1_0.d2_0; + a4_main.c2_0.d3_0 = a2_main.b2_0.d3_0; + } catch (NullPointerException e) { + + } + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + + } + + private static void rc_testcase_main_wrapper() { + RCAnnotationThread01_1 t1 = new RCAnnotationThread01_1(); + RCAnnotationThread01_2 t2 = new RCAnnotationThread01_2(); + RCAnnotationThread01_3 t3 = new RCAnnotationThread01_3(); + RCAnnotationThread01_4 t4 = new RCAnnotationThread01_4(); + RCAnnotationThread01_5 t5 = new RCAnnotationThread01_5(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t5.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + t5.join(); + } catch (InterruptedException e) { + } + + } + + + public void setA1null() { + a1_main = null; + } + + public void setA2null() { + a2_main = null; + } + + public void setA3() { + try { + a3_main.c2_0.d2_0 = new RCAnnotationThread01_D2("new"); + a3_main = new RCAnnotationThread01_A3("a3_new"); + a3_main = null; + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + a3_main = null; + } + + public void setA4null() { + a4_main = null; + } + + class RCAnnotationThread01_A1 { + volatile RCAnnotationThread01_B1 b1_0; + volatile RCAnnotationThread01_D1 d1_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + + class RCAnnotationThread01_A2 { + volatile RCAnnotationThread01_B2 b2_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + + class RCAnnotationThread01_A3 { + @Unowned + volatile RCAnnotationThread01_B2 b2_0; + volatile RCAnnotationThread01_C2 c2_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class RCAnnotationThread01_A4 { + volatile RCAnnotationThread01_B3 b3_0; + @Unowned + volatile RCAnnotationThread01_C2 c2_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + + class RCAnnotationThread01_B1 { + volatile RCAnnotationThread01_D2 d2_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + + class RCAnnotationThread01_B2 { + volatile RCAnnotationThread01_C1 c1_0; + @Unowned + volatile RCAnnotationThread01_D1 d1_0; + @Unowned + volatile RCAnnotationThread01_D2 d2_0; + volatile RCAnnotationThread01_D3 d3_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + + class RCAnnotationThread01_B3 { + @Unowned + volatile RCAnnotationThread01_C1 c1_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + + class RCAnnotationThread01_C1 { + @Unowned + volatile RCAnnotationThread01_D1 d1_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class RCAnnotationThread01_C2 { + @Unowned + volatile RCAnnotationThread01_D2 d2_0; + @Unowned + volatile RCAnnotationThread01_D3 d3_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + + class RCAnnotationThread01_D1 { + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RCAnnotationThread01_D2 { + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RCAnnotationThread01_D3 { + int a; + int sum; + String strObjectName; + + RCAnnotationThread01_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0392-rc-Annotation-RCAnnotationThread02/RCAnnotationThread02.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0392-rc-Annotation-RCAnnotationThread02/RCAnnotationThread02.java index 30af31d06068f4134e6868fcc088c58f66107904..51fddea2c7a01ffd85045985cedf2b7664daf0cf 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0392-rc-Annotation-RCAnnotationThread02/RCAnnotationThread02.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0392-rc-Annotation-RCAnnotationThread02/RCAnnotationThread02.java @@ -1,214 +1,214 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationThread02.java - *- @ExecuteClass: RCAnnotationThread02 - *- @ExecuteArgs: - - * - */ - -import com.huawei.ark.annotation.Weak; -import com.huawei.ark.annotation.Unowned; - -class RCAnnotationThread02_1 extends Thread { - public void run() { - RCAnnotationThread02 rcth01 = new RCAnnotationThread02(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread02_2 extends Thread { - public void run() { - RCAnnotationThread02 rcth01 = new RCAnnotationThread02(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread02_3 extends Thread { - public void run() { - RCAnnotationThread02 rcth01 = new RCAnnotationThread02(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RCAnnotationThread02 { - private volatile static RCAnnotationThread02_A1 a1_main = null; - private volatile static RCAnnotationThread02_A4 a4_main = null; - private volatile static RCAnnotationThread02_A5 a5_main = null; - - RCAnnotationThread02() { - synchronized (this) { - try { - RCAnnotationThread02_A1 a1 = new RCAnnotationThread02_A1(); - a1.a2_0 = new RCAnnotationThread02_A2(); - a1.a2_0.a3_0 = new RCAnnotationThread02_A3(); - RCAnnotationThread02_A4 a4 = new RCAnnotationThread02_A4(); - RCAnnotationThread02_A5 a5 = new RCAnnotationThread02_A5(); - a4.a1_0 = a1; - a5.a1_0 = a1; - a1.a2_0.a3_0.a1_0 = a1; - a1_main = a1; - a4_main = a4; - a5_main = a5; - } catch (NullPointerException e) { - } - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RCAnnotationThread02_1 t1 = new RCAnnotationThread02_1(); - RCAnnotationThread02_2 t2 = new RCAnnotationThread02_2(); - RCAnnotationThread02_3 t3 = new RCAnnotationThread02_3(); - t1.start(); - t2.start(); - t3.start(); - - try { - t1.join(); - t2.join(); - t3.join(); - - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - a4_main = null; - } - - public void setA5null() { - a5_main = null; - } - - static class RCAnnotationThread02_A1 { - volatile RCAnnotationThread02_A2 a2_0; - int a; - int sum; - - RCAnnotationThread02_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RCAnnotationThread02_A2 { - volatile RCAnnotationThread02_A3 a3_0; - int a; - int sum; - - RCAnnotationThread02_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RCAnnotationThread02_A3 { - @Weak - volatile RCAnnotationThread02_A1 a1_0; - int a; - int sum; - - RCAnnotationThread02_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - static class RCAnnotationThread02_A4 { - @Unowned - volatile RCAnnotationThread02_A1 a1_0; - int a; - int sum; - - RCAnnotationThread02_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - - static class RCAnnotationThread02_A5 { - @Unowned - volatile RCAnnotationThread02_A1 a1_0; - int a; - int sum; - - RCAnnotationThread02_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationThread02.java + *- @ExecuteClass: RCAnnotationThread02 + *- @ExecuteArgs: + + * + */ + +import com.huawei.ark.annotation.Weak; +import com.huawei.ark.annotation.Unowned; + +class RCAnnotationThread02_1 extends Thread { + public void run() { + RCAnnotationThread02 rcth01 = new RCAnnotationThread02(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread02_2 extends Thread { + public void run() { + RCAnnotationThread02 rcth01 = new RCAnnotationThread02(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread02_3 extends Thread { + public void run() { + RCAnnotationThread02 rcth01 = new RCAnnotationThread02(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RCAnnotationThread02 { + private volatile static RCAnnotationThread02_A1 a1_main = null; + private volatile static RCAnnotationThread02_A4 a4_main = null; + private volatile static RCAnnotationThread02_A5 a5_main = null; + + RCAnnotationThread02() { + synchronized (this) { + try { + RCAnnotationThread02_A1 a1 = new RCAnnotationThread02_A1(); + a1.a2_0 = new RCAnnotationThread02_A2(); + a1.a2_0.a3_0 = new RCAnnotationThread02_A3(); + RCAnnotationThread02_A4 a4 = new RCAnnotationThread02_A4(); + RCAnnotationThread02_A5 a5 = new RCAnnotationThread02_A5(); + a4.a1_0 = a1; + a5.a1_0 = a1; + a1.a2_0.a3_0.a1_0 = a1; + a1_main = a1; + a4_main = a4; + a5_main = a5; + } catch (NullPointerException e) { + } + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RCAnnotationThread02_1 t1 = new RCAnnotationThread02_1(); + RCAnnotationThread02_2 t2 = new RCAnnotationThread02_2(); + RCAnnotationThread02_3 t3 = new RCAnnotationThread02_3(); + t1.start(); + t2.start(); + t3.start(); + + try { + t1.join(); + t2.join(); + t3.join(); + + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + a4_main = null; + } + + public void setA5null() { + a5_main = null; + } + + static class RCAnnotationThread02_A1 { + volatile RCAnnotationThread02_A2 a2_0; + int a; + int sum; + + RCAnnotationThread02_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RCAnnotationThread02_A2 { + volatile RCAnnotationThread02_A3 a3_0; + int a; + int sum; + + RCAnnotationThread02_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RCAnnotationThread02_A3 { + @Weak + volatile RCAnnotationThread02_A1 a1_0; + int a; + int sum; + + RCAnnotationThread02_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + static class RCAnnotationThread02_A4 { + @Unowned + volatile RCAnnotationThread02_A1 a1_0; + int a; + int sum; + + RCAnnotationThread02_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + + static class RCAnnotationThread02_A5 { + @Unowned + volatile RCAnnotationThread02_A1 a1_0; + int a; + int sum; + + RCAnnotationThread02_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0393-rc-Annotation-RCAnnotationThread03/RCAnnotationThread03.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0393-rc-Annotation-RCAnnotationThread03/RCAnnotationThread03.java index 89f460973b50e427c1afd05fd8395b1aea013e5e..fa3a518aa70271cea46241181e6308c32a71f891 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0393-rc-Annotation-RCAnnotationThread03/RCAnnotationThread03.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0393-rc-Annotation-RCAnnotationThread03/RCAnnotationThread03.java @@ -1,234 +1,234 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread03.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationThread03.java - *- @ExecuteClass: RCAnnotationThread03 - *- @ExecuteArgs: - - * - */ - -import com.huawei.ark.annotation.Weak; -import com.huawei.ark.annotation.Unowned; - -class RCAnnotationThread03_1 extends Thread { - public void run() { - RCAnnotationThread03 rcth01 = new RCAnnotationThread03(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - } -} - -class RCAnnotationThread03_2 extends Thread { - public void run() { - RCAnnotationThread03 rcth01 = new RCAnnotationThread03(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - } -} - -class RCAnnotationThread03_3 extends Thread { - public void run() { - RCAnnotationThread03 rcth01 = new RCAnnotationThread03(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - - } -} - -public class RCAnnotationThread03 { - private volatile static RCAnnotationThread03_A1 a1_main = null; - private volatile static RCAnnotationThread03_A5 a5_main = null; - - RCAnnotationThread03() { - synchronized (this) { - try { - a1_main = new RCAnnotationThread03_A1(); - a1_main.a2_0 = new RCAnnotationThread03_A2(); - a1_main.a2_0.a3_0 = new RCAnnotationThread03_A3(); - a1_main.a2_0.a3_0.a4_0 = new RCAnnotationThread03_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a5_main = new RCAnnotationThread03_A5(); - a1_main.a2_0.a3_0.a4_0.a6_0 = new RCAnnotationThread03_A6(); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - } catch (NullPointerException e) { - } - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - - private static void rc_testcase_main_wrapper() { - RCAnnotationThread03_1 t1 = new RCAnnotationThread03_1(); - RCAnnotationThread03_2 t2 = new RCAnnotationThread03_2(); - RCAnnotationThread03_3 t3 = new RCAnnotationThread03_3(); - t1.start(); - t2.start(); - t3.start(); - try { - t1.join(); - t2.join(); - t3.join(); - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - try { - a1_main.a2_0.a3_0.a4_0 = null; - a5_main.a3_0.a4_0 = null; - } catch (NullPointerException e) { - } - } - - public void setA5null() { - a5_main = null; - } - - static class RCAnnotationThread03_A1 { - volatile RCAnnotationThread03_A2 a2_0; - volatile RCAnnotationThread03_A4 a4_0; - int a; - int sum; - - RCAnnotationThread03_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RCAnnotationThread03_A2 { - volatile RCAnnotationThread03_A3 a3_0; - int a; - int sum; - - RCAnnotationThread03_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RCAnnotationThread03_A3 { - volatile RCAnnotationThread03_A4 a4_0; - int a; - int sum; - - RCAnnotationThread03_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - - static class RCAnnotationThread03_A4 { - @Weak - volatile RCAnnotationThread03_A1 a1_0; - volatile RCAnnotationThread03_A6 a6_0; - int a; - int sum; - - RCAnnotationThread03_A4() { - a1_0 = null; - a6_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - static class RCAnnotationThread03_A5 { - @Unowned - volatile RCAnnotationThread03_A3 a3_0; - int a; - int sum; - - RCAnnotationThread03_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RCAnnotationThread03_A6 { - @Unowned - volatile RCAnnotationThread03_A5 a5_0; - int a; - int sum; - - RCAnnotationThread03_A6() { - a5_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread03.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationThread03.java + *- @ExecuteClass: RCAnnotationThread03 + *- @ExecuteArgs: + + * + */ + +import com.huawei.ark.annotation.Weak; +import com.huawei.ark.annotation.Unowned; + +class RCAnnotationThread03_1 extends Thread { + public void run() { + RCAnnotationThread03 rcth01 = new RCAnnotationThread03(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + } +} + +class RCAnnotationThread03_2 extends Thread { + public void run() { + RCAnnotationThread03 rcth01 = new RCAnnotationThread03(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + } +} + +class RCAnnotationThread03_3 extends Thread { + public void run() { + RCAnnotationThread03 rcth01 = new RCAnnotationThread03(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + + } +} + +public class RCAnnotationThread03 { + private volatile static RCAnnotationThread03_A1 a1_main = null; + private volatile static RCAnnotationThread03_A5 a5_main = null; + + RCAnnotationThread03() { + synchronized (this) { + try { + a1_main = new RCAnnotationThread03_A1(); + a1_main.a2_0 = new RCAnnotationThread03_A2(); + a1_main.a2_0.a3_0 = new RCAnnotationThread03_A3(); + a1_main.a2_0.a3_0.a4_0 = new RCAnnotationThread03_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a5_main = new RCAnnotationThread03_A5(); + a1_main.a2_0.a3_0.a4_0.a6_0 = new RCAnnotationThread03_A6(); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + } catch (NullPointerException e) { + } + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + + private static void rc_testcase_main_wrapper() { + RCAnnotationThread03_1 t1 = new RCAnnotationThread03_1(); + RCAnnotationThread03_2 t2 = new RCAnnotationThread03_2(); + RCAnnotationThread03_3 t3 = new RCAnnotationThread03_3(); + t1.start(); + t2.start(); + t3.start(); + try { + t1.join(); + t2.join(); + t3.join(); + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + try { + a1_main.a2_0.a3_0.a4_0 = null; + a5_main.a3_0.a4_0 = null; + } catch (NullPointerException e) { + } + } + + public void setA5null() { + a5_main = null; + } + + static class RCAnnotationThread03_A1 { + volatile RCAnnotationThread03_A2 a2_0; + volatile RCAnnotationThread03_A4 a4_0; + int a; + int sum; + + RCAnnotationThread03_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RCAnnotationThread03_A2 { + volatile RCAnnotationThread03_A3 a3_0; + int a; + int sum; + + RCAnnotationThread03_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RCAnnotationThread03_A3 { + volatile RCAnnotationThread03_A4 a4_0; + int a; + int sum; + + RCAnnotationThread03_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + + static class RCAnnotationThread03_A4 { + @Weak + volatile RCAnnotationThread03_A1 a1_0; + volatile RCAnnotationThread03_A6 a6_0; + int a; + int sum; + + RCAnnotationThread03_A4() { + a1_0 = null; + a6_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + static class RCAnnotationThread03_A5 { + @Unowned + volatile RCAnnotationThread03_A3 a3_0; + int a; + int sum; + + RCAnnotationThread03_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RCAnnotationThread03_A6 { + @Unowned + volatile RCAnnotationThread03_A5 a5_0; + int a; + int sum; + + RCAnnotationThread03_A6() { + a5_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0394-rc-Annotation-RCAnnotationThread04/RCAnnotationThread04.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0394-rc-Annotation-RCAnnotationThread04/RCAnnotationThread04.java index 1beee0dba1a2d24ca7328ab28b3f0b2167e33306..2e39902d549a49cab297e5b8c908ef18b29dd996 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0394-rc-Annotation-RCAnnotationThread04/RCAnnotationThread04.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0394-rc-Annotation-RCAnnotationThread04/RCAnnotationThread04.java @@ -1,274 +1,274 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread04.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationThread04.java - *- @ExecuteClass: RCAnnotationThread04 - *- @ExecuteArgs: - * - */ - -import com.huawei.ark.annotation.Weak; -import com.huawei.ark.annotation.Unowned; - -class RCAnnotationThread04_1 extends Thread { - public void run() { - RCAnnotationThread04 rcth01 = new RCAnnotationThread04(); - try { - rcth01.ModifyA3(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread04_2 extends Thread { - public void run() { - RCAnnotationThread04 rcth01 = new RCAnnotationThread04(); - try { - rcth01.checkA3(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread04_3 extends Thread { - public void run() { - RCAnnotationThread04 rcth01 = new RCAnnotationThread04(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RCAnnotationThread04 { - private volatile static RCAnnotationThread04_A1 a1_main = null; - private volatile static RCAnnotationThread04_A4 a4_main = null; - private volatile static RCAnnotationThread04_A6 a6_main = null; - - RCAnnotationThread04() { - synchronized (this) { - try { - RCAnnotationThread04_A1 a1 = new RCAnnotationThread04_A1("a1"); - RCAnnotationThread04_A4 a4 = new RCAnnotationThread04_A4("a4"); - RCAnnotationThread04_A6 a6 = new RCAnnotationThread04_A6("a6"); - a1.a2_0 = new RCAnnotationThread04_A2("a2_0"); - a1.a2_0.a3_0 = new RCAnnotationThread04_A3("a3_0"); - a1.a2_0.a3_0.a1_0 = a1; - a1.a2_0.a3_0.a5_0 = new RCAnnotationThread04_A5("a5_0"); - a1.a2_0.a3_0.a5_0.a6_0 = a6; - a6.a1_0 = a1; - a6.a3_0 = a1.a2_0.a3_0; - a4.a5_0 = a1.a2_0.a3_0.a5_0; - a6.a4_0 = a4; - a1_main = a1; - a4_main = a4; - a6_main = a6; - } catch (NullPointerException e) { - } - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RCAnnotationThread04_1 t_00010 = new RCAnnotationThread04_1(); - RCAnnotationThread04_2 t_00020 = new RCAnnotationThread04_2(); - RCAnnotationThread04_3 t_00030 = new RCAnnotationThread04_3(); - t_00010.start(); - t_00020.start(); - t_00030.start(); - try { - t_00010.join(); - t_00020.join(); - t_00030.join(); - - } catch (InterruptedException e) { - } - - } - - public void checkA3() { - int[] arr = new int[2]; - try { - arr[0] = a1_main.a2_0.a3_0.a; - arr[1] = a1_main.a2_0.a3_0.sum; - } catch (NullPointerException e) { - - } - } - - public void ModifyA3() { - try { - a1_main.a2_0.a3_0 = new RCAnnotationThread04_A3("new-a3"); - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - RCAnnotationThread04_A3 a3 = new RCAnnotationThread04_A3("test"); - try { - a3 = this.a1_main.a2_0.a3_0; - this.a1_main.a2_0.a3_0 = null; - } catch (NullPointerException e) { - - } - - } - - static class RCAnnotationThread04_A1 { - volatile RCAnnotationThread04_A2 a2_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread04_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - static class RCAnnotationThread04_A2 { - volatile RCAnnotationThread04_A3 a3_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread04_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RCAnnotationThread04_A3 { - @Weak - volatile RCAnnotationThread04_A1 a1_0; - volatile RCAnnotationThread04_A5 a5_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread04_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - - static class RCAnnotationThread04_A4 { - volatile RCAnnotationThread04_A5 a5_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread04_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - static class RCAnnotationThread04_A5 { - @Unowned - volatile RCAnnotationThread04_A6 a6_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread04_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - static class RCAnnotationThread04_A6 { - @Unowned - volatile RCAnnotationThread04_A1 a1_0; - @Unowned - volatile RCAnnotationThread04_A3 a3_0; - @Unowned - volatile RCAnnotationThread04_A4 a4_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread04_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread04.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationThread04.java + *- @ExecuteClass: RCAnnotationThread04 + *- @ExecuteArgs: + * + */ + +import com.huawei.ark.annotation.Weak; +import com.huawei.ark.annotation.Unowned; + +class RCAnnotationThread04_1 extends Thread { + public void run() { + RCAnnotationThread04 rcth01 = new RCAnnotationThread04(); + try { + rcth01.ModifyA3(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread04_2 extends Thread { + public void run() { + RCAnnotationThread04 rcth01 = new RCAnnotationThread04(); + try { + rcth01.checkA3(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread04_3 extends Thread { + public void run() { + RCAnnotationThread04 rcth01 = new RCAnnotationThread04(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RCAnnotationThread04 { + private volatile static RCAnnotationThread04_A1 a1_main = null; + private volatile static RCAnnotationThread04_A4 a4_main = null; + private volatile static RCAnnotationThread04_A6 a6_main = null; + + RCAnnotationThread04() { + synchronized (this) { + try { + RCAnnotationThread04_A1 a1 = new RCAnnotationThread04_A1("a1"); + RCAnnotationThread04_A4 a4 = new RCAnnotationThread04_A4("a4"); + RCAnnotationThread04_A6 a6 = new RCAnnotationThread04_A6("a6"); + a1.a2_0 = new RCAnnotationThread04_A2("a2_0"); + a1.a2_0.a3_0 = new RCAnnotationThread04_A3("a3_0"); + a1.a2_0.a3_0.a1_0 = a1; + a1.a2_0.a3_0.a5_0 = new RCAnnotationThread04_A5("a5_0"); + a1.a2_0.a3_0.a5_0.a6_0 = a6; + a6.a1_0 = a1; + a6.a3_0 = a1.a2_0.a3_0; + a4.a5_0 = a1.a2_0.a3_0.a5_0; + a6.a4_0 = a4; + a1_main = a1; + a4_main = a4; + a6_main = a6; + } catch (NullPointerException e) { + } + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RCAnnotationThread04_1 t_00010 = new RCAnnotationThread04_1(); + RCAnnotationThread04_2 t_00020 = new RCAnnotationThread04_2(); + RCAnnotationThread04_3 t_00030 = new RCAnnotationThread04_3(); + t_00010.start(); + t_00020.start(); + t_00030.start(); + try { + t_00010.join(); + t_00020.join(); + t_00030.join(); + + } catch (InterruptedException e) { + } + + } + + public void checkA3() { + int[] arr = new int[2]; + try { + arr[0] = a1_main.a2_0.a3_0.a; + arr[1] = a1_main.a2_0.a3_0.sum; + } catch (NullPointerException e) { + + } + } + + public void ModifyA3() { + try { + a1_main.a2_0.a3_0 = new RCAnnotationThread04_A3("new-a3"); + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + RCAnnotationThread04_A3 a3 = new RCAnnotationThread04_A3("test"); + try { + a3 = this.a1_main.a2_0.a3_0; + this.a1_main.a2_0.a3_0 = null; + } catch (NullPointerException e) { + + } + + } + + static class RCAnnotationThread04_A1 { + volatile RCAnnotationThread04_A2 a2_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread04_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + static class RCAnnotationThread04_A2 { + volatile RCAnnotationThread04_A3 a3_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread04_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RCAnnotationThread04_A3 { + @Weak + volatile RCAnnotationThread04_A1 a1_0; + volatile RCAnnotationThread04_A5 a5_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread04_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + + static class RCAnnotationThread04_A4 { + volatile RCAnnotationThread04_A5 a5_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread04_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + static class RCAnnotationThread04_A5 { + @Unowned + volatile RCAnnotationThread04_A6 a6_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread04_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + static class RCAnnotationThread04_A6 { + @Unowned + volatile RCAnnotationThread04_A1 a1_0; + @Unowned + volatile RCAnnotationThread04_A3 a3_0; + @Unowned + volatile RCAnnotationThread04_A4 a4_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread04_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0395-rc-Annotation-RCAnnotationThread05/RCAnnotationThread05.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0395-rc-Annotation-RCAnnotationThread05/RCAnnotationThread05.java index cff978d8a3df3aa46802809f5af4d1207ad6979b..68a92ed0060662b3a68682157cc8151a2c1cba31 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0395-rc-Annotation-RCAnnotationThread05/RCAnnotationThread05.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0395-rc-Annotation-RCAnnotationThread05/RCAnnotationThread05.java @@ -1,278 +1,278 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread05.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationThread05.java - *- @ExecuteClass: RCAnnotationThread05 - *- @ExecuteArgs: - * - */ - -import com.huawei.ark.annotation.Weak; -import com.huawei.ark.annotation.Unowned; - -class RCAnnotationThread05_1 extends Thread { - public void run() { - RCAnnotationThread05 rcth01 = new RCAnnotationThread05(); - try { - rcth01.ModifyA3(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread05_2 extends Thread { - public void run() { - RCAnnotationThread05 rcth01 = new RCAnnotationThread05(); - try { - rcth01.checkA3(); - } catch (NullPointerException e) { - - } - } -} - -class RCAnnotationThread05_3 extends Thread { - public void run() { - RCAnnotationThread05 rcth01 = new RCAnnotationThread05(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RCAnnotationThread05 { - private volatile static RCAnnotationThread05_A1 a1_main = null; - private volatile static RCAnnotationThread05_A4 a4_main = null; - private volatile static RCAnnotationThread05_A6 a6_main = null; - private static RCAnnotationThread05_A2 a2 = null; - - RCAnnotationThread05() { - synchronized (this) { - try { - RCAnnotationThread05_A1 a1 = new RCAnnotationThread05_A1("a1"); - RCAnnotationThread05_A4 a4 = new RCAnnotationThread05_A4("a4"); - RCAnnotationThread05_A6 a6 = new RCAnnotationThread05_A6("a6"); - a2 = new RCAnnotationThread05_A2("a2_0"); - a1.a2_0 = a2; - a1.a2_0.a3_0 = new RCAnnotationThread05_A3("a3_0"); - a1.a2_0.a3_0.a1_0 = a1; - a1.a2_0.a3_0.a5_0 = new RCAnnotationThread05_A5("a5_0"); - a1.a2_0.a3_0.a5_0.a6_0 = a6; - a6.a1_0 = a1; - a6.a3_0 = a1.a2_0.a3_0; - a4.a5_0 = a1.a2_0.a3_0.a5_0; - a6.a4_0 = a4; - a1_main = a1; - a4_main = a4; - a6_main = a6; - } catch (NullPointerException e) { - - } - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RCAnnotationThread05_1 t_00010 = new RCAnnotationThread05_1(); - RCAnnotationThread05_2 t_00020 = new RCAnnotationThread05_2(); - RCAnnotationThread05_3 t_00030 = new RCAnnotationThread05_3(); - t_00010.start(); - t_00020.start(); - t_00030.start(); - try { - t_00010.join(); - t_00020.join(); - t_00030.join(); - - } catch (InterruptedException e) { - } - - } - - public void checkA3() { - int[] arr = new int[2]; - try { - arr[0] = a1_main.a2_0.a3_0.a; - arr[1] = a1_main.a2_0.a3_0.sum; - } catch (NullPointerException e) { - - } - } - - public void ModifyA3() { - try { - a1_main.a2_0.a3_0 = new RCAnnotationThread05_A3("new-a3"); - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - RCAnnotationThread05_A3 a3 = new RCAnnotationThread05_A3("test"); - try { - a3 = this.a1_main.a2_0.a3_0; - this.a1_main.a2_0.a3_0 = null; - } catch (NullPointerException e) { - - } - - } - - static class RCAnnotationThread05_A1 { - volatile RCAnnotationThread05_A2 a2_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread05_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - static class RCAnnotationThread05_A2 { - volatile RCAnnotationThread05_A3 a3_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread05_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RCAnnotationThread05_A3 { - @Weak - volatile RCAnnotationThread05_A1 a1_0; - volatile RCAnnotationThread05_A5 a5_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread05_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - - static class RCAnnotationThread05_A4 { - @Unowned - volatile RCAnnotationThread05_A5 a5_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread05_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - static class RCAnnotationThread05_A5 { - @Unowned - volatile RCAnnotationThread05_A6 a6_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread05_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - static class RCAnnotationThread05_A6 { - @Unowned - volatile RCAnnotationThread05_A1 a1_0; - @Unowned - volatile RCAnnotationThread05_A3 a3_0; - @Unowned - volatile RCAnnotationThread05_A4 a4_0; - int a; - int sum; - String strObjectName; - - RCAnnotationThread05_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RCAnnotationThread05.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationThread05.java + *- @ExecuteClass: RCAnnotationThread05 + *- @ExecuteArgs: + * + */ + +import com.huawei.ark.annotation.Weak; +import com.huawei.ark.annotation.Unowned; + +class RCAnnotationThread05_1 extends Thread { + public void run() { + RCAnnotationThread05 rcth01 = new RCAnnotationThread05(); + try { + rcth01.ModifyA3(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread05_2 extends Thread { + public void run() { + RCAnnotationThread05 rcth01 = new RCAnnotationThread05(); + try { + rcth01.checkA3(); + } catch (NullPointerException e) { + + } + } +} + +class RCAnnotationThread05_3 extends Thread { + public void run() { + RCAnnotationThread05 rcth01 = new RCAnnotationThread05(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RCAnnotationThread05 { + private volatile static RCAnnotationThread05_A1 a1_main = null; + private volatile static RCAnnotationThread05_A4 a4_main = null; + private volatile static RCAnnotationThread05_A6 a6_main = null; + private static RCAnnotationThread05_A2 a2 = null; + + RCAnnotationThread05() { + synchronized (this) { + try { + RCAnnotationThread05_A1 a1 = new RCAnnotationThread05_A1("a1"); + RCAnnotationThread05_A4 a4 = new RCAnnotationThread05_A4("a4"); + RCAnnotationThread05_A6 a6 = new RCAnnotationThread05_A6("a6"); + a2 = new RCAnnotationThread05_A2("a2_0"); + a1.a2_0 = a2; + a1.a2_0.a3_0 = new RCAnnotationThread05_A3("a3_0"); + a1.a2_0.a3_0.a1_0 = a1; + a1.a2_0.a3_0.a5_0 = new RCAnnotationThread05_A5("a5_0"); + a1.a2_0.a3_0.a5_0.a6_0 = a6; + a6.a1_0 = a1; + a6.a3_0 = a1.a2_0.a3_0; + a4.a5_0 = a1.a2_0.a3_0.a5_0; + a6.a4_0 = a4; + a1_main = a1; + a4_main = a4; + a6_main = a6; + } catch (NullPointerException e) { + + } + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RCAnnotationThread05_1 t_00010 = new RCAnnotationThread05_1(); + RCAnnotationThread05_2 t_00020 = new RCAnnotationThread05_2(); + RCAnnotationThread05_3 t_00030 = new RCAnnotationThread05_3(); + t_00010.start(); + t_00020.start(); + t_00030.start(); + try { + t_00010.join(); + t_00020.join(); + t_00030.join(); + + } catch (InterruptedException e) { + } + + } + + public void checkA3() { + int[] arr = new int[2]; + try { + arr[0] = a1_main.a2_0.a3_0.a; + arr[1] = a1_main.a2_0.a3_0.sum; + } catch (NullPointerException e) { + + } + } + + public void ModifyA3() { + try { + a1_main.a2_0.a3_0 = new RCAnnotationThread05_A3("new-a3"); + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + RCAnnotationThread05_A3 a3 = new RCAnnotationThread05_A3("test"); + try { + a3 = this.a1_main.a2_0.a3_0; + this.a1_main.a2_0.a3_0 = null; + } catch (NullPointerException e) { + + } + + } + + static class RCAnnotationThread05_A1 { + volatile RCAnnotationThread05_A2 a2_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread05_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + static class RCAnnotationThread05_A2 { + volatile RCAnnotationThread05_A3 a3_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread05_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RCAnnotationThread05_A3 { + @Weak + volatile RCAnnotationThread05_A1 a1_0; + volatile RCAnnotationThread05_A5 a5_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread05_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + + static class RCAnnotationThread05_A4 { + @Unowned + volatile RCAnnotationThread05_A5 a5_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread05_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + static class RCAnnotationThread05_A5 { + @Unowned + volatile RCAnnotationThread05_A6 a6_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread05_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + static class RCAnnotationThread05_A6 { + @Unowned + volatile RCAnnotationThread05_A1 a1_0; + @Unowned + volatile RCAnnotationThread05_A3 a3_0; + @Unowned + volatile RCAnnotationThread05_A4 a4_0; + int a; + int sum; + String strObjectName; + + RCAnnotationThread05_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0396-rc-Annotation-RCAnnotationOneCycle/RCAnnotationOneCycle.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0396-rc-Annotation-RCAnnotationOneCycle/RCAnnotationOneCycle.java index 54de4d5738ca4f04155649ac5c627e63a3980006..37b8f755237eb7b4e55a2f0dec47773a8d38f7c3 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0396-rc-Annotation-RCAnnotationOneCycle/RCAnnotationOneCycle.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0396-rc-Annotation-RCAnnotationOneCycle/RCAnnotationOneCycle.java @@ -1,145 +1,145 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RCAnnotationOneCycle.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Cycle_B_1_00180 for @Weak and @Unowned Test - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationOneCycle.java - *- @ExecuteClass: RCAnnotationOneCycle - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class Cycle_B_1_00180_A1 { - Cycle_B_1_00180_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00180_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_B_1_00180_A2 { - Cycle_B_1_00180_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00180_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_B_1_00180_A3 { - @Weak - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_B_1_00180_A4 { - @Unowned - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_B_1_00180_A5 { - @Unowned - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - -public class RCAnnotationOneCycle { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_B_1_00180_A1 a1_0 = new Cycle_B_1_00180_A1(); - a1_0.a2_0 = new Cycle_B_1_00180_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00180_A3(); - Cycle_B_1_00180_A4 a4_0 = new Cycle_B_1_00180_A4(); - Cycle_B_1_00180_A5 a5_0 = new Cycle_B_1_00180_A5(); - a4_0.a1_0 = a1_0; - a5_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - //System.out.println(nsum); - if (nsum == 23) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RCAnnotationOneCycle.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Cycle_B_1_00180 for @Weak and @Unowned Test + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationOneCycle.java + *- @ExecuteClass: RCAnnotationOneCycle + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class Cycle_B_1_00180_A1 { + Cycle_B_1_00180_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00180_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_B_1_00180_A2 { + Cycle_B_1_00180_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00180_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_B_1_00180_A3 { + @Weak + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_B_1_00180_A4 { + @Unowned + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_B_1_00180_A5 { + @Unowned + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + +public class RCAnnotationOneCycle { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_B_1_00180_A1 a1_0 = new Cycle_B_1_00180_A1(); + a1_0.a2_0 = new Cycle_B_1_00180_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00180_A3(); + Cycle_B_1_00180_A4 a4_0 = new Cycle_B_1_00180_A4(); + Cycle_B_1_00180_A5 a5_0 = new Cycle_B_1_00180_A5(); + a4_0.a1_0 = a1_0; + a5_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + //System.out.println(nsum); + if (nsum == 23) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0397-rc-Annotation-RCAnnotationOneCycleThread/RCAnnotationOneCycleThread.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0397-rc-Annotation-RCAnnotationOneCycleThread/RCAnnotationOneCycleThread.java index f2c1d65fdc369d685bf88d52f9ba017bd977e3d2..d28d758abb62dea5b4e563f552e189e95ef97c9b 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0397-rc-Annotation-RCAnnotationOneCycleThread/RCAnnotationOneCycleThread.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0397-rc-Annotation-RCAnnotationOneCycleThread/RCAnnotationOneCycleThread.java @@ -1,181 +1,181 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationOneCycleThread.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change RCAnnotationOneCycle to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationOneCycleThread.java - *- @ExecuteClass: RCAnnotationOneCycleThread - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class ThreadRc_Cycle_Bm_1_00180 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00180_A1 a1_0 = new Cycle_B_1_00180_A1(); - a1_0.a2_0 = new Cycle_B_1_00180_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00180_A3(); - Cycle_B_1_00180_A4 a4_0 = new Cycle_B_1_00180_A4(); - Cycle_B_1_00180_A5 a5_0 = new Cycle_B_1_00180_A5(); - a4_0.a1_0 = a1_0; - a5_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - //System.out.println(nsum); - - if (nsum == 23) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00180_A1 { - Cycle_B_1_00180_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00180_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00180_A2 { - Cycle_B_1_00180_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00180_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00180_A3 { - @Weak - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00180_A4 { - @Unowned - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00180_A5 { - @Unowned - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class RCAnnotationOneCycleThread { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00180 A1_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A2_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A3_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A4_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A5_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A6_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - - A1_Cycle_Bm_1_00180.start(); - A2_Cycle_Bm_1_00180.start(); - A3_Cycle_Bm_1_00180.start(); - A4_Cycle_Bm_1_00180.start(); - A5_Cycle_Bm_1_00180.start(); - A6_Cycle_Bm_1_00180.start(); - - try { - A1_Cycle_Bm_1_00180.join(); - A2_Cycle_Bm_1_00180.join(); - A3_Cycle_Bm_1_00180.join(); - A4_Cycle_Bm_1_00180.join(); - A5_Cycle_Bm_1_00180.join(); - A6_Cycle_Bm_1_00180.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00180.check() && A2_Cycle_Bm_1_00180.check() && A3_Cycle_Bm_1_00180.check() && A4_Cycle_Bm_1_00180.check() && A5_Cycle_Bm_1_00180.check() && A6_Cycle_Bm_1_00180.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationOneCycleThread.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change RCAnnotationOneCycle to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationOneCycleThread.java + *- @ExecuteClass: RCAnnotationOneCycleThread + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class ThreadRc_Cycle_Bm_1_00180 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00180_A1 a1_0 = new Cycle_B_1_00180_A1(); + a1_0.a2_0 = new Cycle_B_1_00180_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00180_A3(); + Cycle_B_1_00180_A4 a4_0 = new Cycle_B_1_00180_A4(); + Cycle_B_1_00180_A5 a5_0 = new Cycle_B_1_00180_A5(); + a4_0.a1_0 = a1_0; + a5_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + //System.out.println(nsum); + + if (nsum == 23) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00180_A1 { + Cycle_B_1_00180_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00180_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00180_A2 { + Cycle_B_1_00180_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00180_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00180_A3 { + @Weak + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00180_A4 { + @Unowned + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00180_A5 { + @Unowned + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class RCAnnotationOneCycleThread { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00180 A1_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A2_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A3_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A4_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A5_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A6_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + + A1_Cycle_Bm_1_00180.start(); + A2_Cycle_Bm_1_00180.start(); + A3_Cycle_Bm_1_00180.start(); + A4_Cycle_Bm_1_00180.start(); + A5_Cycle_Bm_1_00180.start(); + A6_Cycle_Bm_1_00180.start(); + + try { + A1_Cycle_Bm_1_00180.join(); + A2_Cycle_Bm_1_00180.join(); + A3_Cycle_Bm_1_00180.join(); + A4_Cycle_Bm_1_00180.join(); + A5_Cycle_Bm_1_00180.join(); + A6_Cycle_Bm_1_00180.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00180.check() && A2_Cycle_Bm_1_00180.check() && A3_Cycle_Bm_1_00180.check() && A4_Cycle_Bm_1_00180.check() && A5_Cycle_Bm_1_00180.check() && A6_Cycle_Bm_1_00180.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0398-rc-Annotation-RCAnnotationTwoCycle/RCAnnotationTwoCycle.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0398-rc-Annotation-RCAnnotationTwoCycle/RCAnnotationTwoCycle.java index 312541d84ee51da0293c92e03d1a4d1a31f1f8db..1ae0ab3dbaee31c937277a76eda6389137776412 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0398-rc-Annotation-RCAnnotationTwoCycle/RCAnnotationTwoCycle.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0398-rc-Annotation-RCAnnotationTwoCycle/RCAnnotationTwoCycle.java @@ -1,159 +1,159 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RCAnnotationTwoCycle.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_B_2_00080 for @Weak and @Unowned Test. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationTwoCycle.java - *- @ExecuteClass: RCAnnotationTwoCycle - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class Cycle_B_2_00080_A1 { - Cycle_B_2_00080_A2 a2_0; - Cycle_B_2_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00080_A1() { - a2_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_B_2_00080_A2 { - Cycle_B_2_00080_A3 a3_0; - Cycle_B_2_00080_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00080_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_B_2_00080_A3 { - @Weak - Cycle_B_2_00080_A1 a1_0; - @Unowned - Cycle_B_2_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00080_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_B_2_00080_A4 { - @Unowned - Cycle_B_2_00080_A3 a3_0; - @Unowned - Cycle_B_2_00080_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00080_A4() { - a3_0 = null; - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_B_2_00080_A5 { - @Unowned - Cycle_B_2_00080_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00080_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } -} - -public class RCAnnotationTwoCycle { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_B_2_00080_A1 a1_0 = new Cycle_B_2_00080_A1(); - a1_0.a2_0 = new Cycle_B_2_00080_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00080_A3(); - Cycle_B_2_00080_A4 a4_0 = new Cycle_B_2_00080_A4(); - a4_0.a2_0 = a1_0.a2_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a5_0 = new Cycle_B_2_00080_A5(); - a1_0.a2_0.a3_0.a5_0 = a1_0.a5_0; - a4_0.a3_0.a5_0 = a1_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a1_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a1_0.a5_0.sum); - //System.out.println(nsum); - if (nsum == 28) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RCAnnotationTwoCycle.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_B_2_00080 for @Weak and @Unowned Test. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationTwoCycle.java + *- @ExecuteClass: RCAnnotationTwoCycle + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class Cycle_B_2_00080_A1 { + Cycle_B_2_00080_A2 a2_0; + Cycle_B_2_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00080_A1() { + a2_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_B_2_00080_A2 { + Cycle_B_2_00080_A3 a3_0; + Cycle_B_2_00080_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00080_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_B_2_00080_A3 { + @Weak + Cycle_B_2_00080_A1 a1_0; + @Unowned + Cycle_B_2_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00080_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_B_2_00080_A4 { + @Unowned + Cycle_B_2_00080_A3 a3_0; + @Unowned + Cycle_B_2_00080_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00080_A4() { + a3_0 = null; + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_B_2_00080_A5 { + @Unowned + Cycle_B_2_00080_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00080_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } +} + +public class RCAnnotationTwoCycle { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_B_2_00080_A1 a1_0 = new Cycle_B_2_00080_A1(); + a1_0.a2_0 = new Cycle_B_2_00080_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00080_A3(); + Cycle_B_2_00080_A4 a4_0 = new Cycle_B_2_00080_A4(); + a4_0.a2_0 = a1_0.a2_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a5_0 = new Cycle_B_2_00080_A5(); + a1_0.a2_0.a3_0.a5_0 = a1_0.a5_0; + a4_0.a3_0.a5_0 = a1_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a1_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a1_0.a5_0.sum); + //System.out.println(nsum); + if (nsum == 28) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0399-rc-Annotation-RCAnnotationTwoCycle2/RCAnnotationTwoCycle2.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0399-rc-Annotation-RCAnnotationTwoCycle2/RCAnnotationTwoCycle2.java index e1201e52c2c776d20fc8ec8ed6a7f9952a5bd379..ace9f2dbcb1956e7d359180261b857a3bbc61f42 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0399-rc-Annotation-RCAnnotationTwoCycle2/RCAnnotationTwoCycle2.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0399-rc-Annotation-RCAnnotationTwoCycle2/RCAnnotationTwoCycle2.java @@ -1,244 +1,244 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RCAnnotationTwoCycle2.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_B_2_00230 in RC测试-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationTwoCycle2.java - *- @ExecuteClass: RCAnnotationTwoCycle2 - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class Cycle_B_2_00230_A1 { - Cycle_B_2_00230_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00230_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_B_2_00230_A2 { - Cycle_B_2_00230_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00230_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_B_2_00230_A3 { - Cycle_B_2_00230_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00230_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_B_2_00230_A4 { - Cycle_B_2_00230_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00230_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } -} - - -class Cycle_B_2_00230_A5 { - Cycle_B_2_00230_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00230_A5() { - a6_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a6_0.a; - } -} - - -class Cycle_B_2_00230_A6 { - @Weak - Cycle_B_2_00230_A1 a1_0; - @Unowned - Cycle_B_2_00230_A10 a10_0; - int a; - int sum; - - Cycle_B_2_00230_A6() { - a1_0 = null; - a10_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a10_0.a; - } -} - -class Cycle_B_2_00230_A8 { - Cycle_B_2_00230_A9 a9_0; - int a; - int sum; - - Cycle_B_2_00230_A8() { - a9_0 = null; - a = 7; - sum = 0; - } - - void add() { - sum = a + a9_0.a; - } -} - - -class Cycle_B_2_00230_A9 { - Cycle_B_2_00230_A7 a7_0; - int a; - int sum; - - Cycle_B_2_00230_A9() { - a7_0 = null; - a = 8; - sum = 0; - } - - void add() { - sum = a + a7_0.a; - } -} - - -class Cycle_B_2_00230_A7 { - @Unowned - Cycle_B_2_00230_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00230_A7() { - a4_0 = null; - a = 9; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_B_2_00230_A10 { - Cycle_B_2_00230_A8 a8_0; - int a; - int sum; - - Cycle_B_2_00230_A10() { - a8_0 = null; - a = 10; - sum = 0; - } - - void add() { - sum = a + a8_0.a; - } -} - - -public class RCAnnotationTwoCycle2 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_B_2_00230_A1 a1_0 = new Cycle_B_2_00230_A1(); - a1_0.a2_0 = new Cycle_B_2_00230_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00230_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00230_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00230_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00230_A6(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; - - Cycle_B_2_00230_A10 a10_0 = new Cycle_B_2_00230_A10(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_0; - a10_0.a8_0 = new Cycle_B_2_00230_A8(); - a10_0.a8_0.a9_0 = new Cycle_B_2_00230_A9(); - a10_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00230_A7(); - a10_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a10_0.a8_0.add(); - a10_0.a8_0.a9_0.add(); - a10_0.a8_0.a9_0.a7_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_0.a8_0.sum + a10_0.a8_0.a9_0.sum + a10_0.a8_0.a9_0.a7_0.sum); - - //System.out.println(nsum); - if (nsum == 97) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RCAnnotationTwoCycle2.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_B_2_00230 in RC测试-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationTwoCycle2.java + *- @ExecuteClass: RCAnnotationTwoCycle2 + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class Cycle_B_2_00230_A1 { + Cycle_B_2_00230_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00230_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_B_2_00230_A2 { + Cycle_B_2_00230_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00230_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_B_2_00230_A3 { + Cycle_B_2_00230_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00230_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_B_2_00230_A4 { + Cycle_B_2_00230_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00230_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } +} + + +class Cycle_B_2_00230_A5 { + Cycle_B_2_00230_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00230_A5() { + a6_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a6_0.a; + } +} + + +class Cycle_B_2_00230_A6 { + @Weak + Cycle_B_2_00230_A1 a1_0; + @Unowned + Cycle_B_2_00230_A10 a10_0; + int a; + int sum; + + Cycle_B_2_00230_A6() { + a1_0 = null; + a10_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a10_0.a; + } +} + +class Cycle_B_2_00230_A8 { + Cycle_B_2_00230_A9 a9_0; + int a; + int sum; + + Cycle_B_2_00230_A8() { + a9_0 = null; + a = 7; + sum = 0; + } + + void add() { + sum = a + a9_0.a; + } +} + + +class Cycle_B_2_00230_A9 { + Cycle_B_2_00230_A7 a7_0; + int a; + int sum; + + Cycle_B_2_00230_A9() { + a7_0 = null; + a = 8; + sum = 0; + } + + void add() { + sum = a + a7_0.a; + } +} + + +class Cycle_B_2_00230_A7 { + @Unowned + Cycle_B_2_00230_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00230_A7() { + a4_0 = null; + a = 9; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_B_2_00230_A10 { + Cycle_B_2_00230_A8 a8_0; + int a; + int sum; + + Cycle_B_2_00230_A10() { + a8_0 = null; + a = 10; + sum = 0; + } + + void add() { + sum = a + a8_0.a; + } +} + + +public class RCAnnotationTwoCycle2 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_B_2_00230_A1 a1_0 = new Cycle_B_2_00230_A1(); + a1_0.a2_0 = new Cycle_B_2_00230_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00230_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00230_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00230_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00230_A6(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; + + Cycle_B_2_00230_A10 a10_0 = new Cycle_B_2_00230_A10(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_0; + a10_0.a8_0 = new Cycle_B_2_00230_A8(); + a10_0.a8_0.a9_0 = new Cycle_B_2_00230_A9(); + a10_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00230_A7(); + a10_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a10_0.a8_0.add(); + a10_0.a8_0.a9_0.add(); + a10_0.a8_0.a9_0.a7_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_0.a8_0.sum + a10_0.a8_0.a9_0.sum + a10_0.a8_0.a9_0.a7_0.sum); + + //System.out.println(nsum); + if (nsum == 97) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0400-rc-Annotation-RCAnnotationTwoCycleThread/RCAnnotationTwoCycleThread.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0400-rc-Annotation-RCAnnotationTwoCycleThread/RCAnnotationTwoCycleThread.java index 5c6c08cf420b52cad7f492d2b180d0e7c527680b..4224b4290319a457d443adae9122efd011bdbc40 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0400-rc-Annotation-RCAnnotationTwoCycleThread/RCAnnotationTwoCycleThread.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0400-rc-Annotation-RCAnnotationTwoCycleThread/RCAnnotationTwoCycleThread.java @@ -1,195 +1,195 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationTwoCycleThread.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change RCAnnotationTwoCycle to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationTwoCycleThread.java - *- @ExecuteClass: RCAnnotationTwoCycleThread - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class ThreadRc_Cycle_Bm_2_00080 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00080_A1 a1_0 = new Cycle_B_2_00080_A1(); - a1_0.a2_0 = new Cycle_B_2_00080_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00080_A3(); - Cycle_B_2_00080_A4 a4_0 = new Cycle_B_2_00080_A4(); - a4_0.a2_0 = a1_0.a2_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a5_0 = new Cycle_B_2_00080_A5(); - a1_0.a2_0.a3_0.a5_0 = a1_0.a5_0; - a4_0.a3_0.a5_0 = a1_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a1_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a1_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00080_A1 { - Cycle_B_2_00080_A2 a2_0; - Cycle_B_2_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00080_A1() { - a2_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00080_A2 { - Cycle_B_2_00080_A3 a3_0; - Cycle_B_2_00080_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00080_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00080_A3 { - @Weak - Cycle_B_2_00080_A1 a1_0; - @Unowned - Cycle_B_2_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00080_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00080_A4 { - @Unowned - Cycle_B_2_00080_A3 a3_0; - @Unowned - Cycle_B_2_00080_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00080_A4() { - a3_0 = null; - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00080_A5 { - @Unowned - Cycle_B_2_00080_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00080_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class RCAnnotationTwoCycleThread { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00080 A1_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A2_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A3_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A4_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A5_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A6_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - - A1_Cycle_Bm_2_00080.start(); - A2_Cycle_Bm_2_00080.start(); - A3_Cycle_Bm_2_00080.start(); - A4_Cycle_Bm_2_00080.start(); - A5_Cycle_Bm_2_00080.start(); - A6_Cycle_Bm_2_00080.start(); - - try { - A1_Cycle_Bm_2_00080.join(); - A2_Cycle_Bm_2_00080.join(); - A3_Cycle_Bm_2_00080.join(); - A4_Cycle_Bm_2_00080.join(); - A5_Cycle_Bm_2_00080.join(); - A6_Cycle_Bm_2_00080.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00080.check() && A2_Cycle_Bm_2_00080.check() && A3_Cycle_Bm_2_00080.check() && A4_Cycle_Bm_2_00080.check() && A5_Cycle_Bm_2_00080.check() && A6_Cycle_Bm_2_00080.check()) - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationTwoCycleThread.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change RCAnnotationTwoCycle to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationTwoCycleThread.java + *- @ExecuteClass: RCAnnotationTwoCycleThread + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class ThreadRc_Cycle_Bm_2_00080 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00080_A1 a1_0 = new Cycle_B_2_00080_A1(); + a1_0.a2_0 = new Cycle_B_2_00080_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00080_A3(); + Cycle_B_2_00080_A4 a4_0 = new Cycle_B_2_00080_A4(); + a4_0.a2_0 = a1_0.a2_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a5_0 = new Cycle_B_2_00080_A5(); + a1_0.a2_0.a3_0.a5_0 = a1_0.a5_0; + a4_0.a3_0.a5_0 = a1_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a1_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a1_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00080_A1 { + Cycle_B_2_00080_A2 a2_0; + Cycle_B_2_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00080_A1() { + a2_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00080_A2 { + Cycle_B_2_00080_A3 a3_0; + Cycle_B_2_00080_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00080_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00080_A3 { + @Weak + Cycle_B_2_00080_A1 a1_0; + @Unowned + Cycle_B_2_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00080_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00080_A4 { + @Unowned + Cycle_B_2_00080_A3 a3_0; + @Unowned + Cycle_B_2_00080_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00080_A4() { + a3_0 = null; + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00080_A5 { + @Unowned + Cycle_B_2_00080_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00080_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class RCAnnotationTwoCycleThread { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00080 A1_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A2_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A3_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A4_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A5_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A6_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + + A1_Cycle_Bm_2_00080.start(); + A2_Cycle_Bm_2_00080.start(); + A3_Cycle_Bm_2_00080.start(); + A4_Cycle_Bm_2_00080.start(); + A5_Cycle_Bm_2_00080.start(); + A6_Cycle_Bm_2_00080.start(); + + try { + A1_Cycle_Bm_2_00080.join(); + A2_Cycle_Bm_2_00080.join(); + A3_Cycle_Bm_2_00080.join(); + A4_Cycle_Bm_2_00080.join(); + A5_Cycle_Bm_2_00080.join(); + A6_Cycle_Bm_2_00080.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00080.check() && A2_Cycle_Bm_2_00080.check() && A3_Cycle_Bm_2_00080.check() && A4_Cycle_Bm_2_00080.check() && A5_Cycle_Bm_2_00080.check() && A6_Cycle_Bm_2_00080.check()) + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0401-rc-Annotation-RCAnnotationTwoCycleThread2/RCAnnotationTwoCycleThread2.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0401-rc-Annotation-RCAnnotationTwoCycleThread2/RCAnnotationTwoCycleThread2.java index 8dd422b1638c5aaca6fdb53b898457f7faab660f..a2ccdabbc19f9b2fca60b60abfc85bc0235388b7 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0401-rc-Annotation-RCAnnotationTwoCycleThread2/RCAnnotationTwoCycleThread2.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0401-rc-Annotation-RCAnnotationTwoCycleThread2/RCAnnotationTwoCycleThread2.java @@ -1,271 +1,271 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationTwoCycleThread2.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change RCAnnotationTwoCycle2 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationTwoCycleThread2.java - *- @ExecuteClass: RCAnnotationTwoCycleThread2 - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class ThreadRc_Cycle_Bm_2_00230 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00230_A1 a1_0 = new Cycle_B_2_00230_A1(); - a1_0.a2_0 = new Cycle_B_2_00230_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00230_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00230_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00230_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00230_A6(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; - - Cycle_B_2_00230_A10 a10_0 = new Cycle_B_2_00230_A10(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_0; - a10_0.a8_0 = new Cycle_B_2_00230_A8(); - a10_0.a8_0.a9_0 = new Cycle_B_2_00230_A9(); - a10_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00230_A7(); - a10_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a10_0.a8_0.add(); - a10_0.a8_0.a9_0.add(); - a10_0.a8_0.a9_0.a7_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_0.a8_0.sum + a10_0.a8_0.a9_0.sum + a10_0.a8_0.a9_0.a7_0.sum); - - if (nsum == 97) - checkout = true; - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00230_A1 { - Cycle_B_2_00230_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00230_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00230_A2 { - Cycle_B_2_00230_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00230_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00230_A3 { - Cycle_B_2_00230_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00230_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00230_A4 { - Cycle_B_2_00230_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00230_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00230_A5 { - Cycle_B_2_00230_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00230_A5() { - a6_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_B_2_00230_A6 { - @Weak - Cycle_B_2_00230_A1 a1_0; - @Unowned - Cycle_B_2_00230_A10 a10_0; - int a; - int sum; - - Cycle_B_2_00230_A6() { - a1_0 = null; - a10_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a10_0.a; - } - } - - class Cycle_B_2_00230_A8 { - Cycle_B_2_00230_A9 a9_0; - int a; - int sum; - - Cycle_B_2_00230_A8() { - a9_0 = null; - a = 7; - sum = 0; - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_B_2_00230_A9 { - Cycle_B_2_00230_A7 a7_0; - int a; - int sum; - - Cycle_B_2_00230_A9() { - a7_0 = null; - a = 8; - sum = 0; - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_B_2_00230_A7 { - @Unowned - Cycle_B_2_00230_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00230_A7() { - a4_0 = null; - a = 9; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00230_A10 { - Cycle_B_2_00230_A8 a8_0; - int a; - int sum; - - Cycle_B_2_00230_A10() { - a8_0 = null; - a = 10; - sum = 0; - } - - void add() { - sum = a + a8_0.a; - } - } -} - - -public class RCAnnotationTwoCycleThread2 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00230 A1_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A2_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A3_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A4_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A5_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A6_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - - A1_Cycle_Bm_2_00230.start(); - A2_Cycle_Bm_2_00230.start(); - A3_Cycle_Bm_2_00230.start(); - A4_Cycle_Bm_2_00230.start(); - A5_Cycle_Bm_2_00230.start(); - A6_Cycle_Bm_2_00230.start(); - - try { - A1_Cycle_Bm_2_00230.join(); - A2_Cycle_Bm_2_00230.join(); - A3_Cycle_Bm_2_00230.join(); - A4_Cycle_Bm_2_00230.join(); - A5_Cycle_Bm_2_00230.join(); - A6_Cycle_Bm_2_00230.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00230.check() && A2_Cycle_Bm_2_00230.check() && A3_Cycle_Bm_2_00230.check() && A4_Cycle_Bm_2_00230.check() && A5_Cycle_Bm_2_00230.check() && A6_Cycle_Bm_2_00230.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationTwoCycleThread2.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change RCAnnotationTwoCycle2 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationTwoCycleThread2.java + *- @ExecuteClass: RCAnnotationTwoCycleThread2 + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class ThreadRc_Cycle_Bm_2_00230 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00230_A1 a1_0 = new Cycle_B_2_00230_A1(); + a1_0.a2_0 = new Cycle_B_2_00230_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00230_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00230_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00230_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00230_A6(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; + + Cycle_B_2_00230_A10 a10_0 = new Cycle_B_2_00230_A10(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_0; + a10_0.a8_0 = new Cycle_B_2_00230_A8(); + a10_0.a8_0.a9_0 = new Cycle_B_2_00230_A9(); + a10_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00230_A7(); + a10_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a10_0.a8_0.add(); + a10_0.a8_0.a9_0.add(); + a10_0.a8_0.a9_0.a7_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_0.a8_0.sum + a10_0.a8_0.a9_0.sum + a10_0.a8_0.a9_0.a7_0.sum); + + if (nsum == 97) + checkout = true; + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00230_A1 { + Cycle_B_2_00230_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00230_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00230_A2 { + Cycle_B_2_00230_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00230_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00230_A3 { + Cycle_B_2_00230_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00230_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00230_A4 { + Cycle_B_2_00230_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00230_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00230_A5 { + Cycle_B_2_00230_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00230_A5() { + a6_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_B_2_00230_A6 { + @Weak + Cycle_B_2_00230_A1 a1_0; + @Unowned + Cycle_B_2_00230_A10 a10_0; + int a; + int sum; + + Cycle_B_2_00230_A6() { + a1_0 = null; + a10_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a10_0.a; + } + } + + class Cycle_B_2_00230_A8 { + Cycle_B_2_00230_A9 a9_0; + int a; + int sum; + + Cycle_B_2_00230_A8() { + a9_0 = null; + a = 7; + sum = 0; + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_B_2_00230_A9 { + Cycle_B_2_00230_A7 a7_0; + int a; + int sum; + + Cycle_B_2_00230_A9() { + a7_0 = null; + a = 8; + sum = 0; + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_B_2_00230_A7 { + @Unowned + Cycle_B_2_00230_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00230_A7() { + a4_0 = null; + a = 9; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00230_A10 { + Cycle_B_2_00230_A8 a8_0; + int a; + int sum; + + Cycle_B_2_00230_A10() { + a8_0 = null; + a = 10; + sum = 0; + } + + void add() { + sum = a + a8_0.a; + } + } +} + + +public class RCAnnotationTwoCycleThread2 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00230 A1_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A2_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A3_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A4_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A5_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A6_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + + A1_Cycle_Bm_2_00230.start(); + A2_Cycle_Bm_2_00230.start(); + A3_Cycle_Bm_2_00230.start(); + A4_Cycle_Bm_2_00230.start(); + A5_Cycle_Bm_2_00230.start(); + A6_Cycle_Bm_2_00230.start(); + + try { + A1_Cycle_Bm_2_00230.join(); + A2_Cycle_Bm_2_00230.join(); + A3_Cycle_Bm_2_00230.join(); + A4_Cycle_Bm_2_00230.join(); + A5_Cycle_Bm_2_00230.join(); + A6_Cycle_Bm_2_00230.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00230.check() && A2_Cycle_Bm_2_00230.check() && A3_Cycle_Bm_2_00230.check() && A4_Cycle_Bm_2_00230.check() && A5_Cycle_Bm_2_00230.check() && A6_Cycle_Bm_2_00230.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0402-rc-Annotation-RCAnnotationMultiCycle/RCAnnotationMultiCycle.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0402-rc-Annotation-RCAnnotationMultiCycle/RCAnnotationMultiCycle.java index eb2d5cbe08568a1b110d624ceb93e7971b10b86d..0605d4effdb67be604a20d42c5a38144e6fcd56b 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0402-rc-Annotation-RCAnnotationMultiCycle/RCAnnotationMultiCycle.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0402-rc-Annotation-RCAnnotationMultiCycle/RCAnnotationMultiCycle.java @@ -1,179 +1,179 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RCAnnotationMultiCycle.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00280 for @Weak and @Unowned Test - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationMultiCycle.java - *- @ExecuteClass: RCAnnotationMultiCycle - *- @ExecuteArgs: - * A1 depend A2 A3; A6 depend A3 - * A2 depend A1 A3; A3 depend A1 A5; A5 depend A6; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102+103)+(102+101+103)+(103+101+102+105)+(105+106)+(106+103)=1443 - * - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class Cycle_a_00280_A1 { - Cycle_a_00280_A2 a2_0; - @Unowned - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } -} - -class Cycle_a_00280_A2 { - @Weak - Cycle_a_00280_A1 a1_0; - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - -class Cycle_a_00280_A3 { - @Weak - Cycle_a_00280_A1 a1_0; - @Weak - Cycle_a_00280_A2 a2_0; - Cycle_a_00280_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a + a5_0.a; - } -} - - -class Cycle_a_00280_A5 { - @Unowned - Cycle_a_00280_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00280_A6 { - @Unowned - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -public class RCAnnotationMultiCycle { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); - Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a3_0 = a1_main.a2_0.a3_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - if (result == 1443) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RCAnnotationMultiCycle.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00280 for @Weak and @Unowned Test + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationMultiCycle.java + *- @ExecuteClass: RCAnnotationMultiCycle + *- @ExecuteArgs: + * A1 depend A2 A3; A6 depend A3 + * A2 depend A1 A3; A3 depend A1 A5; A5 depend A6; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102+103)+(102+101+103)+(103+101+102+105)+(105+106)+(106+103)=1443 + * + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class Cycle_a_00280_A1 { + Cycle_a_00280_A2 a2_0; + @Unowned + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } +} + +class Cycle_a_00280_A2 { + @Weak + Cycle_a_00280_A1 a1_0; + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + +class Cycle_a_00280_A3 { + @Weak + Cycle_a_00280_A1 a1_0; + @Weak + Cycle_a_00280_A2 a2_0; + Cycle_a_00280_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a + a5_0.a; + } +} + + +class Cycle_a_00280_A5 { + @Unowned + Cycle_a_00280_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00280_A6 { + @Unowned + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +public class RCAnnotationMultiCycle { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); + Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a3_0 = a1_main.a2_0.a3_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + if (result == 1443) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0403-rc-Annotation-RCAnnotationMultiCycle2/RCAnnotationMultiCycle2.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0403-rc-Annotation-RCAnnotationMultiCycle2/RCAnnotationMultiCycle2.java index 702e517608e7696e8d75eee3b8b142d8bc8d556c..fd465760fc54f1cdf929b222b8b557d487079394 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0403-rc-Annotation-RCAnnotationMultiCycle2/RCAnnotationMultiCycle2.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0403-rc-Annotation-RCAnnotationMultiCycle2/RCAnnotationMultiCycle2.java @@ -1,298 +1,298 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RCAnnotationMultiCycle2.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00370 for @Weak and @Unowned Test - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationMultiCycle2.java - *- @ExecuteClass: RCAnnotationMultiCycle2 - *- @ExecuteArgs: - * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; - * A2 depend A3 A4; A3 depend A1 A5 A10; A5 depend A6 A8 - * A7 depend A2 ; A8 depend A7; - * A8 depend A6 ; A10 depend A9; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 A10.a=1001 - * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105+110)+(104+101)+(105+106+108)+(106+101+103)+(107+102)+(108+107)+(109+106)+(110+109)=2623 - * - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class Cycle_a_00370_A1 { - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00370_A2 { - Cycle_a_00370_A3 a3_0; - @Unowned - Cycle_a_00370_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00370_A3 { - @Weak - Cycle_a_00370_A1 a1_0; - Cycle_a_00370_A5 a5_0; - Cycle_a_00370_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a10_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a10_0.a; - } -} - - -class Cycle_a_00370_A4 { - @Unowned - Cycle_a_00370_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_00370_A5 { - @Unowned - Cycle_a_00370_A6 a6_0; - Cycle_a_00370_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } -} - -class Cycle_a_00370_A6 { - @Unowned - Cycle_a_00370_A1 a1_0; - @Unowned - Cycle_a_00370_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - - -class Cycle_a_00370_A7 { - @Unowned - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_a_00370_A8 { - Cycle_a_00370_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - - -class Cycle_a_00370_A9 { - @Unowned - Cycle_a_00370_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A9(String strObjectName) { - a6_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00370_A10 { - @Unowned - Cycle_a_00370_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A10(String strObjectName) { - a9_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } -} - -public class RCAnnotationMultiCycle2 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); - Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); - Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); - Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); - a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; - a9_main.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a10_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.sum + a1_main.a2_0.a3_0.a5_0.a8_0.sum + a1_main.a2_0.a3_0.a10_0.sum; - - if (result == 2623) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RCAnnotationMultiCycle2.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00370 for @Weak and @Unowned Test + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationMultiCycle2.java + *- @ExecuteClass: RCAnnotationMultiCycle2 + *- @ExecuteArgs: + * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; + * A2 depend A3 A4; A3 depend A1 A5 A10; A5 depend A6 A8 + * A7 depend A2 ; A8 depend A7; + * A8 depend A6 ; A10 depend A9; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 A10.a=1001 + * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105+110)+(104+101)+(105+106+108)+(106+101+103)+(107+102)+(108+107)+(109+106)+(110+109)=2623 + * + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class Cycle_a_00370_A1 { + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00370_A2 { + Cycle_a_00370_A3 a3_0; + @Unowned + Cycle_a_00370_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00370_A3 { + @Weak + Cycle_a_00370_A1 a1_0; + Cycle_a_00370_A5 a5_0; + Cycle_a_00370_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a10_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a10_0.a; + } +} + + +class Cycle_a_00370_A4 { + @Unowned + Cycle_a_00370_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_00370_A5 { + @Unowned + Cycle_a_00370_A6 a6_0; + Cycle_a_00370_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } +} + +class Cycle_a_00370_A6 { + @Unowned + Cycle_a_00370_A1 a1_0; + @Unowned + Cycle_a_00370_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + + +class Cycle_a_00370_A7 { + @Unowned + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_a_00370_A8 { + Cycle_a_00370_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + + +class Cycle_a_00370_A9 { + @Unowned + Cycle_a_00370_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A9(String strObjectName) { + a6_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00370_A10 { + @Unowned + Cycle_a_00370_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A10(String strObjectName) { + a9_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } +} + +public class RCAnnotationMultiCycle2 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); + Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); + Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); + Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); + a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; + a9_main.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a10_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.sum + a1_main.a2_0.a3_0.a5_0.a8_0.sum + a1_main.a2_0.a3_0.a10_0.sum; + + if (result == 2623) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0404-rc-Annotation-RCAnnotationMultiCycleThread/RCAnnotationMultiCycleThread.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0404-rc-Annotation-RCAnnotationMultiCycleThread/RCAnnotationMultiCycleThread.java index 632a5b83092b593643378c95f8a7cc2ef377b508..c17e5c4ed704bb677d61d6e05fca89504a87e4cf 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0404-rc-Annotation-RCAnnotationMultiCycleThread/RCAnnotationMultiCycleThread.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0404-rc-Annotation-RCAnnotationMultiCycleThread/RCAnnotationMultiCycleThread.java @@ -1,211 +1,211 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationMultiCycleThread.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change RCAnnotationMultiCycle to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationMultiCycleThread.java - *- @ExecuteClass: RCAnnotationMultiCycleThread - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class ThreadRc_Cycle_am_00280 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); - Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a3_0 = a1_main.a2_0.a3_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1443) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00280_A1 { - Cycle_a_00280_A2 a2_0; - @Unowned - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00280_A2 { - @Weak - Cycle_a_00280_A1 a1_0; - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00280_A3 { - @Weak - Cycle_a_00280_A1 a1_0; - @Weak - Cycle_a_00280_A2 a2_0; - Cycle_a_00280_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a + a5_0.a; - } - } - - class Cycle_a_00280_A5 { - @Unowned - Cycle_a_00280_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00280_A6 { - @Unowned - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class RCAnnotationMultiCycleThread { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00280 A1_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A2_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A3_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A4_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A5_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A6_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - - A1_Cycle_am_00280.start(); - A2_Cycle_am_00280.start(); - A3_Cycle_am_00280.start(); - A4_Cycle_am_00280.start(); - A5_Cycle_am_00280.start(); - A6_Cycle_am_00280.start(); - - try { - A1_Cycle_am_00280.join(); - A2_Cycle_am_00280.join(); - A3_Cycle_am_00280.join(); - A4_Cycle_am_00280.join(); - A5_Cycle_am_00280.join(); - A6_Cycle_am_00280.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00280.check() && A2_Cycle_am_00280.check() && A3_Cycle_am_00280.check() && A4_Cycle_am_00280.check() && A5_Cycle_am_00280.check() && A6_Cycle_am_00280.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationMultiCycleThread.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change RCAnnotationMultiCycle to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationMultiCycleThread.java + *- @ExecuteClass: RCAnnotationMultiCycleThread + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class ThreadRc_Cycle_am_00280 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); + Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a3_0 = a1_main.a2_0.a3_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1443) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00280_A1 { + Cycle_a_00280_A2 a2_0; + @Unowned + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00280_A2 { + @Weak + Cycle_a_00280_A1 a1_0; + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00280_A3 { + @Weak + Cycle_a_00280_A1 a1_0; + @Weak + Cycle_a_00280_A2 a2_0; + Cycle_a_00280_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a + a5_0.a; + } + } + + class Cycle_a_00280_A5 { + @Unowned + Cycle_a_00280_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00280_A6 { + @Unowned + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class RCAnnotationMultiCycleThread { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00280 A1_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A2_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A3_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A4_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A5_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A6_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + + A1_Cycle_am_00280.start(); + A2_Cycle_am_00280.start(); + A3_Cycle_am_00280.start(); + A4_Cycle_am_00280.start(); + A5_Cycle_am_00280.start(); + A6_Cycle_am_00280.start(); + + try { + A1_Cycle_am_00280.join(); + A2_Cycle_am_00280.join(); + A3_Cycle_am_00280.join(); + A4_Cycle_am_00280.join(); + A5_Cycle_am_00280.join(); + A6_Cycle_am_00280.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00280.check() && A2_Cycle_am_00280.check() && A3_Cycle_am_00280.check() && A4_Cycle_am_00280.check() && A5_Cycle_am_00280.check() && A6_Cycle_am_00280.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0405-rc-Annotation-RCAnnotationMultiCycleThread2/RCAnnotationMultiCycleThread2.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0405-rc-Annotation-RCAnnotationMultiCycleThread2/RCAnnotationMultiCycleThread2.java index fc01233f247112071cc21f43baaf6caade34ac63..0cacd0ece5c0778d8681bdad6646cd0433cc49ea 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0405-rc-Annotation-RCAnnotationMultiCycleThread2/RCAnnotationMultiCycleThread2.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0405-rc-Annotation-RCAnnotationMultiCycleThread2/RCAnnotationMultiCycleThread2.java @@ -1,324 +1,324 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationMultiCycleThread2.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change RCAnnotationMultiCycle2 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect: ExpectResult\n - *- @Priority: High - *- @Source: RCAnnotationMultiCycleThread2.java - *- @ExecuteClass: RCAnnotationMultiCycleThread2 - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; -import com.huawei.ark.annotation.Weak; - -class ThreadRc_Cycle_am_00370 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); - Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); - Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); - Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); - a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; - a9_main.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a10_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.sum + a1_main.a2_0.a3_0.a5_0.a8_0.sum + a1_main.a2_0.a3_0.a10_0.sum; - - if (result == 2623) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00370_A1 { - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00370_A2 { - Cycle_a_00370_A3 a3_0; - @Unowned - Cycle_a_00370_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00370_A3 { - @Weak - Cycle_a_00370_A1 a1_0; - Cycle_a_00370_A5 a5_0; - Cycle_a_00370_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a10_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a10_0.a; - } - } - - class Cycle_a_00370_A4 { - @Unowned - Cycle_a_00370_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00370_A5 { - @Unowned - Cycle_a_00370_A6 a6_0; - Cycle_a_00370_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00370_A6 { - @Unowned - Cycle_a_00370_A1 a1_0; - @Unowned - Cycle_a_00370_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00370_A7 { - @Unowned - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00370_A8 { - Cycle_a_00370_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00370_A9 { - @Unowned - Cycle_a_00370_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A9(String strObjectName) { - a6_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00370_A10 { - @Unowned - Cycle_a_00370_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A10(String strObjectName) { - a9_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } -} - - -public class RCAnnotationMultiCycleThread2 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00370 A1_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A2_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A3_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A4_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A5_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A6_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - - A1_Cycle_am_00370.start(); - A2_Cycle_am_00370.start(); - A3_Cycle_am_00370.start(); - A4_Cycle_am_00370.start(); - A5_Cycle_am_00370.start(); - A6_Cycle_am_00370.start(); - - try { - A1_Cycle_am_00370.join(); - A2_Cycle_am_00370.join(); - A3_Cycle_am_00370.join(); - A4_Cycle_am_00370.join(); - A5_Cycle_am_00370.join(); - A6_Cycle_am_00370.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00370.check() && A2_Cycle_am_00370.check() && A3_Cycle_am_00370.check() && A4_Cycle_am_00370.check() && A5_Cycle_am_00370.check() && A6_Cycle_am_00370.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCAnnotationMultiCycleThread2.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change RCAnnotationMultiCycle2 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect: ExpectResult\n + *- @Priority: High + *- @Source: RCAnnotationMultiCycleThread2.java + *- @ExecuteClass: RCAnnotationMultiCycleThread2 + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; +import com.huawei.ark.annotation.Weak; + +class ThreadRc_Cycle_am_00370 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); + Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); + Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); + Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); + a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; + a9_main.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a10_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.sum + a1_main.a2_0.a3_0.a5_0.a8_0.sum + a1_main.a2_0.a3_0.a10_0.sum; + + if (result == 2623) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00370_A1 { + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00370_A2 { + Cycle_a_00370_A3 a3_0; + @Unowned + Cycle_a_00370_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00370_A3 { + @Weak + Cycle_a_00370_A1 a1_0; + Cycle_a_00370_A5 a5_0; + Cycle_a_00370_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a10_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a10_0.a; + } + } + + class Cycle_a_00370_A4 { + @Unowned + Cycle_a_00370_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00370_A5 { + @Unowned + Cycle_a_00370_A6 a6_0; + Cycle_a_00370_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00370_A6 { + @Unowned + Cycle_a_00370_A1 a1_0; + @Unowned + Cycle_a_00370_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00370_A7 { + @Unowned + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00370_A8 { + Cycle_a_00370_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00370_A9 { + @Unowned + Cycle_a_00370_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A9(String strObjectName) { + a6_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00370_A10 { + @Unowned + Cycle_a_00370_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A10(String strObjectName) { + a9_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } +} + + +public class RCAnnotationMultiCycleThread2 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00370 A1_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A2_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A3_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A4_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A5_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A6_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + + A1_Cycle_am_00370.start(); + A2_Cycle_am_00370.start(); + A3_Cycle_am_00370.start(); + A4_Cycle_am_00370.start(); + A5_Cycle_am_00370.start(); + A6_Cycle_am_00370.start(); + + try { + A1_Cycle_am_00370.join(); + A2_Cycle_am_00370.join(); + A3_Cycle_am_00370.join(); + A4_Cycle_am_00370.join(); + A5_Cycle_am_00370.join(); + A6_Cycle_am_00370.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00370.check() && A2_Cycle_am_00370.check() && A3_Cycle_am_00370.check() && A4_Cycle_am_00370.check() && A5_Cycle_am_00370.check() && A6_Cycle_am_00370.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0420-rc-Annotation-RCUnownedLocalThreadTest/RCUnownedLocalThreadTest.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0420-rc-Annotation-RCUnownedLocalThreadTest/RCUnownedLocalThreadTest.java index ade38dc2c6a2634a681e543bfcd091c8dae18f6c..d982ccd5adecb7281c7decf66ddb76de6a741682 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0420-rc-Annotation-RCUnownedLocalThreadTest/RCUnownedLocalThreadTest.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0420-rc-Annotation-RCUnownedLocalThreadTest/RCUnownedLocalThreadTest.java @@ -1,106 +1,106 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCUnownedLocalThreadTest.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change CaseRC0419 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCUnownedLocalThreadTest.java - *- @ExecuteClass: RCUnownedLocalThreadTest - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.*; - -import java.util.LinkedList; -import java.util.List; - -class RCUnownedLocalTest extends Thread { - private boolean checkout; - - Integer a = new Integer(1); - Object[] arr = new Object[]{1, 2, 3}; - - @UnownedLocal - int method(Integer a, Object[] arr) { - int check = 0; - Integer c = a + a; - if (c == 2) { - check++; - } else { - check--; - } - for (Object array : arr) { - //System.out.println(array); - check++; - } - return check; - } - - public void run() { - int result = method(a, arr); - if (result == 4) { - checkout = true; - } else { - checkout = false; - System.out.println("result:" + result); - } - } - - public boolean check() { - return checkout; - } -} - -public class RCUnownedLocalThreadTest { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - RCUnownedLocalTest rcTest1 = new RCUnownedLocalTest(); - RCUnownedLocalTest rcTest2 = new RCUnownedLocalTest(); - RCUnownedLocalTest rcTest3 = new RCUnownedLocalTest(); - RCUnownedLocalTest rcTest4 = new RCUnownedLocalTest(); - RCUnownedLocalTest rcTest5 = new RCUnownedLocalTest(); - RCUnownedLocalTest rcTest6 = new RCUnownedLocalTest(); - - rcTest1.start(); - rcTest2.start(); - rcTest3.start(); - rcTest4.start(); - rcTest5.start(); - rcTest6.start(); - - try { - rcTest1.join(); - rcTest2.join(); - rcTest3.join(); - rcTest4.join(); - rcTest5.join(); - rcTest6.join(); - - } catch (InterruptedException e) { - } - if (rcTest1.check() && rcTest2.check() && rcTest3.check() && rcTest4.check() && rcTest5.check() && rcTest6.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCUnownedLocalThreadTest.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change CaseRC0419 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCUnownedLocalThreadTest.java + *- @ExecuteClass: RCUnownedLocalThreadTest + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.*; + +import java.util.LinkedList; +import java.util.List; + +class RCUnownedLocalTest extends Thread { + private boolean checkout; + + Integer a = new Integer(1); + Object[] arr = new Object[]{1, 2, 3}; + + @UnownedLocal + int method(Integer a, Object[] arr) { + int check = 0; + Integer c = a + a; + if (c == 2) { + check++; + } else { + check--; + } + for (Object array : arr) { + //System.out.println(array); + check++; + } + return check; + } + + public void run() { + int result = method(a, arr); + if (result == 4) { + checkout = true; + } else { + checkout = false; + System.out.println("result:" + result); + } + } + + public boolean check() { + return checkout; + } +} + +public class RCUnownedLocalThreadTest { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + RCUnownedLocalTest rcTest1 = new RCUnownedLocalTest(); + RCUnownedLocalTest rcTest2 = new RCUnownedLocalTest(); + RCUnownedLocalTest rcTest3 = new RCUnownedLocalTest(); + RCUnownedLocalTest rcTest4 = new RCUnownedLocalTest(); + RCUnownedLocalTest rcTest5 = new RCUnownedLocalTest(); + RCUnownedLocalTest rcTest6 = new RCUnownedLocalTest(); + + rcTest1.start(); + rcTest2.start(); + rcTest3.start(); + rcTest4.start(); + rcTest5.start(); + rcTest6.start(); + + try { + rcTest1.join(); + rcTest2.join(); + rcTest3.join(); + rcTest4.join(); + rcTest5.join(); + rcTest6.join(); + + } catch (InterruptedException e) { + } + if (rcTest1.check() && rcTest2.check() && rcTest3.check() && rcTest4.check() && rcTest5.check() && rcTest6.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/RC0428-rc-Annotation-RCMixThreadTest/RCMixThreadTest.java b/test/testsuite/ouroboros/memory_management/Annotation/RC0428-rc-Annotation-RCMixThreadTest/RCMixThreadTest.java index b31cfc5c556dcf527921b0581c3628c231381c92..81ddd67a25eac6bf476df2d7c3fb0869e75f6cad 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/RC0428-rc-Annotation-RCMixThreadTest/RCMixThreadTest.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/RC0428-rc-Annotation-RCMixThreadTest/RCMixThreadTest.java @@ -1,103 +1,103 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/annotation/Permanent/RCMixThreadTest - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:多线程下调用Weak 或Unowned和Permanent一起用在一个对象的case,验证是否能够正常被释放 - *- @Brief:functionTest - * 多线程下调用Weak 或Unowned和Permanent一起用在一个对象的case,验证是否能够正常被释放 - *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: RCMixThreadTest.java - *- @ExecuteClass: RCMixThreadTest - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; -import java.util.ArrayList; - -import com.huawei.ark.annotation.*; - - -public class RCMixThreadTest { - public static void main(String[] args) throws InterruptedException { - rc_testcase_main_wrapper(); - } - - public static void rc_testcase_main_wrapper() throws InterruptedException { - RCMixTest_Weak rcMixTest_weak = new RCMixTest_Weak(); - RCMixTest_Weak rcMixTest_weak2 = new RCMixTest_Weak(); - RCMixTest_Weak rcMixTest_weak3 = new RCMixTest_Weak(); - RCMixTest_Weak rcMixTest_weak4 = new RCMixTest_Weak(); - RCMixTest_Weak rcMixTest_weak5 = new RCMixTest_Weak(); - - rcMixTest_weak.start(); - rcMixTest_weak2.start(); - rcMixTest_weak3.start(); - rcMixTest_weak4.start(); - rcMixTest_weak5.start(); - - rcMixTest_weak.join(); - rcMixTest_weak2.join(); - rcMixTest_weak3.join(); - rcMixTest_weak4.join(); - rcMixTest_weak5.join(); - } -} - - -class RCMixTest_Weak extends Thread { - - public void run() { - new Test_A_Weak().test(); - } -} - - -class Test_A_Weak { - @Weak - Test_B_Weak bb; - Test_B_Weak bb2; - - public void test() { - foo(); - try { - Thread.sleep(5000); - } catch (Exception e) { - e.printStackTrace(); - } - try { - bb.run(); - } catch (NullPointerException e) { - System.out.println("NullPointerException"); - } - bb2.run(); - } - - private void foo() { - bb = new @Permanent Test_B_Weak(); - bb2 = new Test_B_Weak(); - } -} - -class Test_B_Weak { - public void run() { - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/annotation/Permanent/RCMixThreadTest + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:多线程下调用Weak 或Unowned和Permanent一起用在一个对象的case,验证是否能够正常被释放 + *- @Brief:functionTest + * 多线程下调用Weak 或Unowned和Permanent一起用在一个对象的case,验证是否能够正常被释放 + *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: RCMixThreadTest.java + *- @ExecuteClass: RCMixThreadTest + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; +import java.util.ArrayList; + +import com.huawei.ark.annotation.*; + + +public class RCMixThreadTest { + public static void main(String[] args) throws InterruptedException { + rc_testcase_main_wrapper(); + } + + public static void rc_testcase_main_wrapper() throws InterruptedException { + RCMixTest_Weak rcMixTest_weak = new RCMixTest_Weak(); + RCMixTest_Weak rcMixTest_weak2 = new RCMixTest_Weak(); + RCMixTest_Weak rcMixTest_weak3 = new RCMixTest_Weak(); + RCMixTest_Weak rcMixTest_weak4 = new RCMixTest_Weak(); + RCMixTest_Weak rcMixTest_weak5 = new RCMixTest_Weak(); + + rcMixTest_weak.start(); + rcMixTest_weak2.start(); + rcMixTest_weak3.start(); + rcMixTest_weak4.start(); + rcMixTest_weak5.start(); + + rcMixTest_weak.join(); + rcMixTest_weak2.join(); + rcMixTest_weak3.join(); + rcMixTest_weak4.join(); + rcMixTest_weak5.join(); + } +} + + +class RCMixTest_Weak extends Thread { + + public void run() { + new Test_A_Weak().test(); + } +} + + +class Test_A_Weak { + @Weak + Test_B_Weak bb; + Test_B_Weak bb2; + + public void test() { + foo(); + try { + Thread.sleep(5000); + } catch (Exception e) { + e.printStackTrace(); + } + try { + bb.run(); + } catch (NullPointerException e) { + System.out.println("NullPointerException"); + } + bb2.run(); + } + + private void foo() { + bb = new @Permanent Test_B_Weak(); + bb2 = new Test_B_Weak(); + } +} + +class Test_B_Weak { + public void run() { + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/issue-RC0388-rc-Annotation-RCUnownedRefUnCycle02/RCUnownedRefUncycle02.java b/test/testsuite/ouroboros/memory_management/Annotation/issue-RC0388-rc-Annotation-RCUnownedRefUnCycle02/RCUnownedRefUncycle02.java index 0d42604e580a8a99692fdc2f8c24a6a5838ec424..d6332ee8a87bf308981dd239a467a2f1146a20d1 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/issue-RC0388-rc-Annotation-RCUnownedRefUnCycle02/RCUnownedRefUncycle02.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/issue-RC0388-rc-Annotation-RCUnownedRefUnCycle02/RCUnownedRefUncycle02.java @@ -1,363 +1,363 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RCUnownedRefUncycle02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00180 for @Unowned Test - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCUnownedRefUncycle02.java - *- @ExecuteClass: RCUnownedRefUncycle02 - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; - -class Nocycle_a_00180_A1 { - Nocycle_a_00180_B1 b1_0; - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } -} - - -class Nocycle_a_00180_A2 { - Nocycle_a_00180_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } -} - - -class Nocycle_a_00180_A3 { - @Unowned - Nocycle_a_00180_B2 b2_0; - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } -} - -class Nocycle_a_00180_A4 { - Nocycle_a_00180_B3 b3_0; - @Unowned - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } -} - - -class Nocycle_a_00180_B1 { - Nocycle_a_00180_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } -} - - -class Nocycle_a_00180_B2 { - Nocycle_a_00180_C1 c1_0; - @Unowned - Nocycle_a_00180_D1 d1_0; - @Unowned - Nocycle_a_00180_D2 d2_0; - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_a_00180_B3 { - @Unowned - Nocycle_a_00180_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_a_00180_C1 { - @Unowned - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_a_00180_C2 { - @Unowned - Nocycle_a_00180_D2 d2_0; - @Unowned - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_a_00180_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00180_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00180_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class RCUnownedRefUncycle02 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); - Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); - Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); - Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); - a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - - a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a2_main.b2_0.d1_0 = a1_main.d1_0; - a2_main.b2_0.d2_0 = a1_main.b1_0.d2_0; - a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - - a3_main.b2_0 = a2_main.b2_0; - a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; - a3_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - a3_main.b2_0.d1_0 = a1_main.d1_0; - a3_main.b2_0.d2_0 = a1_main.b1_0.d2_0; - a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; - - a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); - a3_main.c2_0.d2_0 = a1_main.b1_0.d2_0; - a3_main.c2_0.d3_0 = a2_main.b2_0.d3_0; - - a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); - a4_main.b3_0.c1_0 = a2_main.b2_0.c1_0; - a4_main.b3_0.c1_0.d1_0 = a1_main.d1_0; - a4_main.c2_0 = a3_main.c2_0; - a4_main.c2_0.d2_0 = a1_main.b1_0.d2_0; - a4_main.c2_0.d3_0 = a2_main.b2_0.d3_0; - - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.d1_0.add(); - a1_main.b1_0.d2_0.add(); - - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a3_main.c2_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum + a1_main.d1_0.sum + a2_main.b2_0.c1_0.sum; - if (result == 9260) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RCUnownedRefUncycle02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00180 for @Unowned Test + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCUnownedRefUncycle02.java + *- @ExecuteClass: RCUnownedRefUncycle02 + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; + +class Nocycle_a_00180_A1 { + Nocycle_a_00180_B1 b1_0; + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } +} + + +class Nocycle_a_00180_A2 { + Nocycle_a_00180_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } +} + + +class Nocycle_a_00180_A3 { + @Unowned + Nocycle_a_00180_B2 b2_0; + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } +} + +class Nocycle_a_00180_A4 { + Nocycle_a_00180_B3 b3_0; + @Unowned + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } +} + + +class Nocycle_a_00180_B1 { + Nocycle_a_00180_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } +} + + +class Nocycle_a_00180_B2 { + Nocycle_a_00180_C1 c1_0; + @Unowned + Nocycle_a_00180_D1 d1_0; + @Unowned + Nocycle_a_00180_D2 d2_0; + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_a_00180_B3 { + @Unowned + Nocycle_a_00180_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_a_00180_C1 { + @Unowned + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_a_00180_C2 { + @Unowned + Nocycle_a_00180_D2 d2_0; + @Unowned + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_a_00180_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00180_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00180_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class RCUnownedRefUncycle02 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); + Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); + Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); + Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); + a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + + a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a2_main.b2_0.d1_0 = a1_main.d1_0; + a2_main.b2_0.d2_0 = a1_main.b1_0.d2_0; + a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + + a3_main.b2_0 = a2_main.b2_0; + a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; + a3_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + a3_main.b2_0.d1_0 = a1_main.d1_0; + a3_main.b2_0.d2_0 = a1_main.b1_0.d2_0; + a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; + + a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); + a3_main.c2_0.d2_0 = a1_main.b1_0.d2_0; + a3_main.c2_0.d3_0 = a2_main.b2_0.d3_0; + + a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); + a4_main.b3_0.c1_0 = a2_main.b2_0.c1_0; + a4_main.b3_0.c1_0.d1_0 = a1_main.d1_0; + a4_main.c2_0 = a3_main.c2_0; + a4_main.c2_0.d2_0 = a1_main.b1_0.d2_0; + a4_main.c2_0.d3_0 = a2_main.b2_0.d3_0; + + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.d1_0.add(); + a1_main.b1_0.d2_0.add(); + + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a3_main.c2_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum + a1_main.d1_0.sum + a2_main.b2_0.c1_0.sum; + if (result == 9260) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Annotation/issue-RC0390-rc-Annotation-RCUnownedRefUncycleThread2/RCUnownedRefUncycleThread2.java b/test/testsuite/ouroboros/memory_management/Annotation/issue-RC0390-rc-Annotation-RCUnownedRefUncycleThread2/RCUnownedRefUncycleThread2.java index 278674bab8878205b1554372e800e80a737bce25..762fef499181019d7a26ac3a49cae224c5628868 100644 --- a/test/testsuite/ouroboros/memory_management/Annotation/issue-RC0390-rc-Annotation-RCUnownedRefUncycleThread2/RCUnownedRefUncycleThread2.java +++ b/test/testsuite/ouroboros/memory_management/Annotation/issue-RC0390-rc-Annotation-RCUnownedRefUncycleThread2/RCUnownedRefUncycleThread2.java @@ -1,392 +1,392 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCUnownedRefUncycleThread2.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change RCUnownedRefUncycle02 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RCUnownedRefUncycleThread2.java - *- @ExecuteClass: RCUnownedRefUncycleThread2 - *- @ExecuteArgs: - */ - -import com.huawei.ark.annotation.Unowned; - -class ThreadRc_00180 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); - Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); - Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); - Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); - a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - - a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a2_main.b2_0.d1_0 = a1_main.d1_0; - a2_main.b2_0.d2_0 = a1_main.b1_0.d2_0; - a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - - a3_main.b2_0 = a2_main.b2_0; - a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; - a3_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - a3_main.b2_0.d1_0 = a1_main.d1_0; - a3_main.b2_0.d2_0 = a1_main.b1_0.d2_0; - a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; - - a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); - a3_main.c2_0.d2_0 = a1_main.b1_0.d2_0; - a3_main.c2_0.d3_0 = a2_main.b2_0.d3_0; - - a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); - a4_main.b3_0.c1_0 = a2_main.b2_0.c1_0; - a4_main.b3_0.c1_0.d1_0 = a1_main.d1_0; - a4_main.c2_0 = a3_main.c2_0; - a4_main.c2_0.d2_0 = a1_main.b1_0.d2_0; - a4_main.c2_0.d3_0 = a2_main.b2_0.d3_0; - - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.d1_0.add(); - a1_main.b1_0.d2_0.add(); - - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a3_main.c2_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum + a1_main.d1_0.sum + a2_main.b2_0.c1_0.sum; - - if (result == 9260) - checkout = true; - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00180_A1 { - Nocycle_a_00180_B1 b1_0; - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - class Nocycle_a_00180_A2 { - Nocycle_a_00180_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - class Nocycle_a_00180_A3 { - @Unowned - Nocycle_a_00180_B2 b2_0; - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class Nocycle_a_00180_A4 { - Nocycle_a_00180_B3 b3_0; - @Unowned - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - class Nocycle_a_00180_B1 { - Nocycle_a_00180_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - class Nocycle_a_00180_B2 { - Nocycle_a_00180_C1 c1_0; - @Unowned - Nocycle_a_00180_D1 d1_0; - @Unowned - Nocycle_a_00180_D2 d2_0; - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_00180_B3 { - @Unowned - Nocycle_a_00180_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00180_C1 { - @Unowned - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00180_C2 { - @Unowned - Nocycle_a_00180_D2 d2_0; - @Unowned - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_00180_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00180_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00180_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class RCUnownedRefUncycleThread2 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00180 A1_00180 = new ThreadRc_00180(); - ThreadRc_00180 A2_00180 = new ThreadRc_00180(); - ThreadRc_00180 A3_00180 = new ThreadRc_00180(); - ThreadRc_00180 A4_00180 = new ThreadRc_00180(); - ThreadRc_00180 A5_00180 = new ThreadRc_00180(); - ThreadRc_00180 A6_00180 = new ThreadRc_00180(); - - A1_00180.start(); - A2_00180.start(); - A3_00180.start(); - A4_00180.start(); - A5_00180.start(); - A6_00180.start(); - - try { - A1_00180.join(); - A2_00180.join(); - A3_00180.join(); - A4_00180.join(); - A5_00180.join(); - A6_00180.join(); - - } catch (InterruptedException e) { - } - if (A1_00180.check() && A2_00180.check() && A3_00180.check() && A4_00180.check() && A5_00180.check() && A6_00180.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/RCUnownedRefUncycleThread2.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change RCUnownedRefUncycle02 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RCUnownedRefUncycleThread2.java + *- @ExecuteClass: RCUnownedRefUncycleThread2 + *- @ExecuteArgs: + */ + +import com.huawei.ark.annotation.Unowned; + +class ThreadRc_00180 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); + Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); + Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); + Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); + a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + + a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a2_main.b2_0.d1_0 = a1_main.d1_0; + a2_main.b2_0.d2_0 = a1_main.b1_0.d2_0; + a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + + a3_main.b2_0 = a2_main.b2_0; + a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; + a3_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + a3_main.b2_0.d1_0 = a1_main.d1_0; + a3_main.b2_0.d2_0 = a1_main.b1_0.d2_0; + a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; + + a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); + a3_main.c2_0.d2_0 = a1_main.b1_0.d2_0; + a3_main.c2_0.d3_0 = a2_main.b2_0.d3_0; + + a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); + a4_main.b3_0.c1_0 = a2_main.b2_0.c1_0; + a4_main.b3_0.c1_0.d1_0 = a1_main.d1_0; + a4_main.c2_0 = a3_main.c2_0; + a4_main.c2_0.d2_0 = a1_main.b1_0.d2_0; + a4_main.c2_0.d3_0 = a2_main.b2_0.d3_0; + + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.d1_0.add(); + a1_main.b1_0.d2_0.add(); + + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a3_main.c2_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum + a1_main.d1_0.sum + a2_main.b2_0.c1_0.sum; + + if (result == 9260) + checkout = true; + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00180_A1 { + Nocycle_a_00180_B1 b1_0; + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + class Nocycle_a_00180_A2 { + Nocycle_a_00180_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + class Nocycle_a_00180_A3 { + @Unowned + Nocycle_a_00180_B2 b2_0; + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class Nocycle_a_00180_A4 { + Nocycle_a_00180_B3 b3_0; + @Unowned + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + class Nocycle_a_00180_B1 { + Nocycle_a_00180_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + class Nocycle_a_00180_B2 { + Nocycle_a_00180_C1 c1_0; + @Unowned + Nocycle_a_00180_D1 d1_0; + @Unowned + Nocycle_a_00180_D2 d2_0; + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_00180_B3 { + @Unowned + Nocycle_a_00180_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00180_C1 { + @Unowned + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00180_C2 { + @Unowned + Nocycle_a_00180_D2 d2_0; + @Unowned + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_00180_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00180_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00180_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class RCUnownedRefUncycleThread2 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00180 A1_00180 = new ThreadRc_00180(); + ThreadRc_00180 A2_00180 = new ThreadRc_00180(); + ThreadRc_00180 A3_00180 = new ThreadRc_00180(); + ThreadRc_00180 A4_00180 = new ThreadRc_00180(); + ThreadRc_00180 A5_00180 = new ThreadRc_00180(); + ThreadRc_00180 A6_00180 = new ThreadRc_00180(); + + A1_00180.start(); + A2_00180.start(); + A3_00180.start(); + A4_00180.start(); + A5_00180.start(); + A6_00180.start(); + + try { + A1_00180.join(); + A2_00180.join(); + A3_00180.join(); + A4_00180.join(); + A5_00180.join(); + A6_00180.join(); + + } catch (InterruptedException e) { + } + if (A1_00180.check() && A2_00180.check() && A3_00180.check() && A4_00180.check() && A5_00180.check() && A6_00180.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0366-rc-ArrayOptimization-RC_Array_01/RC_Array_01.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0366-rc-ArrayOptimization-RC_Array_01/RC_Array_01.java index 1dd87e349e7ed7170eef725fe380478a9eb6698b..82f3832490719652aefcaf0072aba9ad91a048e3 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0366-rc-ArrayOptimization-RC_Array_01/RC_Array_01.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0366-rc-ArrayOptimization-RC_Array_01/RC_Array_01.java @@ -1,432 +1,432 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_01.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D int array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_01.java - *- @ExecuteClass: RC_Array_01 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; - -class Base_001 { - //Parent interface - volatile int[] base1; - int[][] base2; - int[][] base21; - int[][][] base3; -} - -public class RC_Array_01 extends Base_001 { - static int check_count = 0; - static int[] arr1 = {10, 20, 30, 40}; - static int[][] arr2 = {{10, 20, 30, 40}, {40, 50}, {60}}; - static int[][] arr21 = {{40, 50, 60, 30}, {70, 80}, {90}}; - static int[][][] arr3 = {arr2, arr21}; - - private RC_Array_01() { - base1 = new int[]{10, 20, 30, 40}; - base2 = new int[][]{{10, 20, 30, 40}, {40, 50}, {60}}; - base21 = new int[][]{{40, 50, 60, 30}, {70, 80}, {90}}; - base3 = new int[][][]{{{10, 20, 30, 40}, {40, 50}, {60}}, {{40, 50, 60, 30}, {70, 80}, {90}}}; - } - - private RC_Array_01(int[] intar) { - base1 = intar; - } - - private RC_Array_01(int[][] intarr) { - base2 = intarr; - } - - private RC_Array_01(int[][][] intarrr) { - base3 = intarrr; - } - - private RC_Array_01(int[] intar, int[][] intarr, int[][][] intarrr) { - base1 = intar; - base2 = intarr; - base3 = intarrr; - } - - public static void main(String[] args) { - final int[] TEST1 = {10, 20, 30, 40}; - final int[][] TEST2 = {TEST1, {40, 50}, {60}}; - final int[][] TEST21 = {{40, 50, 60, 30}, {70, 80}, {90}}; - final int[][][] TEST3 = {TEST2, TEST21}; - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_01_test01 function return value to the parameter third and judged. - //RC_Array_01_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_01 () no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_01_test02(); - - //Get an array object by returning a function call - int[] getarr1 = RC_Array_get01(); - int[][] getarr2 = RC_Array_get02(); - int[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - Boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 24) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, int[] second, int[][] third, int[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - int[] xyz = {23, 24, 25, 26}; - int[][] xyz2 = {{23, 24, 25, 26}, {23, 24}, {23}}; - int[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, int[] second, int[][] third, int[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - int[] xyz = {23, 24, 25, 26}; - int[][] xyz2 = {{23, 24, 25, 26}, {23, 24}, {23}}; - int[][][] xyz3 = {xyz2, xyz2}; - second = (int[]) change(second, xyz); - third = (int[][]) change(third, xyz2); - four = (int[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(int[][] third) { - //The test03 interface is called, and the RC_Array_01_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_01_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static int[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static int[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static int[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static int[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - int[] value1 = {23, 24, 25, 26}; - RC_Array_01 rctest = new RC_Array_01(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new int[]{88, 10, 02, 11}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static int[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - int[][] value2 = {{23, 24, 25, 26}, {23, 24}, {23}}; - RC_Array_01 rctest = new RC_Array_01(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new int[][]{{88, 10, 02, 11}, {10, 92}, {16}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static int[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - int[][][] value3 = {{{10, 20, 30, 40}, {40, 50}, {60}}, {{40, 50, 60, 30}, {70, 80}, {90}}}; - RC_Array_01 rctest = new RC_Array_01(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new int[][][]{{{88, 10, 02, 11}, {10, 92}, {12}}, {{88, 10, 02, 11}, {10, 92}, {16}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static int[][] RC_Array_01_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to the newly created - // object field, and judge the result - int[] value1 = {23, 24, 25, 26}; - int[][] value2 = {{23, 24, 25, 26}, {23, 24}, {23}}; - int[][][] value3 = {value2, value2}; - RC_Array_01 rctest = new RC_Array_01(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new int[]{88, 10, 02, 11}; - rctest.base2 = new int[][]{{88, 10, 02, 11}, {10, 92}, {16}}; - rctest.base21 = new int[][]{{88, 10, 02, 11}, {10, 92}, {12}}; - rctest.base3 = new int[][][]{{{88, 10, 02, 11}, {10, 92}, {12}}, {{88, 10, 02, 11}, {10, 92}, {16}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_01_test01"); - return rctest.base21; - } - - private static int[] RC_Array_final01() { - final int[] VALUE1 = {23, 24, 25, 26}; - return VALUE1; - } - - private static int[][] RC_Array_final02() { - final int[][] VALUE2 = {{23, 24, 25, 26}, {23, 24}, {23}}; - return VALUE2; - } - - private static int[][][] RC_Array_final03() { - final int[][][] VALUE3 = {{{10, 20, 30, 40}, {40, 50}, {60}}, {{40, 50, 60, 30}, {70, 80}, {90}}}; - return VALUE3; - } - - private static int[][] RC_Array_01_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_01 () no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final int[] VALUE1 = RC_Array_final01(); - final int[][] VALUE2 = RC_Array_final02(); - final int[][][] VALUE3 = RC_Array_final03(); - RC_Array_01 rctest = new RC_Array_01(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_01_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_01_test02_2"); - return VALUE2; - } - - private static Boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - int[] value1 = RC_Array_final01(); - int[][] value2 = RC_Array_final02(); - int[][][] value3 = RC_Array_final03(); - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - //ArrayIndexOutOfBoundsException - try { - Array.getInt(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = 23; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.setInt(value1, 5, 10); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getInt(RC_Array_final01(), 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getInt(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getInt(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getInt(RC_Array_final02()[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getInt(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getInt(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getInt(RC_Array_final03()[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - //IllegalArgumentException - try { - Array.getInt(value2, 1); - } catch (IllegalArgumentException e) { - check++; - } - try { - Array.getInt(value3, 1); - } catch (IllegalArgumentException e) { - check++; - } - //NumberFormatException - try { - Integer i = new Integer(10); - Array.setInt(value1, 0, i.decode("abc")); - } catch (NumberFormatException e) { - check++; - } - //ClassCastException - RC_Array_01 rc1 = new RC_Array_01(); - try { - Base_001 bs1 = new Base_001(); - rc1 = (RC_Array_01) bs1; - rc1.base1[0] = 123; - } catch (ClassCastException e) { - if (rc1.base1[0] != 123) - check++; - } - - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.getInt(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getInt(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getInt(value3, 1); - } catch (NullPointerException e) { - check++; - } - if (check == 19) - return true; - else - return false; - } - -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_01.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D int array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_01.java + *- @ExecuteClass: RC_Array_01 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; + +class Base_001 { + //Parent interface + volatile int[] base1; + int[][] base2; + int[][] base21; + int[][][] base3; +} + +public class RC_Array_01 extends Base_001 { + static int check_count = 0; + static int[] arr1 = {10, 20, 30, 40}; + static int[][] arr2 = {{10, 20, 30, 40}, {40, 50}, {60}}; + static int[][] arr21 = {{40, 50, 60, 30}, {70, 80}, {90}}; + static int[][][] arr3 = {arr2, arr21}; + + private RC_Array_01() { + base1 = new int[]{10, 20, 30, 40}; + base2 = new int[][]{{10, 20, 30, 40}, {40, 50}, {60}}; + base21 = new int[][]{{40, 50, 60, 30}, {70, 80}, {90}}; + base3 = new int[][][]{{{10, 20, 30, 40}, {40, 50}, {60}}, {{40, 50, 60, 30}, {70, 80}, {90}}}; + } + + private RC_Array_01(int[] intar) { + base1 = intar; + } + + private RC_Array_01(int[][] intarr) { + base2 = intarr; + } + + private RC_Array_01(int[][][] intarrr) { + base3 = intarrr; + } + + private RC_Array_01(int[] intar, int[][] intarr, int[][][] intarrr) { + base1 = intar; + base2 = intarr; + base3 = intarrr; + } + + public static void main(String[] args) { + final int[] TEST1 = {10, 20, 30, 40}; + final int[][] TEST2 = {TEST1, {40, 50}, {60}}; + final int[][] TEST21 = {{40, 50, 60, 30}, {70, 80}, {90}}; + final int[][][] TEST3 = {TEST2, TEST21}; + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_01_test01 function return value to the parameter third and judged. + //RC_Array_01_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_01 () no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_01_test02(); + + //Get an array object by returning a function call + int[] getarr1 = RC_Array_get01(); + int[][] getarr2 = RC_Array_get02(); + int[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + Boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 24) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, int[] second, int[][] third, int[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + int[] xyz = {23, 24, 25, 26}; + int[][] xyz2 = {{23, 24, 25, 26}, {23, 24}, {23}}; + int[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, int[] second, int[][] third, int[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + int[] xyz = {23, 24, 25, 26}; + int[][] xyz2 = {{23, 24, 25, 26}, {23, 24}, {23}}; + int[][][] xyz3 = {xyz2, xyz2}; + second = (int[]) change(second, xyz); + third = (int[][]) change(third, xyz2); + four = (int[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(int[][] third) { + //The test03 interface is called, and the RC_Array_01_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_01_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static int[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static int[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static int[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static int[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + int[] value1 = {23, 24, 25, 26}; + RC_Array_01 rctest = new RC_Array_01(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new int[]{88, 10, 02, 11}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static int[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + int[][] value2 = {{23, 24, 25, 26}, {23, 24}, {23}}; + RC_Array_01 rctest = new RC_Array_01(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new int[][]{{88, 10, 02, 11}, {10, 92}, {16}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static int[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + int[][][] value3 = {{{10, 20, 30, 40}, {40, 50}, {60}}, {{40, 50, 60, 30}, {70, 80}, {90}}}; + RC_Array_01 rctest = new RC_Array_01(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new int[][][]{{{88, 10, 02, 11}, {10, 92}, {12}}, {{88, 10, 02, 11}, {10, 92}, {16}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static int[][] RC_Array_01_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to the newly created + // object field, and judge the result + int[] value1 = {23, 24, 25, 26}; + int[][] value2 = {{23, 24, 25, 26}, {23, 24}, {23}}; + int[][][] value3 = {value2, value2}; + RC_Array_01 rctest = new RC_Array_01(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new int[]{88, 10, 02, 11}; + rctest.base2 = new int[][]{{88, 10, 02, 11}, {10, 92}, {16}}; + rctest.base21 = new int[][]{{88, 10, 02, 11}, {10, 92}, {12}}; + rctest.base3 = new int[][][]{{{88, 10, 02, 11}, {10, 92}, {12}}, {{88, 10, 02, 11}, {10, 92}, {16}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_01_test01"); + return rctest.base21; + } + + private static int[] RC_Array_final01() { + final int[] VALUE1 = {23, 24, 25, 26}; + return VALUE1; + } + + private static int[][] RC_Array_final02() { + final int[][] VALUE2 = {{23, 24, 25, 26}, {23, 24}, {23}}; + return VALUE2; + } + + private static int[][][] RC_Array_final03() { + final int[][][] VALUE3 = {{{10, 20, 30, 40}, {40, 50}, {60}}, {{40, 50, 60, 30}, {70, 80}, {90}}}; + return VALUE3; + } + + private static int[][] RC_Array_01_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_01 () no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final int[] VALUE1 = RC_Array_final01(); + final int[][] VALUE2 = RC_Array_final02(); + final int[][][] VALUE3 = RC_Array_final03(); + RC_Array_01 rctest = new RC_Array_01(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_01_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_01_test02_2"); + return VALUE2; + } + + private static Boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + int[] value1 = RC_Array_final01(); + int[][] value2 = RC_Array_final02(); + int[][][] value3 = RC_Array_final03(); + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + //ArrayIndexOutOfBoundsException + try { + Array.getInt(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = 23; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.setInt(value1, 5, 10); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getInt(RC_Array_final01(), 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getInt(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getInt(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getInt(RC_Array_final02()[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getInt(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getInt(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getInt(RC_Array_final03()[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + //IllegalArgumentException + try { + Array.getInt(value2, 1); + } catch (IllegalArgumentException e) { + check++; + } + try { + Array.getInt(value3, 1); + } catch (IllegalArgumentException e) { + check++; + } + //NumberFormatException + try { + Integer i = new Integer(10); + Array.setInt(value1, 0, i.decode("abc")); + } catch (NumberFormatException e) { + check++; + } + //ClassCastException + RC_Array_01 rc1 = new RC_Array_01(); + try { + Base_001 bs1 = new Base_001(); + rc1 = (RC_Array_01) bs1; + rc1.base1[0] = 123; + } catch (ClassCastException e) { + if (rc1.base1[0] != 123) + check++; + } + + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.getInt(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getInt(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getInt(value3, 1); + } catch (NullPointerException e) { + check++; + } + if (check == 19) + return true; + else + return false; + } + +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0367-rc-ArrayOptimization-RC_Array_02/RC_Array_02.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0367-rc-ArrayOptimization-RC_Array_02/RC_Array_02.java index 720dfea641aa3fe38075eb40dd266a8c3b890f4c..ab175ff0b9ff88a96bd4d1e5313a723588026d25 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0367-rc-ArrayOptimization-RC_Array_02/RC_Array_02.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0367-rc-ArrayOptimization-RC_Array_02/RC_Array_02.java @@ -1,446 +1,446 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D String array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static、literial - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_02.java - *- @ExecuteClass: RC_Array_02 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; -import java.util.regex.PatternSyntaxException; - -class Base_002 { - //Parent interface - volatile String[] base1; - String[][] base2; - String[][] base21; - String[][][] base3; -} - -public class RC_Array_02 extends Base_002 { - static int check_count = 0; - static String[] arr1 = {"10", "20", "30", "40"}; - static String[][] arr2 = {{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}; - static String[][] arr21 = {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}; - static String[][][] arr3 = {arr2, arr21}; - //literial type data - static String literial_v = "abc"; - static String[] arstr1 = {literial_v, literial_v, literial_v, literial_v}; - static String[][] arstr2 = {{"abc", "abc", "abc", "abc"}, {"abc", "abc"}, {literial_v}}; - static String[][][] arstr3 = {arstr2, arstr2}; - - private RC_Array_02() { - base1 = new String[]{"10", "20", "30", "40"}; - base2 = new String[][]{{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}; - base21 = new String[][]{{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}; - base3 = new String[][][]{{{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}, {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}}; - } - - private RC_Array_02(String[] Stringar) { - base1 = Stringar; - } - - private RC_Array_02(String[][] Stringarr) { - base2 = Stringarr; - } - - private RC_Array_02(String[][][] Stringarrr) { - base3 = Stringarrr; - } - - private RC_Array_02(String[] Stringar, String[][] Stringarr, String[][][] Stringarrr) { - base1 = Stringar; - base2 = Stringarr; - base3 = Stringarrr; - } - - public static void main(String[] args) { - final String[] TEST1 = {"10", "20", "30", "40"}; - final String[][] TEST2 = {TEST1, {"40", "50"}, {"60"}}; - final String[][] TEST21 = {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}; - final String[][][] TEST3 = {TEST2, TEST21}; - //literial type data - final String literial_v = "abc"; - final String[] arstrr1 = {literial_v, literial_v, literial_v, literial_v}; - final String[][] arstrr2 = {{"abc", "abc", "abc", "abc"}, {"abc", "abc"}, {literial_v}}; - final String[][][] arstrr3 = {arstrr2, arstrr2}; - - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2 - && arstrr1.length == 4 && arstrr2.length == 3 && arstrr3.length == 2 - && arstr1.length == 4 && arstr2.length == 3 && arstr3.length == 2) - check_count++; - else - System.out.println("ErrorResult String step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - test01(4, arstr1, arstr2, arstr3); - test01(4, arstrr1, arstrr2, arstrr3); - - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2 - && arstrr1.length == 4 && arstrr2.length == 3 && arstrr3.length == 2 - && arstr1.length == 4 && arstr2.length == 3 && arstr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - test02(4, arstr1, arstr2, arstr3); - test02(4, arstrr1, arstrr2, arstrr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2 - && arstrr1.length == 4 && arstrr2.length == 3 && arstrr3.length == 2 - && arstr1.length == 4 && arstr2.length == 3 && arstr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_02_test01 function return value to the parameter third and judged. - //RC_Array_02_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_02() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_02_test02(); - - //Get an array object by returning a function call - String[] getarr1 = RC_Array_get01(); - String[][] getarr2 = RC_Array_get02(); - String[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - Boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 28) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, String[] second, String[][] third, String[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - String[] xyz = {"23", "24", "25", "26"}; - String[][] xyz2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; - String[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, String[] second, String[][] third, String[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - String[] xyz = {"23", "24", "25", "26"}; - String[][] xyz2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; - String[][][] xyz3 = {xyz2, xyz2}; - second = (String[]) change(second, xyz); - third = (String[][]) change(third, xyz2); - four = (String[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(String[][] third) { - //The test03 interface is called, and the RC_Array_02_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_02_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static String[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static String[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static String[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static String[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - String[] value1 = {"23", "24", "25", "26"}; - RC_Array_02 rctest = new RC_Array_02(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new String[]{"88", "10", "02", "11"}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static String[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - String[][] value2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; - RC_Array_02 rctest = new RC_Array_02(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new String[][]{{"88", "10", "02", "11"}, {"10", "92"}, {"16"}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static String[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - String[][][] value3 = {{{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}, {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}}; - RC_Array_02 rctest = new RC_Array_02(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new String[][][]{{{"88", "10", "02", "11"}, {"10", "92"}, {"12"}}, {{"88", "10", "02", "11"}, {"10", "92"}, {"16"}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static String[][] RC_Array_02_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_02, and assign a value to the newly created - // object field, and judge the result - String[] value1 = {"23", "24", "25", "26"}; - String[][] value2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; - String[][][] value3 = {value2, value2}; - RC_Array_02 rctest = new RC_Array_02(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new String[]{"88", "10", "02", "11"}; - rctest.base2 = new String[][]{{"88", "10", "02", "11"}, {"10", "92"}, {"16"}}; - rctest.base21 = new String[][]{{"88", "10", "02", "11"}, {"10", "92"}, {"12"}}; - rctest.base3 = new String[][][]{{{"88", "10", "02", "11"}, {"10", "92"}, {"12"}}, {{"88", "10", "02", "11"}, {"10", "92"}, {"16"}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_02_test01"); - return rctest.base21; - } - - private static String[] RC_Array_final01() { - final String[] VALUE1 = {"23", "24", "25", "26"}; - return VALUE1; - } - - private static String[][] RC_Array_final02() { - final String[][] VALUE2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; - return VALUE2; - } - - private static String[][][] RC_Array_final03() { - final String[][][] VALUE3 = {{{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}, {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}}; - return VALUE3; - } - - private static String[][] RC_Array_02_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_02 () no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final String[] VALUE1 = RC_Array_final01(); - final String[][] VALUE2 = RC_Array_final02(); - final String[][][] VALUE3 = RC_Array_final03(); - RC_Array_02 rctest = new RC_Array_02(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_02_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_02_test02_2"); - return VALUE2; - } - - private static Boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - String[] value1 = RC_Array_final01(); - String[][] value2 = RC_Array_final02(); - String[][][] value3 = RC_Array_final03(); - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - //ArrayIndexOutOfBoundsException - try { - Array.get(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = "error"; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.set(value1, 5, "10"); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.get(RC_Array_final01(), 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.get(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.get(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.get(RC_Array_final02()[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.get(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.get(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.get(RC_Array_final03()[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - - //IndexOutOfBoundsException - try { - char[] ch1 = {'h', 'x', 'c', 't'}; - Array.set(RC_Array_final03()[0][0], 0, String.valueOf(ch1, 5, 2)); - } catch (IndexOutOfBoundsException e) { - check++; - } - //ClassCastException - RC_Array_02 rc1 = new RC_Array_02(); - try { - Base_002 bs1 = new Base_002(); - rc1 = (RC_Array_02) bs1; - rc1.base1[0] = "kitty"; - } catch (ClassCastException e) { - if (rc1.base1[0] != "kitty") - check++; - } - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.get(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.get(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.get(value3, 1); - } catch (NullPointerException e) { - check++; - } - //System.out.println(check); - if (check == 17) - return true; - else - return false; - } - -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D String array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static、literial + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_02.java + *- @ExecuteClass: RC_Array_02 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.regex.PatternSyntaxException; + +class Base_002 { + //Parent interface + volatile String[] base1; + String[][] base2; + String[][] base21; + String[][][] base3; +} + +public class RC_Array_02 extends Base_002 { + static int check_count = 0; + static String[] arr1 = {"10", "20", "30", "40"}; + static String[][] arr2 = {{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}; + static String[][] arr21 = {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}; + static String[][][] arr3 = {arr2, arr21}; + //literial type data + static String literial_v = "abc"; + static String[] arstr1 = {literial_v, literial_v, literial_v, literial_v}; + static String[][] arstr2 = {{"abc", "abc", "abc", "abc"}, {"abc", "abc"}, {literial_v}}; + static String[][][] arstr3 = {arstr2, arstr2}; + + private RC_Array_02() { + base1 = new String[]{"10", "20", "30", "40"}; + base2 = new String[][]{{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}; + base21 = new String[][]{{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}; + base3 = new String[][][]{{{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}, {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}}; + } + + private RC_Array_02(String[] Stringar) { + base1 = Stringar; + } + + private RC_Array_02(String[][] Stringarr) { + base2 = Stringarr; + } + + private RC_Array_02(String[][][] Stringarrr) { + base3 = Stringarrr; + } + + private RC_Array_02(String[] Stringar, String[][] Stringarr, String[][][] Stringarrr) { + base1 = Stringar; + base2 = Stringarr; + base3 = Stringarrr; + } + + public static void main(String[] args) { + final String[] TEST1 = {"10", "20", "30", "40"}; + final String[][] TEST2 = {TEST1, {"40", "50"}, {"60"}}; + final String[][] TEST21 = {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}; + final String[][][] TEST3 = {TEST2, TEST21}; + //literial type data + final String literial_v = "abc"; + final String[] arstrr1 = {literial_v, literial_v, literial_v, literial_v}; + final String[][] arstrr2 = {{"abc", "abc", "abc", "abc"}, {"abc", "abc"}, {literial_v}}; + final String[][][] arstrr3 = {arstrr2, arstrr2}; + + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2 + && arstrr1.length == 4 && arstrr2.length == 3 && arstrr3.length == 2 + && arstr1.length == 4 && arstr2.length == 3 && arstr3.length == 2) + check_count++; + else + System.out.println("ErrorResult String step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + test01(4, arstr1, arstr2, arstr3); + test01(4, arstrr1, arstrr2, arstrr3); + + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2 + && arstrr1.length == 4 && arstrr2.length == 3 && arstrr3.length == 2 + && arstr1.length == 4 && arstr2.length == 3 && arstr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + test02(4, arstr1, arstr2, arstr3); + test02(4, arstrr1, arstrr2, arstrr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2 + && arstrr1.length == 4 && arstrr2.length == 3 && arstrr3.length == 2 + && arstr1.length == 4 && arstr2.length == 3 && arstr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_02_test01 function return value to the parameter third and judged. + //RC_Array_02_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_02() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_02_test02(); + + //Get an array object by returning a function call + String[] getarr1 = RC_Array_get01(); + String[][] getarr2 = RC_Array_get02(); + String[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + Boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 28) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, String[] second, String[][] third, String[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + String[] xyz = {"23", "24", "25", "26"}; + String[][] xyz2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; + String[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, String[] second, String[][] third, String[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + String[] xyz = {"23", "24", "25", "26"}; + String[][] xyz2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; + String[][][] xyz3 = {xyz2, xyz2}; + second = (String[]) change(second, xyz); + third = (String[][]) change(third, xyz2); + four = (String[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(String[][] third) { + //The test03 interface is called, and the RC_Array_02_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_02_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static String[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static String[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static String[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static String[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + String[] value1 = {"23", "24", "25", "26"}; + RC_Array_02 rctest = new RC_Array_02(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new String[]{"88", "10", "02", "11"}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static String[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + String[][] value2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; + RC_Array_02 rctest = new RC_Array_02(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new String[][]{{"88", "10", "02", "11"}, {"10", "92"}, {"16"}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static String[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + String[][][] value3 = {{{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}, {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}}; + RC_Array_02 rctest = new RC_Array_02(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new String[][][]{{{"88", "10", "02", "11"}, {"10", "92"}, {"12"}}, {{"88", "10", "02", "11"}, {"10", "92"}, {"16"}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static String[][] RC_Array_02_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_02, and assign a value to the newly created + // object field, and judge the result + String[] value1 = {"23", "24", "25", "26"}; + String[][] value2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; + String[][][] value3 = {value2, value2}; + RC_Array_02 rctest = new RC_Array_02(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new String[]{"88", "10", "02", "11"}; + rctest.base2 = new String[][]{{"88", "10", "02", "11"}, {"10", "92"}, {"16"}}; + rctest.base21 = new String[][]{{"88", "10", "02", "11"}, {"10", "92"}, {"12"}}; + rctest.base3 = new String[][][]{{{"88", "10", "02", "11"}, {"10", "92"}, {"12"}}, {{"88", "10", "02", "11"}, {"10", "92"}, {"16"}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_02_test01"); + return rctest.base21; + } + + private static String[] RC_Array_final01() { + final String[] VALUE1 = {"23", "24", "25", "26"}; + return VALUE1; + } + + private static String[][] RC_Array_final02() { + final String[][] VALUE2 = {{"23", "24", "25", "26"}, {"23", "24"}, {"23"}}; + return VALUE2; + } + + private static String[][][] RC_Array_final03() { + final String[][][] VALUE3 = {{{"10", "20", "30", "40"}, {"40", "50"}, {"60"}}, {{"40", "50", "60", "30"}, {"70", "80"}, {"90"}}}; + return VALUE3; + } + + private static String[][] RC_Array_02_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_02 () no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final String[] VALUE1 = RC_Array_final01(); + final String[][] VALUE2 = RC_Array_final02(); + final String[][][] VALUE3 = RC_Array_final03(); + RC_Array_02 rctest = new RC_Array_02(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_02_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_02_test02_2"); + return VALUE2; + } + + private static Boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + String[] value1 = RC_Array_final01(); + String[][] value2 = RC_Array_final02(); + String[][][] value3 = RC_Array_final03(); + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + //ArrayIndexOutOfBoundsException + try { + Array.get(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = "error"; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.set(value1, 5, "10"); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.get(RC_Array_final01(), 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.get(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.get(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.get(RC_Array_final02()[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.get(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.get(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.get(RC_Array_final03()[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + + //IndexOutOfBoundsException + try { + char[] ch1 = {'h', 'x', 'c', 't'}; + Array.set(RC_Array_final03()[0][0], 0, String.valueOf(ch1, 5, 2)); + } catch (IndexOutOfBoundsException e) { + check++; + } + //ClassCastException + RC_Array_02 rc1 = new RC_Array_02(); + try { + Base_002 bs1 = new Base_002(); + rc1 = (RC_Array_02) bs1; + rc1.base1[0] = "kitty"; + } catch (ClassCastException e) { + if (rc1.base1[0] != "kitty") + check++; + } + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.get(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.get(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.get(value3, 1); + } catch (NullPointerException e) { + check++; + } + //System.out.println(check); + if (check == 17) + return true; + else + return false; + } + +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0368-rc-ArrayOptimization-RC_Array_03/RC_Array_03.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0368-rc-ArrayOptimization-RC_Array_03/RC_Array_03.java index 727364a15a9f6da00a21f85363dbd9fec26e60e0..916a0545a1e68e88ae94929918a1f1134e4bf797 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0368-rc-ArrayOptimization-RC_Array_03/RC_Array_03.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0368-rc-ArrayOptimization-RC_Array_03/RC_Array_03.java @@ -1,427 +1,427 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_03.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D Char array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_03.java - *- @ExecuteClass: RC_Array_03 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; - -class Base_003 { - //Parent interface - volatile char[] base1; - char[][] base2; - char[][] base21; - char[][][] base3; -} - -public class RC_Array_03 extends Base_003 { - static int check_count = 0; - static char[] arr1 = {'a', 'b', 'c', 'd'}; - static char[][] arr2 = {{'a', 'b', 'c', 'd'}, {'e', 'f'}, {'g'}}; - static char[][] arr21 = {{'h', 'i', 'j', 'k'}, {'l', 'm'}, {'n'}}; - static char[][][] arr3 = {arr2, arr21}; - - private RC_Array_03() { - base1 = new char[]{'a', 'b', 'c', 'd'}; - base2 = new char[][]{{'a', 'b', 'c', 'd'}, {'e', 'f'}, {'g'}}; - base21 = new char[][]{{'h', 'i', 'j', 'k'}, {'l', 'm'}, {'n'}}; - base3 = new char[][][]{{{'a', 'b', 'c', 'd'}, {'e', 'f'}, {'g'}}, {{'h', 'i', 'j', 'k'}, {'l', 'm'}, {'n'}}}; - } - - private RC_Array_03(char[] charar) { - base1 = charar; - } - - private RC_Array_03(char[][] chararr) { - base2 = chararr; - } - - private RC_Array_03(char[][][] chararrr) { - base3 = chararrr; - } - - private RC_Array_03(char[] charar, char[][] chararr, char[][][] chararrr) { - base1 = charar; - base2 = chararr; - base3 = chararrr; - } - - public static void main(String[] args) { - final char[] TEST1 = {'1', '2', '3', '4'}; - final char[][] TEST2 = {TEST1, {'4', '5'}, {'6'}}; - final char[][] TEST21 = {{'4', '5', '6', '3'}, {'7', '8'}, {'9'}}; - final char[][][] TEST3 = {TEST2, TEST21}; - - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult char step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_03_test01 function return value to the parameter third and judged. - //RC_Array_03_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_03() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_03_test02(); - - //Get an array object by returning a function call - char[] getarr1 = RC_Array_get01(); - char[][] getarr2 = RC_Array_get02(); - char[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - Boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 24) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, char[] second, char[][] third, char[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - char[] xyz = {'h', 'x', 'w', 'g'}; - char[][] xyz2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; - char[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, char[] second, char[][] third, char[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - char[] xyz = {'h', 'x', 'w', 'g'}; - char[][] xyz2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; - char[][][] xyz3 = {xyz2, xyz2}; - second = (char[]) change(second, xyz); - third = (char[][]) change(third, xyz2); - four = (char[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(char[][] third) { - //The test03 interface is called, and the RC_Array_03_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_03_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static char[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static char[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static char[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static char[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - char[] value1 = {'h', 'x', 'w', 'g'}; - RC_Array_03 rctest = new RC_Array_03(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new char[]{'8', '0', '2', '3'}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static char[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - char[][] value2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; - RC_Array_03 rctest = new RC_Array_03(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new char[][]{{'8', '0', '2', '3'}, {'w', 'g'}, {'q'}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static char[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - char[][][] value3 = {{{'1', '2', '3', '4'}, {'4', '5'}, {'6'}}, {{'4', '5', '6', '3'}, {'7', '8'}, {'9'}}}; - RC_Array_03 rctest = new RC_Array_03(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new char[][][]{{{'w', 'a', 'n', 'g'}, {'s', 'u'}, {'n'}}, {{'w', 'a', 'n', 'g'}, {'w', 'g'}, {'q'}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static char[][] RC_Array_03_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_03, and assign a value to the newly created - // object field, and judge the result - char[] value1 = {'h', 'x', 'w', 'g'}; - char[][] value2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; - char[][][] value3 = {value2, value2}; - RC_Array_03 rctest = new RC_Array_03(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new char[]{'w', 'a', 'n', 'g'}; - rctest.base2 = new char[][]{{'w', 'a', 'n', 'g'}, {'w', 'g'}, {'q'}}; - rctest.base21 = new char[][]{{'w', 'a', 'n', 'g'}, {'s', 'u'}, {'n'}}; - rctest.base3 = new char[][][]{{{'w', 'a', 'n', 'g'}, {'s', 'u'}, {'n'}}, {{'w', 'a', 'n', 'g'}, {'w', 'g'}, {'q'}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_03_test01"); - return rctest.base21; - } - - private static char[] RC_Array_final01() { - final char[] VALUE1 = {'h', 'x', 'w', 'g'}; - return VALUE1; - } - - private static char[][] RC_Array_final02() { - final char[][] VALUE2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; - return VALUE2; - } - - private static char[][][] RC_Array_final03() { - final char[][][] VALUE3 = {{{'1', '2', '3', '4'}, {'4', '5'}, {'6'}}, {{'4', '5', '6', '3'}, {'7', '8'}, {'9'}}}; - return VALUE3; - } - - private static char[][] RC_Array_03_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_03 () no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final char[] VALUE1 = RC_Array_final01(); - final char[][] VALUE2 = RC_Array_final02(); - final char[][][] VALUE3 = RC_Array_final03(); - RC_Array_03 rctest = new RC_Array_03(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_03_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_03_test02_2"); - return VALUE2; - } - - private static Boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - char[] value1 = RC_Array_final01(); - char[][] value2 = RC_Array_final02(); - char[][][] value3 = RC_Array_final03(); - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - //ArrayIndexOutOfBoundsException - try { - Array.getChar(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = 'e'; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.setChar(value1, 5, '1'); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getChar(RC_Array_final01(), 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getChar(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getChar(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getChar(RC_Array_final02()[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getChar(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getChar(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getChar(RC_Array_final03()[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - //IllegalArgumentException - try { - Array.getChar(value2, 1); - } catch (IllegalArgumentException e) { - check++; - } - try { - Array.getChar(value3, 1); - } catch (IllegalArgumentException e) { - check++; - } - //ClassCastException - RC_Array_03 rc1 = new RC_Array_03(); - try { - Base_003 bs1 = new Base_003(); - rc1 = (RC_Array_03) bs1; - rc1.base1[0] = 'p'; - } catch (ClassCastException e) { - if (rc1.base1[0] != 'p') - check++; - } - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.getChar(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getChar(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getChar(value3, 1); - } catch (NullPointerException e) { - check++; - } - if (check == 18) - return true; - else - return false; - } - -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_03.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D Char array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_03.java + *- @ExecuteClass: RC_Array_03 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; + +class Base_003 { + //Parent interface + volatile char[] base1; + char[][] base2; + char[][] base21; + char[][][] base3; +} + +public class RC_Array_03 extends Base_003 { + static int check_count = 0; + static char[] arr1 = {'a', 'b', 'c', 'd'}; + static char[][] arr2 = {{'a', 'b', 'c', 'd'}, {'e', 'f'}, {'g'}}; + static char[][] arr21 = {{'h', 'i', 'j', 'k'}, {'l', 'm'}, {'n'}}; + static char[][][] arr3 = {arr2, arr21}; + + private RC_Array_03() { + base1 = new char[]{'a', 'b', 'c', 'd'}; + base2 = new char[][]{{'a', 'b', 'c', 'd'}, {'e', 'f'}, {'g'}}; + base21 = new char[][]{{'h', 'i', 'j', 'k'}, {'l', 'm'}, {'n'}}; + base3 = new char[][][]{{{'a', 'b', 'c', 'd'}, {'e', 'f'}, {'g'}}, {{'h', 'i', 'j', 'k'}, {'l', 'm'}, {'n'}}}; + } + + private RC_Array_03(char[] charar) { + base1 = charar; + } + + private RC_Array_03(char[][] chararr) { + base2 = chararr; + } + + private RC_Array_03(char[][][] chararrr) { + base3 = chararrr; + } + + private RC_Array_03(char[] charar, char[][] chararr, char[][][] chararrr) { + base1 = charar; + base2 = chararr; + base3 = chararrr; + } + + public static void main(String[] args) { + final char[] TEST1 = {'1', '2', '3', '4'}; + final char[][] TEST2 = {TEST1, {'4', '5'}, {'6'}}; + final char[][] TEST21 = {{'4', '5', '6', '3'}, {'7', '8'}, {'9'}}; + final char[][][] TEST3 = {TEST2, TEST21}; + + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult char step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_03_test01 function return value to the parameter third and judged. + //RC_Array_03_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_03() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_03_test02(); + + //Get an array object by returning a function call + char[] getarr1 = RC_Array_get01(); + char[][] getarr2 = RC_Array_get02(); + char[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + Boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 24) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, char[] second, char[][] third, char[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + char[] xyz = {'h', 'x', 'w', 'g'}; + char[][] xyz2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; + char[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, char[] second, char[][] third, char[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + char[] xyz = {'h', 'x', 'w', 'g'}; + char[][] xyz2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; + char[][][] xyz3 = {xyz2, xyz2}; + second = (char[]) change(second, xyz); + third = (char[][]) change(third, xyz2); + four = (char[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(char[][] third) { + //The test03 interface is called, and the RC_Array_03_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_03_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static char[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static char[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static char[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static char[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + char[] value1 = {'h', 'x', 'w', 'g'}; + RC_Array_03 rctest = new RC_Array_03(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new char[]{'8', '0', '2', '3'}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static char[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + char[][] value2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; + RC_Array_03 rctest = new RC_Array_03(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new char[][]{{'8', '0', '2', '3'}, {'w', 'g'}, {'q'}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static char[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + char[][][] value3 = {{{'1', '2', '3', '4'}, {'4', '5'}, {'6'}}, {{'4', '5', '6', '3'}, {'7', '8'}, {'9'}}}; + RC_Array_03 rctest = new RC_Array_03(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new char[][][]{{{'w', 'a', 'n', 'g'}, {'s', 'u'}, {'n'}}, {{'w', 'a', 'n', 'g'}, {'w', 'g'}, {'q'}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static char[][] RC_Array_03_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_03, and assign a value to the newly created + // object field, and judge the result + char[] value1 = {'h', 'x', 'w', 'g'}; + char[][] value2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; + char[][][] value3 = {value2, value2}; + RC_Array_03 rctest = new RC_Array_03(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new char[]{'w', 'a', 'n', 'g'}; + rctest.base2 = new char[][]{{'w', 'a', 'n', 'g'}, {'w', 'g'}, {'q'}}; + rctest.base21 = new char[][]{{'w', 'a', 'n', 'g'}, {'s', 'u'}, {'n'}}; + rctest.base3 = new char[][][]{{{'w', 'a', 'n', 'g'}, {'s', 'u'}, {'n'}}, {{'w', 'a', 'n', 'g'}, {'w', 'g'}, {'q'}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_03_test01"); + return rctest.base21; + } + + private static char[] RC_Array_final01() { + final char[] VALUE1 = {'h', 'x', 'w', 'g'}; + return VALUE1; + } + + private static char[][] RC_Array_final02() { + final char[][] VALUE2 = {{'h', 'x', 'w', 'g'}, {'w', 'g'}, {'q'}}; + return VALUE2; + } + + private static char[][][] RC_Array_final03() { + final char[][][] VALUE3 = {{{'1', '2', '3', '4'}, {'4', '5'}, {'6'}}, {{'4', '5', '6', '3'}, {'7', '8'}, {'9'}}}; + return VALUE3; + } + + private static char[][] RC_Array_03_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_03 () no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final char[] VALUE1 = RC_Array_final01(); + final char[][] VALUE2 = RC_Array_final02(); + final char[][][] VALUE3 = RC_Array_final03(); + RC_Array_03 rctest = new RC_Array_03(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_03_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_03_test02_2"); + return VALUE2; + } + + private static Boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + char[] value1 = RC_Array_final01(); + char[][] value2 = RC_Array_final02(); + char[][][] value3 = RC_Array_final03(); + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + //ArrayIndexOutOfBoundsException + try { + Array.getChar(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = 'e'; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.setChar(value1, 5, '1'); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getChar(RC_Array_final01(), 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getChar(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getChar(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getChar(RC_Array_final02()[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getChar(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getChar(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getChar(RC_Array_final03()[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + //IllegalArgumentException + try { + Array.getChar(value2, 1); + } catch (IllegalArgumentException e) { + check++; + } + try { + Array.getChar(value3, 1); + } catch (IllegalArgumentException e) { + check++; + } + //ClassCastException + RC_Array_03 rc1 = new RC_Array_03(); + try { + Base_003 bs1 = new Base_003(); + rc1 = (RC_Array_03) bs1; + rc1.base1[0] = 'p'; + } catch (ClassCastException e) { + if (rc1.base1[0] != 'p') + check++; + } + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.getChar(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getChar(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getChar(value3, 1); + } catch (NullPointerException e) { + check++; + } + if (check == 18) + return true; + else + return false; + } + +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0369-rc-ArrayOptimization-RC_Array_04/RC_Array_04.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0369-rc-ArrayOptimization-RC_Array_04/RC_Array_04.java index 9daca6bb535f5c9ec8ec8e6b9daeb19a5cfd5a37..0450adffbdbd6046273f7b81d0a2e97f435843c2 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0369-rc-ArrayOptimization-RC_Array_04/RC_Array_04.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0369-rc-ArrayOptimization-RC_Array_04/RC_Array_04.java @@ -1,427 +1,427 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_04.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D boolean array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_04.java - *- @ExecuteClass: RC_Array_04 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; - -class Base_004 { - //Parent interface - volatile boolean[] base1; - boolean[][] base2; - boolean[][] base21; - boolean[][][] base3; -} - -public class RC_Array_04 extends Base_004 { - static int check_count = 0; - static boolean[] arr1 = {true, false, false, true}; - static boolean[][] arr2 = {{true, false, false, true}, {false, false}, {true, true}}; - static boolean[][] arr21 = {{false, true, false, true}, {true, false}, {false, true}}; - static boolean[][][] arr3 = {arr2, arr21}; - - private RC_Array_04() { - base1 = new boolean[]{true, true, true, true}; - base2 = new boolean[][]{{true, true, true, true}, {false, false}, {true, true}}; - base21 = new boolean[][]{{false, true, true, true}, {false, true}, {true, true}}; - base3 = new boolean[][][]{{{true, true, true, true}, {false, false}, {true, true}}, {{false, true, true, true}, {false, true}, {true, true}}}; - } - - private RC_Array_04(boolean[] booleanar) { - base1 = booleanar; - } - - private RC_Array_04(boolean[][] booleanarr) { - base2 = booleanarr; - } - - private RC_Array_04(boolean[][][] booleanarrr) { - base3 = booleanarrr; - } - - private RC_Array_04(boolean[] booleanar, boolean[][] booleanarr, boolean[][][] booleanarrr) { - base1 = booleanar; - base2 = booleanarr; - base3 = booleanarrr; - } - - public static void main(String[] args) { - final boolean[] TEST1 = {true, true, true, true}; - final boolean[][] TEST2 = {TEST1, {false, false}, {true, true}}; - final boolean[][] TEST21 = {{false, true, true, true}, {false, true}, {true, true}}; - final boolean[][][] TEST3 = {TEST2, TEST21}; - - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult boolean step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_04_test01 function return value to the parameter third and judged. - //RC_Array_04_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_04() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_04_test02(); - - //Get an array object by returning a function call - boolean[] getarr1 = RC_Array_get01(); - boolean[][] getarr2 = RC_Array_get02(); - boolean[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 24) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, boolean[] second, boolean[][] third, boolean[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - boolean[] xyz = {false, true, false, true}; - boolean[][] xyz2 = {{true, true, true, true}, {false, false}, {true}}; - boolean[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, boolean[] second, boolean[][] third, boolean[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - boolean[] xyz = {false, true, false, true}; - boolean[][] xyz2 = {{true, true, true, true}, {false, false}, {true}}; - boolean[][][] xyz3 = {xyz2, xyz2}; - second = (boolean[]) change(second, xyz); - third = (boolean[][]) change(third, xyz2); - four = (boolean[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(boolean[][] third) { - //The test03 interface is called, and the RC_Array_04_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_04_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static boolean[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static boolean[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static boolean[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static boolean[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - boolean[] value1 = {false, false, false, false}; - RC_Array_04 rctest = new RC_Array_04(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new boolean[]{true, true, true, true}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static boolean[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - boolean[][] value2 = {{true, true, true, true}, {false, false}, {true}}; - RC_Array_04 rctest = new RC_Array_04(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new boolean[][]{{false, false, false, false}, {false, false}, {true}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static boolean[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - boolean[][][] value3 = {{{true, true, true, true}, {false, false}, {true}}, {{false, false, false, false}, {false, false}, {true}}}; - RC_Array_04 rctest = new RC_Array_04(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new boolean[][][]{{{false, false, false, false}, {false, false}, {true}}, {{true, true, true, true}, {false, false}, {true}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static boolean[][] RC_Array_04_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_04, and assign a value to the newly created - // object field, and judge the result - boolean[] value1 = {true, true, true, true}; - boolean[][] value2 = {{true, true, true, true}, {false, false}, {true}}; - boolean[][][] value3 = {value2, value2}; - RC_Array_04 rctest = new RC_Array_04(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new boolean[]{false, false, false, false}; - rctest.base2 = new boolean[][]{{false, false, false, false}, {false, false}, {true}}; - rctest.base21 = new boolean[][]{{false, true, true, false}, {false, false}, {true}}; - rctest.base3 = new boolean[][][]{{{false, false, false, false}, {false, false}, {true}}, {{false, true, true, false}, {false, false}, {true}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_04_test01"); - return rctest.base21; - } - - private static boolean[] RC_Array_final01() { - final boolean[] VALUE1 = {true, true, true, true}; - return VALUE1; - } - - private static boolean[][] RC_Array_final02() { - final boolean[][] VALUE2 = {{false, false, false, false}, {false, false}, {true}}; - return VALUE2; - } - - private static boolean[][][] RC_Array_final03() { - final boolean[][][] VALUE3 = {{{false, true, true, false}, {false, false}, {true}}, {{false, false, false, false}, {false, false}, {true}}}; - return VALUE3; - } - - private static boolean[][] RC_Array_04_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_04 () no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final boolean[] VALUE1 = RC_Array_final01(); - final boolean[][] VALUE2 = RC_Array_final02(); - final boolean[][][] VALUE3 = RC_Array_final03(); - RC_Array_04 rctest = new RC_Array_04(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_04_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_04_test02_2"); - return VALUE2; - } - - private static boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - boolean[] value1 = RC_Array_final01(); - boolean[][] value2 = RC_Array_final02(); - boolean[][][] value3 = RC_Array_final03(); - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - //ArrayIndexOutOfBoundsException - try { - Array.getBoolean(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = false; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.setBoolean(value1, 5, true); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getBoolean(RC_Array_final01(), 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getBoolean(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getBoolean(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getBoolean(RC_Array_final02()[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getBoolean(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getBoolean(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getBoolean(RC_Array_final03()[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - //IllegalArgumentException - try { - Array.getBoolean(value2, 1); - } catch (IllegalArgumentException e) { - check++; - } - try { - Array.getBoolean(value3, 1); - } catch (IllegalArgumentException e) { - check++; - } - //ClassCastException - RC_Array_04 rc1 = new RC_Array_04(); - try { - Base_004 bs1 = new Base_004(); - rc1 = (RC_Array_04) bs1; - rc1.base1[0] = false; - } catch (ClassCastException e) { - if (rc1.base1[0] != false) - check++; - } - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.getBoolean(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getBoolean(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getBoolean(value3, 1); - } catch (NullPointerException e) { - check++; - } - //System.out.println(check); - if (check == 18) - return true; - else - return false; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_04.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D boolean array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_04.java + *- @ExecuteClass: RC_Array_04 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; + +class Base_004 { + //Parent interface + volatile boolean[] base1; + boolean[][] base2; + boolean[][] base21; + boolean[][][] base3; +} + +public class RC_Array_04 extends Base_004 { + static int check_count = 0; + static boolean[] arr1 = {true, false, false, true}; + static boolean[][] arr2 = {{true, false, false, true}, {false, false}, {true, true}}; + static boolean[][] arr21 = {{false, true, false, true}, {true, false}, {false, true}}; + static boolean[][][] arr3 = {arr2, arr21}; + + private RC_Array_04() { + base1 = new boolean[]{true, true, true, true}; + base2 = new boolean[][]{{true, true, true, true}, {false, false}, {true, true}}; + base21 = new boolean[][]{{false, true, true, true}, {false, true}, {true, true}}; + base3 = new boolean[][][]{{{true, true, true, true}, {false, false}, {true, true}}, {{false, true, true, true}, {false, true}, {true, true}}}; + } + + private RC_Array_04(boolean[] booleanar) { + base1 = booleanar; + } + + private RC_Array_04(boolean[][] booleanarr) { + base2 = booleanarr; + } + + private RC_Array_04(boolean[][][] booleanarrr) { + base3 = booleanarrr; + } + + private RC_Array_04(boolean[] booleanar, boolean[][] booleanarr, boolean[][][] booleanarrr) { + base1 = booleanar; + base2 = booleanarr; + base3 = booleanarrr; + } + + public static void main(String[] args) { + final boolean[] TEST1 = {true, true, true, true}; + final boolean[][] TEST2 = {TEST1, {false, false}, {true, true}}; + final boolean[][] TEST21 = {{false, true, true, true}, {false, true}, {true, true}}; + final boolean[][][] TEST3 = {TEST2, TEST21}; + + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult boolean step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_04_test01 function return value to the parameter third and judged. + //RC_Array_04_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_04() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_04_test02(); + + //Get an array object by returning a function call + boolean[] getarr1 = RC_Array_get01(); + boolean[][] getarr2 = RC_Array_get02(); + boolean[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 24) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, boolean[] second, boolean[][] third, boolean[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + boolean[] xyz = {false, true, false, true}; + boolean[][] xyz2 = {{true, true, true, true}, {false, false}, {true}}; + boolean[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, boolean[] second, boolean[][] third, boolean[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + boolean[] xyz = {false, true, false, true}; + boolean[][] xyz2 = {{true, true, true, true}, {false, false}, {true}}; + boolean[][][] xyz3 = {xyz2, xyz2}; + second = (boolean[]) change(second, xyz); + third = (boolean[][]) change(third, xyz2); + four = (boolean[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(boolean[][] third) { + //The test03 interface is called, and the RC_Array_04_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_04_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static boolean[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static boolean[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static boolean[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static boolean[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + boolean[] value1 = {false, false, false, false}; + RC_Array_04 rctest = new RC_Array_04(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new boolean[]{true, true, true, true}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static boolean[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + boolean[][] value2 = {{true, true, true, true}, {false, false}, {true}}; + RC_Array_04 rctest = new RC_Array_04(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new boolean[][]{{false, false, false, false}, {false, false}, {true}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static boolean[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + boolean[][][] value3 = {{{true, true, true, true}, {false, false}, {true}}, {{false, false, false, false}, {false, false}, {true}}}; + RC_Array_04 rctest = new RC_Array_04(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new boolean[][][]{{{false, false, false, false}, {false, false}, {true}}, {{true, true, true, true}, {false, false}, {true}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static boolean[][] RC_Array_04_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_04, and assign a value to the newly created + // object field, and judge the result + boolean[] value1 = {true, true, true, true}; + boolean[][] value2 = {{true, true, true, true}, {false, false}, {true}}; + boolean[][][] value3 = {value2, value2}; + RC_Array_04 rctest = new RC_Array_04(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new boolean[]{false, false, false, false}; + rctest.base2 = new boolean[][]{{false, false, false, false}, {false, false}, {true}}; + rctest.base21 = new boolean[][]{{false, true, true, false}, {false, false}, {true}}; + rctest.base3 = new boolean[][][]{{{false, false, false, false}, {false, false}, {true}}, {{false, true, true, false}, {false, false}, {true}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_04_test01"); + return rctest.base21; + } + + private static boolean[] RC_Array_final01() { + final boolean[] VALUE1 = {true, true, true, true}; + return VALUE1; + } + + private static boolean[][] RC_Array_final02() { + final boolean[][] VALUE2 = {{false, false, false, false}, {false, false}, {true}}; + return VALUE2; + } + + private static boolean[][][] RC_Array_final03() { + final boolean[][][] VALUE3 = {{{false, true, true, false}, {false, false}, {true}}, {{false, false, false, false}, {false, false}, {true}}}; + return VALUE3; + } + + private static boolean[][] RC_Array_04_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_04 () no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final boolean[] VALUE1 = RC_Array_final01(); + final boolean[][] VALUE2 = RC_Array_final02(); + final boolean[][][] VALUE3 = RC_Array_final03(); + RC_Array_04 rctest = new RC_Array_04(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_04_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_04_test02_2"); + return VALUE2; + } + + private static boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + boolean[] value1 = RC_Array_final01(); + boolean[][] value2 = RC_Array_final02(); + boolean[][][] value3 = RC_Array_final03(); + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + //ArrayIndexOutOfBoundsException + try { + Array.getBoolean(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = false; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.setBoolean(value1, 5, true); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getBoolean(RC_Array_final01(), 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getBoolean(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getBoolean(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getBoolean(RC_Array_final02()[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getBoolean(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getBoolean(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getBoolean(RC_Array_final03()[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + //IllegalArgumentException + try { + Array.getBoolean(value2, 1); + } catch (IllegalArgumentException e) { + check++; + } + try { + Array.getBoolean(value3, 1); + } catch (IllegalArgumentException e) { + check++; + } + //ClassCastException + RC_Array_04 rc1 = new RC_Array_04(); + try { + Base_004 bs1 = new Base_004(); + rc1 = (RC_Array_04) bs1; + rc1.base1[0] = false; + } catch (ClassCastException e) { + if (rc1.base1[0] != false) + check++; + } + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.getBoolean(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getBoolean(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getBoolean(value3, 1); + } catch (NullPointerException e) { + check++; + } + //System.out.println(check); + if (check == 18) + return true; + else + return false; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0370-rc-ArrayOptimization-RC_Array_05/RC_Array_05.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0370-rc-ArrayOptimization-RC_Array_05/RC_Array_05.java index dfd6d08b143dab723c85d4bdc42729c8c321019a..a295a6500376c0c63d3d0755876973db664c2efd 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0370-rc-ArrayOptimization-RC_Array_05/RC_Array_05.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0370-rc-ArrayOptimization-RC_Array_05/RC_Array_05.java @@ -1,427 +1,427 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_05.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D byte array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_05.java - *- @ExecuteClass: RC_Array_05 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; - -class Base_005 { - //Parent interface - volatile byte[] base1; - byte[][] base2; - byte[][] base21; - byte[][][] base3; -} - -public class RC_Array_05 extends Base_005 { - static int check_count = 0; - static byte[] arr1 = {1, 2, 3, 4}; - static byte[][] arr2 = {{1, 2, 3, 4}, {5, 6}, {7, 8}}; - static byte[][] arr21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; - static byte[][][] arr3 = {arr2, arr21}; - - private RC_Array_05() { - base1 = new byte[]{1, 2, 3, 4}; - base2 = new byte[][]{{1, 2, 3, 4}, {5, 6}, {7, 8}}; - base21 = new byte[][]{{4, 5, 6, 7}, {8, 9}, {10, 11}}; - base3 = new byte[][][]{{{1, 2, 3, 4}, {5, 6}, {7, 8}}, {{4, 5, 6, 7}, {8, 9}, {10, 11}}}; - } - - private RC_Array_05(byte[] bytear) { - base1 = bytear; - } - - private RC_Array_05(byte[][] bytearr) { - base2 = bytearr; - } - - private RC_Array_05(byte[][][] bytearrr) { - base3 = bytearrr; - } - - private RC_Array_05(byte[] bytear, byte[][] bytearr, byte[][][] bytearrr) { - base1 = bytear; - base2 = bytearr; - base3 = bytearrr; - } - - public static void main(String[] args) { - final byte[] TEST1 = {1, 2, 3, 4}; - final byte[][] TEST2 = {TEST1, {5, 6}, {7, 8}}; - final byte[][] TEST21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; - final byte[][][] TEST3 = {TEST2, TEST21}; - - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult byte step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_05_test01 function return value to the parameter third and judged. - //RC_Array_05_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_05() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_05_test02(); - - //Get an array object by returning a function call - byte[] getarr1 = RC_Array_get01(); - byte[][] getarr2 = RC_Array_get02(); - byte[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 24) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, byte[] second, byte[][] third, byte[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - byte[] xyz = {8, 8, 1, 0}; - byte[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - byte[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, byte[] second, byte[][] third, byte[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - byte[] xyz = {8, 8, 1, 0}; - byte[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - byte[][][] xyz3 = {xyz2, xyz2}; - second = (byte[]) change(second, xyz); - third = (byte[][]) change(third, xyz2); - four = (byte[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(byte[][] third) { - //The test03 interface is called, and the RC_Array_05_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_05_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static byte[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static byte[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static byte[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static byte[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - byte[] value1 = {9, 2, 8, 8}; - RC_Array_05 rctest = new RC_Array_05(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new byte[]{1, 2, 3, 4}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static byte[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - byte[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - RC_Array_05 rctest = new RC_Array_05(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new byte[][]{{9, 2, 8, 8}, {1, 1}, {0}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static byte[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - byte[][][] value3 = {{{1, 2, 3, 4}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; - RC_Array_05 rctest = new RC_Array_05(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new byte[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{1, 2, 3, 4}, {1, 1}, {0}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static byte[][] RC_Array_05_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_05, and assign a value to the newly created - // object field, and judge the result - byte[] value1 = {1, 2, 3, 4}; - byte[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - byte[][][] value3 = {value2, value2}; - RC_Array_05 rctest = new RC_Array_05(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new byte[]{9, 2, 8, 8}; - rctest.base2 = new byte[][]{{9, 2, 8, 8}, {1, 1}, {0}}; - rctest.base21 = new byte[][]{{6, 6, 6, 5}, {1, 1}, {0}}; - rctest.base3 = new byte[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{6, 6, 6, 5}, {1, 1}, {0}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_05_test01"); - return rctest.base21; - } - - private static byte[] RC_Array_final01() { - final byte[] VALUE1 = {1, 2, 3, 4}; - return VALUE1; - } - - private static byte[][] RC_Array_final02() { - final byte[][] VALUE2 = {{9, 2, 8, 8}, {1, 1}, {0}}; - return VALUE2; - } - - private static byte[][][] RC_Array_final03() { - final byte[][][] VALUE3 = {{{6, 6, 6, 5}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; - return VALUE3; - } - - private static byte[][] RC_Array_05_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_05 () no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final byte[] VALUE1 = RC_Array_final01(); - final byte[][] VALUE2 = RC_Array_final02(); - final byte[][][] VALUE3 = RC_Array_final03(); - RC_Array_05 rctest = new RC_Array_05(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_05_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_05_test02_2"); - return VALUE2; - } - - private static boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - byte[] value1 = RC_Array_final01(); - byte[][] value2 = RC_Array_final02(); - byte[][][] value3 = RC_Array_final03(); - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - //ArrayIndexOutOfBoundsException - try { - Array.getByte(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = 'h'; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.setByte(value1, 5, (byte) 0x19); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getByte(RC_Array_final01(), 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getByte(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getByte(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getByte(RC_Array_final02()[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getByte(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getByte(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getByte(RC_Array_final03()[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - //IllegalArgumentException - try { - Array.getByte(value2, 1); - } catch (IllegalArgumentException e) { - check++; - } - try { - Array.getByte(value3, 1); - } catch (IllegalArgumentException e) { - check++; - } - //ClassCastException - RC_Array_05 rc1 = new RC_Array_05(); - try { - Base_005 bs1 = new Base_005(); - rc1 = (RC_Array_05) bs1; - rc1.base1[0] = 8; - } catch (ClassCastException e) { - if (rc1.base1[0] != 8) - check++; - } - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.getByte(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getByte(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getByte(value3, 1); - } catch (NullPointerException e) { - check++; - } - //System.out.println(check); - if (check == 18) - return true; - else - return false; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_05.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D byte array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_05.java + *- @ExecuteClass: RC_Array_05 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; + +class Base_005 { + //Parent interface + volatile byte[] base1; + byte[][] base2; + byte[][] base21; + byte[][][] base3; +} + +public class RC_Array_05 extends Base_005 { + static int check_count = 0; + static byte[] arr1 = {1, 2, 3, 4}; + static byte[][] arr2 = {{1, 2, 3, 4}, {5, 6}, {7, 8}}; + static byte[][] arr21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; + static byte[][][] arr3 = {arr2, arr21}; + + private RC_Array_05() { + base1 = new byte[]{1, 2, 3, 4}; + base2 = new byte[][]{{1, 2, 3, 4}, {5, 6}, {7, 8}}; + base21 = new byte[][]{{4, 5, 6, 7}, {8, 9}, {10, 11}}; + base3 = new byte[][][]{{{1, 2, 3, 4}, {5, 6}, {7, 8}}, {{4, 5, 6, 7}, {8, 9}, {10, 11}}}; + } + + private RC_Array_05(byte[] bytear) { + base1 = bytear; + } + + private RC_Array_05(byte[][] bytearr) { + base2 = bytearr; + } + + private RC_Array_05(byte[][][] bytearrr) { + base3 = bytearrr; + } + + private RC_Array_05(byte[] bytear, byte[][] bytearr, byte[][][] bytearrr) { + base1 = bytear; + base2 = bytearr; + base3 = bytearrr; + } + + public static void main(String[] args) { + final byte[] TEST1 = {1, 2, 3, 4}; + final byte[][] TEST2 = {TEST1, {5, 6}, {7, 8}}; + final byte[][] TEST21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; + final byte[][][] TEST3 = {TEST2, TEST21}; + + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult byte step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_05_test01 function return value to the parameter third and judged. + //RC_Array_05_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_05() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_05_test02(); + + //Get an array object by returning a function call + byte[] getarr1 = RC_Array_get01(); + byte[][] getarr2 = RC_Array_get02(); + byte[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 24) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, byte[] second, byte[][] third, byte[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + byte[] xyz = {8, 8, 1, 0}; + byte[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + byte[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, byte[] second, byte[][] third, byte[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + byte[] xyz = {8, 8, 1, 0}; + byte[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + byte[][][] xyz3 = {xyz2, xyz2}; + second = (byte[]) change(second, xyz); + third = (byte[][]) change(third, xyz2); + four = (byte[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(byte[][] third) { + //The test03 interface is called, and the RC_Array_05_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_05_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static byte[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static byte[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static byte[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static byte[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + byte[] value1 = {9, 2, 8, 8}; + RC_Array_05 rctest = new RC_Array_05(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new byte[]{1, 2, 3, 4}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static byte[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + byte[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + RC_Array_05 rctest = new RC_Array_05(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new byte[][]{{9, 2, 8, 8}, {1, 1}, {0}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static byte[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + byte[][][] value3 = {{{1, 2, 3, 4}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; + RC_Array_05 rctest = new RC_Array_05(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new byte[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{1, 2, 3, 4}, {1, 1}, {0}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static byte[][] RC_Array_05_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_05, and assign a value to the newly created + // object field, and judge the result + byte[] value1 = {1, 2, 3, 4}; + byte[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + byte[][][] value3 = {value2, value2}; + RC_Array_05 rctest = new RC_Array_05(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new byte[]{9, 2, 8, 8}; + rctest.base2 = new byte[][]{{9, 2, 8, 8}, {1, 1}, {0}}; + rctest.base21 = new byte[][]{{6, 6, 6, 5}, {1, 1}, {0}}; + rctest.base3 = new byte[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{6, 6, 6, 5}, {1, 1}, {0}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_05_test01"); + return rctest.base21; + } + + private static byte[] RC_Array_final01() { + final byte[] VALUE1 = {1, 2, 3, 4}; + return VALUE1; + } + + private static byte[][] RC_Array_final02() { + final byte[][] VALUE2 = {{9, 2, 8, 8}, {1, 1}, {0}}; + return VALUE2; + } + + private static byte[][][] RC_Array_final03() { + final byte[][][] VALUE3 = {{{6, 6, 6, 5}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; + return VALUE3; + } + + private static byte[][] RC_Array_05_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_05 () no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final byte[] VALUE1 = RC_Array_final01(); + final byte[][] VALUE2 = RC_Array_final02(); + final byte[][][] VALUE3 = RC_Array_final03(); + RC_Array_05 rctest = new RC_Array_05(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_05_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_05_test02_2"); + return VALUE2; + } + + private static boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + byte[] value1 = RC_Array_final01(); + byte[][] value2 = RC_Array_final02(); + byte[][][] value3 = RC_Array_final03(); + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + //ArrayIndexOutOfBoundsException + try { + Array.getByte(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = 'h'; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.setByte(value1, 5, (byte) 0x19); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getByte(RC_Array_final01(), 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getByte(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getByte(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getByte(RC_Array_final02()[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getByte(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getByte(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getByte(RC_Array_final03()[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + //IllegalArgumentException + try { + Array.getByte(value2, 1); + } catch (IllegalArgumentException e) { + check++; + } + try { + Array.getByte(value3, 1); + } catch (IllegalArgumentException e) { + check++; + } + //ClassCastException + RC_Array_05 rc1 = new RC_Array_05(); + try { + Base_005 bs1 = new Base_005(); + rc1 = (RC_Array_05) bs1; + rc1.base1[0] = 8; + } catch (ClassCastException e) { + if (rc1.base1[0] != 8) + check++; + } + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.getByte(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getByte(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getByte(value3, 1); + } catch (NullPointerException e) { + check++; + } + //System.out.println(check); + if (check == 18) + return true; + else + return false; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0371-rc-ArrayOptimization-RC_Array_06/RC_Array_06.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0371-rc-ArrayOptimization-RC_Array_06/RC_Array_06.java index b10906866361ce8a809496fbfb03524fb2012e7e..b1d009626767147db51ecf161a6d1dea1deb1e0b 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0371-rc-ArrayOptimization-RC_Array_06/RC_Array_06.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0371-rc-ArrayOptimization-RC_Array_06/RC_Array_06.java @@ -1,427 +1,427 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_06.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D short array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_06.java - *- @ExecuteClass: RC_Array_06 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; - -class Base_006 { - //Parent interface - volatile short[] base1; - short[][] base2; - short[][] base21; - short[][][] base3; -} - -public class RC_Array_06 extends Base_006 { - static int check_count = 0; - static short[] arr1 = {1, 2, 3, 4}; - static short[][] arr2 = {{1, 2, 3, 4}, {5, 6}, {7, 8}}; - static short[][] arr21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; - static short[][][] arr3 = {arr2, arr21}; - - private RC_Array_06() { - base1 = new short[]{1, 2, 3, 4}; - base2 = new short[][]{{1, 2, 3, 4}, {5, 6}, {7, 8}}; - base21 = new short[][]{{4, 5, 6, 7}, {8, 9}, {10, 11}}; - base3 = new short[][][]{{{1, 2, 3, 4}, {5, 6}, {7, 8}}, {{4, 5, 6, 7}, {8, 9}, {10, 11}}}; - } - - private RC_Array_06(short[] shortar) { - base1 = shortar; - } - - private RC_Array_06(short[][] shortarr) { - base2 = shortarr; - } - - private RC_Array_06(short[][][] shortarrr) { - base3 = shortarrr; - } - - private RC_Array_06(short[] shortar, short[][] shortarr, short[][][] shortarrr) { - base1 = shortar; - base2 = shortarr; - base3 = shortarrr; - } - - public static void main(String[] args) { - final short[] TEST1 = {1, 2, 3, 4}; - final short[][] TEST2 = {TEST1, {5, 6}, {7, 8}}; - final short[][] TEST21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; - final short[][][] TEST3 = {TEST2, TEST21}; - - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult short step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_06_test01 function return value to the parameter third and judged. - //RC_Array_06_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_06() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_06_test02(); - - //Get an array object by returning a function call - short[] getarr1 = RC_Array_get01(); - short[][] getarr2 = RC_Array_get02(); - short[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 24) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, short[] second, short[][] third, short[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - short[] xyz = {8, 8, 1, 0}; - short[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - short[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, short[] second, short[][] third, short[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - short[] xyz = {8, 8, 1, 0}; - short[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - short[][][] xyz3 = {xyz2, xyz2}; - second = (short[]) change(second, xyz); - third = (short[][]) change(third, xyz2); - four = (short[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(short[][] third) { - //The test03 interface is called, and the RC_Array_06_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_06_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static short[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static short[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static short[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static short[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - short[] value1 = {9, 2, 8, 8}; - RC_Array_06 rctest = new RC_Array_06(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new short[]{1, 2, 3, 4}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static short[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - short[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - RC_Array_06 rctest = new RC_Array_06(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new short[][]{{9, 2, 8, 8}, {1, 1}, {0}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static short[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - short[][][] value3 = {{{1, 2, 3, 4}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; - RC_Array_06 rctest = new RC_Array_06(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new short[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{1, 2, 3, 4}, {1, 1}, {0}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static short[][] RC_Array_06_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_06, and assign a value to the newly created - // object field, and judge the result - short[] value1 = {1, 2, 3, 4}; - short[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - short[][][] value3 = {value2, value2}; - RC_Array_06 rctest = new RC_Array_06(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new short[]{9, 2, 8, 8}; - rctest.base2 = new short[][]{{9, 2, 8, 8}, {1, 1}, {0}}; - rctest.base21 = new short[][]{{6, 6, 6, 5}, {1, 1}, {0}}; - rctest.base3 = new short[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{6, 6, 6, 5}, {1, 1}, {0}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_06_test01"); - return rctest.base21; - } - - private static short[] RC_Array_final01() { - final short[] VALUE1 = {1, 2, 3, 4}; - return VALUE1; - } - - private static short[][] RC_Array_final02() { - final short[][] VALUE2 = {{9, 2, 8, 8}, {1, 1}, {0}}; - return VALUE2; - } - - private static short[][][] RC_Array_final03() { - final short[][][] VALUE3 = {{{6, 6, 6, 5}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; - return VALUE3; - } - - private static short[][] RC_Array_06_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_06() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final short[] VALUE1 = RC_Array_final01(); - final short[][] VALUE2 = RC_Array_final02(); - final short[][][] VALUE3 = RC_Array_final03(); - RC_Array_06 rctest = new RC_Array_06(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_06_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_06_test02_2"); - return VALUE2; - } - - private static boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - short[] value1 = RC_Array_final01(); - short[][] value2 = RC_Array_final02(); - short[][][] value3 = RC_Array_final03(); - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - //ArrayIndexOutOfBoundsException - try { - Array.getShort(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = 88; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.setShort(value1, 5, (short) 12); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getShort(RC_Array_final01(), 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getShort(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getShort(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getShort(RC_Array_final02()[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getShort(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getShort(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getShort(RC_Array_final03()[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - //IllegalArgumentException - try { - Array.getShort(value2, 1); - } catch (IllegalArgumentException e) { - check++; - } - try { - Array.getShort(value3, 1); - } catch (IllegalArgumentException e) { - check++; - } - //ClassCastException - RC_Array_06 rc1 = new RC_Array_06(); - try { - Base_006 bs1 = new Base_006(); - rc1 = (RC_Array_06) bs1; - rc1.base1[0] = 8; - } catch (ClassCastException e) { - if (rc1.base1[0] != 8) - check++; - } - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.getShort(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getShort(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getShort(value3, 1); - } catch (NullPointerException e) { - check++; - } - //System.out.println(check); - if (check == 18) - return true; - else - return false; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_06.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D short array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_06.java + *- @ExecuteClass: RC_Array_06 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; + +class Base_006 { + //Parent interface + volatile short[] base1; + short[][] base2; + short[][] base21; + short[][][] base3; +} + +public class RC_Array_06 extends Base_006 { + static int check_count = 0; + static short[] arr1 = {1, 2, 3, 4}; + static short[][] arr2 = {{1, 2, 3, 4}, {5, 6}, {7, 8}}; + static short[][] arr21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; + static short[][][] arr3 = {arr2, arr21}; + + private RC_Array_06() { + base1 = new short[]{1, 2, 3, 4}; + base2 = new short[][]{{1, 2, 3, 4}, {5, 6}, {7, 8}}; + base21 = new short[][]{{4, 5, 6, 7}, {8, 9}, {10, 11}}; + base3 = new short[][][]{{{1, 2, 3, 4}, {5, 6}, {7, 8}}, {{4, 5, 6, 7}, {8, 9}, {10, 11}}}; + } + + private RC_Array_06(short[] shortar) { + base1 = shortar; + } + + private RC_Array_06(short[][] shortarr) { + base2 = shortarr; + } + + private RC_Array_06(short[][][] shortarrr) { + base3 = shortarrr; + } + + private RC_Array_06(short[] shortar, short[][] shortarr, short[][][] shortarrr) { + base1 = shortar; + base2 = shortarr; + base3 = shortarrr; + } + + public static void main(String[] args) { + final short[] TEST1 = {1, 2, 3, 4}; + final short[][] TEST2 = {TEST1, {5, 6}, {7, 8}}; + final short[][] TEST21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; + final short[][][] TEST3 = {TEST2, TEST21}; + + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult short step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_06_test01 function return value to the parameter third and judged. + //RC_Array_06_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_06() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_06_test02(); + + //Get an array object by returning a function call + short[] getarr1 = RC_Array_get01(); + short[][] getarr2 = RC_Array_get02(); + short[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 24) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, short[] second, short[][] third, short[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + short[] xyz = {8, 8, 1, 0}; + short[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + short[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, short[] second, short[][] third, short[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + short[] xyz = {8, 8, 1, 0}; + short[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + short[][][] xyz3 = {xyz2, xyz2}; + second = (short[]) change(second, xyz); + third = (short[][]) change(third, xyz2); + four = (short[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(short[][] third) { + //The test03 interface is called, and the RC_Array_06_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_06_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static short[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static short[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static short[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static short[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + short[] value1 = {9, 2, 8, 8}; + RC_Array_06 rctest = new RC_Array_06(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new short[]{1, 2, 3, 4}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static short[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + short[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + RC_Array_06 rctest = new RC_Array_06(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new short[][]{{9, 2, 8, 8}, {1, 1}, {0}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static short[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + short[][][] value3 = {{{1, 2, 3, 4}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; + RC_Array_06 rctest = new RC_Array_06(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new short[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{1, 2, 3, 4}, {1, 1}, {0}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static short[][] RC_Array_06_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_06, and assign a value to the newly created + // object field, and judge the result + short[] value1 = {1, 2, 3, 4}; + short[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + short[][][] value3 = {value2, value2}; + RC_Array_06 rctest = new RC_Array_06(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new short[]{9, 2, 8, 8}; + rctest.base2 = new short[][]{{9, 2, 8, 8}, {1, 1}, {0}}; + rctest.base21 = new short[][]{{6, 6, 6, 5}, {1, 1}, {0}}; + rctest.base3 = new short[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{6, 6, 6, 5}, {1, 1}, {0}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_06_test01"); + return rctest.base21; + } + + private static short[] RC_Array_final01() { + final short[] VALUE1 = {1, 2, 3, 4}; + return VALUE1; + } + + private static short[][] RC_Array_final02() { + final short[][] VALUE2 = {{9, 2, 8, 8}, {1, 1}, {0}}; + return VALUE2; + } + + private static short[][][] RC_Array_final03() { + final short[][][] VALUE3 = {{{6, 6, 6, 5}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; + return VALUE3; + } + + private static short[][] RC_Array_06_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_06() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final short[] VALUE1 = RC_Array_final01(); + final short[][] VALUE2 = RC_Array_final02(); + final short[][][] VALUE3 = RC_Array_final03(); + RC_Array_06 rctest = new RC_Array_06(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_06_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_06_test02_2"); + return VALUE2; + } + + private static boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + short[] value1 = RC_Array_final01(); + short[][] value2 = RC_Array_final02(); + short[][][] value3 = RC_Array_final03(); + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + //ArrayIndexOutOfBoundsException + try { + Array.getShort(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = 88; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.setShort(value1, 5, (short) 12); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getShort(RC_Array_final01(), 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getShort(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getShort(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getShort(RC_Array_final02()[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getShort(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getShort(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getShort(RC_Array_final03()[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + //IllegalArgumentException + try { + Array.getShort(value2, 1); + } catch (IllegalArgumentException e) { + check++; + } + try { + Array.getShort(value3, 1); + } catch (IllegalArgumentException e) { + check++; + } + //ClassCastException + RC_Array_06 rc1 = new RC_Array_06(); + try { + Base_006 bs1 = new Base_006(); + rc1 = (RC_Array_06) bs1; + rc1.base1[0] = 8; + } catch (ClassCastException e) { + if (rc1.base1[0] != 8) + check++; + } + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.getShort(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getShort(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getShort(value3, 1); + } catch (NullPointerException e) { + check++; + } + //System.out.println(check); + if (check == 18) + return true; + else + return false; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0372-rc-ArrayOptimization-RC_Array_07/RC_Array_07.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0372-rc-ArrayOptimization-RC_Array_07/RC_Array_07.java index 5faeea7e56337647e3e27627e787ad825784f9ef..e029b913f57a80850325eb7ea4e6f747b15447af 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0372-rc-ArrayOptimization-RC_Array_07/RC_Array_07.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0372-rc-ArrayOptimization-RC_Array_07/RC_Array_07.java @@ -1,430 +1,430 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_07.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D long array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_07.java - *- @ExecuteClass: RC_Array_07 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; - -class Base_007 { - //Parent interface - volatile long[] base1; - long[][] base2; - long[][] base21; - long[][][] base3; -} - -public class RC_Array_07 extends Base_007 { - static int check_count = 0; - static long[] arr1 = {1, 2, 3, 4}; - static long[][] arr2 = {{1, 2, 3, 4}, {5, 6}, {7, 8}}; - static long[][] arr21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; - static long[][][] arr3 = {arr2, arr21}; - - private RC_Array_07() { - base1 = new long[]{1, 2, 3, 4}; - base2 = new long[][]{{1, 2, 3, 4}, {5, 6}, {7, 8}}; - base21 = new long[][]{{4, 5, 6, 7}, {8, 9}, {10, 11}}; - base3 = new long[][][]{{{1, 2, 3, 4}, {5, 6}, {7, 8}}, {{4, 5, 6, 7}, {8, 9}, {10, 11}}}; - } - - private RC_Array_07(long[] longar) { - base1 = longar; - } - - private RC_Array_07(long[][] longarr) { - base2 = longarr; - } - - private RC_Array_07(long[][][] longarrr) { - base3 = longarrr; - } - - private RC_Array_07(long[] longar, long[][] longarr, long[][][] longarrr) { - base1 = longar; - base2 = longarr; - base3 = longarrr; - } - - public static void main(String[] args) { - final long[] TEST1 = {1, 2, 3, 4}; - final long[][] TEST2 = {TEST1, {5, 6}, {7, 8}}; - final long[][] TEST21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; - final long[][][] TEST3 = {TEST2, TEST21}; - - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult long step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_07_test01 function return value to the parameter third and judged. - //RC_Array_07_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_07() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_07_test02(); - - //Get an array object by returning a function call - long[] getarr1 = RC_Array_get01(); - long[][] getarr2 = RC_Array_get02(); - long[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 24) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, long[] second, long[][] third, long[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - long[] xyz = {8, 8, 1, 0}; - long[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - long[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, long[] second, long[][] third, long[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - long[] xyz = {8, 8, 1, 0}; - long[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - long[][][] xyz3 = {xyz2, xyz2}; - second = (long[]) change(second, xyz); - third = (long[][]) change(third, xyz2); - four = (long[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(long[][] third) { - //The test03 interface is called, and the RC_Array_07_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_07_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static long[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static long[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static long[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static long[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - long[] value1 = {9, 2, 8, 8}; - RC_Array_07 rctest = new RC_Array_07(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new long[]{1, 2, 3, 4}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static long[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - long[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - RC_Array_07 rctest = new RC_Array_07(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new long[][]{{9, 2, 8, 8}, {1, 1}, {0}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static long[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - long[][][] value3 = {{{1, 2, 3, 4}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; - RC_Array_07 rctest = new RC_Array_07(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new long[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{1, 2, 3, 4}, {1, 1}, {0}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static long[][] RC_Array_07_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_07, and assign a value to the newly created - // object field, and judge the result - long[] value1 = {1, 2, 3, 4}; - long[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; - long[][][] value3 = {value2, value2}; - RC_Array_07 rctest = new RC_Array_07(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new long[]{9, 2, 8, 8}; - rctest.base2 = new long[][]{{9, 2, 8, 8}, {1, 1}, {0}}; - rctest.base21 = new long[][]{{6, 6, 6, 5}, {1, 1}, {0}}; - rctest.base3 = new long[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{6, 6, 6, 5}, {1, 1}, {0}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_07_test01"); - return rctest.base21; - } - - private static long[] RC_Array_final01() { - final long[] VALUE1 = {1, 2, 3, 4}; - return VALUE1; - } - - private static long[][] RC_Array_final02() { - final long[][] VALUE2 = {{9, 2, 8, 8}, {1, 1}, {0}}; - return VALUE2; - } - - private static long[][][] RC_Array_final03() { - final long[][][] VALUE3 = {{{6, 6, 6, 5}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; - return VALUE3; - } - - private static long[][] RC_Array_07_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_07() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final long[] VALUE1 = RC_Array_final01(); - final long[][] VALUE2 = RC_Array_final02(); - final long[][][] VALUE3 = RC_Array_final03(); - RC_Array_07 rctest = new RC_Array_07(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_07_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_07_test02_2"); - return VALUE2; - } - - private static boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - long[] value1 = RC_Array_final01(); - long[][] value2 = RC_Array_final02(); - long[][][] value3 = RC_Array_final03(); - - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - - //ArrayIndexOutOfBoundsException - try { - Array.getLong(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = 92; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.setLong(value1, 5, (long) 12); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getLong(RC_Array_final01(), 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getLong(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getLong(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getLong(RC_Array_final02()[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getLong(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getLong(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getLong(RC_Array_final03()[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - //IllegalArgumentException - try { - Array.getLong(value2, 1); - } catch (IllegalArgumentException e) { - check++; - } - try { - Array.getLong(value3, 1); - } catch (IllegalArgumentException e) { - check++; - } - //ClassCastException - RC_Array_07 rc1 = new RC_Array_07(); - try { - Base_007 bs1 = new Base_007(); - rc1 = (RC_Array_07) bs1; - rc1.base1[0] = 8; - } catch (ClassCastException e) { - if (rc1.base1[0] != 8) - check++; - } - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.getLong(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getLong(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getLong(value3, 1); - } catch (NullPointerException e) { - check++; - } - //System.out.println(check); - if (check == 18) - return true; - else - return false; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_07.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D long array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_07.java + *- @ExecuteClass: RC_Array_07 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; + +class Base_007 { + //Parent interface + volatile long[] base1; + long[][] base2; + long[][] base21; + long[][][] base3; +} + +public class RC_Array_07 extends Base_007 { + static int check_count = 0; + static long[] arr1 = {1, 2, 3, 4}; + static long[][] arr2 = {{1, 2, 3, 4}, {5, 6}, {7, 8}}; + static long[][] arr21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; + static long[][][] arr3 = {arr2, arr21}; + + private RC_Array_07() { + base1 = new long[]{1, 2, 3, 4}; + base2 = new long[][]{{1, 2, 3, 4}, {5, 6}, {7, 8}}; + base21 = new long[][]{{4, 5, 6, 7}, {8, 9}, {10, 11}}; + base3 = new long[][][]{{{1, 2, 3, 4}, {5, 6}, {7, 8}}, {{4, 5, 6, 7}, {8, 9}, {10, 11}}}; + } + + private RC_Array_07(long[] longar) { + base1 = longar; + } + + private RC_Array_07(long[][] longarr) { + base2 = longarr; + } + + private RC_Array_07(long[][][] longarrr) { + base3 = longarrr; + } + + private RC_Array_07(long[] longar, long[][] longarr, long[][][] longarrr) { + base1 = longar; + base2 = longarr; + base3 = longarrr; + } + + public static void main(String[] args) { + final long[] TEST1 = {1, 2, 3, 4}; + final long[][] TEST2 = {TEST1, {5, 6}, {7, 8}}; + final long[][] TEST21 = {{4, 5, 6, 7}, {8, 9}, {10, 11}}; + final long[][][] TEST3 = {TEST2, TEST21}; + + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult long step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_07_test01 function return value to the parameter third and judged. + //RC_Array_07_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_07() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_07_test02(); + + //Get an array object by returning a function call + long[] getarr1 = RC_Array_get01(); + long[][] getarr2 = RC_Array_get02(); + long[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 24) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, long[] second, long[][] third, long[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + long[] xyz = {8, 8, 1, 0}; + long[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + long[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, long[] second, long[][] third, long[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + long[] xyz = {8, 8, 1, 0}; + long[][] xyz2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + long[][][] xyz3 = {xyz2, xyz2}; + second = (long[]) change(second, xyz); + third = (long[][]) change(third, xyz2); + four = (long[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(long[][] third) { + //The test03 interface is called, and the RC_Array_07_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_07_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static long[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static long[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static long[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static long[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + long[] value1 = {9, 2, 8, 8}; + RC_Array_07 rctest = new RC_Array_07(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new long[]{1, 2, 3, 4}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static long[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + long[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + RC_Array_07 rctest = new RC_Array_07(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new long[][]{{9, 2, 8, 8}, {1, 1}, {0}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static long[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + long[][][] value3 = {{{1, 2, 3, 4}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; + RC_Array_07 rctest = new RC_Array_07(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new long[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{1, 2, 3, 4}, {1, 1}, {0}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static long[][] RC_Array_07_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_07, and assign a value to the newly created + // object field, and judge the result + long[] value1 = {1, 2, 3, 4}; + long[][] value2 = {{1, 2, 3, 4}, {1, 1}, {0}}; + long[][][] value3 = {value2, value2}; + RC_Array_07 rctest = new RC_Array_07(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new long[]{9, 2, 8, 8}; + rctest.base2 = new long[][]{{9, 2, 8, 8}, {1, 1}, {0}}; + rctest.base21 = new long[][]{{6, 6, 6, 5}, {1, 1}, {0}}; + rctest.base3 = new long[][][]{{{9, 2, 8, 8}, {1, 1}, {0}}, {{6, 6, 6, 5}, {1, 1}, {0}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_07_test01"); + return rctest.base21; + } + + private static long[] RC_Array_final01() { + final long[] VALUE1 = {1, 2, 3, 4}; + return VALUE1; + } + + private static long[][] RC_Array_final02() { + final long[][] VALUE2 = {{9, 2, 8, 8}, {1, 1}, {0}}; + return VALUE2; + } + + private static long[][][] RC_Array_final03() { + final long[][][] VALUE3 = {{{6, 6, 6, 5}, {1, 1}, {0}}, {{9, 2, 8, 8}, {1, 1}, {0}}}; + return VALUE3; + } + + private static long[][] RC_Array_07_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_07() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final long[] VALUE1 = RC_Array_final01(); + final long[][] VALUE2 = RC_Array_final02(); + final long[][][] VALUE3 = RC_Array_final03(); + RC_Array_07 rctest = new RC_Array_07(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_07_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_07_test02_2"); + return VALUE2; + } + + private static boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + long[] value1 = RC_Array_final01(); + long[][] value2 = RC_Array_final02(); + long[][][] value3 = RC_Array_final03(); + + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + + //ArrayIndexOutOfBoundsException + try { + Array.getLong(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = 92; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.setLong(value1, 5, (long) 12); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getLong(RC_Array_final01(), 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getLong(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getLong(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getLong(RC_Array_final02()[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getLong(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getLong(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getLong(RC_Array_final03()[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + //IllegalArgumentException + try { + Array.getLong(value2, 1); + } catch (IllegalArgumentException e) { + check++; + } + try { + Array.getLong(value3, 1); + } catch (IllegalArgumentException e) { + check++; + } + //ClassCastException + RC_Array_07 rc1 = new RC_Array_07(); + try { + Base_007 bs1 = new Base_007(); + rc1 = (RC_Array_07) bs1; + rc1.base1[0] = 8; + } catch (ClassCastException e) { + if (rc1.base1[0] != 8) + check++; + } + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.getLong(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getLong(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getLong(value3, 1); + } catch (NullPointerException e) { + check++; + } + //System.out.println(check); + if (check == 18) + return true; + else + return false; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0373-rc-ArrayOptimization-RC_Array_08/RC_Array_08.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0373-rc-ArrayOptimization-RC_Array_08/RC_Array_08.java index b6036494f8cfa8ad2b577ac91871f9e8ffe69a87..43b6afaabebe4ffd299abfab4b036965ba3e8bc6 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0373-rc-ArrayOptimization-RC_Array_08/RC_Array_08.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0373-rc-ArrayOptimization-RC_Array_08/RC_Array_08.java @@ -1,430 +1,430 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_08.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D float array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_08.java - *- @ExecuteClass: RC_Array_08 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; - -class Base_008 { - //Parent interface - volatile float[] base1; - float[][] base2; - float[][] base21; - float[][][] base3; -} - -public class RC_Array_08 extends Base_008 { - static int check_count = 0; - static float[] arr1 = {1.1f, 2.2f, 3.3f, 4.4f}; - static float[][] arr2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; - static float[][] arr21 = {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; - static float[][][] arr3 = {arr2, arr21}; - - private RC_Array_08() { - base1 = new float[]{1.1f, 2.2f, 3.3f, 4.4f}; - base2 = new float[][]{{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; - base21 = new float[][]{{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; - base3 = new float[][][]{{{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}, {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}}; - } - - private RC_Array_08(float[] floatar) { - base1 = floatar; - } - - private RC_Array_08(float[][] floatarr) { - base2 = floatarr; - } - - private RC_Array_08(float[][][] floatarrr) { - base3 = floatarrr; - } - - private RC_Array_08(float[] floatar, float[][] floatarr, float[][][] floatarrr) { - base1 = floatar; - base2 = floatarr; - base3 = floatarrr; - } - - public static void main(String[] args) { - final float[] TEST1 = {1.1f, 2.2f, 3.3f, 4.4f}; - final float[][] TEST2 = {TEST1, {5.5f, 6.6f}, {7.7f, 8.8f}}; - final float[][] TEST21 = {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; - final float[][][] TEST3 = {TEST2, TEST21}; - - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult float step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_08_test01 function return value to the parameter third and judged. - //RC_Array_08_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_08() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_08_test02(); - - //Get an array object by returning a function call - float[] getarr1 = RC_Array_get01(); - float[][] getarr2 = RC_Array_get02(); - float[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 24) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, float[] second, float[][] third, float[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - float[] xyz = {8.5f, 8.3f, 1.2f, 0.5f}; - float[][] xyz2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; - float[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, float[] second, float[][] third, float[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - float[] xyz = {8.5f, 8.3f, 1.2f, 0.5f}; - float[][] xyz2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; - float[][][] xyz3 = {xyz2, xyz2}; - second = (float[]) change(second, xyz); - third = (float[][]) change(third, xyz2); - four = (float[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(float[][] third) { - //The test03 interface is called, and the RC_Array_08_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_08_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static float[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static float[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static float[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static float[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - float[] value1 = {9.2f, 2.2f, 8.8f, 8.8f}; - RC_Array_08 rctest = new RC_Array_08(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new float[]{1.1f, 2.2f, 3.3f, 4.4f}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static float[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - float[][] value2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; - RC_Array_08 rctest = new RC_Array_08(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new float[][]{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static float[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - float[][][] value3 = {{{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}, {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}}; - RC_Array_08 rctest = new RC_Array_08(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new float[][][]{{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}, {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static float[][] RC_Array_08_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_08, and assign a value to the newly created - // object field, and judge the result - float[] value1 = {1.1f, 2.2f, 3.3f, 4.4f}; - float[][] value2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; - float[][][] value3 = {value2, value2}; - RC_Array_08 rctest = new RC_Array_08(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new float[]{9.2f, 2.2f, 8.8f, 8.8f}; - rctest.base2 = new float[][]{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; - rctest.base21 = new float[][]{{6, 6, 6, 5}, {1.3f, 1.1f}, {0.5f}}; - rctest.base3 = new float[][][]{{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}, {{6, 6, 6, 5}, {1.3f, 1.1f}, {0.5f}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_08_test01"); - return rctest.base21; - } - - private static float[] RC_Array_final01() { - final float[] VALUE1 = {1.1f, 2.2f, 3.3f, 4.4f}; - return VALUE1; - } - - private static float[][] RC_Array_final02() { - final float[][] VALUE2 = {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; - return VALUE2; - } - - private static float[][][] RC_Array_final03() { - final float[][][] VALUE3 = {{{6.4f, 6.1f, 6.3f, 5.5f}, {1.3f, 1.1f}, {0.5f}}, {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}}; - return VALUE3; - } - - private static float[][] RC_Array_08_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_08() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final float[] VALUE1 = RC_Array_final01(); - final float[][] VALUE2 = RC_Array_final02(); - final float[][][] VALUE3 = RC_Array_final03(); - RC_Array_08 rctest = new RC_Array_08(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_08_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_08_test02_2"); - return VALUE2; - } - - private static boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - float[] value1 = RC_Array_final01(); - float[][] value2 = RC_Array_final02(); - float[][][] value3 = RC_Array_final03(); - - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - - //ArrayIndexOutOfBoundsException - try { - Array.getFloat(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = 88.10f; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.setFloat(value1, 5, 12.5f); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getFloat(RC_Array_final01(), 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getFloat(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getFloat(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getFloat(RC_Array_final02()[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getFloat(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getFloat(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getFloat(RC_Array_final03()[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - //IllegalArgumentException - try { - Array.getFloat(value2, 1); - } catch (IllegalArgumentException e) { - check++; - } - try { - Array.getFloat(value3, 1); - } catch (IllegalArgumentException e) { - check++; - } - //ClassCastException - RC_Array_08 rc1 = new RC_Array_08(); - try { - Base_008 bs1 = new Base_008(); - rc1 = (RC_Array_08) bs1; - rc1.base1[0] = 8.9f; - } catch (ClassCastException e) { - if (rc1.base1[0] != 8.9f) - check++; - } - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.getFloat(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getFloat(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getFloat(value3, 1); - } catch (NullPointerException e) { - check++; - } - //System.out.println(check); - if (check == 18) - return true; - else - return false; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_08.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D float array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_08.java + *- @ExecuteClass: RC_Array_08 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; + +class Base_008 { + //Parent interface + volatile float[] base1; + float[][] base2; + float[][] base21; + float[][][] base3; +} + +public class RC_Array_08 extends Base_008 { + static int check_count = 0; + static float[] arr1 = {1.1f, 2.2f, 3.3f, 4.4f}; + static float[][] arr2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; + static float[][] arr21 = {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; + static float[][][] arr3 = {arr2, arr21}; + + private RC_Array_08() { + base1 = new float[]{1.1f, 2.2f, 3.3f, 4.4f}; + base2 = new float[][]{{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; + base21 = new float[][]{{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; + base3 = new float[][][]{{{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}, {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}}; + } + + private RC_Array_08(float[] floatar) { + base1 = floatar; + } + + private RC_Array_08(float[][] floatarr) { + base2 = floatarr; + } + + private RC_Array_08(float[][][] floatarrr) { + base3 = floatarrr; + } + + private RC_Array_08(float[] floatar, float[][] floatarr, float[][][] floatarrr) { + base1 = floatar; + base2 = floatarr; + base3 = floatarrr; + } + + public static void main(String[] args) { + final float[] TEST1 = {1.1f, 2.2f, 3.3f, 4.4f}; + final float[][] TEST2 = {TEST1, {5.5f, 6.6f}, {7.7f, 8.8f}}; + final float[][] TEST21 = {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; + final float[][][] TEST3 = {TEST2, TEST21}; + + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult float step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_08_test01 function return value to the parameter third and judged. + //RC_Array_08_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_08() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_08_test02(); + + //Get an array object by returning a function call + float[] getarr1 = RC_Array_get01(); + float[][] getarr2 = RC_Array_get02(); + float[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 24) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, float[] second, float[][] third, float[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + float[] xyz = {8.5f, 8.3f, 1.2f, 0.5f}; + float[][] xyz2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; + float[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, float[] second, float[][] third, float[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + float[] xyz = {8.5f, 8.3f, 1.2f, 0.5f}; + float[][] xyz2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; + float[][][] xyz3 = {xyz2, xyz2}; + second = (float[]) change(second, xyz); + third = (float[][]) change(third, xyz2); + four = (float[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(float[][] third) { + //The test03 interface is called, and the RC_Array_08_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_08_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static float[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static float[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static float[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static float[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + float[] value1 = {9.2f, 2.2f, 8.8f, 8.8f}; + RC_Array_08 rctest = new RC_Array_08(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new float[]{1.1f, 2.2f, 3.3f, 4.4f}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static float[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + float[][] value2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; + RC_Array_08 rctest = new RC_Array_08(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new float[][]{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static float[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + float[][][] value3 = {{{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}, {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}}; + RC_Array_08 rctest = new RC_Array_08(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new float[][][]{{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}, {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static float[][] RC_Array_08_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_08, and assign a value to the newly created + // object field, and judge the result + float[] value1 = {1.1f, 2.2f, 3.3f, 4.4f}; + float[][] value2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; + float[][][] value3 = {value2, value2}; + RC_Array_08 rctest = new RC_Array_08(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new float[]{9.2f, 2.2f, 8.8f, 8.8f}; + rctest.base2 = new float[][]{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; + rctest.base21 = new float[][]{{6, 6, 6, 5}, {1.3f, 1.1f}, {0.5f}}; + rctest.base3 = new float[][][]{{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}, {{6, 6, 6, 5}, {1.3f, 1.1f}, {0.5f}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_08_test01"); + return rctest.base21; + } + + private static float[] RC_Array_final01() { + final float[] VALUE1 = {1.1f, 2.2f, 3.3f, 4.4f}; + return VALUE1; + } + + private static float[][] RC_Array_final02() { + final float[][] VALUE2 = {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; + return VALUE2; + } + + private static float[][][] RC_Array_final03() { + final float[][][] VALUE3 = {{{6.4f, 6.1f, 6.3f, 5.5f}, {1.3f, 1.1f}, {0.5f}}, {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}}; + return VALUE3; + } + + private static float[][] RC_Array_08_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_08() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final float[] VALUE1 = RC_Array_final01(); + final float[][] VALUE2 = RC_Array_final02(); + final float[][][] VALUE3 = RC_Array_final03(); + RC_Array_08 rctest = new RC_Array_08(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_08_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_08_test02_2"); + return VALUE2; + } + + private static boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + float[] value1 = RC_Array_final01(); + float[][] value2 = RC_Array_final02(); + float[][][] value3 = RC_Array_final03(); + + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + + //ArrayIndexOutOfBoundsException + try { + Array.getFloat(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = 88.10f; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.setFloat(value1, 5, 12.5f); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getFloat(RC_Array_final01(), 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getFloat(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getFloat(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getFloat(RC_Array_final02()[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getFloat(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getFloat(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getFloat(RC_Array_final03()[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + //IllegalArgumentException + try { + Array.getFloat(value2, 1); + } catch (IllegalArgumentException e) { + check++; + } + try { + Array.getFloat(value3, 1); + } catch (IllegalArgumentException e) { + check++; + } + //ClassCastException + RC_Array_08 rc1 = new RC_Array_08(); + try { + Base_008 bs1 = new Base_008(); + rc1 = (RC_Array_08) bs1; + rc1.base1[0] = 8.9f; + } catch (ClassCastException e) { + if (rc1.base1[0] != 8.9f) + check++; + } + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.getFloat(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getFloat(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getFloat(value3, 1); + } catch (NullPointerException e) { + check++; + } + //System.out.println(check); + if (check == 18) + return true; + else + return false; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0374-rc-ArrayOptimization-RC_Array_09/RC_Array_09.java b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0374-rc-ArrayOptimization-RC_Array_09/RC_Array_09.java index 1504238da565a05e5a501a175b9abaa4d0001a83..df788dbefdda4db952d0e816a62acd101e7371a9 100644 --- a/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0374-rc-ArrayOptimization-RC_Array_09/RC_Array_09.java +++ b/test/testsuite/ouroboros/memory_management/ArrayOptimization/RC0374-rc-ArrayOptimization-RC_Array_09/RC_Array_09.java @@ -1,416 +1,416 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_09.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D double array objects,including: - * 1.Parameter modification / parameter has not been modified - * 2.final、static - * 3.As a constructor fun - * 4.Function call - * 5.Object Passing - * 6.return constant; variable; function call - * 7.Inherited as a parent class; child class inherits the parent class; interface call; - * 8.Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Array_09.java - *- @ExecuteClass: RC_Array_09 - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; -import java.util.Arrays; - -class Base_009 { - //Parent interface - volatile double[] base1; - double[][] base2; - double[][] base21; - double[][][] base3; -} - -public class RC_Array_09 extends Base_009 { - static int check_count = 0; - static double[] arr1 = {1.1f, 2.2f, 3.3f, 4.4f}; - static double[][] arr2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; - static double[][] arr21 = {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; - static double[][][] arr3 = {arr2, arr21}; - - private RC_Array_09() { - base1 = new double[]{1.1f, 2.2f, 3.3f, 4.4f}; - base2 = new double[][]{{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; - base21 = new double[][]{{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; - base3 = new double[][][]{{{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}, {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}}; - } - - private RC_Array_09(double[] doublear) { - base1 = doublear; - } - - private RC_Array_09(double[][] doublearr) { - base2 = doublearr; - } - - private RC_Array_09(double[][][] doublearrr) { - base3 = doublearrr; - } - - private RC_Array_09(double[] doublear, double[][] doublearr, double[][][] doublearrr) { - base1 = doublear; - base2 = doublearr; - base3 = doublearrr; - } - - public static void main(String[] args) { - final double[] TEST1 = {1.1f, 2.2f, 3.3f, 4.4f}; - final double[][] TEST2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; - final double[][] TEST21 = {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; - final double[][][] TEST3 = {TEST2, TEST21}; - - //Initialization check - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult double step1"); - - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - test01(4, TEST1, TEST2, TEST3); - test01(4, arr1, arr2, arr3); - - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step2"); - - //test02 interface call, call function change to modify the parameter value and judge - test02(4, TEST1, TEST2, TEST3); - test02(4, arr1, arr2, arr3); - if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 - && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step3"); - - //The test03 interface call, call the RC_Array_09_test01 function return value to the parameter third and judged. - //RC_Array_09_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to - //the newly created object field, and judge the result - test03(TEST2); - test03(arr2); - if (TEST2.length == 3 && arr2.length == 3) - check_count++; - else - System.out.println("ErrorResult in step4"); - - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_09() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value - RC_Array_09_test02(); - - //Get an array object by returning a function call - double[] getarr1 = RC_Array_get01(); - double[][] getarr2 = RC_Array_get02(); - double[][][] getarr3 = RC_Array_get03(); - if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) - check_count++; - else - System.out.println("ErrorResult in step5"); - - //Exception testing - boolean ret = RC_Array_Exception(); - if (ret == true) - check_count++; - else - System.out.println("RC_Array_Exception ErrorResult"); - - //Result judgment - //System.out.println(check_count); - if (check_count == 24) - System.out.println("ExpectResult"); - - } - - private static void test01(int first, double[] second, double[][] third, double[][][] four) { - //test01 interface call, internal initialization array, do not modify the parameter value, only judge - double[] xyz = {8.5f, 8.3f, 1.2f, 0.5f}; - double[][] xyz2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; - double[][][] xyz3 = {xyz2, xyz2}; - if (second.length == 4 && third.length == 3 && four.length == 2 - && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static Object change(Object temp1, Object temp2) { - temp1 = temp2; - return temp1; - } - - private static void test02(int first, double[] second, double[][] third, double[][][] four) { - //test02 interface call, call function change to modify the parameter value and judge - double[] xyz = {8.5f, 8.3f, 1.2f, 0.5f}; - double[][] xyz2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; - double[][][] xyz3 = {xyz2, xyz2}; - second = (double[]) change(second, xyz); - third = (double[][]) change(third, xyz2); - four = (double[][][]) change(four, xyz3); - if (second.length == 4 && third.length == 3 && four.length == 2) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private static void test03(double[][] third) { - //The test03 interface is called, and the RC_Array_09_test01 function call is assigned as the return value to - // the parameter third and judged. - third = RC_Array_09_test01(); - if (third.length == 3) - check_count++; - else - System.out.println("ErrorResult in test03"); - } - - private static double[] RC_Array_get01() { - //Call the 1D array returned by RC_Array_set01 - return RC_Array_set01(); - } - - private static double[][] RC_Array_get02() { - //Call the 2D array returned by RC_Array_set02 - return RC_Array_set02(); - } - - private static double[][][] RC_Array_get03() { - //Call the 3D array returned by RC_Array_set03 - return RC_Array_set03(); - } - - private static double[] RC_Array_set01() { - //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the - // field of the newly created object, and judge the result - double[] value1 = {9.2f, 2.2f, 8.8f, 8.8f}; - RC_Array_09 rctest = new RC_Array_09(value1); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new double[]{1.1f, 2.2f, 3.3f, 4.4f}; - if (rctest.base1.length == 4) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set01"); - return rctest.base1; - } - - private static double[][] RC_Array_set02() { - //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a - // value to the domain of the newly created object, and judge the result - double[][] value2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; - RC_Array_09 rctest = new RC_Array_09(value2); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base2 = new double[][]{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; - if (rctest.base2.length == 3) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set02"); - return rctest.base2; - } - - private static double[][][] RC_Array_set03() { - //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the - // field of the newly created object, and judge the result - double[][][] value3 = {{{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}, {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}}; - RC_Array_09 rctest = new RC_Array_09(value3); - if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base3 = new double[][][]{{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}, {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}}; - if (rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_set03"); - return rctest.base3; - } - - private static double[][] RC_Array_09_test01() { - //return 2D array,Call the multi-parameter constructor of RC_Array_09, and assign a value to the newly created - // object field, and judge the result - double[] value1 = {1.1f, 2.2f, 3.3f, 4.4f}; - double[][] value2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; - double[][][] value3 = {value2, value2}; - RC_Array_09 rctest = new RC_Array_09(value1, value2, value3); - if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) - && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) - check_count++; - rctest.base1 = new double[]{9.2f, 2.2f, 8.8f, 8.8f}; - rctest.base2 = new double[][]{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; - rctest.base21 = new double[][]{{6, 6, 6, 5}, {1.3f, 1.1f}, {0.5f}}; - rctest.base3 = new double[][][]{{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}, {{6, 6, 6, 5}, {1.3f, 1.1f}, {0.5f}}}; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_09_test01"); - return rctest.base21; - } - - private static double[] RC_Array_final01() { - final double[] VALUE1 = {1.1f, 2.2f, 3.3f, 4.4f}; - return VALUE1; - } - - private static double[][] RC_Array_final02() { - final double[][] VALUE2 = {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; - return VALUE2; - } - - private static double[][][] RC_Array_final03() { - final double[][][] VALUE3 = {{{6.4f, 6.1f, 6.3f, 5.5f}, {1.3f, 1.1f}, {0.5f}}, {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}}; - return VALUE3; - } - - private static double[][] RC_Array_09_test02() { - //The calling function returns a constant value as the assignment of the constant of this function. - //Call RC_Array_09() no argument construction method, initialize the variable of the parent class, and assign - // a value to the domain of the newly created object, and judge the result - final double[] VALUE1 = RC_Array_final01(); - final double[][] VALUE2 = RC_Array_final02(); - final double[][][] VALUE3 = RC_Array_final03(); - RC_Array_09 rctest = new RC_Array_09(); - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_09_test02"); - rctest.base1 = VALUE1; - rctest.base2 = VALUE2; - rctest.base21 = VALUE2; - rctest.base3 = VALUE3; - if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) - check_count++; - else - System.out.println("ErrorResult in RC_Array_09_test02_2"); - return VALUE2; - } - - private static boolean RC_Array_Exception() { - //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on - int check = 0; - double[] value1 = RC_Array_final01(); - double[][] value2 = RC_Array_final02(); - double[][][] value3 = RC_Array_final03(); - - //Is the value as expect after the assignment? - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——1"); - - //ArrayIndexOutOfBoundsException - try { - Array.getDouble(value1, 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - value1[5] = 10.16f; - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.setDouble(value1, 5, 12.5f); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getDouble(value2[5], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getDouble(value2[0], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getDouble(value3[0][3], 0); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - try { - Array.getDouble(value3[0][1], 5); - } catch (ArrayIndexOutOfBoundsException e) { - check++; - } - //IllegalArgumentException - try { - Array.getDouble(value2, 1); - } catch (IllegalArgumentException e) { - check++; - } - try { - Array.getDouble(value3, 1); - } catch (IllegalArgumentException e) { - check++; - } - //ClassCastException - RC_Array_09 rc1 = new RC_Array_09(); - try { - Base_009 bs1 = new Base_009(); - rc1 = (RC_Array_09) bs1; - rc1.base1[0] = 8.9f; - } catch (ClassCastException e) { - if (rc1.base1[0] != 8.9f) - check++; - } - //Whether the judgment value is normal after Exception - if (value1.length == 4 && value2.length == 3 && value3.length == 2) - check++; - else - System.out.println("ErrorResult in RC_Array_Exception——2"); - - //NullPointerException - value1 = null; - value2 = null; - value3 = null; - try { - Array.getDouble(value1, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getDouble(value2, 1); - } catch (NullPointerException e) { - check++; - } - try { - Array.getDouble(value3, 1); - } catch (NullPointerException e) { - check++; - } - - //System.out.println(check); - if (check == 15) - return true; - else - return false; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/optimization/RC_Array_09.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Scenario testing for RC optimization: testing various scenes of 1D, 2D, 3D double array objects,including: + * 1.Parameter modification / parameter has not been modified + * 2.final、static + * 3.As a constructor fun + * 4.Function call + * 5.Object Passing + * 6.return constant; variable; function call + * 7.Inherited as a parent class; child class inherits the parent class; interface call; + * 8.Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Array_09.java + *- @ExecuteClass: RC_Array_09 + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; +import java.util.Arrays; + +class Base_009 { + //Parent interface + volatile double[] base1; + double[][] base2; + double[][] base21; + double[][][] base3; +} + +public class RC_Array_09 extends Base_009 { + static int check_count = 0; + static double[] arr1 = {1.1f, 2.2f, 3.3f, 4.4f}; + static double[][] arr2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; + static double[][] arr21 = {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; + static double[][][] arr3 = {arr2, arr21}; + + private RC_Array_09() { + base1 = new double[]{1.1f, 2.2f, 3.3f, 4.4f}; + base2 = new double[][]{{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; + base21 = new double[][]{{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; + base3 = new double[][][]{{{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}, {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}}; + } + + private RC_Array_09(double[] doublear) { + base1 = doublear; + } + + private RC_Array_09(double[][] doublearr) { + base2 = doublearr; + } + + private RC_Array_09(double[][][] doublearrr) { + base3 = doublearrr; + } + + private RC_Array_09(double[] doublear, double[][] doublearr, double[][][] doublearrr) { + base1 = doublear; + base2 = doublearr; + base3 = doublearrr; + } + + public static void main(String[] args) { + final double[] TEST1 = {1.1f, 2.2f, 3.3f, 4.4f}; + final double[][] TEST2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f}}; + final double[][] TEST21 = {{4.1f, 5.1f, 6.1f, 7.1f}, {8.1f, 9.1f}, {10.3f, 11.10f}}; + final double[][][] TEST3 = {TEST2, TEST21}; + + //Initialization check + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult double step1"); + + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + test01(4, TEST1, TEST2, TEST3); + test01(4, arr1, arr2, arr3); + + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step2"); + + //test02 interface call, call function change to modify the parameter value and judge + test02(4, TEST1, TEST2, TEST3); + test02(4, arr1, arr2, arr3); + if (TEST1.length == 4 && TEST2.length == 3 && TEST3.length == 2 + && arr1.length == 4 && arr2.length == 3 && arr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step3"); + + //The test03 interface call, call the RC_Array_09_test01 function return value to the parameter third and judged. + //RC_Array_09_test01,return 2D array,Call the multi-parameter constructor of RC_Array_01, and assign a value to + //the newly created object field, and judge the result + test03(TEST2); + test03(arr2); + if (TEST2.length == 3 && arr2.length == 3) + check_count++; + else + System.out.println("ErrorResult in step4"); + + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_09() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + //Test points: inheritance, constructor, return function call, constant, variable, do not receive return value + RC_Array_09_test02(); + + //Get an array object by returning a function call + double[] getarr1 = RC_Array_get01(); + double[][] getarr2 = RC_Array_get02(); + double[][][] getarr3 = RC_Array_get03(); + if (getarr1.length == 4 && getarr2.length == 3 && getarr3.length == 2) + check_count++; + else + System.out.println("ErrorResult in step5"); + + //Exception testing + boolean ret = RC_Array_Exception(); + if (ret == true) + check_count++; + else + System.out.println("RC_Array_Exception ErrorResult"); + + //Result judgment + //System.out.println(check_count); + if (check_count == 24) + System.out.println("ExpectResult"); + + } + + private static void test01(int first, double[] second, double[][] third, double[][][] four) { + //test01 interface call, internal initialization array, do not modify the parameter value, only judge + double[] xyz = {8.5f, 8.3f, 1.2f, 0.5f}; + double[][] xyz2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; + double[][][] xyz3 = {xyz2, xyz2}; + if (second.length == 4 && third.length == 3 && four.length == 2 + && xyz.length == 4 && xyz2.length == 3 && xyz3.length == 2) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static Object change(Object temp1, Object temp2) { + temp1 = temp2; + return temp1; + } + + private static void test02(int first, double[] second, double[][] third, double[][][] four) { + //test02 interface call, call function change to modify the parameter value and judge + double[] xyz = {8.5f, 8.3f, 1.2f, 0.5f}; + double[][] xyz2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; + double[][][] xyz3 = {xyz2, xyz2}; + second = (double[]) change(second, xyz); + third = (double[][]) change(third, xyz2); + four = (double[][][]) change(four, xyz3); + if (second.length == 4 && third.length == 3 && four.length == 2) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private static void test03(double[][] third) { + //The test03 interface is called, and the RC_Array_09_test01 function call is assigned as the return value to + // the parameter third and judged. + third = RC_Array_09_test01(); + if (third.length == 3) + check_count++; + else + System.out.println("ErrorResult in test03"); + } + + private static double[] RC_Array_get01() { + //Call the 1D array returned by RC_Array_set01 + return RC_Array_set01(); + } + + private static double[][] RC_Array_get02() { + //Call the 2D array returned by RC_Array_set02 + return RC_Array_set02(); + } + + private static double[][][] RC_Array_get03() { + //Call the 3D array returned by RC_Array_set03 + return RC_Array_set03(); + } + + private static double[] RC_Array_set01() { + //return 1D array,Call the constructor of the 1D array parameter of RC_Array_set01, and assign a value to the + // field of the newly created object, and judge the result + double[] value1 = {9.2f, 2.2f, 8.8f, 8.8f}; + RC_Array_09 rctest = new RC_Array_09(value1); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new double[]{1.1f, 2.2f, 3.3f, 4.4f}; + if (rctest.base1.length == 4) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set01"); + return rctest.base1; + } + + private static double[][] RC_Array_set02() { + //return 2D array,Call the constructor of the 2D array parameter of RC_Array_set02, and assign a + // value to the domain of the newly created object, and judge the result + double[][] value2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; + RC_Array_09 rctest = new RC_Array_09(value2); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, null) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base2 = new double[][]{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; + if (rctest.base2.length == 3) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set02"); + return rctest.base2; + } + + private static double[][][] RC_Array_set03() { + //return 3D array,Call the constructor of the 3D array parameter of RC_Array_set03, and assign a value to the + // field of the newly created object, and judge the result + double[][][] value3 = {{{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}, {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}}; + RC_Array_09 rctest = new RC_Array_09(value3); + if (Arrays.equals(rctest.base1, null) && Arrays.equals(rctest.base2, null) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base3 = new double[][][]{{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}, {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}}; + if (rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_set03"); + return rctest.base3; + } + + private static double[][] RC_Array_09_test01() { + //return 2D array,Call the multi-parameter constructor of RC_Array_09, and assign a value to the newly created + // object field, and judge the result + double[] value1 = {1.1f, 2.2f, 3.3f, 4.4f}; + double[][] value2 = {{1.1f, 2.2f, 3.3f, 4.4f}, {1.3f, 1.1f}, {0.5f}}; + double[][][] value3 = {value2, value2}; + RC_Array_09 rctest = new RC_Array_09(value1, value2, value3); + if (Arrays.equals(rctest.base1, value1) && Arrays.equals(rctest.base2, value2) + && Arrays.equals(rctest.base3, value3) && Arrays.equals(rctest.base21, null)) + check_count++; + rctest.base1 = new double[]{9.2f, 2.2f, 8.8f, 8.8f}; + rctest.base2 = new double[][]{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; + rctest.base21 = new double[][]{{6, 6, 6, 5}, {1.3f, 1.1f}, {0.5f}}; + rctest.base3 = new double[][][]{{{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}, {{6, 6, 6, 5}, {1.3f, 1.1f}, {0.5f}}}; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_09_test01"); + return rctest.base21; + } + + private static double[] RC_Array_final01() { + final double[] VALUE1 = {1.1f, 2.2f, 3.3f, 4.4f}; + return VALUE1; + } + + private static double[][] RC_Array_final02() { + final double[][] VALUE2 = {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}; + return VALUE2; + } + + private static double[][][] RC_Array_final03() { + final double[][][] VALUE3 = {{{6.4f, 6.1f, 6.3f, 5.5f}, {1.3f, 1.1f}, {0.5f}}, {{9.2f, 2.2f, 8.8f, 8.8f}, {1.3f, 1.1f}, {0.5f}}}; + return VALUE3; + } + + private static double[][] RC_Array_09_test02() { + //The calling function returns a constant value as the assignment of the constant of this function. + //Call RC_Array_09() no argument construction method, initialize the variable of the parent class, and assign + // a value to the domain of the newly created object, and judge the result + final double[] VALUE1 = RC_Array_final01(); + final double[][] VALUE2 = RC_Array_final02(); + final double[][][] VALUE3 = RC_Array_final03(); + RC_Array_09 rctest = new RC_Array_09(); + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_09_test02"); + rctest.base1 = VALUE1; + rctest.base2 = VALUE2; + rctest.base21 = VALUE2; + rctest.base3 = VALUE3; + if (rctest.base1.length == 4 && rctest.base2.length == 3 && rctest.base21.length == 3 && rctest.base3.length == 2) + check_count++; + else + System.out.println("ErrorResult in RC_Array_09_test02_2"); + return VALUE2; + } + + private static boolean RC_Array_Exception() { + //Exception test,exclude NullPointerException,ArrayIndexOutOfBoundsException and so on + int check = 0; + double[] value1 = RC_Array_final01(); + double[][] value2 = RC_Array_final02(); + double[][][] value3 = RC_Array_final03(); + + //Is the value as expect after the assignment? + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——1"); + + //ArrayIndexOutOfBoundsException + try { + Array.getDouble(value1, 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + value1[5] = 10.16f; + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.setDouble(value1, 5, 12.5f); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getDouble(value2[5], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getDouble(value2[0], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getDouble(value3[0][3], 0); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + try { + Array.getDouble(value3[0][1], 5); + } catch (ArrayIndexOutOfBoundsException e) { + check++; + } + //IllegalArgumentException + try { + Array.getDouble(value2, 1); + } catch (IllegalArgumentException e) { + check++; + } + try { + Array.getDouble(value3, 1); + } catch (IllegalArgumentException e) { + check++; + } + //ClassCastException + RC_Array_09 rc1 = new RC_Array_09(); + try { + Base_009 bs1 = new Base_009(); + rc1 = (RC_Array_09) bs1; + rc1.base1[0] = 8.9f; + } catch (ClassCastException e) { + if (rc1.base1[0] != 8.9f) + check++; + } + //Whether the judgment value is normal after Exception + if (value1.length == 4 && value2.length == 3 && value3.length == 2) + check++; + else + System.out.println("ErrorResult in RC_Array_Exception——2"); + + //NullPointerException + value1 = null; + value2 = null; + value3 = null; + try { + Array.getDouble(value1, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getDouble(value2, 1); + } catch (NullPointerException e) { + check++; + } + try { + Array.getDouble(value3, 1); + } catch (NullPointerException e) { + check++; + } + + //System.out.println(check); + if (check == 15) + return true; + else + return false; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/DTS/RC0406-rc-DTS-stringIntern/stringIntern.java b/test/testsuite/ouroboros/memory_management/DTS/RC0406-rc-DTS-stringIntern/stringIntern.java index 7cdca6316e9c48e0d635a2f2cf1fbc8dbab4c85b..416651c4771335393b69cd3f7df308dab7653e4d 100644 --- a/test/testsuite/ouroboros/memory_management/DTS/RC0406-rc-DTS-stringIntern/stringIntern.java +++ b/test/testsuite/ouroboros/memory_management/DTS/RC0406-rc-DTS-stringIntern/stringIntern.java @@ -1,111 +1,111 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:String_intern.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:test Intern() API of String - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: stringIntern.java - *- @ExecuteClass: stringIntern - *- @ExecuteArgs: - - * - */ -public class stringIntern { - private static int check = 0; - - public static void main(String[] args) { - String s1 = new String("aaa"); - String s2 = "aaa"; - if (s1 != s2) { - check++; //=1 - } - - s1 = new String("bbb").intern(); - s2 = "bbb"; - if (s1 == s2) { - check++; //=2 - } - - s1 = "ccc"; - s2 = "ccc"; - if (s1 == s2) { - check++; //=3 - } - - s1 = new String("ddd").intern(); - s2 = new String("ddd").intern(); - if (s1 == s2) { - check++; //=4 - } - - s1 = "ab" + "cd"; - s2 = "abcd"; - if (s1 == s2) { - check++; //=5 - } - - String temp = "hh"; - s1 = "a" + temp; - s2 = "ahh"; - if (s1 != s2) { - check++; //=6 - } - - temp = "hh".intern(); - s1 = "a" + temp; - s2 = "ahh"; - if (s1 != s2) { - check++; //=7 - } - - temp = "hh".intern(); - s1 = ("a" + temp).intern(); - s2 = "ahh"; - if (s1 == s2) { - check++; //=8 - } - - s1 = new String("1"); - s1.intern(); - s2 = "1"; - if (s1 != s2) { - check++; //=9 - } - - String s3 = new String("1") + new String("1"); - s3.intern(); - String s4 = "11"; - if (s1 != s2) { - check++; //=10 - } - - s3 = new String("2") + new String("2"); - s4 = "22"; - s3.intern(); - if (s1 != s2) { - check++; //=11 - } - if (check == 11) { - System.out.println("ExpectResult"); - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:String_intern.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:test Intern() API of String + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: stringIntern.java + *- @ExecuteClass: stringIntern + *- @ExecuteArgs: + + * + */ +public class stringIntern { + private static int check = 0; + + public static void main(String[] args) { + String s1 = new String("aaa"); + String s2 = "aaa"; + if (s1 != s2) { + check++; //=1 + } + + s1 = new String("bbb").intern(); + s2 = "bbb"; + if (s1 == s2) { + check++; //=2 + } + + s1 = "ccc"; + s2 = "ccc"; + if (s1 == s2) { + check++; //=3 + } + + s1 = new String("ddd").intern(); + s2 = new String("ddd").intern(); + if (s1 == s2) { + check++; //=4 + } + + s1 = "ab" + "cd"; + s2 = "abcd"; + if (s1 == s2) { + check++; //=5 + } + + String temp = "hh"; + s1 = "a" + temp; + s2 = "ahh"; + if (s1 != s2) { + check++; //=6 + } + + temp = "hh".intern(); + s1 = "a" + temp; + s2 = "ahh"; + if (s1 != s2) { + check++; //=7 + } + + temp = "hh".intern(); + s1 = ("a" + temp).intern(); + s2 = "ahh"; + if (s1 == s2) { + check++; //=8 + } + + s1 = new String("1"); + s1.intern(); + s2 = "1"; + if (s1 != s2) { + check++; //=9 + } + + String s3 = new String("1") + new String("1"); + s3.intern(); + String s4 = "11"; + if (s1 != s2) { + check++; //=10 + } + + s3 = new String("2") + new String("2"); + s4 = "22"; + s3.intern(); + if (s1 != s2) { + check++; //=11 + } + if (check == 11) { + System.out.println("ExpectResult"); + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/DTS/RC0407-rc-DTS-stackAllocField/stackAllocField.java b/test/testsuite/ouroboros/memory_management/DTS/RC0407-rc-DTS-stackAllocField/stackAllocField.java index a09818f09fb0588dc1d29733d4a942ca6ac54b0a..26a0242817321829a8612aa86da075970c6d5997 100644 --- a/test/testsuite/ouroboros/memory_management/DTS/RC0407-rc-DTS-stackAllocField/stackAllocField.java +++ b/test/testsuite/ouroboros/memory_management/DTS/RC0407-rc-DTS-stackAllocField/stackAllocField.java @@ -1,69 +1,69 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:stackAllocField.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:test Intern() API of String - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: stackAllocField.java - *- @ExecuteClass: stackAllocField - *- @ExecuteArgs: - - * - */ -public class stackAllocField { - private static A a1 = new A(); - private static A a2 = new A(); - private static A a3 = new A(); - private static A a4 = new A(); - - public static void main(String[] args) { - wrapper(a1, a2, a3, a4); - } - - public static void wrapper(A tempa1, A tempa2, A tempa3, A tempa4) { - A testa1 = new A(); - testa1.a = tempa1; - A testa2 = new A(); - testa2.a = tempa2; - A testa3 = new A(); - testa3.a = tempa3; - A testa4 = new A(); - testa4.a = tempa4; - tempa1 = null; - tempa2 = null; - tempa3 = null; - tempa4 = null; - a1 = null; - a2 = null; - a3 = null; - a4 = null; - for (int i = 0; i <= 50; i++) { - Runtime.getRuntime().gc(); - } - if (testa1.a != null && testa2.a != null && testa3.a != null && testa4.a != null) { - System.out.println("ExpectResult"); - } - } - - private static class A { - A a; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:stackAllocField.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:test Intern() API of String + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: stackAllocField.java + *- @ExecuteClass: stackAllocField + *- @ExecuteArgs: + + * + */ +public class stackAllocField { + private static A a1 = new A(); + private static A a2 = new A(); + private static A a3 = new A(); + private static A a4 = new A(); + + public static void main(String[] args) { + wrapper(a1, a2, a3, a4); + } + + public static void wrapper(A tempa1, A tempa2, A tempa3, A tempa4) { + A testa1 = new A(); + testa1.a = tempa1; + A testa2 = new A(); + testa2.a = tempa2; + A testa3 = new A(); + testa3.a = tempa3; + A testa4 = new A(); + testa4.a = tempa4; + tempa1 = null; + tempa2 = null; + tempa3 = null; + tempa4 = null; + a1 = null; + a2 = null; + a3 = null; + a4 = null; + for (int i = 0; i <= 50; i++) { + Runtime.getRuntime().gc(); + } + if (testa1.a != null && testa2.a != null && testa3.a != null && testa4.a != null) { + System.out.println("ExpectResult"); + } + } + + private static class A { + A a; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/DTS/RC0408-rc-DTS-OOMtest/OOMtest.java b/test/testsuite/ouroboros/memory_management/DTS/RC0408-rc-DTS-OOMtest/OOMtest.java index a1eef20470ee72687e47014ffc899d35dd1df9c0..73afcb7709fc87df803895a0b8143d84ed61dcc0 100644 --- a/test/testsuite/ouroboros/memory_management/DTS/RC0408-rc-DTS-OOMtest/OOMtest.java +++ b/test/testsuite/ouroboros/memory_management/DTS/RC0408-rc-DTS-OOMtest/OOMtest.java @@ -1,61 +1,61 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:OOMtest.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: OOMtest.java - *- @ExecuteClass: OOMtest - *- @ExecuteArgs: - * - */ - -import java.util.ArrayList; - -public class OOMtest { - private static ArrayList store; - - private static int alloc_test() { - int sum = 0; - store = new ArrayList(); - byte[] temp; - - for (int i = 1024 * 1024 * 10; i <= 1024 * 1024 * 10; ) { - temp = new byte[i]; - store.add(temp); - sum += store.size(); - } - return sum; - } - - public static void main(String[] args) { - try { - int result = alloc_test(); - } catch (OutOfMemoryError o) { - System.out.println("ExpectResult"); - } - if (store == null) { - System.out.println("Error"); - } else { - System.out.println("ExpectResult"); - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:OOMtest.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: OOMtest.java + *- @ExecuteClass: OOMtest + *- @ExecuteArgs: + * + */ + +import java.util.ArrayList; + +public class OOMtest { + private static ArrayList store; + + private static int alloc_test() { + int sum = 0; + store = new ArrayList(); + byte[] temp; + + for (int i = 1024 * 1024 * 10; i <= 1024 * 1024 * 10; ) { + temp = new byte[i]; + store.add(temp); + sum += store.size(); + } + return sum; + } + + public static void main(String[] args) { + try { + int result = alloc_test(); + } catch (OutOfMemoryError o) { + System.out.println("ExpectResult"); + } + if (store == null) { + System.out.println("Error"); + } else { + System.out.println("ExpectResult"); + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/DTS/RC0409-rc-DTS-Ex_eight_arguments/Ex_eight_arguments.java b/test/testsuite/ouroboros/memory_management/DTS/RC0409-rc-DTS-Ex_eight_arguments/Ex_eight_arguments.java index 09815d389d8fa716edd3a8910f3182ae41188f05..e8497f5f2c21605bb33bb9ab00f647478f62c531 100644 --- a/test/testsuite/ouroboros/memory_management/DTS/RC0409-rc-DTS-Ex_eight_arguments/Ex_eight_arguments.java +++ b/test/testsuite/ouroboros/memory_management/DTS/RC0409-rc-DTS-Ex_eight_arguments/Ex_eight_arguments.java @@ -1,275 +1,275 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Ex_eight_arguments_static.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: more than 8 arguments method test, include static ,no static, has return value, no return, throw - * Exception,not throw Exception - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Ex_eight_arguments.java - *- @ExecuteClass: Ex_eight_arguments - *- @ExecuteArgs: - */ - -import java.lang.reflect.Array; - -public class Ex_eight_arguments { - static int check_count = 0; - - public static void main(String[] args) { - int first = 1988; - byte second = 2; - char third = 'g'; - long four = 19881110; - float five = 601.5f; - double six = 60.15f; - String seven = "huawei"; - boolean eight = true; - Object nine = new String("CC is a cat"); - int[] ten = {2012, 2020, 2019, 2040, 3301}; - Ex_eight_arguments Test = new Ex_eight_arguments(); - - //test static method no return no exception - test01(first, second, third, four, five, six, seven, eight, nine, ten); - - //test no static method no return no exception - Test.test02(first, second, third, four, five, six, seven, eight, nine, ten); - - //test no static method return value no exception - first = Test.test03(first, second, third, four, five, six, seven, eight, nine, ten); - - //test no static method no return throws exception - try { - Test.test04(first, second, third, four, five, six, seven, eight, nine, ten); - System.out.println("ErrorResult in test04 not catch Exception"); - } catch (ArrayIndexOutOfBoundsException e) { - check_count++; - } - - //test static method return value no exception - seven = test05(first, second, third, four, five, six, seven, eight, nine, ten); - - //test static method no return value throws exception - try { - test06(first, second, third, four, five, six, seven, eight, nine, ten); - System.out.println("ErrorResult in test06 not catch Exception"); - } catch (IllegalArgumentException e) { - check_count++; - } - - //test no static method return value throws exception - try { - boolean result7 = Test.test07(first, second, third, four, five, six, seven, eight, nine, ten); - System.out.println("ErrorResult in test07 not catch Exception"); - } catch (ArithmeticException e) { - check_count++; - } - - //test static method return value throws exception - try { - int[] result8 = test08(first, second, third, four, five, six, seven, eight, nine, ten); - System.out.println("ErrorResult in test08 not catch Exception"); - } catch (NegativeArraySizeException e) { - check_count++; - } - - //Result judgment - if (check_count == 12) - System.out.println("ExpectResult"); - //System.out.println(check_count); - } - - private static void test01(int first, byte second, char third, long four, float five, double six, String seven, - boolean eight, Object nine, int[] ten) { - /*test static method no return no exception*/ - first++; - second = 56; - third = (char) second; - four = (long) third; - five = (float) four; - six = (double) five; - seven = "fei fei is not a pig"; - eight = false; - nine = (Object) eight; - ten = ten.clone(); - if (first == 1989 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" - && eight == false && nine == (Object) false && ten[4] == 3301) - check_count++; - else - System.out.println("ErrorResult in test01"); - } - - private static String test05(int first, byte second, char third, long four, float five, double six, String seven, - Boolean eight, Object nine, int[] ten) { - /*test static method return value no exception*/ - first++; - second = 56; - third = (char) second; - four = (long) third; - five = (float) four; - six = (double) five; - seven = "fei fei is not a pig"; - eight = false; - nine = (Object) eight; - ten = ten.clone(); - - if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" - && eight == false && nine == (Object) false && ten[4] == 3301) - check_count++; - else - System.out.println("ErrorResult in test05"); - return new String("test05 is End"); - } - - private static void test06(int first, byte second, char third, long four, float five, double six, String seven, - Boolean eight, Object nine, int[] ten) throws IllegalArgumentException { - /*test static method no return value throws exception*/ - first++; - second = 56; - third = (char) second; - four = (long) third; - five = (float) four; - six = (double) five; - seven = "fei fei is not a pig"; - eight = false; - nine = (Object) eight; - ten = ten.clone(); - int[][] test_ten = {ten, ten, ten, ten, ten, ten}; - - if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" - && eight == false && nine == (Object) false && ten[4] == 3301) - check_count++; - else - System.out.println("ErrorResult in test06"); - Array.getInt(test_ten, 5); - } - - private static int[] test08(int first, byte second, char third, long four, float five, double six, String seven, - Boolean eight, Object nine, int[] ten) throws NegativeArraySizeException { - /*test static method return value throws exception*/ - first++; - second = 56; - third = (char) second; - four = (long) third; - five = (float) four; - six = (double) five; - seven = "fei fei is not a pig"; - eight = false; - nine = (Object) eight; - ten = ten.clone(); - int[][] test_ten = {ten, ten, ten, ten, ten, ten}; - - if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" - && eight == false && nine == (Object) false && ten[4] == 3301) - check_count++; - else - System.out.println("ErrorResult in test08"); - int[] chck = new int[-1]; - return chck; - } - - private void test02(int first, byte second, char third, long four, float five, double six, String seven, - Boolean eight, Object nine, int[] ten) { - /*test no static method no return no exception*/ - first++; - second = 56; - third = (char) second; - four = (long) third; - five = (float) four; - six = (double) five; - seven = "fei fei is not a pig"; - eight = false; - nine = (Object) eight; - ten = ten.clone(); - if (first == 1989 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" - && eight == false && nine == (Object) false && ten[4] == 3301) - check_count++; - else - System.out.println("ErrorResult in test02"); - } - - private int test03(int first, byte second, char third, long four, float five, double six, String seven, - Boolean eight, Object nine, int[] ten) { - /*test no static method return value no exception*/ - first++; - second = 56; - third = (char) second; - four = (long) third; - five = (float) four; - six = (double) five; - seven = "fei fei is not a pig"; - eight = false; - nine = (Object) eight; - ten = ten.clone(); - if (first == 1989 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" - && eight == false && nine == (Object) false && ten[4] == 3301) - check_count++; - else - System.out.println("ErrorResult in test03"); - return first; - } - - private void test04(int first, byte second, char third, long four, float five, double six, String seven, - Boolean eight, Object nine, int[] ten) throws ArrayIndexOutOfBoundsException { - /*test no static method no return throws exception*/ - first++; - second = 56; - third = (char) second; - four = (long) third; - five = (float) four; - six = (double) five; - seven = "fei fei is not a pig"; - eight = false; - nine = (Object) eight; - ten = ten.clone(); - - if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" - && eight == false && nine == (Object) false && ten[4] == 3301) - check_count++; - else - System.out.println("ErrorResult in test04"); - ten[5] = 1988; - } - - private boolean test07(int first, byte second, char third, long four, float five, double six, String seven, - Boolean eight, Object nine, int[] ten) throws ArithmeticException { - /*test no static method return value throws exception*/ - first++; - second = 56; - third = (char) second; - four = (long) third; - five = (float) four; - six = (double) five; - seven = "fei fei is not a pig"; - eight = false; - nine = (Object) eight; - ten = ten.clone(); - int[][] test_ten = {ten, ten, ten, ten, ten, ten}; - - if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" - && eight == false && nine == (Object) false && ten[4] == 3301) - check_count++; - else - System.out.println("ErrorResult in test07"); - - first = first / 0; - return true; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Ex_eight_arguments_static.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: more than 8 arguments method test, include static ,no static, has return value, no return, throw + * Exception,not throw Exception + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Ex_eight_arguments.java + *- @ExecuteClass: Ex_eight_arguments + *- @ExecuteArgs: + */ + +import java.lang.reflect.Array; + +public class Ex_eight_arguments { + static int check_count = 0; + + public static void main(String[] args) { + int first = 1988; + byte second = 2; + char third = 'g'; + long four = 19881110; + float five = 601.5f; + double six = 60.15f; + String seven = "huawei"; + boolean eight = true; + Object nine = new String("CC is a cat"); + int[] ten = {2012, 2020, 2019, 2040, 3301}; + Ex_eight_arguments Test = new Ex_eight_arguments(); + + //test static method no return no exception + test01(first, second, third, four, five, six, seven, eight, nine, ten); + + //test no static method no return no exception + Test.test02(first, second, third, four, five, six, seven, eight, nine, ten); + + //test no static method return value no exception + first = Test.test03(first, second, third, four, five, six, seven, eight, nine, ten); + + //test no static method no return throws exception + try { + Test.test04(first, second, third, four, five, six, seven, eight, nine, ten); + System.out.println("ErrorResult in test04 not catch Exception"); + } catch (ArrayIndexOutOfBoundsException e) { + check_count++; + } + + //test static method return value no exception + seven = test05(first, second, third, four, five, six, seven, eight, nine, ten); + + //test static method no return value throws exception + try { + test06(first, second, third, four, five, six, seven, eight, nine, ten); + System.out.println("ErrorResult in test06 not catch Exception"); + } catch (IllegalArgumentException e) { + check_count++; + } + + //test no static method return value throws exception + try { + boolean result7 = Test.test07(first, second, third, four, five, six, seven, eight, nine, ten); + System.out.println("ErrorResult in test07 not catch Exception"); + } catch (ArithmeticException e) { + check_count++; + } + + //test static method return value throws exception + try { + int[] result8 = test08(first, second, third, four, five, six, seven, eight, nine, ten); + System.out.println("ErrorResult in test08 not catch Exception"); + } catch (NegativeArraySizeException e) { + check_count++; + } + + //Result judgment + if (check_count == 12) + System.out.println("ExpectResult"); + //System.out.println(check_count); + } + + private static void test01(int first, byte second, char third, long four, float five, double six, String seven, + boolean eight, Object nine, int[] ten) { + /*test static method no return no exception*/ + first++; + second = 56; + third = (char) second; + four = (long) third; + five = (float) four; + six = (double) five; + seven = "fei fei is not a pig"; + eight = false; + nine = (Object) eight; + ten = ten.clone(); + if (first == 1989 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" + && eight == false && nine == (Object) false && ten[4] == 3301) + check_count++; + else + System.out.println("ErrorResult in test01"); + } + + private static String test05(int first, byte second, char third, long four, float five, double six, String seven, + Boolean eight, Object nine, int[] ten) { + /*test static method return value no exception*/ + first++; + second = 56; + third = (char) second; + four = (long) third; + five = (float) four; + six = (double) five; + seven = "fei fei is not a pig"; + eight = false; + nine = (Object) eight; + ten = ten.clone(); + + if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" + && eight == false && nine == (Object) false && ten[4] == 3301) + check_count++; + else + System.out.println("ErrorResult in test05"); + return new String("test05 is End"); + } + + private static void test06(int first, byte second, char third, long four, float five, double six, String seven, + Boolean eight, Object nine, int[] ten) throws IllegalArgumentException { + /*test static method no return value throws exception*/ + first++; + second = 56; + third = (char) second; + four = (long) third; + five = (float) four; + six = (double) five; + seven = "fei fei is not a pig"; + eight = false; + nine = (Object) eight; + ten = ten.clone(); + int[][] test_ten = {ten, ten, ten, ten, ten, ten}; + + if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" + && eight == false && nine == (Object) false && ten[4] == 3301) + check_count++; + else + System.out.println("ErrorResult in test06"); + Array.getInt(test_ten, 5); + } + + private static int[] test08(int first, byte second, char third, long four, float five, double six, String seven, + Boolean eight, Object nine, int[] ten) throws NegativeArraySizeException { + /*test static method return value throws exception*/ + first++; + second = 56; + third = (char) second; + four = (long) third; + five = (float) four; + six = (double) five; + seven = "fei fei is not a pig"; + eight = false; + nine = (Object) eight; + ten = ten.clone(); + int[][] test_ten = {ten, ten, ten, ten, ten, ten}; + + if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" + && eight == false && nine == (Object) false && ten[4] == 3301) + check_count++; + else + System.out.println("ErrorResult in test08"); + int[] chck = new int[-1]; + return chck; + } + + private void test02(int first, byte second, char third, long four, float five, double six, String seven, + Boolean eight, Object nine, int[] ten) { + /*test no static method no return no exception*/ + first++; + second = 56; + third = (char) second; + four = (long) third; + five = (float) four; + six = (double) five; + seven = "fei fei is not a pig"; + eight = false; + nine = (Object) eight; + ten = ten.clone(); + if (first == 1989 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" + && eight == false && nine == (Object) false && ten[4] == 3301) + check_count++; + else + System.out.println("ErrorResult in test02"); + } + + private int test03(int first, byte second, char third, long four, float five, double six, String seven, + Boolean eight, Object nine, int[] ten) { + /*test no static method return value no exception*/ + first++; + second = 56; + third = (char) second; + four = (long) third; + five = (float) four; + six = (double) five; + seven = "fei fei is not a pig"; + eight = false; + nine = (Object) eight; + ten = ten.clone(); + if (first == 1989 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" + && eight == false && nine == (Object) false && ten[4] == 3301) + check_count++; + else + System.out.println("ErrorResult in test03"); + return first; + } + + private void test04(int first, byte second, char third, long four, float five, double six, String seven, + Boolean eight, Object nine, int[] ten) throws ArrayIndexOutOfBoundsException { + /*test no static method no return throws exception*/ + first++; + second = 56; + third = (char) second; + four = (long) third; + five = (float) four; + six = (double) five; + seven = "fei fei is not a pig"; + eight = false; + nine = (Object) eight; + ten = ten.clone(); + + if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" + && eight == false && nine == (Object) false && ten[4] == 3301) + check_count++; + else + System.out.println("ErrorResult in test04"); + ten[5] = 1988; + } + + private boolean test07(int first, byte second, char third, long four, float five, double six, String seven, + Boolean eight, Object nine, int[] ten) throws ArithmeticException { + /*test no static method return value throws exception*/ + first++; + second = 56; + third = (char) second; + four = (long) third; + five = (float) four; + six = (double) five; + seven = "fei fei is not a pig"; + eight = false; + nine = (Object) eight; + ten = ten.clone(); + int[][] test_ten = {ten, ten, ten, ten, ten, ten}; + + if (first == 1990 && second == 56 && third == '8' && four == 56 && five == 56f && six == 56f && seven == "fei fei is not a pig" + && eight == false && nine == (Object) false && ten[4] == 3301) + check_count++; + else + System.out.println("ErrorResult in test07"); + + first = first / 0; + return true; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0001-rc-function-Cycle_a_00180/Cycle_a_00180.java b/test/testsuite/ouroboros/memory_management/Function/RC0001-rc-function-Cycle_a_00180/Cycle_a_00180.java index bceb104cc711e561a506bff4a73cfc4b5bf4fb31..40360df55e84db5e5443930f3a0236846bb40178 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0001-rc-function-Cycle_a_00180/Cycle_a_00180.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0001-rc-function-Cycle_a_00180/Cycle_a_00180.java @@ -1,247 +1,247 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00180.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00180 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00180.java - *- @ExecuteClass: Cycle_a_00180 - *- @ExecuteArgs: - * A1 depend A2 A8; - * A2 depend A3 ; A3 depend A4; A4 depend A5 ; A5 depend A6; A6 depend A1 ; - * A8 depend A9 ; A9 depend A7; A7 depend A4 - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102+108)+(102+103)+(103+104)+(104+105)+(105+106)+(106+101)+(107+104)+(108+109)+(109+107)=1994 - * - */ - -class Cycle_a_00180_A1 { - Cycle_a_00180_A2 a2_0; - Cycle_a_00180_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A1(String strObjectName) { - a2_0 = null; - a8_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a8_0.a; - } -} - -class Cycle_a_00180_A2 { - Cycle_a_00180_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00180_A3 { - Cycle_a_00180_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - -class Cycle_a_00180_A4 { - Cycle_a_00180_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - -class Cycle_a_00180_A5 { - Cycle_a_00180_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00180_A6 { - Cycle_a_00180_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A6(String strObjectName) { - a1_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_00180_A7 { - Cycle_a_00180_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A7(String strObjectName) { - a4_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - -class Cycle_a_00180_A8 { - Cycle_a_00180_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A8(String strObjectName) { - a9_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } -} - -class Cycle_a_00180_A9 { - Cycle_a_00180_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A9(String strObjectName) { - a7_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - -public class Cycle_a_00180 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00180_A1 a1_main = new Cycle_a_00180_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00180_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00180_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00180_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00180_A5("a5_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00180_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; - a1_main.a8_0 = new Cycle_a_00180_A8("a8_0"); - a1_main.a8_0.a9_0 = new Cycle_a_00180_A9("a9_0"); - a1_main.a8_0.a9_0.a7_0 = new Cycle_a_00180_A7("a7_0"); - a1_main.a8_0.a9_0.a7_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a1_main.a8_0.add(); - a1_main.a8_0.a9_0.add(); - a1_main.a8_0.a9_0.a7_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_main.a8_0.sum + a1_main.a8_0.a9_0.sum + a1_main.a8_0.a9_0.a7_0.sum; - if (result == 1994) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00180.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00180 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00180.java + *- @ExecuteClass: Cycle_a_00180 + *- @ExecuteArgs: + * A1 depend A2 A8; + * A2 depend A3 ; A3 depend A4; A4 depend A5 ; A5 depend A6; A6 depend A1 ; + * A8 depend A9 ; A9 depend A7; A7 depend A4 + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102+108)+(102+103)+(103+104)+(104+105)+(105+106)+(106+101)+(107+104)+(108+109)+(109+107)=1994 + * + */ + +class Cycle_a_00180_A1 { + Cycle_a_00180_A2 a2_0; + Cycle_a_00180_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A1(String strObjectName) { + a2_0 = null; + a8_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a8_0.a; + } +} + +class Cycle_a_00180_A2 { + Cycle_a_00180_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00180_A3 { + Cycle_a_00180_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + +class Cycle_a_00180_A4 { + Cycle_a_00180_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + +class Cycle_a_00180_A5 { + Cycle_a_00180_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00180_A6 { + Cycle_a_00180_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A6(String strObjectName) { + a1_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_00180_A7 { + Cycle_a_00180_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A7(String strObjectName) { + a4_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + +class Cycle_a_00180_A8 { + Cycle_a_00180_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A8(String strObjectName) { + a9_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } +} + +class Cycle_a_00180_A9 { + Cycle_a_00180_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A9(String strObjectName) { + a7_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + +public class Cycle_a_00180 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00180_A1 a1_main = new Cycle_a_00180_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00180_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00180_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00180_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00180_A5("a5_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00180_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; + a1_main.a8_0 = new Cycle_a_00180_A8("a8_0"); + a1_main.a8_0.a9_0 = new Cycle_a_00180_A9("a9_0"); + a1_main.a8_0.a9_0.a7_0 = new Cycle_a_00180_A7("a7_0"); + a1_main.a8_0.a9_0.a7_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a1_main.a8_0.add(); + a1_main.a8_0.a9_0.add(); + a1_main.a8_0.a9_0.a7_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_main.a8_0.sum + a1_main.a8_0.a9_0.sum + a1_main.a8_0.a9_0.a7_0.sum; + if (result == 1994) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0002-rc-function-Cycle_a_00190/Cycle_a_00190.java b/test/testsuite/ouroboros/memory_management/Function/RC0002-rc-function-Cycle_a_00190/Cycle_a_00190.java index 4f21be2d3a7227db63227bf449c6a4352be9da1d..312d08b3a1664ee76471e757480bf0682db68fad 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0002-rc-function-Cycle_a_00190/Cycle_a_00190.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0002-rc-function-Cycle_a_00190/Cycle_a_00190.java @@ -1,270 +1,270 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00190.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00190 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00190.java - *- @ExecuteClass: Cycle_a_00190 - *- @ExecuteArgs: - A1 depend A2; A10 depend A8 ; - * A2 depend A3 ; A3 depend A4; A4 depend A5 ; A5 depend A6; A6 depend A1 A10 ; - * A8 depend A9 ; A9 depend A7; A7 depend A5 - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+104)+(104+105)+(105+106)+(106+101+110)+(107+105)+(108+109)+(109+107)+(110+108)=2215 - * - */ - -class Cycle_a_00190_A1 { - Cycle_a_00190_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00190_A2 { - Cycle_a_00190_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00190_A3 { - Cycle_a_00190_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - -class Cycle_a_00190_A4 { - Cycle_a_00190_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - -class Cycle_a_00190_A5 { - Cycle_a_00190_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00190_A6 { - Cycle_a_00190_A1 a1_0; - Cycle_a_00190_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A6(String strObjectName) { - a1_0 = null; - a10_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a10_0.a; - } -} - -class Cycle_a_00190_A7 { - Cycle_a_00190_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A7(String strObjectName) { - a5_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - -class Cycle_a_00190_A8 { - Cycle_a_00190_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A8(String strObjectName) { - a9_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } -} - -class Cycle_a_00190_A9 { - Cycle_a_00190_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A9(String strObjectName) { - a7_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - -class Cycle_a_00190_A10 { - Cycle_a_00190_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A10(String strObjectName) { - a8_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } -} - -public class Cycle_a_00190 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00190_A1 a1_main = new Cycle_a_00190_A1("a1_main"); - Cycle_a_00190_A10 a10_main = new Cycle_a_00190_A10("a10_main"); - a1_main.a2_0 = new Cycle_a_00190_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00190_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00190_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00190_A5("a5_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00190_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_main; - - a10_main.a8_0 = new Cycle_a_00190_A8("a8_0"); - a10_main.a8_0.a9_0 = new Cycle_a_00190_A9("a9_0"); - a10_main.a8_0.a9_0.a7_0 = new Cycle_a_00190_A7("a7_0"); - a10_main.a8_0.a9_0.a7_0.a5_0 = a1_main.a2_0.a3_0.a4_0.a5_0; - - a1_main.add(); - a10_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a10_main.a8_0.add(); - a10_main.a8_0.a9_0.add(); - a10_main.a8_0.a9_0.a7_0.add(); - - - int result = a1_main.sum + a10_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_main.a8_0.sum + a10_main.a8_0.a9_0.sum + a10_main.a8_0.a9_0.a7_0.sum; - if (result == 2215) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00190.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00190 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00190.java + *- @ExecuteClass: Cycle_a_00190 + *- @ExecuteArgs: + A1 depend A2; A10 depend A8 ; + * A2 depend A3 ; A3 depend A4; A4 depend A5 ; A5 depend A6; A6 depend A1 A10 ; + * A8 depend A9 ; A9 depend A7; A7 depend A5 + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+104)+(104+105)+(105+106)+(106+101+110)+(107+105)+(108+109)+(109+107)+(110+108)=2215 + * + */ + +class Cycle_a_00190_A1 { + Cycle_a_00190_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00190_A2 { + Cycle_a_00190_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00190_A3 { + Cycle_a_00190_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + +class Cycle_a_00190_A4 { + Cycle_a_00190_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + +class Cycle_a_00190_A5 { + Cycle_a_00190_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00190_A6 { + Cycle_a_00190_A1 a1_0; + Cycle_a_00190_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A6(String strObjectName) { + a1_0 = null; + a10_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a10_0.a; + } +} + +class Cycle_a_00190_A7 { + Cycle_a_00190_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A7(String strObjectName) { + a5_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + +class Cycle_a_00190_A8 { + Cycle_a_00190_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A8(String strObjectName) { + a9_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } +} + +class Cycle_a_00190_A9 { + Cycle_a_00190_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A9(String strObjectName) { + a7_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + +class Cycle_a_00190_A10 { + Cycle_a_00190_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A10(String strObjectName) { + a8_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } +} + +public class Cycle_a_00190 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00190_A1 a1_main = new Cycle_a_00190_A1("a1_main"); + Cycle_a_00190_A10 a10_main = new Cycle_a_00190_A10("a10_main"); + a1_main.a2_0 = new Cycle_a_00190_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00190_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00190_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00190_A5("a5_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00190_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_main; + + a10_main.a8_0 = new Cycle_a_00190_A8("a8_0"); + a10_main.a8_0.a9_0 = new Cycle_a_00190_A9("a9_0"); + a10_main.a8_0.a9_0.a7_0 = new Cycle_a_00190_A7("a7_0"); + a10_main.a8_0.a9_0.a7_0.a5_0 = a1_main.a2_0.a3_0.a4_0.a5_0; + + a1_main.add(); + a10_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a10_main.a8_0.add(); + a10_main.a8_0.a9_0.add(); + a10_main.a8_0.a9_0.a7_0.add(); + + + int result = a1_main.sum + a10_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_main.a8_0.sum + a10_main.a8_0.a9_0.sum + a10_main.a8_0.a9_0.a7_0.sum; + if (result == 2215) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0003-rc-function-Cycle_a_00200/Cycle_a_00200.java b/test/testsuite/ouroboros/memory_management/Function/RC0003-rc-function-Cycle_a_00200/Cycle_a_00200.java index 094c9e9a12292a6893fee922ec2529d7539828ea..9625a9b70b13f7294b2e0210bcb15cb000ef5055 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0003-rc-function-Cycle_a_00200/Cycle_a_00200.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0003-rc-function-Cycle_a_00200/Cycle_a_00200.java @@ -1,208 +1,208 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00200.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00200 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00200.java - *- @ExecuteClass: Cycle_a_00200 - *- @ExecuteArgs: - * A1 depend A2; A4 depend A3 ; - * A2 depend A3 A6 A7; A3 depend A1 A5; A5 depend A4; A6 depend A7 ; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102+106+107)+(102+103)+(103+101+105)+(104+103)+(105+104)+(106+107)+(107+107)=1773 - * - */ - -class Cycle_a_00200_A1 { - Cycle_a_00200_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00200_A2 { - Cycle_a_00200_A3 a3_0; - Cycle_a_00200_A6 a6_0; - Cycle_a_00200_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A2(String strObjectName) { - a3_0 = null; - a6_0 = null; - a7_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a6_0.a + a7_0.a; - } -} - -class Cycle_a_00200_A3 { - Cycle_a_00200_A1 a1_0; - Cycle_a_00200_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - -class Cycle_a_00200_A4 { - Cycle_a_00200_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00200_A5 { - Cycle_a_00200_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A5(String strObjectName) { - a4_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - -class Cycle_a_00200_A6 { - Cycle_a_00200_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - -class Cycle_a_00200_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Cycle_a_00200 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00200_A1 a1_main = new Cycle_a_00200_A1("a1_main"); - Cycle_a_00200_A4 a4_main = new Cycle_a_00200_A4("a4_main"); - a1_main.a2_0 = new Cycle_a_00200_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00200_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00200_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a6_0 = new Cycle_a_00200_A6("a6_0"); - a1_main.a2_0.a6_0.a7_0 = new Cycle_a_00200_A7("a7_0"); - a1_main.a2_0.a7_0 = a1_main.a2_0.a6_0.a7_0; - - a1_main.add(); - a4_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a6_0.add(); - a1_main.a2_0.a6_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a6_0.sum + a1_main.a2_0.a6_0.a7_0.sum; - if (result == 1773) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00200.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00200 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00200.java + *- @ExecuteClass: Cycle_a_00200 + *- @ExecuteArgs: + * A1 depend A2; A4 depend A3 ; + * A2 depend A3 A6 A7; A3 depend A1 A5; A5 depend A4; A6 depend A7 ; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102+106+107)+(102+103)+(103+101+105)+(104+103)+(105+104)+(106+107)+(107+107)=1773 + * + */ + +class Cycle_a_00200_A1 { + Cycle_a_00200_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00200_A2 { + Cycle_a_00200_A3 a3_0; + Cycle_a_00200_A6 a6_0; + Cycle_a_00200_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A2(String strObjectName) { + a3_0 = null; + a6_0 = null; + a7_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a6_0.a + a7_0.a; + } +} + +class Cycle_a_00200_A3 { + Cycle_a_00200_A1 a1_0; + Cycle_a_00200_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + +class Cycle_a_00200_A4 { + Cycle_a_00200_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00200_A5 { + Cycle_a_00200_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A5(String strObjectName) { + a4_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + +class Cycle_a_00200_A6 { + Cycle_a_00200_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + +class Cycle_a_00200_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Cycle_a_00200 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00200_A1 a1_main = new Cycle_a_00200_A1("a1_main"); + Cycle_a_00200_A4 a4_main = new Cycle_a_00200_A4("a4_main"); + a1_main.a2_0 = new Cycle_a_00200_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00200_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00200_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a6_0 = new Cycle_a_00200_A6("a6_0"); + a1_main.a2_0.a6_0.a7_0 = new Cycle_a_00200_A7("a7_0"); + a1_main.a2_0.a7_0 = a1_main.a2_0.a6_0.a7_0; + + a1_main.add(); + a4_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a6_0.add(); + a1_main.a2_0.a6_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a6_0.sum + a1_main.a2_0.a6_0.a7_0.sum; + if (result == 1773) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0004-rc-function-Cycle_a_00210/Cycle_a_00210.java b/test/testsuite/ouroboros/memory_management/Function/RC0004-rc-function-Cycle_a_00210/Cycle_a_00210.java index dfe947359417593b89d9ed87dcd2f788f93681e3..748ad6b19479cc776b707d26e04f9836339debc0 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0004-rc-function-Cycle_a_00210/Cycle_a_00210.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0004-rc-function-Cycle_a_00210/Cycle_a_00210.java @@ -1,208 +1,208 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00210.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Cycle_a_00210 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00210.java - *- @ExecuteClass: Cycle_a_00210 - *- @ExecuteArgs: - * A1 depend A2; A4 depend A3 ; - * A2 depend A3; A3 depend A1 A5 A6; A5 depend A4; A6 depend A7 ; A7 depend A3; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101+105+106)+(104+103)+(105+104)+(106+107)+(107+103)=1662 - * - */ - -class Cycle_a_00210_A1 { - Cycle_a_00210_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00210_A2 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00210_A3 { - Cycle_a_00210_A1 a1_0; - Cycle_a_00210_A5 a5_0; - Cycle_a_00210_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a6_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a6_0.a; - } -} - -class Cycle_a_00210_A4 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00210_A5 { - Cycle_a_00210_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A5(String strObjectName) { - a4_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - -class Cycle_a_00210_A6 { - Cycle_a_00210_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - -class Cycle_a_00210_A7 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -public class Cycle_a_00210 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00210_A1 a1_main = new Cycle_a_00210_A1("a1_main"); - Cycle_a_00210_A4 a4_main = new Cycle_a_00210_A4("a4_main"); - a1_main.a2_0 = new Cycle_a_00210_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00210_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00210_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00210_A6("a6_0"); - a1_main.a2_0.a3_0.a6_0.a7_0 = new Cycle_a_00210_A7("a7_0"); - a1_main.a2_0.a3_0.a6_0.a7_0.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a4_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a6_0.add(); - a1_main.a2_0.a3_0.a6_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a6_0.sum + a1_main.a2_0.a3_0.a6_0.a7_0.sum; - if (result == 1662) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00210.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Cycle_a_00210 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00210.java + *- @ExecuteClass: Cycle_a_00210 + *- @ExecuteArgs: + * A1 depend A2; A4 depend A3 ; + * A2 depend A3; A3 depend A1 A5 A6; A5 depend A4; A6 depend A7 ; A7 depend A3; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101+105+106)+(104+103)+(105+104)+(106+107)+(107+103)=1662 + * + */ + +class Cycle_a_00210_A1 { + Cycle_a_00210_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00210_A2 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00210_A3 { + Cycle_a_00210_A1 a1_0; + Cycle_a_00210_A5 a5_0; + Cycle_a_00210_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a6_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a6_0.a; + } +} + +class Cycle_a_00210_A4 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00210_A5 { + Cycle_a_00210_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A5(String strObjectName) { + a4_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + +class Cycle_a_00210_A6 { + Cycle_a_00210_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + +class Cycle_a_00210_A7 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +public class Cycle_a_00210 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00210_A1 a1_main = new Cycle_a_00210_A1("a1_main"); + Cycle_a_00210_A4 a4_main = new Cycle_a_00210_A4("a4_main"); + a1_main.a2_0 = new Cycle_a_00210_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00210_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00210_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00210_A6("a6_0"); + a1_main.a2_0.a3_0.a6_0.a7_0 = new Cycle_a_00210_A7("a7_0"); + a1_main.a2_0.a3_0.a6_0.a7_0.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a4_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a6_0.add(); + a1_main.a2_0.a3_0.a6_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a6_0.sum + a1_main.a2_0.a3_0.a6_0.a7_0.sum; + if (result == 1662) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0005-rc-function-Cycle_a_00220/Cycle_a_00220.java b/test/testsuite/ouroboros/memory_management/Function/RC0005-rc-function-Cycle_a_00220/Cycle_a_00220.java index 53ce21dc3549feb4f4d054ac7b2f711d48f3bc8d..ba10260d2d1803a8aaaef4b48ca849bfdee45180 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0005-rc-function-Cycle_a_00220/Cycle_a_00220.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0005-rc-function-Cycle_a_00220/Cycle_a_00220.java @@ -1,210 +1,210 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00220.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00220 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00220.java - *- @ExecuteClass: Cycle_a_00220 - *- @ExecuteArgs: - * A1 depend A2; A5 depend A4 A7; - * A2 depend A3; A3 depend A1 A5; A4 depend A3 ; A6 depend A5 A7 ; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101+105)+(104+103)+(105+104+107)+(106+105+107)+(107+107)=1772 - * - */ - -class Cycle_a_00220_A1 { - Cycle_a_00220_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00220_A2 { - Cycle_a_00220_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00220_A3 { - Cycle_a_00220_A1 a1_0; - Cycle_a_00220_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - -class Cycle_a_00220_A4 { - Cycle_a_00220_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00220_A5 { - Cycle_a_00220_A4 a4_0; - Cycle_a_00220_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A5(String strObjectName) { - a4_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a + a7_0.a; - } -} - -class Cycle_a_00220_A6 { - Cycle_a_00220_A5 a5_0; - Cycle_a_00220_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A6(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a7_0.a; - } -} - -class Cycle_a_00220_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Cycle_a_00220 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00220_A1 a1_main = new Cycle_a_00220_A1("a1_main"); - Cycle_a_00220_A4 a4_main = new Cycle_a_00220_A4("a4_main"); - Cycle_a_00220_A6 a6_main = new Cycle_a_00220_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00220_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00220_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00220_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_00220_A7("a7_0"); - a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; - a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; - if (result == 1772) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00220.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00220 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00220.java + *- @ExecuteClass: Cycle_a_00220 + *- @ExecuteArgs: + * A1 depend A2; A5 depend A4 A7; + * A2 depend A3; A3 depend A1 A5; A4 depend A3 ; A6 depend A5 A7 ; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101+105)+(104+103)+(105+104+107)+(106+105+107)+(107+107)=1772 + * + */ + +class Cycle_a_00220_A1 { + Cycle_a_00220_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00220_A2 { + Cycle_a_00220_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00220_A3 { + Cycle_a_00220_A1 a1_0; + Cycle_a_00220_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + +class Cycle_a_00220_A4 { + Cycle_a_00220_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00220_A5 { + Cycle_a_00220_A4 a4_0; + Cycle_a_00220_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A5(String strObjectName) { + a4_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a + a7_0.a; + } +} + +class Cycle_a_00220_A6 { + Cycle_a_00220_A5 a5_0; + Cycle_a_00220_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A6(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a7_0.a; + } +} + +class Cycle_a_00220_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Cycle_a_00220 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00220_A1 a1_main = new Cycle_a_00220_A1("a1_main"); + Cycle_a_00220_A4 a4_main = new Cycle_a_00220_A4("a4_main"); + Cycle_a_00220_A6 a6_main = new Cycle_a_00220_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00220_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00220_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00220_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_00220_A7("a7_0"); + a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; + a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; + if (result == 1772) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0006-rc-function-Cycle_a_00230/Cycle_a_00230.java b/test/testsuite/ouroboros/memory_management/Function/RC0006-rc-function-Cycle_a_00230/Cycle_a_00230.java index 96d385471fed0294ae073e1a8d28f164ab8502c5..cabec646aff8d2fd949f5d57241657c6015c0fd4 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0006-rc-function-Cycle_a_00230/Cycle_a_00230.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0006-rc-function-Cycle_a_00230/Cycle_a_00230.java @@ -1,208 +1,208 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00230.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Cycle_a_00230 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00230.java - *- @ExecuteClass: Cycle_a_00230 - *- @ExecuteArgs: - * A1 depend A2; A5 depend A3 A6 A7; - * A2 depend A3; A3 depend A1 A4; A4 depend A5 ; A6 depend A7 ; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101+104)+(104+105)+(105+103+106+107)+(106+107)+(107+107)=1773 - * - */ - -class Cycle_a_00230_A1 { - Cycle_a_00230_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00230_A2 { - Cycle_a_00230_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00230_A3 { - Cycle_a_00230_A1 a1_0; - Cycle_a_00230_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } -} - -class Cycle_a_00230_A4 { - Cycle_a_00230_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - -class Cycle_a_00230_A5 { - Cycle_a_00230_A3 a3_0; - Cycle_a_00230_A6 a6_0; - Cycle_a_00230_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A5(String strObjectName) { - a3_0 = null; - a6_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a6_0.a + a7_0.a; - } -} - -class Cycle_a_00230_A6 { - Cycle_a_00230_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - -class Cycle_a_00230_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Cycle_a_00230 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00230_A1 a1_main = new Cycle_a_00230_A1("a1_main"); - Cycle_a_00230_A5 a5_main = new Cycle_a_00230_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00230_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00230_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00230_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a7_0 = new Cycle_a_00230_A7("a7_0"); - a5_main.a6_0 = new Cycle_a_00230_A6("a6_0"); - a5_main.a6_0.a7_0 = a5_main.a7_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a5_main.a7_0.add(); - a5_main.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a5_main.a6_0.sum + a5_main.a7_0.sum; - if (result == 1773) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00230.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Cycle_a_00230 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00230.java + *- @ExecuteClass: Cycle_a_00230 + *- @ExecuteArgs: + * A1 depend A2; A5 depend A3 A6 A7; + * A2 depend A3; A3 depend A1 A4; A4 depend A5 ; A6 depend A7 ; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101+104)+(104+105)+(105+103+106+107)+(106+107)+(107+107)=1773 + * + */ + +class Cycle_a_00230_A1 { + Cycle_a_00230_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00230_A2 { + Cycle_a_00230_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00230_A3 { + Cycle_a_00230_A1 a1_0; + Cycle_a_00230_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } +} + +class Cycle_a_00230_A4 { + Cycle_a_00230_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + +class Cycle_a_00230_A5 { + Cycle_a_00230_A3 a3_0; + Cycle_a_00230_A6 a6_0; + Cycle_a_00230_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A5(String strObjectName) { + a3_0 = null; + a6_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a6_0.a + a7_0.a; + } +} + +class Cycle_a_00230_A6 { + Cycle_a_00230_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + +class Cycle_a_00230_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Cycle_a_00230 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00230_A1 a1_main = new Cycle_a_00230_A1("a1_main"); + Cycle_a_00230_A5 a5_main = new Cycle_a_00230_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00230_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00230_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00230_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a7_0 = new Cycle_a_00230_A7("a7_0"); + a5_main.a6_0 = new Cycle_a_00230_A6("a6_0"); + a5_main.a6_0.a7_0 = a5_main.a7_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a5_main.a7_0.add(); + a5_main.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a5_main.a6_0.sum + a5_main.a7_0.sum; + if (result == 1773) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0007-rc-function-Cycle_a_00240/Cycle_a_00240.java b/test/testsuite/ouroboros/memory_management/Function/RC0007-rc-function-Cycle_a_00240/Cycle_a_00240.java index 8428c83053efa6a1dd908fb6cfe0099bfaf5c967..85a5ce9eba5e95b904af18f94d28a20099d2800e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0007-rc-function-Cycle_a_00240/Cycle_a_00240.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0007-rc-function-Cycle_a_00240/Cycle_a_00240.java @@ -1,209 +1,209 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00240.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00240 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00240.java - *- @ExecuteClass: Cycle_a_00240 - *- @ExecuteArgs: - * A1 depend A2 A6; A5 depend A3; - * A2 depend A3; A3 depend A1 A4; A4 depend A5 ; A6 depend A7 ; A7 depend A1; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102+106)+(102+103)+(103+101+104)+(104+105)+(105+103)+(106+107)+(107+101)=1660 - * - */ - -class Cycle_a_00240_A1 { - Cycle_a_00240_A2 a2_0; - Cycle_a_00240_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A1(String strObjectName) { - a2_0 = null; - a6_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a6_0.a; - } -} - -class Cycle_a_00240_A2 { - Cycle_a_00240_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00240_A3 { - Cycle_a_00240_A1 a1_0; - Cycle_a_00240_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } -} - -class Cycle_a_00240_A4 { - Cycle_a_00240_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - -class Cycle_a_00240_A5 { - Cycle_a_00240_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00240_A6 { - Cycle_a_00240_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - -class Cycle_a_00240_A7 { - Cycle_a_00240_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A7(String strObjectName) { - a1_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -public class Cycle_a_00240 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00240_A1 a1_main = new Cycle_a_00240_A1("a1_main"); - Cycle_a_00240_A5 a5_main = new Cycle_a_00240_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00240_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00240_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00240_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a1_main.a6_0 = new Cycle_a_00240_A6("a6_0"); - a1_main.a6_0.a7_0 = new Cycle_a_00240_A7("a7_0"); - a1_main.a6_0.a7_0.a1_0 = a1_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a6_0.add(); - a1_main.a6_0.a7_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a6_0.sum + a1_main.a6_0.a7_0.sum; - if (result == 1660) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00240.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00240 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00240.java + *- @ExecuteClass: Cycle_a_00240 + *- @ExecuteArgs: + * A1 depend A2 A6; A5 depend A3; + * A2 depend A3; A3 depend A1 A4; A4 depend A5 ; A6 depend A7 ; A7 depend A1; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102+106)+(102+103)+(103+101+104)+(104+105)+(105+103)+(106+107)+(107+101)=1660 + * + */ + +class Cycle_a_00240_A1 { + Cycle_a_00240_A2 a2_0; + Cycle_a_00240_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A1(String strObjectName) { + a2_0 = null; + a6_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a6_0.a; + } +} + +class Cycle_a_00240_A2 { + Cycle_a_00240_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00240_A3 { + Cycle_a_00240_A1 a1_0; + Cycle_a_00240_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } +} + +class Cycle_a_00240_A4 { + Cycle_a_00240_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + +class Cycle_a_00240_A5 { + Cycle_a_00240_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00240_A6 { + Cycle_a_00240_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + +class Cycle_a_00240_A7 { + Cycle_a_00240_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A7(String strObjectName) { + a1_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +public class Cycle_a_00240 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00240_A1 a1_main = new Cycle_a_00240_A1("a1_main"); + Cycle_a_00240_A5 a5_main = new Cycle_a_00240_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00240_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00240_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00240_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a1_main.a6_0 = new Cycle_a_00240_A6("a6_0"); + a1_main.a6_0.a7_0 = new Cycle_a_00240_A7("a7_0"); + a1_main.a6_0.a7_0.a1_0 = a1_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a6_0.add(); + a1_main.a6_0.a7_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a6_0.sum + a1_main.a6_0.a7_0.sum; + if (result == 1660) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0008-rc-function-Cycle_a_00250/Cycle_a_00250.java b/test/testsuite/ouroboros/memory_management/Function/RC0008-rc-function-Cycle_a_00250/Cycle_a_00250.java index cbec82fe0a5a3d9e56191d98234bd509d8fc39b2..7b97a257f48c9d69ac45697d57221cbf8530bbdf 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0008-rc-function-Cycle_a_00250/Cycle_a_00250.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0008-rc-function-Cycle_a_00250/Cycle_a_00250.java @@ -1,167 +1,167 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00250.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00250 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00250.java - *- @ExecuteClass: Cycle_a_00250 - *- @ExecuteArgs: - * A1 depend A2; A6 depend A3 - * A2 depend A3; A3 depend A1 A2 A5; A5 depend A6; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+101+103)+(103+101+105)+(105+106)+(106+103)=1238 - * - */ - -class Cycle_a_00250_A1 { - Cycle_a_00250_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00250_A2 { - Cycle_a_00250_A1 a1_0; - Cycle_a_00250_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - -class Cycle_a_00250_A3 { - Cycle_a_00250_A1 a1_0; - Cycle_a_00250_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -class Cycle_a_00250_A5 { - Cycle_a_00250_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00250_A6 { - Cycle_a_00250_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -public class Cycle_a_00250 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00250_A1 a1_main = new Cycle_a_00250_A1("a1_main"); - Cycle_a_00250_A6 a6_main = new Cycle_a_00250_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00250_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00250_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00250_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - if (result == 1238) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00250.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00250 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00250.java + *- @ExecuteClass: Cycle_a_00250 + *- @ExecuteArgs: + * A1 depend A2; A6 depend A3 + * A2 depend A3; A3 depend A1 A2 A5; A5 depend A6; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+101+103)+(103+101+105)+(105+106)+(106+103)=1238 + * + */ + +class Cycle_a_00250_A1 { + Cycle_a_00250_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00250_A2 { + Cycle_a_00250_A1 a1_0; + Cycle_a_00250_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + +class Cycle_a_00250_A3 { + Cycle_a_00250_A1 a1_0; + Cycle_a_00250_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +class Cycle_a_00250_A5 { + Cycle_a_00250_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00250_A6 { + Cycle_a_00250_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +public class Cycle_a_00250 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00250_A1 a1_main = new Cycle_a_00250_A1("a1_main"); + Cycle_a_00250_A6 a6_main = new Cycle_a_00250_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00250_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00250_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00250_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + if (result == 1238) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0009-rc-function-Cycle_a_00260/Cycle_a_00260.java b/test/testsuite/ouroboros/memory_management/Function/RC0009-rc-function-Cycle_a_00260/Cycle_a_00260.java index 67be10eadef7101c1ecb3b44b24f07f6622f4ab3..8c5ee4fb71b814ba76ebd0a32c33a0a04b99084a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0009-rc-function-Cycle_a_00260/Cycle_a_00260.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0009-rc-function-Cycle_a_00260/Cycle_a_00260.java @@ -1,168 +1,168 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00260.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00260 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00260.java - *- @ExecuteClass: Cycle_a_00260 - *- @ExecuteArgs: - ** A1 depend A2; A6 depend A3 - * A2 depend A3; A3 depend A1 A2 A5; A5 depend A6; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101+102+105)+(105+106)+(106+103)=1239 - * - */ - -class Cycle_a_00260_A1 { - Cycle_a_00260_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00260_A2 { - Cycle_a_00260_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00260_A3 { - Cycle_a_00260_A1 a1_0; - Cycle_a_00260_A2 a2_0; - Cycle_a_00260_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a + a5_0.a; - } -} - - -class Cycle_a_00260_A5 { - Cycle_a_00260_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00260_A6 { - Cycle_a_00260_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -public class Cycle_a_00260 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00260_A1 a1_main = new Cycle_a_00260_A1("a1_main"); - Cycle_a_00260_A6 a6_main = new Cycle_a_00260_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00260_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00260_A3("a3_0"); - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00260_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - if (result == 1239) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00260.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00260 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00260.java + *- @ExecuteClass: Cycle_a_00260 + *- @ExecuteArgs: + ** A1 depend A2; A6 depend A3 + * A2 depend A3; A3 depend A1 A2 A5; A5 depend A6; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101+102+105)+(105+106)+(106+103)=1239 + * + */ + +class Cycle_a_00260_A1 { + Cycle_a_00260_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00260_A2 { + Cycle_a_00260_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00260_A3 { + Cycle_a_00260_A1 a1_0; + Cycle_a_00260_A2 a2_0; + Cycle_a_00260_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a + a5_0.a; + } +} + + +class Cycle_a_00260_A5 { + Cycle_a_00260_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00260_A6 { + Cycle_a_00260_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +public class Cycle_a_00260 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00260_A1 a1_main = new Cycle_a_00260_A1("a1_main"); + Cycle_a_00260_A6 a6_main = new Cycle_a_00260_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00260_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00260_A3("a3_0"); + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00260_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + if (result == 1239) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0010-rc-function-Cycle_a_00270/Cycle_a_00270.java b/test/testsuite/ouroboros/memory_management/Function/RC0010-rc-function-Cycle_a_00270/Cycle_a_00270.java index 6633d1ece3ff35e966550c53b7106ed447b84044..81439793f7c88012510083a7829c76f857c975bc 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0010-rc-function-Cycle_a_00270/Cycle_a_00270.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0010-rc-function-Cycle_a_00270/Cycle_a_00270.java @@ -1,168 +1,168 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00270.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Cycle_a_00270 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00270.java - *- @ExecuteClass: Cycle_a_00270 - *- @ExecuteArgs: - * A1 depend A2 A3; A6 depend A3 - * A2 depend A3; A3 depend A1 A5; A5 depend A6; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102+103)+(102+103)+(103+101+105)+(105+106)+(106+103)=1240 - * - */ - -class Cycle_a_00270_A1 { - Cycle_a_00270_A2 a2_0; - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } -} - -class Cycle_a_00270_A2 { - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00270_A3 { - Cycle_a_00270_A1 a1_0; - Cycle_a_00270_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -class Cycle_a_00270_A5 { - Cycle_a_00270_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00270_A6 { - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -public class Cycle_a_00270 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00270_A1 a1_main = new Cycle_a_00270_A1("a1_main"); - Cycle_a_00270_A6 a6_main = new Cycle_a_00270_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00270_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00270_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00270_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - if (result == 1240) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00270.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Cycle_a_00270 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00270.java + *- @ExecuteClass: Cycle_a_00270 + *- @ExecuteArgs: + * A1 depend A2 A3; A6 depend A3 + * A2 depend A3; A3 depend A1 A5; A5 depend A6; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102+103)+(102+103)+(103+101+105)+(105+106)+(106+103)=1240 + * + */ + +class Cycle_a_00270_A1 { + Cycle_a_00270_A2 a2_0; + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } +} + +class Cycle_a_00270_A2 { + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00270_A3 { + Cycle_a_00270_A1 a1_0; + Cycle_a_00270_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +class Cycle_a_00270_A5 { + Cycle_a_00270_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00270_A6 { + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +public class Cycle_a_00270 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00270_A1 a1_main = new Cycle_a_00270_A1("a1_main"); + Cycle_a_00270_A6 a6_main = new Cycle_a_00270_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00270_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00270_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00270_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + if (result == 1240) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0011-rc-function-Cycle_a_00280/Cycle_a_00280.java b/test/testsuite/ouroboros/memory_management/Function/RC0011-rc-function-Cycle_a_00280/Cycle_a_00280.java index d8a930c7071e1abac56fef1fa9f5b633ee36b2f1..376d9b8cbc50734e176d0973ab6d28ac92fc8152 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0011-rc-function-Cycle_a_00280/Cycle_a_00280.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0011-rc-function-Cycle_a_00280/Cycle_a_00280.java @@ -1,173 +1,173 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00280.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00280 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00280.java - *- @ExecuteClass: Cycle_a_00280 - *- @ExecuteArgs: - * A1 depend A2 A3; A6 depend A3 - * A2 depend A1 A3; A3 depend A1 A5; A5 depend A6; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102+103)+(102+101+103)+(103+101+102+105)+(105+106)+(106+103)=1443 - * - */ - -class Cycle_a_00280_A1 { - Cycle_a_00280_A2 a2_0; - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } -} - -class Cycle_a_00280_A2 { - Cycle_a_00280_A1 a1_0; - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - -class Cycle_a_00280_A3 { - Cycle_a_00280_A1 a1_0; - Cycle_a_00280_A2 a2_0; - Cycle_a_00280_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a + a5_0.a; - } -} - - -class Cycle_a_00280_A5 { - Cycle_a_00280_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00280_A6 { - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -public class Cycle_a_00280 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); - Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a3_0 = a1_main.a2_0.a3_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - if (result == 1443) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00280.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00280 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00280.java + *- @ExecuteClass: Cycle_a_00280 + *- @ExecuteArgs: + * A1 depend A2 A3; A6 depend A3 + * A2 depend A1 A3; A3 depend A1 A5; A5 depend A6; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102+103)+(102+101+103)+(103+101+102+105)+(105+106)+(106+103)=1443 + * + */ + +class Cycle_a_00280_A1 { + Cycle_a_00280_A2 a2_0; + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } +} + +class Cycle_a_00280_A2 { + Cycle_a_00280_A1 a1_0; + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + +class Cycle_a_00280_A3 { + Cycle_a_00280_A1 a1_0; + Cycle_a_00280_A2 a2_0; + Cycle_a_00280_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a + a5_0.a; + } +} + + +class Cycle_a_00280_A5 { + Cycle_a_00280_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00280_A6 { + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +public class Cycle_a_00280 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); + Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a3_0 = a1_main.a2_0.a3_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + if (result == 1443) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0012-rc-function-Cycle_a_00290/Cycle_a_00290.java b/test/testsuite/ouroboros/memory_management/Function/RC0012-rc-function-Cycle_a_00290/Cycle_a_00290.java index 9342b9423dc21d569d4e8c6e127edecf8d0813be..f755b45c513eb00f9d446b3c01bb114e47167bf0 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0012-rc-function-Cycle_a_00290/Cycle_a_00290.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0012-rc-function-Cycle_a_00290/Cycle_a_00290.java @@ -1,190 +1,190 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00290.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Cycle_a_00290 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00290.java - *- @ExecuteClass: Cycle_a_00290 - *- @ExecuteArgs: - * A1 depend A2; A5 depend A3 - * A2 depend A3; A3 depend A1 A4 A6; A4 depend A5 ;A6 depend A2; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101+104+106)+(104+105)+(105+103)+(106+102)=1447 - * - */ - -class Cycle_a_00290_A1 { - Cycle_a_00290_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00290_A2 { - Cycle_a_00290_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00290_A3 { - Cycle_a_00290_A1 a1_0; - Cycle_a_00290_A4 a4_0; - Cycle_a_00290_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a6_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a + a6_0.a; - } -} - - -class Cycle_a_00290_A4 { - Cycle_a_00290_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - -class Cycle_a_00290_A5 { - Cycle_a_00290_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00290_A6 { - Cycle_a_00290_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A6(String strObjectName) { - a2_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -public class Cycle_a_00290 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00290_A1 a1_main = new Cycle_a_00290_A1("a1_main"); - Cycle_a_00290_A5 a5_main = new Cycle_a_00290_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00290_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00290_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00290_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00290_A6("a6_0"); - a1_main.a2_0.a3_0.a6_0.a2_0 = a1_main.a2_0; - a5_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a6_0.sum; - - if (result == 1447) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00290.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Cycle_a_00290 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00290.java + *- @ExecuteClass: Cycle_a_00290 + *- @ExecuteArgs: + * A1 depend A2; A5 depend A3 + * A2 depend A3; A3 depend A1 A4 A6; A4 depend A5 ;A6 depend A2; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101+104+106)+(104+105)+(105+103)+(106+102)=1447 + * + */ + +class Cycle_a_00290_A1 { + Cycle_a_00290_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00290_A2 { + Cycle_a_00290_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00290_A3 { + Cycle_a_00290_A1 a1_0; + Cycle_a_00290_A4 a4_0; + Cycle_a_00290_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a6_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a + a6_0.a; + } +} + + +class Cycle_a_00290_A4 { + Cycle_a_00290_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + +class Cycle_a_00290_A5 { + Cycle_a_00290_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00290_A6 { + Cycle_a_00290_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A6(String strObjectName) { + a2_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +public class Cycle_a_00290 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00290_A1 a1_main = new Cycle_a_00290_A1("a1_main"); + Cycle_a_00290_A5 a5_main = new Cycle_a_00290_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00290_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00290_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00290_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00290_A6("a6_0"); + a1_main.a2_0.a3_0.a6_0.a2_0 = a1_main.a2_0; + a5_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a6_0.sum; + + if (result == 1447) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0013-rc-function-Cycle_a_00300/Cycle_a_00300.java b/test/testsuite/ouroboros/memory_management/Function/RC0013-rc-function-Cycle_a_00300/Cycle_a_00300.java index 23bf5acbdfc2fd248885fe412791fe0d27b367cd..6d41fc2d21ae89a6efb6f359418d8e4a1b5b38b9 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0013-rc-function-Cycle_a_00300/Cycle_a_00300.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0013-rc-function-Cycle_a_00300/Cycle_a_00300.java @@ -1,190 +1,190 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00300.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Cycle_a_00300 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00300.java - *- @ExecuteClass: Cycle_a_00300 - *- @ExecuteArgs: - * A1 depend A2; A5 depend A3 - * A2 depend A3; A3 depend A1 A4; A4 depend A5 A6 ;A6 depend A3 ; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101+104)+(104+105+106)+(105+103)+(106+103)=1448 - * - */ - -class Cycle_a_00300_A1 { - Cycle_a_00300_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00300_A2 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00300_A3 { - Cycle_a_00300_A1 a1_0; - Cycle_a_00300_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } -} - - -class Cycle_a_00300_A4 { - Cycle_a_00300_A5 a5_0; - Cycle_a_00300_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A4(String strObjectName) { - a5_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a6_0.a; - } -} - -class Cycle_a_00300_A5 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00300_A6 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -public class Cycle_a_00300 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00300_A1 a1_main = new Cycle_a_00300_A1("a1_main"); - Cycle_a_00300_A5 a5_main = new Cycle_a_00300_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00300_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00300_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00300_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0.a6_0 = new Cycle_a_00300_A6("a6_0"); - a5_main.a3_0.a4_0.a6_0.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0.a5_0 = a5_main; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 1448) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00300.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Cycle_a_00300 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00300.java + *- @ExecuteClass: Cycle_a_00300 + *- @ExecuteArgs: + * A1 depend A2; A5 depend A3 + * A2 depend A3; A3 depend A1 A4; A4 depend A5 A6 ;A6 depend A3 ; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101+104)+(104+105+106)+(105+103)+(106+103)=1448 + * + */ + +class Cycle_a_00300_A1 { + Cycle_a_00300_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00300_A2 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00300_A3 { + Cycle_a_00300_A1 a1_0; + Cycle_a_00300_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } +} + + +class Cycle_a_00300_A4 { + Cycle_a_00300_A5 a5_0; + Cycle_a_00300_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A4(String strObjectName) { + a5_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a6_0.a; + } +} + +class Cycle_a_00300_A5 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00300_A6 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +public class Cycle_a_00300 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00300_A1 a1_main = new Cycle_a_00300_A1("a1_main"); + Cycle_a_00300_A5 a5_main = new Cycle_a_00300_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00300_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00300_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00300_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0.a6_0 = new Cycle_a_00300_A6("a6_0"); + a5_main.a3_0.a4_0.a6_0.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0.a5_0 = a5_main; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 1448) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0014-rc-function-Cycle_a_00310/Cycle_a_00310.java b/test/testsuite/ouroboros/memory_management/Function/RC0014-rc-function-Cycle_a_00310/Cycle_a_00310.java index 0820422f51ead5a2cedfcf5e9f045a8e16ca3e78..4d9d9b627c0f119bef0594ef7694a336a6ed9bbd 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0014-rc-function-Cycle_a_00310/Cycle_a_00310.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0014-rc-function-Cycle_a_00310/Cycle_a_00310.java @@ -1,194 +1,194 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00310.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00310 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00310.java - *- @ExecuteClass: Cycle_a_00310 - *- @ExecuteArgs: - * A1 depend A2 A4; A4 depend A6 ; A6 depend A1 A3 - * A2 depend A3; A3 depend A1 A5; A5 depend A6 ; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102+104)+(102+103)+(103+101+105)+(104+106)+(105+106)+(106+101+103)=1552 - * - */ - -class Cycle_a_00310_A1 { - Cycle_a_00310_A2 a2_0; - Cycle_a_00310_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } -} - -class Cycle_a_00310_A2 { - Cycle_a_00310_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00310_A3 { - Cycle_a_00310_A1 a1_0; - Cycle_a_00310_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -class Cycle_a_00310_A4 { - Cycle_a_00310_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A4(String strObjectName) { - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00310_A5 { - Cycle_a_00310_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00310_A6 { - Cycle_a_00310_A1 a1_0; - Cycle_a_00310_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - - -public class Cycle_a_00310 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00310_A1 a1_main = new Cycle_a_00310_A1("a1_main"); - Cycle_a_00310_A4 a4_main = new Cycle_a_00310_A4("a4_main"); - Cycle_a_00310_A6 a6_main = new Cycle_a_00310_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00310_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00310_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00310_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a4_0 = a4_main; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a6_main.a3_0.a5_0 = a1_main.a2_0.a3_0.a5_0; - a4_main.a6_0 = a6_main; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - - if (result == 1552) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00310.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00310 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00310.java + *- @ExecuteClass: Cycle_a_00310 + *- @ExecuteArgs: + * A1 depend A2 A4; A4 depend A6 ; A6 depend A1 A3 + * A2 depend A3; A3 depend A1 A5; A5 depend A6 ; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102+104)+(102+103)+(103+101+105)+(104+106)+(105+106)+(106+101+103)=1552 + * + */ + +class Cycle_a_00310_A1 { + Cycle_a_00310_A2 a2_0; + Cycle_a_00310_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } +} + +class Cycle_a_00310_A2 { + Cycle_a_00310_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00310_A3 { + Cycle_a_00310_A1 a1_0; + Cycle_a_00310_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +class Cycle_a_00310_A4 { + Cycle_a_00310_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A4(String strObjectName) { + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00310_A5 { + Cycle_a_00310_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00310_A6 { + Cycle_a_00310_A1 a1_0; + Cycle_a_00310_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + + +public class Cycle_a_00310 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00310_A1 a1_main = new Cycle_a_00310_A1("a1_main"); + Cycle_a_00310_A4 a4_main = new Cycle_a_00310_A4("a4_main"); + Cycle_a_00310_A6 a6_main = new Cycle_a_00310_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00310_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00310_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00310_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a4_0 = a4_main; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a6_main.a3_0.a5_0 = a1_main.a2_0.a3_0.a5_0; + a4_main.a6_0 = a6_main; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + + if (result == 1552) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0015-rc-function-Cycle_a_00320/Cycle_a_00320.java b/test/testsuite/ouroboros/memory_management/Function/RC0015-rc-function-Cycle_a_00320/Cycle_a_00320.java index 0fd47d3a9aa2071f1d50c1893de9dfbe67230cde..a51df8bbf68afb3e760667c3dc9b2085db13fba2 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0015-rc-function-Cycle_a_00320/Cycle_a_00320.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0015-rc-function-Cycle_a_00320/Cycle_a_00320.java @@ -1,193 +1,193 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00320.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00320 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00320.java - *- @ExecuteClass: Cycle_a_00320 - *- @ExecuteArgs: - * A1 depend A2 ; A4 depend A5 ; A6 depend A1 A3 A4; A6 depend A1 A3 A4; - * A2 depend A3; A3 depend A1 A5; A5 depend A6 ; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101+105)+(104+105)+(105+106)+(106+101+103+104)=1551 - * - */ - -class Cycle_a_00320_A1 { - Cycle_a_00320_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00320_A2 { - Cycle_a_00320_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00320_A3 { - Cycle_a_00320_A1 a1_0; - Cycle_a_00320_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -class Cycle_a_00320_A4 { - Cycle_a_00320_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - -class Cycle_a_00320_A5 { - Cycle_a_00320_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00320_A6 { - Cycle_a_00320_A1 a1_0; - Cycle_a_00320_A3 a3_0; - Cycle_a_00320_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } -} - - -public class Cycle_a_00320 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00320_A1 a1_main = new Cycle_a_00320_A1("a1_main"); - Cycle_a_00320_A4 a4_main = new Cycle_a_00320_A4("a4_main"); - Cycle_a_00320_A6 a6_main = new Cycle_a_00320_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00320_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00320_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00320_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a4_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - a6_main.a4_0 = a4_main; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - - if (result == 1551) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00320.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00320 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00320.java + *- @ExecuteClass: Cycle_a_00320 + *- @ExecuteArgs: + * A1 depend A2 ; A4 depend A5 ; A6 depend A1 A3 A4; A6 depend A1 A3 A4; + * A2 depend A3; A3 depend A1 A5; A5 depend A6 ; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101+105)+(104+105)+(105+106)+(106+101+103+104)=1551 + * + */ + +class Cycle_a_00320_A1 { + Cycle_a_00320_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00320_A2 { + Cycle_a_00320_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00320_A3 { + Cycle_a_00320_A1 a1_0; + Cycle_a_00320_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +class Cycle_a_00320_A4 { + Cycle_a_00320_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + +class Cycle_a_00320_A5 { + Cycle_a_00320_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00320_A6 { + Cycle_a_00320_A1 a1_0; + Cycle_a_00320_A3 a3_0; + Cycle_a_00320_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } +} + + +public class Cycle_a_00320 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00320_A1 a1_main = new Cycle_a_00320_A1("a1_main"); + Cycle_a_00320_A4 a4_main = new Cycle_a_00320_A4("a4_main"); + Cycle_a_00320_A6 a6_main = new Cycle_a_00320_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00320_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00320_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00320_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a4_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + a6_main.a4_0 = a4_main; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + + if (result == 1551) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0016-rc-function-Cycle_a_00330/Cycle_a_00330.java b/test/testsuite/ouroboros/memory_management/Function/RC0016-rc-function-Cycle_a_00330/Cycle_a_00330.java index 267c313d1f36ef1b1ec549bd50714ead1f52689b..a2b5ceba02b5387ada37c3f76dfc7e5094926836 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0016-rc-function-Cycle_a_00330/Cycle_a_00330.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0016-rc-function-Cycle_a_00330/Cycle_a_00330.java @@ -1,242 +1,242 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00330.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00330 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00330.java - *- @ExecuteClass: Cycle_a_00330 - *- @ExecuteArgs: - * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; - * A2 depend A3 A4; A3 depend A1 A5 A8; A5 depend A6 A8; - * A7 depend A3 ; A8 depend A7; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105)+(104+101)+(105+106+108)+(106+101+103)+(107+103)+(108+107)=2080 - * - */ - -class Cycle_a_00330_A1 { - Cycle_a_00330_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00330_A2 { - Cycle_a_00330_A3 a3_0; - Cycle_a_00330_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00330_A3 { - Cycle_a_00330_A1 a1_0; - Cycle_a_00330_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -class Cycle_a_00330_A4 { - Cycle_a_00330_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_00330_A5 { - Cycle_a_00330_A6 a6_0; - Cycle_a_00330_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } -} - -class Cycle_a_00330_A6 { - Cycle_a_00330_A1 a1_0; - Cycle_a_00330_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - - -class Cycle_a_00330_A7 { - Cycle_a_00330_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_a_00330_A8 { - Cycle_a_00330_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - - -public class Cycle_a_00330 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00330_A1 a1_main = new Cycle_a_00330_A1("a1_main"); - Cycle_a_00330_A4 a4_main = new Cycle_a_00330_A4("a4_main"); - Cycle_a_00330_A6 a6_main = new Cycle_a_00330_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00330_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00330_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00330_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00330_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00330_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_main.a2_0.a3_0; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - - if (result == 2080) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00330.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00330 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00330.java + *- @ExecuteClass: Cycle_a_00330 + *- @ExecuteArgs: + * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; + * A2 depend A3 A4; A3 depend A1 A5 A8; A5 depend A6 A8; + * A7 depend A3 ; A8 depend A7; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105)+(104+101)+(105+106+108)+(106+101+103)+(107+103)+(108+107)=2080 + * + */ + +class Cycle_a_00330_A1 { + Cycle_a_00330_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00330_A2 { + Cycle_a_00330_A3 a3_0; + Cycle_a_00330_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00330_A3 { + Cycle_a_00330_A1 a1_0; + Cycle_a_00330_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +class Cycle_a_00330_A4 { + Cycle_a_00330_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_00330_A5 { + Cycle_a_00330_A6 a6_0; + Cycle_a_00330_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } +} + +class Cycle_a_00330_A6 { + Cycle_a_00330_A1 a1_0; + Cycle_a_00330_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + + +class Cycle_a_00330_A7 { + Cycle_a_00330_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_a_00330_A8 { + Cycle_a_00330_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + + +public class Cycle_a_00330 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00330_A1 a1_main = new Cycle_a_00330_A1("a1_main"); + Cycle_a_00330_A4 a4_main = new Cycle_a_00330_A4("a4_main"); + Cycle_a_00330_A6 a6_main = new Cycle_a_00330_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00330_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00330_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00330_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00330_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00330_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_main.a2_0.a3_0; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + + if (result == 2080) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0017-rc-function-Cycle_a_00340/Cycle_a_00340.java b/test/testsuite/ouroboros/memory_management/Function/RC0017-rc-function-Cycle_a_00340/Cycle_a_00340.java index e39ed0d157f58acfbd1d6d8f9546d1c40e8df613..e4c5f827d0f0b828fe9be0d7ac72ef8059d6cfa0 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0017-rc-function-Cycle_a_00340/Cycle_a_00340.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0017-rc-function-Cycle_a_00340/Cycle_a_00340.java @@ -1,242 +1,242 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00340.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00340 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00340.java - *- @ExecuteClass: Cycle_a_00340 - *- @ExecuteArgs: - * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; - * A2 depend A3 A4; A3 depend A1 A5 A8; A5 depend A6; - * A7 depend A2 ; A8 depend A7; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105+108)+(104+101)+(105+106)+(106+101+103)+(107+102)+(108+107)=2079 - * - */ - -class Cycle_a_00340_A1 { - Cycle_a_00340_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00340_A2 { - Cycle_a_00340_A3 a3_0; - Cycle_a_00340_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00340_A3 { - Cycle_a_00340_A1 a1_0; - Cycle_a_00340_A5 a5_0; - Cycle_a_00340_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a8_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a8_0.a; - } -} - - -class Cycle_a_00340_A4 { - Cycle_a_00340_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_00340_A5 { - Cycle_a_00340_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00340_A6 { - Cycle_a_00340_A1 a1_0; - Cycle_a_00340_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - - -class Cycle_a_00340_A7 { - Cycle_a_00340_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_a_00340_A8 { - Cycle_a_00340_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - - -public class Cycle_a_00340 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00340_A1 a1_main = new Cycle_a_00340_A1("a1_main"); - Cycle_a_00340_A4 a4_main = new Cycle_a_00340_A4("a4_main"); - Cycle_a_00340_A6 a6_main = new Cycle_a_00340_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00340_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00340_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00340_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a2_0.a3_0.a8_0 = new Cycle_a_00340_A8("a8_0"); - a1_main.a2_0.a3_0.a8_0.a7_0 = new Cycle_a_00340_A7("a7_0"); - a1_main.a2_0.a3_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a8_0.add(); - a1_main.a2_0.a3_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a8_0.a7_0.sum + a6_main.a3_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 2079) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00340.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00340 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00340.java + *- @ExecuteClass: Cycle_a_00340 + *- @ExecuteArgs: + * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; + * A2 depend A3 A4; A3 depend A1 A5 A8; A5 depend A6; + * A7 depend A2 ; A8 depend A7; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105+108)+(104+101)+(105+106)+(106+101+103)+(107+102)+(108+107)=2079 + * + */ + +class Cycle_a_00340_A1 { + Cycle_a_00340_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00340_A2 { + Cycle_a_00340_A3 a3_0; + Cycle_a_00340_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00340_A3 { + Cycle_a_00340_A1 a1_0; + Cycle_a_00340_A5 a5_0; + Cycle_a_00340_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a8_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a8_0.a; + } +} + + +class Cycle_a_00340_A4 { + Cycle_a_00340_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_00340_A5 { + Cycle_a_00340_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00340_A6 { + Cycle_a_00340_A1 a1_0; + Cycle_a_00340_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + + +class Cycle_a_00340_A7 { + Cycle_a_00340_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_a_00340_A8 { + Cycle_a_00340_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + + +public class Cycle_a_00340 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00340_A1 a1_main = new Cycle_a_00340_A1("a1_main"); + Cycle_a_00340_A4 a4_main = new Cycle_a_00340_A4("a4_main"); + Cycle_a_00340_A6 a6_main = new Cycle_a_00340_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00340_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00340_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00340_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a2_0.a3_0.a8_0 = new Cycle_a_00340_A8("a8_0"); + a1_main.a2_0.a3_0.a8_0.a7_0 = new Cycle_a_00340_A7("a7_0"); + a1_main.a2_0.a3_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a8_0.add(); + a1_main.a2_0.a3_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a8_0.a7_0.sum + a6_main.a3_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 2079) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0018-rc-function-Cycle_a_00350/Cycle_a_00350.java b/test/testsuite/ouroboros/memory_management/Function/RC0018-rc-function-Cycle_a_00350/Cycle_a_00350.java index af396692b83e0dd78afb0113ae64b77625a31736..46bb44c0064d875951503882e92aeed864e3be81 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0018-rc-function-Cycle_a_00350/Cycle_a_00350.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0018-rc-function-Cycle_a_00350/Cycle_a_00350.java @@ -1,224 +1,224 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00350.java - * -@TestCaseName:MyselfClassName - * -@RequirementName:[运行时需求]支持自动内存管理 - * -@Title/Destination: Cycle_a_00350 in RC测试-Cycle-01 - * -@Brief:functionTest - * -@Expect:ExpectResult\nExpectResult\n - * -@Priority: High - * -@Source: Cycle_a_00350.java - * -@ExecuteClass: Cycle_a_00350 - * -@ExecuteArgs: - * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; - * A2 depend A3 A4; A3 depend A1 A5; A5 depend A6 A8; - * A7 depend A2 ; A8 depend A7; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105)+(104+101)+(105+106+108)+(106+101+103)+(107+102)+(108+107)=2079 - */ - -class Cycle_a_00350_A1 { - Cycle_a_00350_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00350_A2 { - Cycle_a_00350_A3 a3_0; - Cycle_a_00350_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00350_A3 { - Cycle_a_00350_A1 a1_0; - Cycle_a_00350_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - -class Cycle_a_00350_A4 { - Cycle_a_00350_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_00350_A5 { - Cycle_a_00350_A6 a6_0; - Cycle_a_00350_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } -} - -class Cycle_a_00350_A6 { - Cycle_a_00350_A1 a1_0; - Cycle_a_00350_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - -class Cycle_a_00350_A7 { - Cycle_a_00350_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00350_A8 { - Cycle_a_00350_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a7_0.a; - } -} - -public class Cycle_a_00350 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00350_A1 a1_main = new Cycle_a_00350_A1("a1_main"); - Cycle_a_00350_A4 a4_main = new Cycle_a_00350_A4("a4_main"); - Cycle_a_00350_A6 a6_main = new Cycle_a_00350_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00350_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00350_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00350_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00350_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00350_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum - + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - if (result == 2079) { - System.out.println("ExpectResult"); - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00350.java + * -@TestCaseName:MyselfClassName + * -@RequirementName:[运行时需求]支持自动内存管理 + * -@Title/Destination: Cycle_a_00350 in RC测试-Cycle-01 + * -@Brief:functionTest + * -@Expect:ExpectResult\nExpectResult\n + * -@Priority: High + * -@Source: Cycle_a_00350.java + * -@ExecuteClass: Cycle_a_00350 + * -@ExecuteArgs: + * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; + * A2 depend A3 A4; A3 depend A1 A5; A5 depend A6 A8; + * A7 depend A2 ; A8 depend A7; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105)+(104+101)+(105+106+108)+(106+101+103)+(107+102)+(108+107)=2079 + */ + +class Cycle_a_00350_A1 { + Cycle_a_00350_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00350_A2 { + Cycle_a_00350_A3 a3_0; + Cycle_a_00350_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00350_A3 { + Cycle_a_00350_A1 a1_0; + Cycle_a_00350_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + +class Cycle_a_00350_A4 { + Cycle_a_00350_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_00350_A5 { + Cycle_a_00350_A6 a6_0; + Cycle_a_00350_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } +} + +class Cycle_a_00350_A6 { + Cycle_a_00350_A1 a1_0; + Cycle_a_00350_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + +class Cycle_a_00350_A7 { + Cycle_a_00350_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00350_A8 { + Cycle_a_00350_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a7_0.a; + } +} + +public class Cycle_a_00350 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00350_A1 a1_main = new Cycle_a_00350_A1("a1_main"); + Cycle_a_00350_A4 a4_main = new Cycle_a_00350_A4("a4_main"); + Cycle_a_00350_A6 a6_main = new Cycle_a_00350_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00350_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00350_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00350_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00350_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00350_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + if (result == 2079) { + System.out.println("ExpectResult"); + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0019-rc-function-Cycle_a_00360/Cycle_a_00360.java b/test/testsuite/ouroboros/memory_management/Function/RC0019-rc-function-Cycle_a_00360/Cycle_a_00360.java index f2fb95d484c1b16b56d5c26b1af99f4bd1759953..957b72545452c6aae59843d481e2dd307d3c20a1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0019-rc-function-Cycle_a_00360/Cycle_a_00360.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0019-rc-function-Cycle_a_00360/Cycle_a_00360.java @@ -1,269 +1,269 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00360.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00360 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00360.java - *- @ExecuteClass: Cycle_a_00360 - *- @ExecuteArgs: - * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; - * A2 depend A3 A4; A3 depend A1 A5; A5 depend A6 A8 A9; - * A7 depend A2 ; A8 depend A7; - * A9 depend A2 ; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105)+(104+101)+(105+106+108+109)+(106+101+103)+(107+102)+(108+107)+(109+102)=2399 - * - */ - -class Cycle_a_00360_A1 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00360_A2 { - Cycle_a_00360_A3 a3_0; - Cycle_a_00360_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00360_A3 { - Cycle_a_00360_A1 a1_0; - Cycle_a_00360_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -class Cycle_a_00360_A4 { - Cycle_a_00360_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_00360_A5 { - Cycle_a_00360_A6 a6_0; - Cycle_a_00360_A8 a8_0; - Cycle_a_00360_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a9_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a + a9_0.a; - } -} - -class Cycle_a_00360_A6 { - Cycle_a_00360_A1 a1_0; - Cycle_a_00360_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - - -class Cycle_a_00360_A7 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_a_00360_A8 { - Cycle_a_00360_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - - -class Cycle_a_00360_A9 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A9(String strObjectName) { - a2_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -public class Cycle_a_00360 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00360_A1 a1_main = new Cycle_a_00360_A1("a1_main"); - Cycle_a_00360_A4 a4_main = new Cycle_a_00360_A4("a4_main"); - Cycle_a_00360_A6 a6_main = new Cycle_a_00360_A6("a6_main"); - Cycle_a_00360_A9 a9_main = new Cycle_a_00360_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_00360_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00360_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00360_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00360_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00360_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a5_0.a9_0 = a9_main; - a9_main.a2_0 = a1_main.a2_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 2399) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00360.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00360 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00360.java + *- @ExecuteClass: Cycle_a_00360 + *- @ExecuteArgs: + * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; + * A2 depend A3 A4; A3 depend A1 A5; A5 depend A6 A8 A9; + * A7 depend A2 ; A8 depend A7; + * A9 depend A2 ; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105)+(104+101)+(105+106+108+109)+(106+101+103)+(107+102)+(108+107)+(109+102)=2399 + * + */ + +class Cycle_a_00360_A1 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00360_A2 { + Cycle_a_00360_A3 a3_0; + Cycle_a_00360_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00360_A3 { + Cycle_a_00360_A1 a1_0; + Cycle_a_00360_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +class Cycle_a_00360_A4 { + Cycle_a_00360_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_00360_A5 { + Cycle_a_00360_A6 a6_0; + Cycle_a_00360_A8 a8_0; + Cycle_a_00360_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a9_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a + a9_0.a; + } +} + +class Cycle_a_00360_A6 { + Cycle_a_00360_A1 a1_0; + Cycle_a_00360_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + + +class Cycle_a_00360_A7 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_a_00360_A8 { + Cycle_a_00360_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + + +class Cycle_a_00360_A9 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A9(String strObjectName) { + a2_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +public class Cycle_a_00360 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00360_A1 a1_main = new Cycle_a_00360_A1("a1_main"); + Cycle_a_00360_A4 a4_main = new Cycle_a_00360_A4("a4_main"); + Cycle_a_00360_A6 a6_main = new Cycle_a_00360_A6("a6_main"); + Cycle_a_00360_A9 a9_main = new Cycle_a_00360_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_00360_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00360_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00360_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00360_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00360_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a5_0.a9_0 = a9_main; + a9_main.a2_0 = a1_main.a2_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 2399) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0020-rc-function-Cycle_a_00370/Cycle_a_00370.java b/test/testsuite/ouroboros/memory_management/Function/RC0020-rc-function-Cycle_a_00370/Cycle_a_00370.java index f3e57645f9d497223beea42d933250102a92e366..d9d4692b57b86cb005dd1ebec509995ba8153c60 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0020-rc-function-Cycle_a_00370/Cycle_a_00370.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0020-rc-function-Cycle_a_00370/Cycle_a_00370.java @@ -1,289 +1,289 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00370.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00370 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00370.java - *- @ExecuteClass: Cycle_a_00370 - *- @ExecuteArgs: - * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; - * A2 depend A3 A4; A3 depend A1 A5 A10; A5 depend A6 A8 - * A7 depend A2 ; A8 depend A7; - * A8 depend A6 ; A10 depend A9; - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 A10.a=1001 - * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105+110)+(104+101)+(105+106+108)+(106+101+103)+(107+102)+(108+107)+(109+106)+(110+109)=2623 - * - */ - -class Cycle_a_00370_A1 { - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00370_A2 { - Cycle_a_00370_A3 a3_0; - Cycle_a_00370_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00370_A3 { - Cycle_a_00370_A1 a1_0; - Cycle_a_00370_A5 a5_0; - Cycle_a_00370_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a10_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a10_0.a; - } -} - - -class Cycle_a_00370_A4 { - Cycle_a_00370_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_00370_A5 { - Cycle_a_00370_A6 a6_0; - Cycle_a_00370_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } -} - -class Cycle_a_00370_A6 { - Cycle_a_00370_A1 a1_0; - Cycle_a_00370_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - - -class Cycle_a_00370_A7 { - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_a_00370_A8 { - Cycle_a_00370_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - - -class Cycle_a_00370_A9 { - Cycle_a_00370_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A9(String strObjectName) { - a6_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00370_A10 { - Cycle_a_00370_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A10(String strObjectName) { - a9_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } -} - -public class Cycle_a_00370 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); - Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); - Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); - Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); - a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; - a9_main.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a10_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 2623) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00370.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00370 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00370.java + *- @ExecuteClass: Cycle_a_00370 + *- @ExecuteArgs: + * A1 depend A2 ; A4 depend A1 ; A6 depend A1 A3; + * A2 depend A3 A4; A3 depend A1 A5 A10; A5 depend A6 A8 + * A7 depend A2 ; A8 depend A7; + * A8 depend A6 ; A10 depend A9; + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 A10.a=1001 + * RC-Testing_Result=(101+102)+(102+103+104)+(103+101+105+110)+(104+101)+(105+106+108)+(106+101+103)+(107+102)+(108+107)+(109+106)+(110+109)=2623 + * + */ + +class Cycle_a_00370_A1 { + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00370_A2 { + Cycle_a_00370_A3 a3_0; + Cycle_a_00370_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00370_A3 { + Cycle_a_00370_A1 a1_0; + Cycle_a_00370_A5 a5_0; + Cycle_a_00370_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a10_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a10_0.a; + } +} + + +class Cycle_a_00370_A4 { + Cycle_a_00370_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_00370_A5 { + Cycle_a_00370_A6 a6_0; + Cycle_a_00370_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } +} + +class Cycle_a_00370_A6 { + Cycle_a_00370_A1 a1_0; + Cycle_a_00370_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + + +class Cycle_a_00370_A7 { + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_a_00370_A8 { + Cycle_a_00370_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + + +class Cycle_a_00370_A9 { + Cycle_a_00370_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A9(String strObjectName) { + a6_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00370_A10 { + Cycle_a_00370_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A10(String strObjectName) { + a9_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } +} + +public class Cycle_a_00370 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); + Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); + Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); + Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); + a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; + a9_main.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a10_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 2623) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0021-rc-function-Cycle_a_00380/Cycle_a_00380.java b/test/testsuite/ouroboros/memory_management/Function/RC0021-rc-function-Cycle_a_00380/Cycle_a_00380.java index b1f0ebbc4e48db94c4588958c4a2814b55b4c5e5..407f83b3345f8edeefa3262c66c8738ad9abbd37 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0021-rc-function-Cycle_a_00380/Cycle_a_00380.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0021-rc-function-Cycle_a_00380/Cycle_a_00380.java @@ -1,124 +1,124 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00380.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00380 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00380.java - *- @ExecuteClass: Cycle_a_00380 - *- @ExecuteArgs: - * A1 depend A2 A3; A2 depend A1 A3; A3 depend A1 - * A1.a=101 A2.a=102 A3.a=103 - * RC-Testing_Result=(101+102)+(102+101+103)+(103++101+102)=815 - * - */ - -class Cycle_a_00380_A1 { - Cycle_a_00380_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00380_A2 { - Cycle_a_00380_A1 a1_0; - Cycle_a_00380_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - -class Cycle_a_00380_A3 { - Cycle_a_00380_A1 a1_0; - Cycle_a_00380_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } -} - - -public class Cycle_a_00380 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00380_A1 a1_main = new Cycle_a_00380_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00380_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00380_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 815) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00380.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00380 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00380.java + *- @ExecuteClass: Cycle_a_00380 + *- @ExecuteArgs: + * A1 depend A2 A3; A2 depend A1 A3; A3 depend A1 + * A1.a=101 A2.a=102 A3.a=103 + * RC-Testing_Result=(101+102)+(102+101+103)+(103++101+102)=815 + * + */ + +class Cycle_a_00380_A1 { + Cycle_a_00380_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00380_A2 { + Cycle_a_00380_A1 a1_0; + Cycle_a_00380_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + +class Cycle_a_00380_A3 { + Cycle_a_00380_A1 a1_0; + Cycle_a_00380_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } +} + + +public class Cycle_a_00380 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00380_A1 a1_main = new Cycle_a_00380_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00380_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00380_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 815) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0022-rc-function-Cycle_a_00390/Cycle_a_00390.java b/test/testsuite/ouroboros/memory_management/Function/RC0022-rc-function-Cycle_a_00390/Cycle_a_00390.java index 69f7e5f237f23d2bd0eb141b419ec0fac8140bcb..e85d92141a68111791b2ec9a2ef80caf9473fdba 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0022-rc-function-Cycle_a_00390/Cycle_a_00390.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0022-rc-function-Cycle_a_00390/Cycle_a_00390.java @@ -1,127 +1,127 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00390.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00390 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00390.java - *- @ExecuteClass: Cycle_a_00390 - *- @ExecuteArgs: - * A1 depend A2 A3; A2 depend A1 A3; A3 depend A1 A2 - * A1.a=101 A2.a=102 A3.a=103 - * RC-Testing_Result=(101+102+103)+(102+101+103)+(103+101+102)=918 - * - */ - -class Cycle_a_00390_A1 { - Cycle_a_00390_A2 a2_0; - Cycle_a_00390_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } -} - -class Cycle_a_00390_A2 { - Cycle_a_00390_A1 a1_0; - Cycle_a_00390_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - -class Cycle_a_00390_A3 { - Cycle_a_00390_A1 a1_0; - Cycle_a_00390_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } -} - - -public class Cycle_a_00390 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00390_A1 a1_main = new Cycle_a_00390_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00390_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00390_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 918) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00390.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00390 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00390.java + *- @ExecuteClass: Cycle_a_00390 + *- @ExecuteArgs: + * A1 depend A2 A3; A2 depend A1 A3; A3 depend A1 A2 + * A1.a=101 A2.a=102 A3.a=103 + * RC-Testing_Result=(101+102+103)+(102+101+103)+(103+101+102)=918 + * + */ + +class Cycle_a_00390_A1 { + Cycle_a_00390_A2 a2_0; + Cycle_a_00390_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } +} + +class Cycle_a_00390_A2 { + Cycle_a_00390_A1 a1_0; + Cycle_a_00390_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + +class Cycle_a_00390_A3 { + Cycle_a_00390_A1 a1_0; + Cycle_a_00390_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } +} + + +public class Cycle_a_00390 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00390_A1 a1_main = new Cycle_a_00390_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00390_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00390_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 918) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0023-rc-function-Cycle_a_00400/Cycle_a_00400.java b/test/testsuite/ouroboros/memory_management/Function/RC0023-rc-function-Cycle_a_00400/Cycle_a_00400.java index d463dc417ebc9d0b457f4a5c3f5010945d6fdfe3..e68a05b59897597635484512943fa9149fe0f250 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0023-rc-function-Cycle_a_00400/Cycle_a_00400.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0023-rc-function-Cycle_a_00400/Cycle_a_00400.java @@ -1,142 +1,142 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00400.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00400 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00400.java - *- @ExecuteClass: Cycle_a_00400 - *- @ExecuteArgs: - * A1 depend A2 A4; A2 depend A3; A3 depend A1 ; A4 depend A3 - * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 A7.a=107 - * RC-Testing_Result=(101+102+104)+(102+103)+(103+101)+(104+103)=923 - * - */ - -class Cycle_a_00400_A1 { - Cycle_a_00400_A2 a2_0; - Cycle_a_00400_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } -} - -class Cycle_a_00400_A2 { - Cycle_a_00400_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00400_A3 { - Cycle_a_00400_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_a_00400_A4 { - Cycle_a_00400_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -public class Cycle_a_00400 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00400_A1 a1_main = new Cycle_a_00400_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00400_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00400_A3("a3_0"); - a1_main.a4_0 = new Cycle_a_00400_A4("a4_0"); - a1_main.a4_0.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 923) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00400.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00400 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00400.java + *- @ExecuteClass: Cycle_a_00400 + *- @ExecuteArgs: + * A1 depend A2 A4; A2 depend A3; A3 depend A1 ; A4 depend A3 + * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 A7.a=107 + * RC-Testing_Result=(101+102+104)+(102+103)+(103+101)+(104+103)=923 + * + */ + +class Cycle_a_00400_A1 { + Cycle_a_00400_A2 a2_0; + Cycle_a_00400_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } +} + +class Cycle_a_00400_A2 { + Cycle_a_00400_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00400_A3 { + Cycle_a_00400_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_a_00400_A4 { + Cycle_a_00400_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +public class Cycle_a_00400 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00400_A1 a1_main = new Cycle_a_00400_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00400_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00400_A3("a3_0"); + a1_main.a4_0 = new Cycle_a_00400_A4("a4_0"); + a1_main.a4_0.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 923) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0024-rc-function-Cycle_a_00410/Cycle_a_00410.java b/test/testsuite/ouroboros/memory_management/Function/RC0024-rc-function-Cycle_a_00410/Cycle_a_00410.java index b7e119ce7138272f197f6d90fe951d2b18fccb04..66242da7a0cc99207c9fd4be5e7ecfdcc44e70b7 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0024-rc-function-Cycle_a_00410/Cycle_a_00410.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0024-rc-function-Cycle_a_00410/Cycle_a_00410.java @@ -1,142 +1,142 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00410.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00410 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00410.java - *- @ExecuteClass: Cycle_a_00410 - *- @ExecuteArgs: - * A1 depend A2 ; A2 depend A3 A4; A3 depend A1 ; A4 depend A1 - * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 A7.a=107 - * RC-Testing_Result=(101+102)+(102++103+104)+(103+101)+(104+101)=921 - * - */ - -class Cycle_a_00410_A1 { - Cycle_a_00410_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00410_A2 { - Cycle_a_00410_A3 a3_0; - Cycle_a_00410_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00410_A3 { - Cycle_a_00410_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_a_00410_A4 { - Cycle_a_00410_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -public class Cycle_a_00410 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00410_A1 a1_main = new Cycle_a_00410_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00410_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00410_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00410_A4("a4_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 921) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00410.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00410 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00410.java + *- @ExecuteClass: Cycle_a_00410 + *- @ExecuteArgs: + * A1 depend A2 ; A2 depend A3 A4; A3 depend A1 ; A4 depend A1 + * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 A7.a=107 + * RC-Testing_Result=(101+102)+(102++103+104)+(103+101)+(104+101)=921 + * + */ + +class Cycle_a_00410_A1 { + Cycle_a_00410_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00410_A2 { + Cycle_a_00410_A3 a3_0; + Cycle_a_00410_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00410_A3 { + Cycle_a_00410_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_a_00410_A4 { + Cycle_a_00410_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +public class Cycle_a_00410 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00410_A1 a1_main = new Cycle_a_00410_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00410_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00410_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00410_A4("a4_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 921) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0025-rc-function-Cycle_a_00420/Cycle_a_00420.java b/test/testsuite/ouroboros/memory_management/Function/RC0025-rc-function-Cycle_a_00420/Cycle_a_00420.java index 18f77d526de9cd8e7db9b5bf809209aa0fde5c92..44c411f1c9c09666f33ffd6b585000ab4e092f68 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0025-rc-function-Cycle_a_00420/Cycle_a_00420.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0025-rc-function-Cycle_a_00420/Cycle_a_00420.java @@ -1,141 +1,141 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00420.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00420 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00420.java - *- @ExecuteClass: Cycle_a_00420 - *- @ExecuteArgs: - * A1 depend A2 A3 ; A2 depend A3 ; A3 depend A4 ; A4 depend A1 - * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 A7.a=107 - * RC-Testing_Result=(101+102+103)+(102+103)+(103+104)+(104+101)=923 - * - */ - -class Cycle_a_00420_A1 { - Cycle_a_00420_A2 a2_0; - Cycle_a_00420_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } -} - -class Cycle_a_00420_A2 { - Cycle_a_00420_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00420_A3 { - Cycle_a_00420_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_a_00420_A4 { - Cycle_a_00420_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -public class Cycle_a_00420 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00420_A1 a1_main = new Cycle_a_00420_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00420_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00420_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00420_A4("a4_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum; - if (result == 923) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00420.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00420 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00420.java + *- @ExecuteClass: Cycle_a_00420 + *- @ExecuteArgs: + * A1 depend A2 A3 ; A2 depend A3 ; A3 depend A4 ; A4 depend A1 + * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 A7.a=107 + * RC-Testing_Result=(101+102+103)+(102+103)+(103+104)+(104+101)=923 + * + */ + +class Cycle_a_00420_A1 { + Cycle_a_00420_A2 a2_0; + Cycle_a_00420_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } +} + +class Cycle_a_00420_A2 { + Cycle_a_00420_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00420_A3 { + Cycle_a_00420_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_a_00420_A4 { + Cycle_a_00420_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +public class Cycle_a_00420 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00420_A1 a1_main = new Cycle_a_00420_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00420_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00420_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00420_A4("a4_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum; + if (result == 923) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0026-rc-function-Cycle_a_00430/Cycle_a_00430.java b/test/testsuite/ouroboros/memory_management/Function/RC0026-rc-function-Cycle_a_00430/Cycle_a_00430.java index e49b858fbde7a507c7d72bc0e9de0f2bcdfe0c47..8fcc3ec97ea16ae218dcca7df8a0d6ea0e564b05 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0026-rc-function-Cycle_a_00430/Cycle_a_00430.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0026-rc-function-Cycle_a_00430/Cycle_a_00430.java @@ -1,149 +1,149 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00430.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00430 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00430.java - *- @ExecuteClass: Cycle_a_00430 - *- @ExecuteArgs: - * A1 depend A2 ; A2 depend A1 A3 A4 ; A3 depend A1 ; A4 depend A1 A2 - * A1.a=101 A2.a=102 A3.a=103 ... A4.a=104 - * RC-Testing_Result=(101+102)+(102+101+103+104)+(103+101)+(104+101+102)=1124 - * - */ - -class Cycle_a_00430_A1 { - Cycle_a_00430_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00430_A2 { - Cycle_a_00430_A1 a1_0; - Cycle_a_00430_A3 a3_0; - Cycle_a_00430_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00430_A3 { - Cycle_a_00430_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_a_00430_A4 { - Cycle_a_00430_A1 a1_0; - Cycle_a_00430_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A4(String strObjectName) { - a2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } -} - - -public class Cycle_a_00430 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00430_A1 a1_main = new Cycle_a_00430_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00430_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00430_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00430_A4("a4_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a4_0.a1_0 = a1_main; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 1124) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00430.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00430 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00430.java + *- @ExecuteClass: Cycle_a_00430 + *- @ExecuteArgs: + * A1 depend A2 ; A2 depend A1 A3 A4 ; A3 depend A1 ; A4 depend A1 A2 + * A1.a=101 A2.a=102 A3.a=103 ... A4.a=104 + * RC-Testing_Result=(101+102)+(102+101+103+104)+(103+101)+(104+101+102)=1124 + * + */ + +class Cycle_a_00430_A1 { + Cycle_a_00430_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00430_A2 { + Cycle_a_00430_A1 a1_0; + Cycle_a_00430_A3 a3_0; + Cycle_a_00430_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00430_A3 { + Cycle_a_00430_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_a_00430_A4 { + Cycle_a_00430_A1 a1_0; + Cycle_a_00430_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A4(String strObjectName) { + a2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } +} + + +public class Cycle_a_00430 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00430_A1 a1_main = new Cycle_a_00430_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00430_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00430_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00430_A4("a4_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a4_0.a1_0 = a1_main; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 1124) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0027-rc-function-Cycle_a_00440/Cycle_a_00440.java b/test/testsuite/ouroboros/memory_management/Function/RC0027-rc-function-Cycle_a_00440/Cycle_a_00440.java index 9f691a4168aefae8434b82919c855bc0247c4a78..28ade132e00850fcd8468efb737e1dfab0807659 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0027-rc-function-Cycle_a_00440/Cycle_a_00440.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0027-rc-function-Cycle_a_00440/Cycle_a_00440.java @@ -1,142 +1,142 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00440.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00440 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00440.java - *- @ExecuteClass: Cycle_a_00440 - *- @ExecuteArgs: - * A1 depend A2 ; A2 depend A1 A3 A4 ; A3 depend A1 ; A4 depend A2 - * A1.a=101 A2.a=102 A3.a=103 ... A4.a=104 - * RC-Testing_Result=(101+102)+(102+101+103+104)+(103+101)+(104+102)=1023 - * - */ - -class Cycle_a_00440_A1 { - Cycle_a_00440_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00440_A2 { - Cycle_a_00440_A1 a1_0; - Cycle_a_00440_A3 a3_0; - Cycle_a_00440_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_00440_A3 { - Cycle_a_00440_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_a_00440_A4 { - Cycle_a_00440_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A4(String strObjectName) { - a2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -public class Cycle_a_00440 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00440_A1 a1_main = new Cycle_a_00440_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00440_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00440_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00440_A4("a4_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - if (result == 1023) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00440.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00440 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00440.java + *- @ExecuteClass: Cycle_a_00440 + *- @ExecuteArgs: + * A1 depend A2 ; A2 depend A1 A3 A4 ; A3 depend A1 ; A4 depend A2 + * A1.a=101 A2.a=102 A3.a=103 ... A4.a=104 + * RC-Testing_Result=(101+102)+(102+101+103+104)+(103+101)+(104+102)=1023 + * + */ + +class Cycle_a_00440_A1 { + Cycle_a_00440_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00440_A2 { + Cycle_a_00440_A1 a1_0; + Cycle_a_00440_A3 a3_0; + Cycle_a_00440_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_00440_A3 { + Cycle_a_00440_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_a_00440_A4 { + Cycle_a_00440_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A4(String strObjectName) { + a2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +public class Cycle_a_00440 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00440_A1 a1_main = new Cycle_a_00440_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00440_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00440_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00440_A4("a4_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + if (result == 1023) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0028-rc-function-Cycle_a_00450/Cycle_a_00450.java b/test/testsuite/ouroboros/memory_management/Function/RC0028-rc-function-Cycle_a_00450/Cycle_a_00450.java index ee2d31ba944764b8d49af47abb15aba996e53617..c77c4fb4d9ee8b9a286b87e34968f4f9288d8059 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0028-rc-function-Cycle_a_00450/Cycle_a_00450.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0028-rc-function-Cycle_a_00450/Cycle_a_00450.java @@ -1,189 +1,189 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00450.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00450 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00450.java - *- @ExecuteClass: Cycle_a_00450 - *- @ExecuteArgs: - * A1 depend A2 ; A2 depend A3 ; A3 depend A1 A5 ; A5 depend A6 A7 - * A6 depend A3 ; A7 depend A2 - * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 A7.a=107 - * RC-Testing_Result=(101+102)+(102+103)+(103+101+105)+(105+106+107)+(106+103)+(107+102)=1453 - * - */ - -class Cycle_a_00450_A1 { - Cycle_a_00450_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00450_A2 { - Cycle_a_00450_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00450_A3 { - Cycle_a_00450_A1 a1_0; - Cycle_a_00450_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -class Cycle_a_00450_A5 { - Cycle_a_00450_A6 a6_0; - Cycle_a_00450_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A5(String strObjectName) { - a6_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a7_0.a; - } -} - -class Cycle_a_00450_A6 { - Cycle_a_00450_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00450_A7 { - Cycle_a_00450_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -public class Cycle_a_00450 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00450_A1 a1_main = new Cycle_a_00450_A1("a1_main"); - Cycle_a_00450_A6 a6_main = new Cycle_a_00450_A6("a6_main"); - Cycle_a_00450_A7 a7_main = new Cycle_a_00450_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00450_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00450_A3("a3_0"); - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00450_A5("a5_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = a7_main; - a7_main.a2_0 = a1_main.a2_0; - - a1_main.add(); - a6_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - int result = a1_main.sum + a6_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - if (result == 1453) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00450.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00450 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00450.java + *- @ExecuteClass: Cycle_a_00450 + *- @ExecuteArgs: + * A1 depend A2 ; A2 depend A3 ; A3 depend A1 A5 ; A5 depend A6 A7 + * A6 depend A3 ; A7 depend A2 + * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 A7.a=107 + * RC-Testing_Result=(101+102)+(102+103)+(103+101+105)+(105+106+107)+(106+103)+(107+102)=1453 + * + */ + +class Cycle_a_00450_A1 { + Cycle_a_00450_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00450_A2 { + Cycle_a_00450_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00450_A3 { + Cycle_a_00450_A1 a1_0; + Cycle_a_00450_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +class Cycle_a_00450_A5 { + Cycle_a_00450_A6 a6_0; + Cycle_a_00450_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A5(String strObjectName) { + a6_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a7_0.a; + } +} + +class Cycle_a_00450_A6 { + Cycle_a_00450_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00450_A7 { + Cycle_a_00450_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +public class Cycle_a_00450 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00450_A1 a1_main = new Cycle_a_00450_A1("a1_main"); + Cycle_a_00450_A6 a6_main = new Cycle_a_00450_A6("a6_main"); + Cycle_a_00450_A7 a7_main = new Cycle_a_00450_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00450_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00450_A3("a3_0"); + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00450_A5("a5_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = a7_main; + a7_main.a2_0 = a1_main.a2_0; + + a1_main.add(); + a6_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + int result = a1_main.sum + a6_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + if (result == 1453) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0029-rc-function-Cycle_a_00460/Cycle_a_00460.java b/test/testsuite/ouroboros/memory_management/Function/RC0029-rc-function-Cycle_a_00460/Cycle_a_00460.java index 9b23275293c51d7e35b20b1b729ebafb15d70a6d..385ac6779e44b2018e5ff3dc65ad2f79d64db680 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0029-rc-function-Cycle_a_00460/Cycle_a_00460.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0029-rc-function-Cycle_a_00460/Cycle_a_00460.java @@ -1,194 +1,194 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00460.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00460 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00460.java - *- @ExecuteClass: Cycle_a_00460 - *- @ExecuteArgs: - * A1 depend A2 A4 ; A2 depend A3 ; A3 depend A4 ; A4 depend A1 A6 - * A5 depend A3 ; A6 depend A1 A5 - * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 - * RC-Testing_Result=(101+102+104)+(102+103)+(103+104)+(104+106+101)+(105+103)+(106+105+101)=1550 - * - */ - -class Cycle_a_00460_A1 { - Cycle_a_00460_A2 a2_0; - Cycle_a_00460_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } -} - -class Cycle_a_00460_A2 { - Cycle_a_00460_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00460_A3 { - Cycle_a_00460_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_a_00460_A4 { - Cycle_a_00460_A1 a1_0; - Cycle_a_00460_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } -} - -class Cycle_a_00460_A5 { - Cycle_a_00460_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00460_A6 { - Cycle_a_00460_A1 a1_0; - Cycle_a_00460_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A6(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -public class Cycle_a_00460 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00460_A1 a1_main = new Cycle_a_00460_A1("a1_main"); - Cycle_a_00460_A5 a5_main = new Cycle_a_00460_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00460_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00460_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00460_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00460_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; - - a5_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 1550) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00460.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00460 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00460.java + *- @ExecuteClass: Cycle_a_00460 + *- @ExecuteArgs: + * A1 depend A2 A4 ; A2 depend A3 ; A3 depend A4 ; A4 depend A1 A6 + * A5 depend A3 ; A6 depend A1 A5 + * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 + * RC-Testing_Result=(101+102+104)+(102+103)+(103+104)+(104+106+101)+(105+103)+(106+105+101)=1550 + * + */ + +class Cycle_a_00460_A1 { + Cycle_a_00460_A2 a2_0; + Cycle_a_00460_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } +} + +class Cycle_a_00460_A2 { + Cycle_a_00460_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00460_A3 { + Cycle_a_00460_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_a_00460_A4 { + Cycle_a_00460_A1 a1_0; + Cycle_a_00460_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } +} + +class Cycle_a_00460_A5 { + Cycle_a_00460_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00460_A6 { + Cycle_a_00460_A1 a1_0; + Cycle_a_00460_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A6(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +public class Cycle_a_00460 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00460_A1 a1_main = new Cycle_a_00460_A1("a1_main"); + Cycle_a_00460_A5 a5_main = new Cycle_a_00460_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00460_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00460_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00460_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00460_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; + + a5_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 1550) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0030-rc-function-Cycle_a_00470/Cycle_a_00470.java b/test/testsuite/ouroboros/memory_management/Function/RC0030-rc-function-Cycle_a_00470/Cycle_a_00470.java index 8ede5859b6b2291909dc58ce999519f5a3d1c6ad..1ab1d81e8871672367824d2c1e69b9890b2eb9ba 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0030-rc-function-Cycle_a_00470/Cycle_a_00470.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0030-rc-function-Cycle_a_00470/Cycle_a_00470.java @@ -1,189 +1,189 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00470.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00470 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00470.java - *- @ExecuteClass: Cycle_a_00470 - *- @ExecuteArgs: - * A1 depend A2 ; A2 depend A3 ; A3 depend A4 ; A4 depend A1 A6 - * A5 depend A3 A1 ; A6 depend A5 - * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 - * RC-Testing_Result=(101+102)+(102+103)+(103+104)+(104+106+101)+(105+103+101)+(106+105)=1446 - * - */ - -class Cycle_a_00470_A1 { - Cycle_a_00470_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00470_A2 { - Cycle_a_00470_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00470_A3 { - Cycle_a_00470_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_a_00470_A4 { - Cycle_a_00470_A1 a1_0; - Cycle_a_00470_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } -} - -class Cycle_a_00470_A5 { - Cycle_a_00470_A1 a1_0; - Cycle_a_00470_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A5(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - -class Cycle_a_00470_A6 { - Cycle_a_00470_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A6(String strObjectName) { - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - - -public class Cycle_a_00470 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00470_A1 a1_main = new Cycle_a_00470_A1("a1_main"); - Cycle_a_00470_A5 a5_main = new Cycle_a_00470_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00470_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00470_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00470_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00470_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a1_0 = a1_main; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - if (result == 1446) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00470.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00470 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00470.java + *- @ExecuteClass: Cycle_a_00470 + *- @ExecuteArgs: + * A1 depend A2 ; A2 depend A3 ; A3 depend A4 ; A4 depend A1 A6 + * A5 depend A3 A1 ; A6 depend A5 + * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 + * RC-Testing_Result=(101+102)+(102+103)+(103+104)+(104+106+101)+(105+103+101)+(106+105)=1446 + * + */ + +class Cycle_a_00470_A1 { + Cycle_a_00470_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00470_A2 { + Cycle_a_00470_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00470_A3 { + Cycle_a_00470_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_a_00470_A4 { + Cycle_a_00470_A1 a1_0; + Cycle_a_00470_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } +} + +class Cycle_a_00470_A5 { + Cycle_a_00470_A1 a1_0; + Cycle_a_00470_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A5(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + +class Cycle_a_00470_A6 { + Cycle_a_00470_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A6(String strObjectName) { + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + + +public class Cycle_a_00470 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00470_A1 a1_main = new Cycle_a_00470_A1("a1_main"); + Cycle_a_00470_A5 a5_main = new Cycle_a_00470_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00470_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00470_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00470_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00470_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a1_0 = a1_main; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + if (result == 1446) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0031-rc-function-Cycle_a_00480/Cycle_a_00480.java b/test/testsuite/ouroboros/memory_management/Function/RC0031-rc-function-Cycle_a_00480/Cycle_a_00480.java index f4c383ee2a0072b74a7c4ac385bf7ca4685cae01..e72d201af71c6945cc20010ba2a3eb8cc8bad4af 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0031-rc-function-Cycle_a_00480/Cycle_a_00480.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0031-rc-function-Cycle_a_00480/Cycle_a_00480.java @@ -1,193 +1,193 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00480.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00480 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00480.java - *- @ExecuteClass: Cycle_a_00480 - *- @ExecuteArgs: - * A1 depend A2 ; A2 depend A3 ; A3 depend A4 ; A4 depend A1 A6 - * A5 depend A3 ; A6 depend A1 A4 A5 - * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 - * RC-Testing_Result=(101+102)+(102+103)+(103+104)+(104+106+101)+(105+103)+(106+101+104+105)=1550 - * - */ - -class Cycle_a_00480_A1 { - Cycle_a_00480_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00480_A2 { - Cycle_a_00480_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00480_A3 { - Cycle_a_00480_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_a_00480_A4 { - Cycle_a_00480_A1 a1_0; - Cycle_a_00480_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } -} - -class Cycle_a_00480_A5 { - Cycle_a_00480_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00480_A6 { - Cycle_a_00480_A1 a1_0; - Cycle_a_00480_A4 a4_0; - Cycle_a_00480_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A6(String strObjectName) { - a1_0 = null; - a4_0 = null; - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a + a5_0.a; - } -} - -public class Cycle_a_00480 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00480_A1 a1_main = new Cycle_a_00480_A1("a1_main"); - Cycle_a_00480_A5 a5_main = new Cycle_a_00480_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00480_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00480_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00480_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00480_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a1_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - a5_main.a3_0.add(); - a5_main.a3_0.a4_0.add(); - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - if (result == 1550) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00480.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00480 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00480.java + *- @ExecuteClass: Cycle_a_00480 + *- @ExecuteArgs: + * A1 depend A2 ; A2 depend A3 ; A3 depend A4 ; A4 depend A1 A6 + * A5 depend A3 ; A6 depend A1 A4 A5 + * A1.a=101 A2.a=102 A3.a=103 ... A6.a=106 + * RC-Testing_Result=(101+102)+(102+103)+(103+104)+(104+106+101)+(105+103)+(106+101+104+105)=1550 + * + */ + +class Cycle_a_00480_A1 { + Cycle_a_00480_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00480_A2 { + Cycle_a_00480_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00480_A3 { + Cycle_a_00480_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_a_00480_A4 { + Cycle_a_00480_A1 a1_0; + Cycle_a_00480_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } +} + +class Cycle_a_00480_A5 { + Cycle_a_00480_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00480_A6 { + Cycle_a_00480_A1 a1_0; + Cycle_a_00480_A4 a4_0; + Cycle_a_00480_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A6(String strObjectName) { + a1_0 = null; + a4_0 = null; + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a + a5_0.a; + } +} + +public class Cycle_a_00480 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00480_A1 a1_main = new Cycle_a_00480_A1("a1_main"); + Cycle_a_00480_A5 a5_main = new Cycle_a_00480_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00480_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00480_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00480_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00480_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a1_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + a5_main.a3_0.add(); + a5_main.a3_0.a4_0.add(); + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + if (result == 1550) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0032-rc-function-Cycle_a_00490/Cycle_a_00490.java b/test/testsuite/ouroboros/memory_management/Function/RC0032-rc-function-Cycle_a_00490/Cycle_a_00490.java index 85f693c321d98e91348aebee8503f4ccd7a4f86a..5cf4b6adaa52c82eafd14c9298ad6a1a93fef670 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0032-rc-function-Cycle_a_00490/Cycle_a_00490.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0032-rc-function-Cycle_a_00490/Cycle_a_00490.java @@ -1,263 +1,263 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00490.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00490 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00490.java - *- @ExecuteClass: Cycle_a_00490 - *- @ExecuteArgs: - * A1 depend A2 ; A2 depend A3 ; A3 depend A1 - * A4 depend A5 ; A5 depend A6 ; A6 depend A4 - * A8 depend A7 A5 ; A7 depend A9 ; A9 depend A8 - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101)+(104+105)+(105+106)+(106+104+103)+(107+109)+(108+107+105)+(109+108)=2098 - * - */ - -class Cycle_a_00490_A1 { - Cycle_a_00490_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00490_A2 { - Cycle_a_00490_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00490_A3 { - Cycle_a_00490_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_a_00490_A4 { - Cycle_a_00490_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } -} - -class Cycle_a_00490_A5 { - Cycle_a_00490_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_00490_A6 { - Cycle_a_00490_A3 a3_0; - Cycle_a_00490_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A6(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - - -class Cycle_a_00490_A7 { - Cycle_a_00490_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A7(String strObjectName) { - a9_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } -} - - -class Cycle_a_00490_A8 { - Cycle_a_00490_A5 a5_0; - Cycle_a_00490_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A8(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a + a5_0.a; - } -} - - -class Cycle_a_00490_A9 { - Cycle_a_00490_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A9(String strObjectName) { - a8_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } -} - - -public class Cycle_a_00490 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00490_A1 a1_main = new Cycle_a_00490_A1("a1_main"); - Cycle_a_00490_A4 a4_main = new Cycle_a_00490_A4("a4_main"); - Cycle_a_00490_A7 a7_main = new Cycle_a_00490_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00490_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00490_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a4_main.a5_0 = new Cycle_a_00490_A5("a5_0"); - a4_main.a5_0.a6_0 = new Cycle_a_00490_A6("a6_0"); - a4_main.a5_0.a6_0.a4_0 = a4_main; - a4_main.a5_0.a6_0.a3_0 = a1_main.a2_0.a3_0; - a4_main.a5_0.a6_0.a3_0.a1_0 = a1_main; - a7_main.a9_0 = new Cycle_a_00490_A9("a9_0"); - a7_main.a9_0.a8_0 = new Cycle_a_00490_A8("a8_0"); - a7_main.a9_0.a8_0.a7_0 = a7_main; - a7_main.a9_0.a8_0.a5_0 = a4_main.a5_0; - a1_main.add(); - a4_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a1_0.add(); - a4_main.a5_0.add(); - a4_main.a5_0.a6_0.add(); - a4_main.a5_0.a6_0.a4_0.add(); - a4_main.a5_0.a6_0.a3_0.add(); - a4_main.a5_0.a6_0.a3_0.a1_0.add(); - a7_main.a9_0.add(); - a7_main.a9_0.a8_0.add(); - a7_main.a9_0.a8_0.a7_0.add(); - a7_main.a9_0.a8_0.a5_0.add(); - int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; - if (result == 2098) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00490.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00490 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00490.java + *- @ExecuteClass: Cycle_a_00490 + *- @ExecuteArgs: + * A1 depend A2 ; A2 depend A3 ; A3 depend A1 + * A4 depend A5 ; A5 depend A6 ; A6 depend A4 + * A8 depend A7 A5 ; A7 depend A9 ; A9 depend A8 + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101)+(104+105)+(105+106)+(106+104+103)+(107+109)+(108+107+105)+(109+108)=2098 + * + */ + +class Cycle_a_00490_A1 { + Cycle_a_00490_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00490_A2 { + Cycle_a_00490_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00490_A3 { + Cycle_a_00490_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_a_00490_A4 { + Cycle_a_00490_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } +} + +class Cycle_a_00490_A5 { + Cycle_a_00490_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_00490_A6 { + Cycle_a_00490_A3 a3_0; + Cycle_a_00490_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A6(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + + +class Cycle_a_00490_A7 { + Cycle_a_00490_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A7(String strObjectName) { + a9_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } +} + + +class Cycle_a_00490_A8 { + Cycle_a_00490_A5 a5_0; + Cycle_a_00490_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A8(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a + a5_0.a; + } +} + + +class Cycle_a_00490_A9 { + Cycle_a_00490_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A9(String strObjectName) { + a8_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } +} + + +public class Cycle_a_00490 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00490_A1 a1_main = new Cycle_a_00490_A1("a1_main"); + Cycle_a_00490_A4 a4_main = new Cycle_a_00490_A4("a4_main"); + Cycle_a_00490_A7 a7_main = new Cycle_a_00490_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00490_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00490_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a4_main.a5_0 = new Cycle_a_00490_A5("a5_0"); + a4_main.a5_0.a6_0 = new Cycle_a_00490_A6("a6_0"); + a4_main.a5_0.a6_0.a4_0 = a4_main; + a4_main.a5_0.a6_0.a3_0 = a1_main.a2_0.a3_0; + a4_main.a5_0.a6_0.a3_0.a1_0 = a1_main; + a7_main.a9_0 = new Cycle_a_00490_A9("a9_0"); + a7_main.a9_0.a8_0 = new Cycle_a_00490_A8("a8_0"); + a7_main.a9_0.a8_0.a7_0 = a7_main; + a7_main.a9_0.a8_0.a5_0 = a4_main.a5_0; + a1_main.add(); + a4_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a1_0.add(); + a4_main.a5_0.add(); + a4_main.a5_0.a6_0.add(); + a4_main.a5_0.a6_0.a4_0.add(); + a4_main.a5_0.a6_0.a3_0.add(); + a4_main.a5_0.a6_0.a3_0.a1_0.add(); + a7_main.a9_0.add(); + a7_main.a9_0.a8_0.add(); + a7_main.a9_0.a8_0.a7_0.add(); + a7_main.a9_0.a8_0.a5_0.add(); + int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; + if (result == 2098) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0033-rc-function-Cycle_a_00500/Cycle_a_00500.java b/test/testsuite/ouroboros/memory_management/Function/RC0033-rc-function-Cycle_a_00500/Cycle_a_00500.java index e00b7913d498ee465bb91602a4cbc1590255a542..9d0b8d52ee88f18458fb3a090c1dc6ee4e958d40 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0033-rc-function-Cycle_a_00500/Cycle_a_00500.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0033-rc-function-Cycle_a_00500/Cycle_a_00500.java @@ -1,266 +1,266 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00500.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_00500 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_00500.java - *- @ExecuteClass: Cycle_a_00500 - *- @ExecuteArgs: - * A1 depend A2 ; A2 depend A3 ; A3 depend A1 - * A4 depend A5 ; A5 depend A6 ; A6 depend A4 ; A4 depend A1 - * A5 depend A8 ; A8 depend A7 ; A7 depend A9 ; A9 depend A8 - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102)+(102+103)+(103+101)+(104+101+105)+(106+104)+(105+106+108)+(107+109)+(108+107)+(109+108)=2099 - * - */ - -class Cycle_a_00500_A1 { - Cycle_a_00500_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_00500_A2 { - Cycle_a_00500_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_00500_A3 { - Cycle_a_00500_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_a_00500_A4 { - Cycle_a_00500_A1 a1_0; - Cycle_a_00500_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A4(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - -class Cycle_a_00500_A5 { - Cycle_a_00500_A6 a6_0; - Cycle_a_00500_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } -} - -class Cycle_a_00500_A6 { - Cycle_a_00500_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A6(String strObjectName) { - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_a_00500_A7 { - Cycle_a_00500_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A7(String strObjectName) { - a9_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } -} - - -class Cycle_a_00500_A8 { - Cycle_a_00500_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - - -class Cycle_a_00500_A9 { - Cycle_a_00500_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A9(String strObjectName) { - a8_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } -} - - -public class Cycle_a_00500 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_00500_A1 a1_main = new Cycle_a_00500_A1("a1_main"); - Cycle_a_00500_A4 a4_main = new Cycle_a_00500_A4("a4_main"); - Cycle_a_00500_A7 a7_main = new Cycle_a_00500_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00500_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00500_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a4_main.a1_0 = a1_main; - a4_main.a5_0 = new Cycle_a_00500_A5("a5_0"); - a4_main.a5_0.a6_0 = new Cycle_a_00500_A6("a6_0"); - a4_main.a5_0.a6_0.a4_0 = a4_main; - - a4_main.a5_0.a8_0 = new Cycle_a_00500_A8("a8_0"); - a4_main.a5_0.a8_0.a7_0 = a7_main; - - a7_main.a9_0 = new Cycle_a_00500_A9("a9_0"); - a7_main.a9_0.a8_0 = new Cycle_a_00500_A8("a8_0"); - a7_main.a9_0.a8_0.a7_0 = a7_main; - - a1_main.add(); - a4_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a1_0.add(); - a4_main.a1_0.add(); - a4_main.a5_0.add(); - a4_main.a5_0.a6_0.add(); - a4_main.a5_0.a6_0.a4_0.add(); - a4_main.a5_0.a8_0.add(); - a4_main.a5_0.a8_0.a7_0.add(); - a7_main.a9_0.add(); - a7_main.a9_0.a8_0.add(); - a7_main.a9_0.a8_0.a7_0.add(); - int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; - if (result == 2099) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_00500.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_00500 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_00500.java + *- @ExecuteClass: Cycle_a_00500 + *- @ExecuteArgs: + * A1 depend A2 ; A2 depend A3 ; A3 depend A1 + * A4 depend A5 ; A5 depend A6 ; A6 depend A4 ; A4 depend A1 + * A5 depend A8 ; A8 depend A7 ; A7 depend A9 ; A9 depend A8 + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102)+(102+103)+(103+101)+(104+101+105)+(106+104)+(105+106+108)+(107+109)+(108+107)+(109+108)=2099 + * + */ + +class Cycle_a_00500_A1 { + Cycle_a_00500_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_00500_A2 { + Cycle_a_00500_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_00500_A3 { + Cycle_a_00500_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_a_00500_A4 { + Cycle_a_00500_A1 a1_0; + Cycle_a_00500_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A4(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + +class Cycle_a_00500_A5 { + Cycle_a_00500_A6 a6_0; + Cycle_a_00500_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } +} + +class Cycle_a_00500_A6 { + Cycle_a_00500_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A6(String strObjectName) { + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_a_00500_A7 { + Cycle_a_00500_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A7(String strObjectName) { + a9_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } +} + + +class Cycle_a_00500_A8 { + Cycle_a_00500_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + + +class Cycle_a_00500_A9 { + Cycle_a_00500_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A9(String strObjectName) { + a8_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } +} + + +public class Cycle_a_00500 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_00500_A1 a1_main = new Cycle_a_00500_A1("a1_main"); + Cycle_a_00500_A4 a4_main = new Cycle_a_00500_A4("a4_main"); + Cycle_a_00500_A7 a7_main = new Cycle_a_00500_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00500_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00500_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a4_main.a1_0 = a1_main; + a4_main.a5_0 = new Cycle_a_00500_A5("a5_0"); + a4_main.a5_0.a6_0 = new Cycle_a_00500_A6("a6_0"); + a4_main.a5_0.a6_0.a4_0 = a4_main; + + a4_main.a5_0.a8_0 = new Cycle_a_00500_A8("a8_0"); + a4_main.a5_0.a8_0.a7_0 = a7_main; + + a7_main.a9_0 = new Cycle_a_00500_A9("a9_0"); + a7_main.a9_0.a8_0 = new Cycle_a_00500_A8("a8_0"); + a7_main.a9_0.a8_0.a7_0 = a7_main; + + a1_main.add(); + a4_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a1_0.add(); + a4_main.a1_0.add(); + a4_main.a5_0.add(); + a4_main.a5_0.a6_0.add(); + a4_main.a5_0.a6_0.a4_0.add(); + a4_main.a5_0.a8_0.add(); + a4_main.a5_0.a8_0.a7_0.add(); + a7_main.a9_0.add(); + a7_main.a9_0.a8_0.add(); + a7_main.a9_0.a8_0.a7_0.add(); + int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; + if (result == 2099) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0034-rc-function-Cycle_a_10010/Cycle_a_10010.java b/test/testsuite/ouroboros/memory_management/Function/RC0034-rc-function-Cycle_a_10010/Cycle_a_10010.java index 4308ef4f8a04d5be77d0780e2f90b48457e4451c..c113fc5e4e9d8984a09441e9b0e705a3b091f526 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0034-rc-function-Cycle_a_10010/Cycle_a_10010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0034-rc-function-Cycle_a_10010/Cycle_a_10010.java @@ -1,387 +1,387 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_10010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_10010 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_10010.java - *- @ExecuteClass: Cycle_a_10010 - *- @ExecuteArgs: - */ -class Cycle_a_10010_A1 { - Cycle_a_10010_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_10010_A2 { - Cycle_a_10010_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_10010_A3 { - Cycle_a_10010_A1 a1_0; - Cycle_a_10010_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - -class Cycle_a_10010_A4 { - Cycle_a_10010_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_a_10010_A5 { - Cycle_a_10010_A4 a4_0; - Cycle_a_10010_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A5(String strObjectName) { - a4_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a + a7_0.a; - } -} - -class Cycle_a_10010_A6 { - Cycle_a_10010_A5 a5_0; - Cycle_a_10010_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A6(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a7_0.a; - } -} - -class Cycle_a_10010_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Cycle_a_10010_2A1 { - Cycle_a_10010_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_10010_2A2 { - Cycle_a_10010_2A3 a3_0; - Cycle_a_10010_2A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_10010_2A3 { - Cycle_a_10010_2A1 a1_0; - Cycle_a_10010_2A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } -} - - -class Cycle_a_10010_2A4 { - Cycle_a_10010_2A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_10010_2A5 { - Cycle_a_10010_2A6 a6_0; - Cycle_a_10010_2A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } -} - -class Cycle_a_10010_2A6 { - Cycle_a_10010_2A1 a1_0; - Cycle_a_10010_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - - -class Cycle_a_10010_2A7 { - Cycle_a_10010_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_a_10010_2A8 { - Cycle_a_10010_2A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - - -public class Cycle_a_10010 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_10010_A1 a1_main = new Cycle_a_10010_A1("a1_main"); - Cycle_a_10010_A4 a4_main = new Cycle_a_10010_A4("a4_main"); - Cycle_a_10010_A6 a6_main = new Cycle_a_10010_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_10010_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_10010_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10010_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_10010_A7("a7_0"); - a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; - a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a7_0.add(); - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; - Cycle_a_10010_2A1 a1_2main = new Cycle_a_10010_2A1("a1_2main"); - Cycle_a_10010_2A4 a4_2main = new Cycle_a_10010_2A4("a4_2main"); - Cycle_a_10010_2A6 a6_2main = new Cycle_a_10010_2A6("a6_2main"); - a1_2main.a2_0 = new Cycle_a_10010_2A2("a2_0"); - a1_2main.a2_0.a3_0 = new Cycle_a_10010_2A3("a3_0"); - a1_2main.a2_0.a4_0 = a4_2main; - a4_2main.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a5_0 = new Cycle_a_10010_2A5("a5_0"); - a1_2main.a2_0.a3_0.a5_0.a6_0 = a6_2main; - a1_2main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10010_2A8("a8_0"); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10010_2A7("a7_0"); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_2main.a2_0.a3_0; - a6_2main.a1_0 = a1_2main; - a6_2main.a3_0 = a1_2main.a2_0.a3_0; - a1_2main.add(); - a4_2main.add(); - a6_2main.add(); - a1_2main.a2_0.add(); - a1_2main.a2_0.a3_0.add(); - a1_2main.a2_0.a3_0.a5_0.add(); - a1_2main.a2_0.a3_0.a5_0.a8_0.add(); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - int result2 = a1_2main.sum + a4_2main.sum + a6_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum + a1_2main.a2_0.a3_0.a5_0.sum + a6_2main.a3_0.a5_0.a8_0.a7_0.sum + a6_2main.a3_0.a5_0.a8_0.sum; - result += result2; - if (result == 3852) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_10010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_10010 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_10010.java + *- @ExecuteClass: Cycle_a_10010 + *- @ExecuteArgs: + */ +class Cycle_a_10010_A1 { + Cycle_a_10010_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_10010_A2 { + Cycle_a_10010_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_10010_A3 { + Cycle_a_10010_A1 a1_0; + Cycle_a_10010_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + +class Cycle_a_10010_A4 { + Cycle_a_10010_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_a_10010_A5 { + Cycle_a_10010_A4 a4_0; + Cycle_a_10010_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A5(String strObjectName) { + a4_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a + a7_0.a; + } +} + +class Cycle_a_10010_A6 { + Cycle_a_10010_A5 a5_0; + Cycle_a_10010_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A6(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a7_0.a; + } +} + +class Cycle_a_10010_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Cycle_a_10010_2A1 { + Cycle_a_10010_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_10010_2A2 { + Cycle_a_10010_2A3 a3_0; + Cycle_a_10010_2A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_10010_2A3 { + Cycle_a_10010_2A1 a1_0; + Cycle_a_10010_2A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } +} + + +class Cycle_a_10010_2A4 { + Cycle_a_10010_2A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_10010_2A5 { + Cycle_a_10010_2A6 a6_0; + Cycle_a_10010_2A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } +} + +class Cycle_a_10010_2A6 { + Cycle_a_10010_2A1 a1_0; + Cycle_a_10010_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + + +class Cycle_a_10010_2A7 { + Cycle_a_10010_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_a_10010_2A8 { + Cycle_a_10010_2A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + + +public class Cycle_a_10010 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_10010_A1 a1_main = new Cycle_a_10010_A1("a1_main"); + Cycle_a_10010_A4 a4_main = new Cycle_a_10010_A4("a4_main"); + Cycle_a_10010_A6 a6_main = new Cycle_a_10010_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_10010_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_10010_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10010_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_10010_A7("a7_0"); + a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; + a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a7_0.add(); + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; + Cycle_a_10010_2A1 a1_2main = new Cycle_a_10010_2A1("a1_2main"); + Cycle_a_10010_2A4 a4_2main = new Cycle_a_10010_2A4("a4_2main"); + Cycle_a_10010_2A6 a6_2main = new Cycle_a_10010_2A6("a6_2main"); + a1_2main.a2_0 = new Cycle_a_10010_2A2("a2_0"); + a1_2main.a2_0.a3_0 = new Cycle_a_10010_2A3("a3_0"); + a1_2main.a2_0.a4_0 = a4_2main; + a4_2main.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a5_0 = new Cycle_a_10010_2A5("a5_0"); + a1_2main.a2_0.a3_0.a5_0.a6_0 = a6_2main; + a1_2main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10010_2A8("a8_0"); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10010_2A7("a7_0"); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_2main.a2_0.a3_0; + a6_2main.a1_0 = a1_2main; + a6_2main.a3_0 = a1_2main.a2_0.a3_0; + a1_2main.add(); + a4_2main.add(); + a6_2main.add(); + a1_2main.a2_0.add(); + a1_2main.a2_0.a3_0.add(); + a1_2main.a2_0.a3_0.a5_0.add(); + a1_2main.a2_0.a3_0.a5_0.a8_0.add(); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + int result2 = a1_2main.sum + a4_2main.sum + a6_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum + a1_2main.a2_0.a3_0.a5_0.sum + a6_2main.a3_0.a5_0.a8_0.a7_0.sum + a6_2main.a3_0.a5_0.a8_0.sum; + result += result2; + if (result == 3852) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0035-rc-function-Cycle_a_10020/Cycle_a_10020.java b/test/testsuite/ouroboros/memory_management/Function/RC0035-rc-function-Cycle_a_10020/Cycle_a_10020.java index 47ef56636a9db28c9009c5d2acd7d21b7935a5de..eeaca6cde859b21fcab148b54cea7ff2f47663b6 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0035-rc-function-Cycle_a_10020/Cycle_a_10020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0035-rc-function-Cycle_a_10020/Cycle_a_10020.java @@ -1,351 +1,351 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_a_10020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_a_10020 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_a_10020.java - *- @ExecuteClass: Cycle_a_10020 - *- @ExecuteArgs: - */ -class Cycle_a_10020_A1 { - Cycle_a_10020_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_10020_A2 { - Cycle_a_10020_A3 a3_0; - Cycle_a_10020_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } -} - -class Cycle_a_10020_A3 { - Cycle_a_10020_A1 a1_0; - Cycle_a_10020_A5 a5_0; - Cycle_a_10020_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a10_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a10_0.a; - } -} - - -class Cycle_a_10020_A4 { - Cycle_a_10020_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_a_10020_A5 { - Cycle_a_10020_A6 a6_0; - Cycle_a_10020_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } -} - -class Cycle_a_10020_A6 { - Cycle_a_10020_A1 a1_0; - Cycle_a_10020_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - - -class Cycle_a_10020_A7 { - Cycle_a_10020_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_a_10020_A8 { - Cycle_a_10020_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } -} - - -class Cycle_a_10020_A9 { - Cycle_a_10020_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A9(String strObjectName) { - a6_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } -} - -class Cycle_a_10020_A10 { - Cycle_a_10020_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A10(String strObjectName) { - a9_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } -} - -class Cycle_a_10020_2A1 { - Cycle_a_10020_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_a_10020_2A2 { - Cycle_a_10020_2A1 a1_0; - Cycle_a_10020_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } -} - -class Cycle_a_10020_2A3 { - Cycle_a_10020_2A1 a1_0; - Cycle_a_10020_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } -} - - -public class Cycle_a_10020 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_a_10020_A1 a1_main = new Cycle_a_10020_A1("a1_main"); - Cycle_a_10020_A4 a4_main = new Cycle_a_10020_A4("a4_main"); - Cycle_a_10020_A6 a6_main = new Cycle_a_10020_A6("a6_main"); - Cycle_a_10020_A9 a9_main = new Cycle_a_10020_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_10020_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_10020_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10020_A5("a5_0"); - a1_main.a2_0.a3_0.a10_0 = new Cycle_a_10020_A10("a10_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10020_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10020_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; - a9_main.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a10_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; - //System.out.println("RC-Testing_Result="+result); - Cycle_a_10020_2A1 a1_2main = new Cycle_a_10020_2A1("a1_2main"); - a1_2main.a2_0 = new Cycle_a_10020_2A2("a2_0"); - a1_2main.a2_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0 = new Cycle_a_10020_2A3("a3_0"); - a1_2main.a2_0.a3_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a2_0 = a1_2main.a2_0; - a1_2main.add(); - a1_2main.a2_0.add(); - a1_2main.a2_0.a3_0.add(); - int result2 = a1_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - result += result2; - if (result == (2623 + 815)) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_a_10020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_a_10020 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_a_10020.java + *- @ExecuteClass: Cycle_a_10020 + *- @ExecuteArgs: + */ +class Cycle_a_10020_A1 { + Cycle_a_10020_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_10020_A2 { + Cycle_a_10020_A3 a3_0; + Cycle_a_10020_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } +} + +class Cycle_a_10020_A3 { + Cycle_a_10020_A1 a1_0; + Cycle_a_10020_A5 a5_0; + Cycle_a_10020_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a10_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a10_0.a; + } +} + + +class Cycle_a_10020_A4 { + Cycle_a_10020_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_a_10020_A5 { + Cycle_a_10020_A6 a6_0; + Cycle_a_10020_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } +} + +class Cycle_a_10020_A6 { + Cycle_a_10020_A1 a1_0; + Cycle_a_10020_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + + +class Cycle_a_10020_A7 { + Cycle_a_10020_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_a_10020_A8 { + Cycle_a_10020_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } +} + + +class Cycle_a_10020_A9 { + Cycle_a_10020_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A9(String strObjectName) { + a6_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } +} + +class Cycle_a_10020_A10 { + Cycle_a_10020_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A10(String strObjectName) { + a9_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } +} + +class Cycle_a_10020_2A1 { + Cycle_a_10020_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_a_10020_2A2 { + Cycle_a_10020_2A1 a1_0; + Cycle_a_10020_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } +} + +class Cycle_a_10020_2A3 { + Cycle_a_10020_2A1 a1_0; + Cycle_a_10020_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } +} + + +public class Cycle_a_10020 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_a_10020_A1 a1_main = new Cycle_a_10020_A1("a1_main"); + Cycle_a_10020_A4 a4_main = new Cycle_a_10020_A4("a4_main"); + Cycle_a_10020_A6 a6_main = new Cycle_a_10020_A6("a6_main"); + Cycle_a_10020_A9 a9_main = new Cycle_a_10020_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_10020_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_10020_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10020_A5("a5_0"); + a1_main.a2_0.a3_0.a10_0 = new Cycle_a_10020_A10("a10_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10020_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10020_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; + a9_main.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a10_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; + //System.out.println("RC-Testing_Result="+result); + Cycle_a_10020_2A1 a1_2main = new Cycle_a_10020_2A1("a1_2main"); + a1_2main.a2_0 = new Cycle_a_10020_2A2("a2_0"); + a1_2main.a2_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0 = new Cycle_a_10020_2A3("a3_0"); + a1_2main.a2_0.a3_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a2_0 = a1_2main.a2_0; + a1_2main.add(); + a1_2main.a2_0.add(); + a1_2main.a2_0.a3_0.add(); + int result2 = a1_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + result += result2; + if (result == (2623 + 815)) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0056-rc-function-Cycle_B_1_10010/Cycle_B_1_10010.java b/test/testsuite/ouroboros/memory_management/Function/RC0056-rc-function-Cycle_B_1_10010/Cycle_B_1_10010.java index 442f46859eab658c56cca530442ae297e502d619..b70dad693030f5b5a7c6b67cfc65395009b2f3b2 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0056-rc-function-Cycle_B_1_10010/Cycle_B_1_10010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0056-rc-function-Cycle_B_1_10010/Cycle_B_1_10010.java @@ -1,162 +1,162 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_B_1_10010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_B_1_10010 in RC测试-Cycle-00.vsd - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_B_1_10010.java - *- @ExecuteClass: Cycle_B_1_10010 - *- @ExecuteArgs: - */ -class Cycle_B_1_10010_A1 { - Cycle_B_1_10010_A2 a2_0; - int a; - int sum; - - Cycle_B_1_10010_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_B_1_10010_A2 { - Cycle_B_1_10010_A3 a3_0; - int a; - int sum; - - Cycle_B_1_10010_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_B_1_10010_A3 { - Cycle_B_1_10010_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10010_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_B_1_10010_2A1 { - Cycle_B_1_10010_2A2 a2_0; - int a; - int sum; - - Cycle_B_1_10010_2A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_B_1_10010_2A2 { - Cycle_B_1_10010_2A3 a3_0; - int a; - int sum; - - Cycle_B_1_10010_2A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_B_1_10010_2A3 { - Cycle_B_1_10010_2A1 a1_0; - int a; - int sum; - - Cycle_B_1_10010_2A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - - -public class Cycle_B_1_10010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_B_1_10010_A1 a1_0 = new Cycle_B_1_10010_A1(); - a1_0.a2_0 = new Cycle_B_1_10010_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_10010_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - Cycle_B_1_10010_2A1 a1_10 = new Cycle_B_1_10010_2A1(); - a1_10.a2_0 = new Cycle_B_1_10010_2A2(); - a1_10.a2_0.a3_0 = new Cycle_B_1_10010_2A3(); - a1_10.a2_0.a3_0.a1_0 = a1_10; - a1_10.add(); - a1_10.a2_0.add(); - a1_10.a2_0.a3_0.add(); - int nsum2 = (a1_10.sum + a1_10.a2_0.sum + a1_10.a2_0.a3_0.sum); - //System.out.println(nsum); - nsum += nsum2; - if (nsum == 24) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_B_1_10010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_B_1_10010 in RC测试-Cycle-00.vsd + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_B_1_10010.java + *- @ExecuteClass: Cycle_B_1_10010 + *- @ExecuteArgs: + */ +class Cycle_B_1_10010_A1 { + Cycle_B_1_10010_A2 a2_0; + int a; + int sum; + + Cycle_B_1_10010_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_B_1_10010_A2 { + Cycle_B_1_10010_A3 a3_0; + int a; + int sum; + + Cycle_B_1_10010_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_B_1_10010_A3 { + Cycle_B_1_10010_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10010_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_B_1_10010_2A1 { + Cycle_B_1_10010_2A2 a2_0; + int a; + int sum; + + Cycle_B_1_10010_2A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_B_1_10010_2A2 { + Cycle_B_1_10010_2A3 a3_0; + int a; + int sum; + + Cycle_B_1_10010_2A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_B_1_10010_2A3 { + Cycle_B_1_10010_2A1 a1_0; + int a; + int sum; + + Cycle_B_1_10010_2A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + + +public class Cycle_B_1_10010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_B_1_10010_A1 a1_0 = new Cycle_B_1_10010_A1(); + a1_0.a2_0 = new Cycle_B_1_10010_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_10010_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + Cycle_B_1_10010_2A1 a1_10 = new Cycle_B_1_10010_2A1(); + a1_10.a2_0 = new Cycle_B_1_10010_2A2(); + a1_10.a2_0.a3_0 = new Cycle_B_1_10010_2A3(); + a1_10.a2_0.a3_0.a1_0 = a1_10; + a1_10.add(); + a1_10.a2_0.add(); + a1_10.a2_0.a3_0.add(); + int nsum2 = (a1_10.sum + a1_10.a2_0.sum + a1_10.a2_0.a3_0.sum); + //System.out.println(nsum); + nsum += nsum2; + if (nsum == 24) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0057-rc-function-Cycle_B_1_10020/Cycle_B_1_10020.java b/test/testsuite/ouroboros/memory_management/Function/RC0057-rc-function-Cycle_B_1_10020/Cycle_B_1_10020.java index 4499bd2ba599dbf0701c8558d18b536ad81d1624..549dc50f3cd1fc7bd78d0ee0ad0ab566e9de72d3 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0057-rc-function-Cycle_B_1_10020/Cycle_B_1_10020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0057-rc-function-Cycle_B_1_10020/Cycle_B_1_10020.java @@ -1,237 +1,237 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_B_1_10020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_B_1_10020 in RC测试-Cycle-00.vsd - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_B_1_10020.java - *- @ExecuteClass: Cycle_B_1_10020 - *- @ExecuteArgs: - */ -class Cycle_B_1_10020_A1 { - Cycle_B_1_10020_A2 a2_0; - int a; - int sum; - - Cycle_B_1_10020_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_B_1_10020_A2 { - Cycle_B_1_10020_A3 a3_0; - int a; - int sum; - - Cycle_B_1_10020_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_B_1_10020_A3 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_B_1_10020_A4 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_B_1_10020_A5 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_B_1_10020_2A1 { - Cycle_B_1_10020_2A2 a2_0; - Cycle_B_1_10020_2A4 a4_0; - Cycle_B_1_10020_2A5 a5_0; - int a; - int sum; - - Cycle_B_1_10020_2A1() { - a2_0 = null; - a4_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_B_1_10020_2A2 { - Cycle_B_1_10020_2A3 a3_0; - int a; - int sum; - - Cycle_B_1_10020_2A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_B_1_10020_2A3 { - Cycle_B_1_10020_2A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_2A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - -class Cycle_B_1_10020_2A4 { - int a; - int sum; - - Cycle_B_1_10020_2A4() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } -} - - -class Cycle_B_1_10020_2A5 { - int a; - int sum; - - Cycle_B_1_10020_2A5() { - a = 7; - sum = 0; - } - - void add() { - sum = a + 8; - } -} - - -public class Cycle_B_1_10020 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_B_1_10020_A1 a1_0 = new Cycle_B_1_10020_A1(); - a1_0.a2_0 = new Cycle_B_1_10020_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_10020_A3(); - Cycle_B_1_10020_A4 a4_0 = new Cycle_B_1_10020_A4(); - Cycle_B_1_10020_A5 a5_0 = new Cycle_B_1_10020_A5(); - a4_0.a1_0 = a1_0; - a5_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - Cycle_B_1_10020_2A1 a1_20 = new Cycle_B_1_10020_2A1(); - a1_20.a2_0 = new Cycle_B_1_10020_2A2(); - a1_20.a2_0.a3_0 = new Cycle_B_1_10020_2A3(); - Cycle_B_1_10020_2A4 a4_20 = new Cycle_B_1_10020_2A4(); - Cycle_B_1_10020_2A5 a5_20 = new Cycle_B_1_10020_2A5(); - a1_20.a4_0 = a4_20; - a1_20.a5_0 = a5_20; - a1_20.a2_0.a3_0.a1_0 = a1_20; - a1_20.add(); - a1_20.a2_0.add(); - a1_20.a2_0.a3_0.add(); - a4_20.add(); - a5_20.add(); - int nsum1 = (a1_20.sum + a1_20.a2_0.sum + a1_20.a2_0.a3_0.sum + a4_20.sum + a5_20.sum); - nsum += nsum1; - if (nsum == 61) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_B_1_10020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_B_1_10020 in RC测试-Cycle-00.vsd + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_B_1_10020.java + *- @ExecuteClass: Cycle_B_1_10020 + *- @ExecuteArgs: + */ +class Cycle_B_1_10020_A1 { + Cycle_B_1_10020_A2 a2_0; + int a; + int sum; + + Cycle_B_1_10020_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_B_1_10020_A2 { + Cycle_B_1_10020_A3 a3_0; + int a; + int sum; + + Cycle_B_1_10020_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_B_1_10020_A3 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_B_1_10020_A4 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_B_1_10020_A5 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_B_1_10020_2A1 { + Cycle_B_1_10020_2A2 a2_0; + Cycle_B_1_10020_2A4 a4_0; + Cycle_B_1_10020_2A5 a5_0; + int a; + int sum; + + Cycle_B_1_10020_2A1() { + a2_0 = null; + a4_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_B_1_10020_2A2 { + Cycle_B_1_10020_2A3 a3_0; + int a; + int sum; + + Cycle_B_1_10020_2A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_B_1_10020_2A3 { + Cycle_B_1_10020_2A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_2A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + +class Cycle_B_1_10020_2A4 { + int a; + int sum; + + Cycle_B_1_10020_2A4() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } +} + + +class Cycle_B_1_10020_2A5 { + int a; + int sum; + + Cycle_B_1_10020_2A5() { + a = 7; + sum = 0; + } + + void add() { + sum = a + 8; + } +} + + +public class Cycle_B_1_10020 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_B_1_10020_A1 a1_0 = new Cycle_B_1_10020_A1(); + a1_0.a2_0 = new Cycle_B_1_10020_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_10020_A3(); + Cycle_B_1_10020_A4 a4_0 = new Cycle_B_1_10020_A4(); + Cycle_B_1_10020_A5 a5_0 = new Cycle_B_1_10020_A5(); + a4_0.a1_0 = a1_0; + a5_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + Cycle_B_1_10020_2A1 a1_20 = new Cycle_B_1_10020_2A1(); + a1_20.a2_0 = new Cycle_B_1_10020_2A2(); + a1_20.a2_0.a3_0 = new Cycle_B_1_10020_2A3(); + Cycle_B_1_10020_2A4 a4_20 = new Cycle_B_1_10020_2A4(); + Cycle_B_1_10020_2A5 a5_20 = new Cycle_B_1_10020_2A5(); + a1_20.a4_0 = a4_20; + a1_20.a5_0 = a5_20; + a1_20.a2_0.a3_0.a1_0 = a1_20; + a1_20.add(); + a1_20.a2_0.add(); + a1_20.a2_0.a3_0.add(); + a4_20.add(); + a5_20.add(); + int nsum1 = (a1_20.sum + a1_20.a2_0.sum + a1_20.a2_0.a3_0.sum + a4_20.sum + a5_20.sum); + nsum += nsum1; + if (nsum == 61) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0081-rc-function-Cycle_B_2_00240/Cycle_B_2_00240.java b/test/testsuite/ouroboros/memory_management/Function/RC0081-rc-function-Cycle_B_2_00240/Cycle_B_2_00240.java index bc88ae262e6f3fc278b0a3b9f3094de17a47f3ef..64bd8d05d32cbf42582b02c78698b7802a1d759f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0081-rc-function-Cycle_B_2_00240/Cycle_B_2_00240.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0081-rc-function-Cycle_B_2_00240/Cycle_B_2_00240.java @@ -1,234 +1,234 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Cycle_B_2_00240.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_B_2_00240 in RC测试-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_B_2_00240.java - *- @ExecuteClass: Cycle_B_2_00240 - *- @ExecuteArgs: - */ - -class Cycle_B_2_00240_A1 { - Cycle_B_2_00240_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_B_2_00240_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_B_2_00240_A2 { - Cycle_B_2_00240_A1 a1_0; - Cycle_B_2_00240_A3 a3_0; - Cycle_B_2_00240_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_B_2_00240_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } -} - -class Cycle_B_2_00240_A3 { - Cycle_B_2_00240_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_B_2_00240_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_B_2_00240_A4 { - Cycle_B_2_00240_A1 a1_0; - Cycle_B_2_00240_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_B_2_00240_A4(String strObjectName) { - a2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } -} - -class Cycle_B_2_00240_B1 { - Cycle_B_2_00240_A3 a3_0; - Cycle_B_2_00240_B2 b2_0; - Nocycle_B_2_00240_C2 c2_0; - - - int a; - int sum; - - Cycle_B_2_00240_B1() { - a3_0 = null; - b2_0 = null; - c2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a3_0.a + b2_0.a + c2_0.a; - } -} - - -class Cycle_B_2_00240_B2 { - Cycle_B_2_00240_B1 b1_0; - int a; - int sum; - - Cycle_B_2_00240_B2() { - b1_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_B_2_00240_C1 { - Nocycle_B_2_00240_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_B_2_00240_C1(String strObjectName) { - c2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - // protected void finalize() throws java.lang.Throwable { -// System.out.println("RC-Testing_Destruction_A1_"+strObjectName); -// } - void add() { - sum = a + c2_0.a; - } -} - -class Nocycle_B_2_00240_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_B_2_00240_C2(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - // protected void finalize() throws java.lang.Throwable { -// System.out.println("RC-Testing_Destruction_B1_"+strObjectName); -// } - void add() { - sum = a + a; - } -} - -public class Cycle_B_2_00240 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Cycle_B_2_00240_A1 a1_main = new Cycle_B_2_00240_A1("a1_main"); - a1_main.a2_0 = new Cycle_B_2_00240_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_B_2_00240_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_B_2_00240_A4("a4_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a4_0.a1_0 = a1_main; - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - - Cycle_B_2_00240_B1 b1_0 = new Cycle_B_2_00240_B1(); - b1_0.a3_0 = new Cycle_B_2_00240_A3("a3_b1"); - b1_0.b2_0 = new Cycle_B_2_00240_B2(); - b1_0.c2_0 = new Nocycle_B_2_00240_C2("c2_b1"); - b1_0.b2_0.b1_0 = b1_0; - b1_0.add(); - b1_0.b2_0.add(); - int nsum = (b1_0.sum + b1_0.b2_0.sum); - Nocycle_B_2_00240_C1 c1_main = new Nocycle_B_2_00240_C1("c1_main"); - c1_main.c2_0 = new Nocycle_B_2_00240_C2("c2_0"); - c1_main.add(); - c1_main.c2_0.add(); - int result2 = c1_main.sum + c1_main.c2_0.sum; - if (result == 1124 && nsum == 310 && result2 == 704) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Cycle_B_2_00240.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_B_2_00240 in RC测试-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_B_2_00240.java + *- @ExecuteClass: Cycle_B_2_00240 + *- @ExecuteArgs: + */ + +class Cycle_B_2_00240_A1 { + Cycle_B_2_00240_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_B_2_00240_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_B_2_00240_A2 { + Cycle_B_2_00240_A1 a1_0; + Cycle_B_2_00240_A3 a3_0; + Cycle_B_2_00240_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_B_2_00240_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } +} + +class Cycle_B_2_00240_A3 { + Cycle_B_2_00240_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_B_2_00240_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_B_2_00240_A4 { + Cycle_B_2_00240_A1 a1_0; + Cycle_B_2_00240_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_B_2_00240_A4(String strObjectName) { + a2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } +} + +class Cycle_B_2_00240_B1 { + Cycle_B_2_00240_A3 a3_0; + Cycle_B_2_00240_B2 b2_0; + Nocycle_B_2_00240_C2 c2_0; + + + int a; + int sum; + + Cycle_B_2_00240_B1() { + a3_0 = null; + b2_0 = null; + c2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a3_0.a + b2_0.a + c2_0.a; + } +} + + +class Cycle_B_2_00240_B2 { + Cycle_B_2_00240_B1 b1_0; + int a; + int sum; + + Cycle_B_2_00240_B2() { + b1_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_B_2_00240_C1 { + Nocycle_B_2_00240_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_B_2_00240_C1(String strObjectName) { + c2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + // protected void finalize() throws java.lang.Throwable { +// System.out.println("RC-Testing_Destruction_A1_"+strObjectName); +// } + void add() { + sum = a + c2_0.a; + } +} + +class Nocycle_B_2_00240_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_B_2_00240_C2(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + // protected void finalize() throws java.lang.Throwable { +// System.out.println("RC-Testing_Destruction_B1_"+strObjectName); +// } + void add() { + sum = a + a; + } +} + +public class Cycle_B_2_00240 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Cycle_B_2_00240_A1 a1_main = new Cycle_B_2_00240_A1("a1_main"); + a1_main.a2_0 = new Cycle_B_2_00240_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_B_2_00240_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_B_2_00240_A4("a4_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a4_0.a1_0 = a1_main; + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + + Cycle_B_2_00240_B1 b1_0 = new Cycle_B_2_00240_B1(); + b1_0.a3_0 = new Cycle_B_2_00240_A3("a3_b1"); + b1_0.b2_0 = new Cycle_B_2_00240_B2(); + b1_0.c2_0 = new Nocycle_B_2_00240_C2("c2_b1"); + b1_0.b2_0.b1_0 = b1_0; + b1_0.add(); + b1_0.b2_0.add(); + int nsum = (b1_0.sum + b1_0.b2_0.sum); + Nocycle_B_2_00240_C1 c1_main = new Nocycle_B_2_00240_C1("c1_main"); + c1_main.c2_0 = new Nocycle_B_2_00240_C2("c2_0"); + c1_main.add(); + c1_main.c2_0.add(); + int result2 = c1_main.sum + c1_main.c2_0.sum; + if (result == 1124 && nsum == 310 && result2 == 704) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0082-rc-function-Nocycle_a_00010/Nocycle_a_00010.java b/test/testsuite/ouroboros/memory_management/Function/RC0082-rc-function-Nocycle_a_00010/Nocycle_a_00010.java index 806441f978424c40c0f929633e9034afe7c262c2..506882fc05fb4ce32a4d58bb74d1c138e5b97d54 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0082-rc-function-Nocycle_a_00010/Nocycle_a_00010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0082-rc-function-Nocycle_a_00010/Nocycle_a_00010.java @@ -1,94 +1,94 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00010 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00010.java - *- @ExecuteClass: Nocycle_a_00010 - *- @ExecuteArgs: - */ - -class Nocycle_a_00010_A1 { - Nocycle_a_00010_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00010_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - // protected void finalize() throws java.lang.Throwable { -// System.out.println("RC-Testing_Destruction_A1_"+strObjectName); -// } - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00010_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00010_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - // protected void finalize() throws java.lang.Throwable { -// System.out.println("RC-Testing_Destruction_B1_"+strObjectName); -// } - void add() { - sum = a + a; - } -} - - -public class Nocycle_a_00010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - } - - public static void rc_testcase_main_wrapper() { - Nocycle_a_00010_A1 a1_main = new Nocycle_a_00010_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00010_B1("b1_0"); - a1_main.add(); - a1_main.b1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 704) - System.out.println("ExpectResult"); - - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00010 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00010.java + *- @ExecuteClass: Nocycle_a_00010 + *- @ExecuteArgs: + */ + +class Nocycle_a_00010_A1 { + Nocycle_a_00010_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00010_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + // protected void finalize() throws java.lang.Throwable { +// System.out.println("RC-Testing_Destruction_A1_"+strObjectName); +// } + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00010_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00010_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + // protected void finalize() throws java.lang.Throwable { +// System.out.println("RC-Testing_Destruction_B1_"+strObjectName); +// } + void add() { + sum = a + a; + } +} + + +public class Nocycle_a_00010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + } + + public static void rc_testcase_main_wrapper() { + Nocycle_a_00010_A1 a1_main = new Nocycle_a_00010_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00010_B1("b1_0"); + a1_main.add(); + a1_main.b1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 704) + System.out.println("ExpectResult"); + + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0083-rc-function-Nocycle_a_00020/Nocycle_a_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0083-rc-function-Nocycle_a_00020/Nocycle_a_00020.java index 1ce8ef594fac58c116f4e6777aa0de4158de2400..bdb3efb7863e788c7c5e7dad42afc13e28a07420 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0083-rc-function-Nocycle_a_00020/Nocycle_a_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0083-rc-function-Nocycle_a_00020/Nocycle_a_00020.java @@ -1,107 +1,107 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00020 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00020.java - *- @ExecuteClass: Nocycle_a_00020 - *- @ExecuteArgs: - */ -class Nocycle_a_00020_A1 { - Nocycle_a_00020_B1 b1_0; - Nocycle_a_00020_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - -class Nocycle_a_00020_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00020_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_a_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00020_A1 a1_main = new Nocycle_a_00020_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00020_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00020_B2("b2_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 1310) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00020 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00020.java + *- @ExecuteClass: Nocycle_a_00020 + *- @ExecuteArgs: + */ +class Nocycle_a_00020_A1 { + Nocycle_a_00020_B1 b1_0; + Nocycle_a_00020_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + +class Nocycle_a_00020_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00020_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_a_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00020_A1 a1_main = new Nocycle_a_00020_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00020_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00020_B2("b2_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 1310) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0084-rc-function-Nocycle_a_00030/Nocycle_a_00030.java b/test/testsuite/ouroboros/memory_management/Function/RC0084-rc-function-Nocycle_a_00030/Nocycle_a_00030.java index 7a1f0a06c90abe3a9f0ade411d03e4e4fec8d7f4..b22c73c98913487b411815d6bc7de7a2f522e8a1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0084-rc-function-Nocycle_a_00030/Nocycle_a_00030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0084-rc-function-Nocycle_a_00030/Nocycle_a_00030.java @@ -1,127 +1,127 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00030 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00030.java - *- @ExecuteClass: Nocycle_a_00030 - *- @ExecuteArgs: - */ -class Nocycle_a_00030_A1 { - Nocycle_a_00030_B1 b1_0; - Nocycle_a_00030_B2 b2_0; - Nocycle_a_00030_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } -} - -class Nocycle_a_00030_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00030_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_00030_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00030 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00030_A1 a1_main = new Nocycle_a_00030_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00030_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00030_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00030_B3("b3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; - if (result == 1919) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00030 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00030.java + *- @ExecuteClass: Nocycle_a_00030 + *- @ExecuteArgs: + */ +class Nocycle_a_00030_A1 { + Nocycle_a_00030_B1 b1_0; + Nocycle_a_00030_B2 b2_0; + Nocycle_a_00030_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } +} + +class Nocycle_a_00030_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00030_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_00030_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00030 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00030_A1 a1_main = new Nocycle_a_00030_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00030_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00030_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00030_B3("b3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; + if (result == 1919) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0085-rc-function-Nocycle_a_00040/Nocycle_a_00040.java b/test/testsuite/ouroboros/memory_management/Function/RC0085-rc-function-Nocycle_a_00040/Nocycle_a_00040.java index df27bd70c87963c5a347ed42c3f890d0b3ec0f73..6391e6bf560554e55f10f2e910f1b72aba83c324 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0085-rc-function-Nocycle_a_00040/Nocycle_a_00040.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0085-rc-function-Nocycle_a_00040/Nocycle_a_00040.java @@ -1,274 +1,274 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00040.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00040 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00040.java - *- @ExecuteClass: Nocycle_a_00040 - *- @ExecuteArgs: - */ -class Nocycle_a_00040_A1 { - Nocycle_a_00040_B1 b1_0; - Nocycle_a_00040_B2 b2_0; - Nocycle_a_00040_B3 b3_0; - Nocycle_a_00040_B4 b4_0; - Nocycle_a_00040_B5 b5_0; - Nocycle_a_00040_B6 b6_0; - Nocycle_a_00040_B7 b7_0; - Nocycle_a_00040_B8 b8_0; - Nocycle_a_00040_B9 b9_0; - Nocycle_a_00040_B10 b10_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - b5_0 = null; - b6_0 = null; - b7_0 = null; - b8_0 = null; - b9_0 = null; - b10_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + b5_0.a + b6_0.a + b7_0.a + b8_0.a + b9_0.a + b10_0.a; - } -} - -class Nocycle_a_00040_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00040_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_00040_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00040_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00040_B5 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B5(String strObjectName) { - a = 205; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B5_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00040_B6 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B6(String strObjectName) { - a = 206; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B6_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00040_B7 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B7(String strObjectName) { - a = 207; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B7_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_00040_B8 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B8(String strObjectName) { - a = 208; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B8_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00040_B9 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B9(String strObjectName) { - a = 209; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B9_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00040_B10 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B10(String strObjectName) { - a = 210; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B10_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00040 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00040_A1 a1_main = new Nocycle_a_00040_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00040_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00040_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00040_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00040_B4("b4_0"); - a1_main.b5_0 = new Nocycle_a_00040_B5("b5_0"); - a1_main.b6_0 = new Nocycle_a_00040_B6("b6_0"); - a1_main.b7_0 = new Nocycle_a_00040_B7("b7_0"); - a1_main.b8_0 = new Nocycle_a_00040_B8("b8_0"); - a1_main.b9_0 = new Nocycle_a_00040_B9("b9_0"); - a1_main.b10_0 = new Nocycle_a_00040_B10("b10_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b5_0.add(); - a1_main.b6_0.add(); - a1_main.b7_0.add(); - a1_main.b8_0.add(); - a1_main.b9_0.add(); - a1_main.b10_0.add(); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b5_0.sum + a1_main.b6_0.sum + a1_main.b7_0.sum + a1_main.b8_0.sum + a1_main.b9_0.sum + a1_main.b10_0.sum; - if (result == 6266) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00040.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00040 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00040.java + *- @ExecuteClass: Nocycle_a_00040 + *- @ExecuteArgs: + */ +class Nocycle_a_00040_A1 { + Nocycle_a_00040_B1 b1_0; + Nocycle_a_00040_B2 b2_0; + Nocycle_a_00040_B3 b3_0; + Nocycle_a_00040_B4 b4_0; + Nocycle_a_00040_B5 b5_0; + Nocycle_a_00040_B6 b6_0; + Nocycle_a_00040_B7 b7_0; + Nocycle_a_00040_B8 b8_0; + Nocycle_a_00040_B9 b9_0; + Nocycle_a_00040_B10 b10_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + b5_0 = null; + b6_0 = null; + b7_0 = null; + b8_0 = null; + b9_0 = null; + b10_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + b5_0.a + b6_0.a + b7_0.a + b8_0.a + b9_0.a + b10_0.a; + } +} + +class Nocycle_a_00040_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00040_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_00040_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00040_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00040_B5 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B5(String strObjectName) { + a = 205; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B5_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00040_B6 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B6(String strObjectName) { + a = 206; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B6_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00040_B7 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B7(String strObjectName) { + a = 207; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B7_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_00040_B8 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B8(String strObjectName) { + a = 208; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B8_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00040_B9 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B9(String strObjectName) { + a = 209; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B9_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00040_B10 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B10(String strObjectName) { + a = 210; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B10_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00040 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00040_A1 a1_main = new Nocycle_a_00040_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00040_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00040_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00040_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00040_B4("b4_0"); + a1_main.b5_0 = new Nocycle_a_00040_B5("b5_0"); + a1_main.b6_0 = new Nocycle_a_00040_B6("b6_0"); + a1_main.b7_0 = new Nocycle_a_00040_B7("b7_0"); + a1_main.b8_0 = new Nocycle_a_00040_B8("b8_0"); + a1_main.b9_0 = new Nocycle_a_00040_B9("b9_0"); + a1_main.b10_0 = new Nocycle_a_00040_B10("b10_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b5_0.add(); + a1_main.b6_0.add(); + a1_main.b7_0.add(); + a1_main.b8_0.add(); + a1_main.b9_0.add(); + a1_main.b10_0.add(); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b5_0.sum + a1_main.b6_0.sum + a1_main.b7_0.sum + a1_main.b8_0.sum + a1_main.b9_0.sum + a1_main.b10_0.sum; + if (result == 6266) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0086-rc-function-Nocycle_a_00050/Nocycle_a_00050.java b/test/testsuite/ouroboros/memory_management/Function/RC0086-rc-function-Nocycle_a_00050/Nocycle_a_00050.java index 226a68dce68f8c43f46dbf8c523efaaa787c5847..476c6459300191bd134812b83e49e88424310b1c 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0086-rc-function-Nocycle_a_00050/Nocycle_a_00050.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0086-rc-function-Nocycle_a_00050/Nocycle_a_00050.java @@ -1,214 +1,214 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00050.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00050 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00050.java - *- @ExecuteClass: Nocycle_a_00050 - *- @ExecuteArgs: - */ -class Nocycle_a_00050_A1 { - Nocycle_a_00050_B1 b1_0; - Nocycle_a_00050_B2 b2_0; - Nocycle_a_00050_B3 b3_0; - Nocycle_a_00050_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } -} - -class Nocycle_a_00050_B1 { - Nocycle_a_00050_C1 c1_0; - Nocycle_a_00050_C2 c2_0; - Nocycle_a_00050_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } -} - -class Nocycle_a_00050_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_00050_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00050_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00050_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00050_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00050_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00050 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00050_A1 a1_main = new Nocycle_a_00050_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00050_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00050_C1("c1_0"); - a1_main.b1_0.c2_0 = new Nocycle_a_00050_C2("c2_0"); - a1_main.b1_0.c3_0 = new Nocycle_a_00050_C3("c3_0"); - a1_main.b2_0 = new Nocycle_a_00050_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00050_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00050_B4("b4_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c2_0.add(); - a1_main.b1_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c2_0.sum+a1_main.b1_0.c3_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c2_0.sum + a1_main.b1_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 5048) - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00050.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00050 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00050.java + *- @ExecuteClass: Nocycle_a_00050 + *- @ExecuteArgs: + */ +class Nocycle_a_00050_A1 { + Nocycle_a_00050_B1 b1_0; + Nocycle_a_00050_B2 b2_0; + Nocycle_a_00050_B3 b3_0; + Nocycle_a_00050_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } +} + +class Nocycle_a_00050_B1 { + Nocycle_a_00050_C1 c1_0; + Nocycle_a_00050_C2 c2_0; + Nocycle_a_00050_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } +} + +class Nocycle_a_00050_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_00050_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00050_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00050_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00050_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00050_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00050 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00050_A1 a1_main = new Nocycle_a_00050_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00050_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00050_C1("c1_0"); + a1_main.b1_0.c2_0 = new Nocycle_a_00050_C2("c2_0"); + a1_main.b1_0.c3_0 = new Nocycle_a_00050_C3("c3_0"); + a1_main.b2_0 = new Nocycle_a_00050_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00050_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00050_B4("b4_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c2_0.add(); + a1_main.b1_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c2_0.sum+a1_main.b1_0.c3_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c2_0.sum + a1_main.b1_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 5048) + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0087-rc-function-Nocycle_a_00060/Nocycle_a_00060.java b/test/testsuite/ouroboros/memory_management/Function/RC0087-rc-function-Nocycle_a_00060/Nocycle_a_00060.java index 0a83289e6c6bcb2662e56bdde253a41383b1dc86..a59d0d1a94f9f5ee652218d367d0cf19492bbd46 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0087-rc-function-Nocycle_a_00060/Nocycle_a_00060.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0087-rc-function-Nocycle_a_00060/Nocycle_a_00060.java @@ -1,213 +1,213 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00060.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00060 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00060.java - *- @ExecuteClass: Nocycle_a_00060 - *- @ExecuteArgs: - */ -class Nocycle_a_00060_A1 { - Nocycle_a_00060_B1 b1_0; - Nocycle_a_00060_B2 b2_0; - Nocycle_a_00060_B3 b3_0; - Nocycle_a_00060_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } -} - -class Nocycle_a_00060_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00060_B2 { - Nocycle_a_00060_C1 c1_0; - Nocycle_a_00060_C2 c2_0; - Nocycle_a_00060_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B2(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } -} - - -class Nocycle_a_00060_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00060_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00060_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00060_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00060_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00060 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00060_A1 a1_main = new Nocycle_a_00060_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00060_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00060_B2("b2_0"); - a1_main.b2_0.c1_0 = new Nocycle_a_00060_C1("c1_0"); - a1_main.b2_0.c2_0 = new Nocycle_a_00060_C2("c2_0"); - a1_main.b2_0.c3_0 = new Nocycle_a_00060_C3("c3_0"); - a1_main.b3_0 = new Nocycle_a_00060_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00060_B4("b4_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b2_0.c1_0.add(); - a1_main.b2_0.c2_0.add(); - a1_main.b2_0.c3_0.add(); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c1_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b2_0.c3_0.sum; - if (result == 5047) - System.out.println("ExpectResult"); - - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00060.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00060 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00060.java + *- @ExecuteClass: Nocycle_a_00060 + *- @ExecuteArgs: + */ +class Nocycle_a_00060_A1 { + Nocycle_a_00060_B1 b1_0; + Nocycle_a_00060_B2 b2_0; + Nocycle_a_00060_B3 b3_0; + Nocycle_a_00060_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } +} + +class Nocycle_a_00060_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00060_B2 { + Nocycle_a_00060_C1 c1_0; + Nocycle_a_00060_C2 c2_0; + Nocycle_a_00060_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B2(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } +} + + +class Nocycle_a_00060_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00060_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00060_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00060_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00060_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00060 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00060_A1 a1_main = new Nocycle_a_00060_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00060_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00060_B2("b2_0"); + a1_main.b2_0.c1_0 = new Nocycle_a_00060_C1("c1_0"); + a1_main.b2_0.c2_0 = new Nocycle_a_00060_C2("c2_0"); + a1_main.b2_0.c3_0 = new Nocycle_a_00060_C3("c3_0"); + a1_main.b3_0 = new Nocycle_a_00060_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00060_B4("b4_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b2_0.c1_0.add(); + a1_main.b2_0.c2_0.add(); + a1_main.b2_0.c3_0.add(); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c1_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b2_0.c3_0.sum; + if (result == 5047) + System.out.println("ExpectResult"); + + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0088-rc-function-Nocycle_a_00070/Nocycle_a_00070.java b/test/testsuite/ouroboros/memory_management/Function/RC0088-rc-function-Nocycle_a_00070/Nocycle_a_00070.java index 0101fcc9ae1eeb1cb05b7b5b2a2917aaccdfaebc..9522591451536553f46e570b9cf1a3445cfcbb00 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0088-rc-function-Nocycle_a_00070/Nocycle_a_00070.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0088-rc-function-Nocycle_a_00070/Nocycle_a_00070.java @@ -1,219 +1,219 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00070.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00070 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00070.java - *- @ExecuteClass: Nocycle_a_00070 - *- @ExecuteArgs: - */ -class Nocycle_a_00070_A1 { - Nocycle_a_00070_B1 b1_0; - Nocycle_a_00070_B2 b2_0; - Nocycle_a_00070_B3 b3_0; - Nocycle_a_00070_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } -} - -class Nocycle_a_00070_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_00070_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_00070_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_00070_B4 { - Nocycle_a_00070_C1 c1_0; - Nocycle_a_00070_C2 c2_0; - Nocycle_a_00070_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B4(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } -} - - -class Nocycle_a_00070_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00070_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00070_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00070 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00070_A1 a1_main = new Nocycle_a_00070_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00070_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00070_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00070_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00070_B4("b4_0"); - a1_main.b4_0.c1_0 = new Nocycle_a_00070_C1("c1_0"); - a1_main.b4_0.c2_0 = new Nocycle_a_00070_C2("c2_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_00070_C3("c3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b4_0.c1_0.add(); - a1_main.b4_0.c2_0.add(); - a1_main.b4_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 5045) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00070.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00070 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00070.java + *- @ExecuteClass: Nocycle_a_00070 + *- @ExecuteArgs: + */ +class Nocycle_a_00070_A1 { + Nocycle_a_00070_B1 b1_0; + Nocycle_a_00070_B2 b2_0; + Nocycle_a_00070_B3 b3_0; + Nocycle_a_00070_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } +} + +class Nocycle_a_00070_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_00070_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_00070_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_00070_B4 { + Nocycle_a_00070_C1 c1_0; + Nocycle_a_00070_C2 c2_0; + Nocycle_a_00070_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B4(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } +} + + +class Nocycle_a_00070_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00070_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00070_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00070 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00070_A1 a1_main = new Nocycle_a_00070_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00070_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00070_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00070_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00070_B4("b4_0"); + a1_main.b4_0.c1_0 = new Nocycle_a_00070_C1("c1_0"); + a1_main.b4_0.c2_0 = new Nocycle_a_00070_C2("c2_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_00070_C3("c3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b4_0.c1_0.add(); + a1_main.b4_0.c2_0.add(); + a1_main.b4_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 5045) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0089-rc-function-Nocycle_a_00080/Nocycle_a_00080.java b/test/testsuite/ouroboros/memory_management/Function/RC0089-rc-function-Nocycle_a_00080/Nocycle_a_00080.java index 36f7b6a8f85b8e93cc5e665576590b7cc0fe9910..b0d96dfa875304cfb2d0dce1b4fc621134d62753 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0089-rc-function-Nocycle_a_00080/Nocycle_a_00080.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0089-rc-function-Nocycle_a_00080/Nocycle_a_00080.java @@ -1,111 +1,111 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00080.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00080 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00080.java - *- @ExecuteClass: Nocycle_a_00080 - *- @ExecuteArgs: - */ -class Nocycle_a_00080_A1 { - Nocycle_a_00080_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00080_B1 { - Nocycle_a_00080_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_a_00080_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_a_00080 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00080_A1 a1_main = new Nocycle_a_00080_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00080_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00080_C1("c1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 1406) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00080.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00080 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00080.java + *- @ExecuteClass: Nocycle_a_00080 + *- @ExecuteArgs: + */ +class Nocycle_a_00080_A1 { + Nocycle_a_00080_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00080_B1 { + Nocycle_a_00080_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_a_00080_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_a_00080 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00080_A1 a1_main = new Nocycle_a_00080_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00080_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00080_C1("c1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 1406) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0090-rc-function-Nocycle_a_00090/Nocycle_a_00090.java b/test/testsuite/ouroboros/memory_management/Function/RC0090-rc-function-Nocycle_a_00090/Nocycle_a_00090.java index 60b166886b1394a8fc4ab02ee86664bcfac1c9e6..3ef36031137d0781a2cc5eb48f2718acca6252bd 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0090-rc-function-Nocycle_a_00090/Nocycle_a_00090.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0090-rc-function-Nocycle_a_00090/Nocycle_a_00090.java @@ -1,132 +1,132 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00090.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00090 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00090.java - *- @ExecuteClass: Nocycle_a_00090 - *- @ExecuteArgs: - */ -class Nocycle_a_00090_A1 { - Nocycle_a_00090_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00090_B1 { - Nocycle_a_00090_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_a_00090_C1 { - Nocycle_a_00090_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_a_00090_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_a_00090 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00090_A1 a1_main = new Nocycle_a_00090_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00090_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00090_C1("c1_0"); - a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00090_D1("d1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c1_0.d1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 2308) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00090.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00090 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00090.java + *- @ExecuteClass: Nocycle_a_00090 + *- @ExecuteArgs: + */ +class Nocycle_a_00090_A1 { + Nocycle_a_00090_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00090_B1 { + Nocycle_a_00090_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_a_00090_C1 { + Nocycle_a_00090_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_a_00090_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_a_00090 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00090_A1 a1_main = new Nocycle_a_00090_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00090_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00090_C1("c1_0"); + a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00090_D1("d1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c1_0.d1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 2308) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0091-rc-function-Nocycle_a_00100/Nocycle_a_00100.java b/test/testsuite/ouroboros/memory_management/Function/RC0091-rc-function-Nocycle_a_00100/Nocycle_a_00100.java index b4cf56a1cacc672c41a36d6d13df890c50e76e8a..5d67ee42a88341bf96325fb22457d709fd2d468b 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0091-rc-function-Nocycle_a_00100/Nocycle_a_00100.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0091-rc-function-Nocycle_a_00100/Nocycle_a_00100.java @@ -1,259 +1,259 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00100.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00100 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00100.java - *- @ExecuteClass: Nocycle_a_00100 - *- @ExecuteArgs: - */ -class Nocycle_a_00100_A1 { - Nocycle_a_00100_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00100_B1 { - Nocycle_a_00100_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_a_00100_C1 { - Nocycle_a_00100_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_a_00100_D1 { - Nocycle_a_00100_E1 e1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_D1(String strObjectName) { - e1_0 = null; - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + e1_0.a; - } -} - -class Nocycle_a_00100_E1 { - Nocycle_a_00100_F1 f1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_E1(String strObjectName) { - f1_0 = null; - a = 501; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_E1_"+strObjectName); - } - - void add() { - sum = a + f1_0.a; - } -} - - -class Nocycle_a_00100_F1 { - Nocycle_a_00100_G1 g1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_F1(String strObjectName) { - g1_0 = null; - a = 601; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_F1_"+strObjectName); - } - - void add() { - sum = a + g1_0.a; - } -} - -class Nocycle_a_00100_G1 { - Nocycle_a_00100_H1 h1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_G1(String strObjectName) { - h1_0 = null; - a = 701; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_G1_"+strObjectName); - } - - void add() { - sum = a + h1_0.a; - } -} - - -class Nocycle_a_00100_H1 { - Nocycle_a_00100_I1 i1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_H1(String strObjectName) { - i1_0 = null; - a = 801; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_H1_"+strObjectName); - } - - void add() { - sum = a + i1_0.a; - } -} - - -class Nocycle_a_00100_I1 { - Nocycle_a_00100_J1 j1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_I1(String strObjectName) { - j1_0 = null; - a = 901; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_I1_"+strObjectName); - } - - void add() { - sum = a + j1_0.a; - } -} - -class Nocycle_a_00100_J1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_J1(String strObjectName) { - a = 1001; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_J1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_a_00100 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00100_A1 a1_main = new Nocycle_a_00100_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00100_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00100_C1("c1_0"); - a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00100_D1("d1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_00100_E1("e1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_00100_F1("f1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_00100_G1("g1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_00100_H1("h1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_00100_I1("i1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_00100_J1("j1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c1_0.d1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; - - if (result == 11920) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00100.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00100 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00100.java + *- @ExecuteClass: Nocycle_a_00100 + *- @ExecuteArgs: + */ +class Nocycle_a_00100_A1 { + Nocycle_a_00100_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00100_B1 { + Nocycle_a_00100_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_a_00100_C1 { + Nocycle_a_00100_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_a_00100_D1 { + Nocycle_a_00100_E1 e1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_D1(String strObjectName) { + e1_0 = null; + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + e1_0.a; + } +} + +class Nocycle_a_00100_E1 { + Nocycle_a_00100_F1 f1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_E1(String strObjectName) { + f1_0 = null; + a = 501; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_E1_"+strObjectName); + } + + void add() { + sum = a + f1_0.a; + } +} + + +class Nocycle_a_00100_F1 { + Nocycle_a_00100_G1 g1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_F1(String strObjectName) { + g1_0 = null; + a = 601; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_F1_"+strObjectName); + } + + void add() { + sum = a + g1_0.a; + } +} + +class Nocycle_a_00100_G1 { + Nocycle_a_00100_H1 h1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_G1(String strObjectName) { + h1_0 = null; + a = 701; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_G1_"+strObjectName); + } + + void add() { + sum = a + h1_0.a; + } +} + + +class Nocycle_a_00100_H1 { + Nocycle_a_00100_I1 i1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_H1(String strObjectName) { + i1_0 = null; + a = 801; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_H1_"+strObjectName); + } + + void add() { + sum = a + i1_0.a; + } +} + + +class Nocycle_a_00100_I1 { + Nocycle_a_00100_J1 j1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_I1(String strObjectName) { + j1_0 = null; + a = 901; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_I1_"+strObjectName); + } + + void add() { + sum = a + j1_0.a; + } +} + +class Nocycle_a_00100_J1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_J1(String strObjectName) { + a = 1001; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_J1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_a_00100 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00100_A1 a1_main = new Nocycle_a_00100_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00100_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00100_C1("c1_0"); + a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00100_D1("d1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_00100_E1("e1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_00100_F1("f1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_00100_G1("g1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_00100_H1("h1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_00100_I1("i1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_00100_J1("j1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c1_0.d1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; + + if (result == 11920) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0092-rc-function-Nocycle_a_00110/Nocycle_a_00110.java b/test/testsuite/ouroboros/memory_management/Function/RC0092-rc-function-Nocycle_a_00110/Nocycle_a_00110.java index 3197a4bf1692a3102bf1f6fc354562675a41aa0a..2c3a8291903fa1173203ebb4f3082c2b06344fd5 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0092-rc-function-Nocycle_a_00110/Nocycle_a_00110.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0092-rc-function-Nocycle_a_00110/Nocycle_a_00110.java @@ -1,320 +1,320 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00110.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00110 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00110.java - *- @ExecuteClass: Nocycle_a_00110 - *- @ExecuteArgs: - */ -class Nocycle_a_00110_A1 { - Nocycle_a_00110_B1 b1_0; - Nocycle_a_00110_B2 b2_0; - Nocycle_a_00110_B3 b3_0; - Nocycle_a_00110_B4 b4_0; - Nocycle_a_00110_D5 d5_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - d5_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + d5_0.a; - } -} - -class Nocycle_a_00110_B1 { - Nocycle_a_00110_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - - -class Nocycle_a_00110_B2 { - Nocycle_a_00110_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B2(String strObjectName) { - c2_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c2_0.a; - } -} - - -class Nocycle_a_00110_B3 { - Nocycle_a_00110_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_a_00110_B4 { - Nocycle_a_00110_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B4(String strObjectName) { - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c3_0.a; - } -} - - -class Nocycle_a_00110_C1 { - Nocycle_a_00110_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C1(String strObjectName) { - d2_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } -} - -class Nocycle_a_00110_C2 { - Nocycle_a_00110_D3 d3_0; - Nocycle_a_00110_D4 d4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C2(String strObjectName) { - d3_0 = null; - d4_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d3_0.a + d4_0.a; - } -} - -class Nocycle_a_00110_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_00110_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00110_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00110_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00110_D4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D4(String strObjectName) { - a = 404; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D4_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00110_D5 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D5(String strObjectName) { - a = 405; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D5_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00110 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00110_A1 a1_main = new Nocycle_a_00110_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00110_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00110_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00110_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00110_B4("b4_0"); - a1_main.b1_0.d1_0 = new Nocycle_a_00110_D1("d1_0"); - a1_main.b2_0.c2_0 = new Nocycle_a_00110_C2("c2_0"); - a1_main.b3_0.c1_0 = new Nocycle_a_00110_C1("c1_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_00110_C3("c3_0"); - a1_main.b3_0.c1_0.d2_0 = new Nocycle_a_00110_D2("d2_0"); - a1_main.b2_0.c2_0.d3_0 = new Nocycle_a_00110_D3("d3_0"); - a1_main.b2_0.c2_0.d4_0 = new Nocycle_a_00110_D4("d4_0"); - a1_main.d5_0 = new Nocycle_a_00110_D5("d5_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b2_0.c2_0.add(); - a1_main.b3_0.c1_0.add(); - a1_main.b4_0.c3_0.add(); - a1_main.b1_0.d1_0.add(); - a1_main.b3_0.c1_0.d2_0.add(); - a1_main.b2_0.c2_0.d3_0.add(); - a1_main.b2_0.c2_0.d4_0.add(); - a1_main.d5_0.add(); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b3_0.c1_0.sum + a1_main.b4_0.c3_0.sum + a1_main.b1_0.d1_0.sum + a1_main.b3_0.c1_0.d2_0.sum + a1_main.b2_0.c2_0.d3_0.sum + a1_main.b2_0.c2_0.d4_0.sum + a1_main.d5_0.sum; - if (result == 9881) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00110.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00110 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00110.java + *- @ExecuteClass: Nocycle_a_00110 + *- @ExecuteArgs: + */ +class Nocycle_a_00110_A1 { + Nocycle_a_00110_B1 b1_0; + Nocycle_a_00110_B2 b2_0; + Nocycle_a_00110_B3 b3_0; + Nocycle_a_00110_B4 b4_0; + Nocycle_a_00110_D5 d5_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + d5_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + d5_0.a; + } +} + +class Nocycle_a_00110_B1 { + Nocycle_a_00110_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + + +class Nocycle_a_00110_B2 { + Nocycle_a_00110_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B2(String strObjectName) { + c2_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c2_0.a; + } +} + + +class Nocycle_a_00110_B3 { + Nocycle_a_00110_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_a_00110_B4 { + Nocycle_a_00110_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B4(String strObjectName) { + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c3_0.a; + } +} + + +class Nocycle_a_00110_C1 { + Nocycle_a_00110_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C1(String strObjectName) { + d2_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } +} + +class Nocycle_a_00110_C2 { + Nocycle_a_00110_D3 d3_0; + Nocycle_a_00110_D4 d4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C2(String strObjectName) { + d3_0 = null; + d4_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d3_0.a + d4_0.a; + } +} + +class Nocycle_a_00110_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_00110_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00110_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00110_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00110_D4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D4(String strObjectName) { + a = 404; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D4_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00110_D5 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D5(String strObjectName) { + a = 405; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D5_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00110 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00110_A1 a1_main = new Nocycle_a_00110_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00110_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00110_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00110_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00110_B4("b4_0"); + a1_main.b1_0.d1_0 = new Nocycle_a_00110_D1("d1_0"); + a1_main.b2_0.c2_0 = new Nocycle_a_00110_C2("c2_0"); + a1_main.b3_0.c1_0 = new Nocycle_a_00110_C1("c1_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_00110_C3("c3_0"); + a1_main.b3_0.c1_0.d2_0 = new Nocycle_a_00110_D2("d2_0"); + a1_main.b2_0.c2_0.d3_0 = new Nocycle_a_00110_D3("d3_0"); + a1_main.b2_0.c2_0.d4_0 = new Nocycle_a_00110_D4("d4_0"); + a1_main.d5_0 = new Nocycle_a_00110_D5("d5_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b2_0.c2_0.add(); + a1_main.b3_0.c1_0.add(); + a1_main.b4_0.c3_0.add(); + a1_main.b1_0.d1_0.add(); + a1_main.b3_0.c1_0.d2_0.add(); + a1_main.b2_0.c2_0.d3_0.add(); + a1_main.b2_0.c2_0.d4_0.add(); + a1_main.d5_0.add(); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b3_0.c1_0.sum + a1_main.b4_0.c3_0.sum + a1_main.b1_0.d1_0.sum + a1_main.b3_0.c1_0.d2_0.sum + a1_main.b2_0.c2_0.d3_0.sum + a1_main.b2_0.c2_0.d4_0.sum + a1_main.d5_0.sum; + if (result == 9881) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0093-rc-function-Nocycle_a_00120/Nocycle_a_00120.java b/test/testsuite/ouroboros/memory_management/Function/RC0093-rc-function-Nocycle_a_00120/Nocycle_a_00120.java index 8858556de5b2e6f05ac7e3cda2d789719c0b1a7e..48748c382b6c41bb4ac57fa5aa690eb61ad22acf 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0093-rc-function-Nocycle_a_00120/Nocycle_a_00120.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0093-rc-function-Nocycle_a_00120/Nocycle_a_00120.java @@ -1,99 +1,99 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00120.java - * -@TestCaseName:MyselfClassName - * -@RequirementName:[运行时需求]支持自动内存管理 - * -@Title/Destination: Nocycle_a_00120 in RC测试-No-Cycle-00.vsd. - * -@Brief:functionTest - * -@Expect:ExpectResult\n - * -@Priority: High - * -@Source: Nocycle_a_00120.java - * -@ExecuteClass: Nocycle_a_00120 - * -@ExecuteArgs: - */ -class Nocycle_a_00120_A1 { - Nocycle_a_00120_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00120_A2 { - Nocycle_a_00120_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00120_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00120 { - - public static void main(String[] args) { - Nocycle_a_00120_A1 a1_main = new Nocycle_a_00120_A1("a1_main"); - Nocycle_a_00120_A2 a2_main = new Nocycle_a_00120_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); - a2_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a2_main.b1_0.add(); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum; - if (result == 1007) { - System.out.println("ExpectResult"); - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00120.java + * -@TestCaseName:MyselfClassName + * -@RequirementName:[运行时需求]支持自动内存管理 + * -@Title/Destination: Nocycle_a_00120 in RC测试-No-Cycle-00.vsd. + * -@Brief:functionTest + * -@Expect:ExpectResult\n + * -@Priority: High + * -@Source: Nocycle_a_00120.java + * -@ExecuteClass: Nocycle_a_00120 + * -@ExecuteArgs: + */ +class Nocycle_a_00120_A1 { + Nocycle_a_00120_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00120_A2 { + Nocycle_a_00120_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00120_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00120 { + + public static void main(String[] args) { + Nocycle_a_00120_A1 a1_main = new Nocycle_a_00120_A1("a1_main"); + Nocycle_a_00120_A2 a2_main = new Nocycle_a_00120_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); + a2_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a2_main.b1_0.add(); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum; + if (result == 1007) { + System.out.println("ExpectResult"); + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0094-rc-function-Nocycle_a_00130/Nocycle_a_00130.java b/test/testsuite/ouroboros/memory_management/Function/RC0094-rc-function-Nocycle_a_00130/Nocycle_a_00130.java index b7fdc50fab2820949637a072acf1ae7721d9be61..1d113efeea0b6028ad7c0c29f046dbc94d1e1bb8 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0094-rc-function-Nocycle_a_00130/Nocycle_a_00130.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0094-rc-function-Nocycle_a_00130/Nocycle_a_00130.java @@ -1,298 +1,298 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00130.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00130 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00130.java - *- @ExecuteClass: Nocycle_a_00130 - *- @ExecuteArgs: - */ -class Nocycle_a_00130_A1 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00130_A2 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - - -class Nocycle_a_00130_A3 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A3(String strObjectName) { - b1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00130_A4 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A4(String strObjectName) { - b1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00130_A5 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A5(String strObjectName) { - b1_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - - -class Nocycle_a_00130_A6 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A6(String strObjectName) { - b1_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00130_A7 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A7(String strObjectName) { - b1_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00130_A8 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A8(String strObjectName) { - b1_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00130_A9 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A9(String strObjectName) { - b1_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_00130_A10 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A10(String strObjectName) { - b1_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - - -class Nocycle_a_00130_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_a_00130 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00130_A1 a1_main = new Nocycle_a_00130_A1("a1_main"); - Nocycle_a_00130_A2 a2_main = new Nocycle_a_00130_A2("a2_main"); - Nocycle_a_00130_A3 a3_main = new Nocycle_a_00130_A3("a3_main"); - Nocycle_a_00130_A4 a4_main = new Nocycle_a_00130_A4("a4_main"); - Nocycle_a_00130_A5 a5_main = new Nocycle_a_00130_A5("a5_main"); - Nocycle_a_00130_A6 a6_main = new Nocycle_a_00130_A6("a6_main"); - Nocycle_a_00130_A7 a7_main = new Nocycle_a_00130_A7("a7_main"); - Nocycle_a_00130_A8 a8_main = new Nocycle_a_00130_A8("a8_main"); - Nocycle_a_00130_A9 a9_main = new Nocycle_a_00130_A9("a9_main"); - Nocycle_a_00130_A10 a10_main = new Nocycle_a_00130_A10("a10_main"); - a1_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a2_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a3_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a4_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a5_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a6_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a7_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a8_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a9_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a10_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a5_main.add(); - a6_main.add(); - a7_main.add(); - a8_main.add(); - a9_main.add(); - a10_main.add(); - a1_main.b1_0.add(); - a2_main.b1_0.add(); - a3_main.b1_0.add(); - a4_main.b1_0.add(); - a5_main.b1_0.add(); - a6_main.b1_0.add(); - a7_main.b1_0.add(); - a8_main.b1_0.add(); - a9_main.b1_0.add(); - a10_main.b1_0.add(); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a5_main.sum + a6_main.sum + a7_main.sum + a8_main.sum + a9_main.sum + a10_main.sum + a1_main.b1_0.sum; - - if (result == 3467) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00130.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00130 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00130.java + *- @ExecuteClass: Nocycle_a_00130 + *- @ExecuteArgs: + */ +class Nocycle_a_00130_A1 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00130_A2 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + + +class Nocycle_a_00130_A3 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A3(String strObjectName) { + b1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00130_A4 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A4(String strObjectName) { + b1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00130_A5 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A5(String strObjectName) { + b1_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + + +class Nocycle_a_00130_A6 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A6(String strObjectName) { + b1_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00130_A7 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A7(String strObjectName) { + b1_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00130_A8 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A8(String strObjectName) { + b1_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00130_A9 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A9(String strObjectName) { + b1_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_00130_A10 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A10(String strObjectName) { + b1_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + + +class Nocycle_a_00130_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_a_00130 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00130_A1 a1_main = new Nocycle_a_00130_A1("a1_main"); + Nocycle_a_00130_A2 a2_main = new Nocycle_a_00130_A2("a2_main"); + Nocycle_a_00130_A3 a3_main = new Nocycle_a_00130_A3("a3_main"); + Nocycle_a_00130_A4 a4_main = new Nocycle_a_00130_A4("a4_main"); + Nocycle_a_00130_A5 a5_main = new Nocycle_a_00130_A5("a5_main"); + Nocycle_a_00130_A6 a6_main = new Nocycle_a_00130_A6("a6_main"); + Nocycle_a_00130_A7 a7_main = new Nocycle_a_00130_A7("a7_main"); + Nocycle_a_00130_A8 a8_main = new Nocycle_a_00130_A8("a8_main"); + Nocycle_a_00130_A9 a9_main = new Nocycle_a_00130_A9("a9_main"); + Nocycle_a_00130_A10 a10_main = new Nocycle_a_00130_A10("a10_main"); + a1_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a2_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a3_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a4_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a5_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a6_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a7_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a8_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a9_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a10_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a5_main.add(); + a6_main.add(); + a7_main.add(); + a8_main.add(); + a9_main.add(); + a10_main.add(); + a1_main.b1_0.add(); + a2_main.b1_0.add(); + a3_main.b1_0.add(); + a4_main.b1_0.add(); + a5_main.b1_0.add(); + a6_main.b1_0.add(); + a7_main.b1_0.add(); + a8_main.b1_0.add(); + a9_main.b1_0.add(); + a10_main.b1_0.add(); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a5_main.sum + a6_main.sum + a7_main.sum + a8_main.sum + a9_main.sum + a10_main.sum + a1_main.b1_0.sum; + + if (result == 3467) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0095-rc-function-Nocycle_a_00140/Nocycle_a_00140.java b/test/testsuite/ouroboros/memory_management/Function/RC0095-rc-function-Nocycle_a_00140/Nocycle_a_00140.java index 37f973b00792e19eedfb518f4eeef0b575e7cf8a..8f41814106620dc307d2ec20dac57e7417897793 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0095-rc-function-Nocycle_a_00140/Nocycle_a_00140.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0095-rc-function-Nocycle_a_00140/Nocycle_a_00140.java @@ -1,131 +1,131 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00140.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00140 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00140.java - *- @ExecuteClass: Nocycle_a_00140 - *- @ExecuteArgs: - */ -class Nocycle_a_00140_A1 { - Nocycle_a_00140_B1 b1_0; - Nocycle_a_00140_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - -class Nocycle_a_00140_A2 { - Nocycle_a_00140_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - - -class Nocycle_a_00140_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00140_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00140 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00140_A1 a1_main = new Nocycle_a_00140_A1("a1_main"); - Nocycle_a_00140_A2 a2_main = new Nocycle_a_00140_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00140_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - if (result == 1613) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00140.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00140 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00140.java + *- @ExecuteClass: Nocycle_a_00140 + *- @ExecuteArgs: + */ +class Nocycle_a_00140_A1 { + Nocycle_a_00140_B1 b1_0; + Nocycle_a_00140_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + +class Nocycle_a_00140_A2 { + Nocycle_a_00140_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + + +class Nocycle_a_00140_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00140_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00140 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00140_A1 a1_main = new Nocycle_a_00140_A1("a1_main"); + Nocycle_a_00140_A2 a2_main = new Nocycle_a_00140_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00140_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + if (result == 1613) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0096-rc-function-Nocycle_a_00150/Nocycle_a_00150.java b/test/testsuite/ouroboros/memory_management/Function/RC0096-rc-function-Nocycle_a_00150/Nocycle_a_00150.java index 6ef30c1adb0aa5d5b6c413f728754cea4d3d009b..50de371b2c2e1705ca7651f93f2e1875e4dba150 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0096-rc-function-Nocycle_a_00150/Nocycle_a_00150.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0096-rc-function-Nocycle_a_00150/Nocycle_a_00150.java @@ -1,134 +1,134 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00150.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00150 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00150.java - *- @ExecuteClass: Nocycle_a_00150 - *- @ExecuteArgs: - */ -class Nocycle_a_00150_A1 { - Nocycle_a_00150_B1 b1_0; - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - -class Nocycle_a_00150_A2 { - Nocycle_a_00150_B1 b1_0; - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - - -class Nocycle_a_00150_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00150_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00150 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); - Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - if (result == 1815) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00150.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00150 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00150.java + *- @ExecuteClass: Nocycle_a_00150 + *- @ExecuteArgs: + */ +class Nocycle_a_00150_A1 { + Nocycle_a_00150_B1 b1_0; + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + +class Nocycle_a_00150_A2 { + Nocycle_a_00150_B1 b1_0; + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + + +class Nocycle_a_00150_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00150_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00150 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); + Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + if (result == 1815) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0097-rc-function-Nocycle_a_00160/Nocycle_a_00160.java b/test/testsuite/ouroboros/memory_management/Function/RC0097-rc-function-Nocycle_a_00160/Nocycle_a_00160.java index 2af760c254771f1c485fe70663ff736765b1105a..e369821fdc6b6f2bc6e33e06623b69ffaae63c09 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0097-rc-function-Nocycle_a_00160/Nocycle_a_00160.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0097-rc-function-Nocycle_a_00160/Nocycle_a_00160.java @@ -1,191 +1,191 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00160.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00160 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00160.java - *- @ExecuteClass: Nocycle_a_00160 - *- @ExecuteArgs: - */ -class Nocycle_a_00160_A1 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - -class Nocycle_a_00160_A2 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - - -class Nocycle_a_00160_A3 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A3(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - -class Nocycle_a_00160_A4 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A4(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } -} - - -class Nocycle_a_00160_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00160_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00160 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00160_A1 a1_main = new Nocycle_a_00160_A1("a1_main"); - Nocycle_a_00160_A2 a2_main = new Nocycle_a_00160_A2("a2_main"); - Nocycle_a_00160_A3 a3_main = new Nocycle_a_00160_A3("a3_main"); - Nocycle_a_00160_A4 a4_main = new Nocycle_a_00160_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a3_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a3_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a4_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a4_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); - a3_main.b1_0.add(); - a3_main.b2_0.add(); - a4_main.b1_0.add(); - a4_main.b2_0.add(); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - - if (result == 2828) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00160.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00160 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00160.java + *- @ExecuteClass: Nocycle_a_00160 + *- @ExecuteArgs: + */ +class Nocycle_a_00160_A1 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + +class Nocycle_a_00160_A2 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + + +class Nocycle_a_00160_A3 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A3(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + +class Nocycle_a_00160_A4 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A4(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } +} + + +class Nocycle_a_00160_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00160_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00160 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00160_A1 a1_main = new Nocycle_a_00160_A1("a1_main"); + Nocycle_a_00160_A2 a2_main = new Nocycle_a_00160_A2("a2_main"); + Nocycle_a_00160_A3 a3_main = new Nocycle_a_00160_A3("a3_main"); + Nocycle_a_00160_A4 a4_main = new Nocycle_a_00160_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a3_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a3_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a4_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a4_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); + a3_main.b1_0.add(); + a3_main.b2_0.add(); + a4_main.b1_0.add(); + a4_main.b2_0.add(); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + + if (result == 2828) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0098-rc-function-Nocycle_a_00170/Nocycle_a_00170.java b/test/testsuite/ouroboros/memory_management/Function/RC0098-rc-function-Nocycle_a_00170/Nocycle_a_00170.java index a0f161ba2d37c1feb212497cfe94db6ddaab262a..3495cf9eb74401da870429f285f19117a6e77b9d 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0098-rc-function-Nocycle_a_00170/Nocycle_a_00170.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0098-rc-function-Nocycle_a_00170/Nocycle_a_00170.java @@ -1,223 +1,223 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00170.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00170 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00170.java - *- @ExecuteClass: Nocycle_a_00170 - *- @ExecuteArgs: - */ -class Nocycle_a_00170_A1 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } -} - -class Nocycle_a_00170_A2 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } -} - - -class Nocycle_a_00170_A3 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A3(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } -} - -class Nocycle_a_00170_A4 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A4(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } -} - - -class Nocycle_a_00170_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00170_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00170_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_00170 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00170_A1 a1_main = new Nocycle_a_00170_A1("a1_main"); - Nocycle_a_00170_A2 a2_main = new Nocycle_a_00170_A2("a2_main"); - Nocycle_a_00170_A3 a3_main = new Nocycle_a_00170_A3("a3_main"); - Nocycle_a_00170_A4 a4_main = new Nocycle_a_00170_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a2_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a2_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a3_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a3_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a3_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a4_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a4_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a4_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); - a2_main.b3_0.add(); - a3_main.b1_0.add(); - a3_main.b2_0.add(); - a3_main.b3_0.add(); - a4_main.b1_0.add(); - a4_main.b2_0.add(); - a4_main.b3_0.add(); - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; - if (result == 4046) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00170.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00170 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00170.java + *- @ExecuteClass: Nocycle_a_00170 + *- @ExecuteArgs: + */ +class Nocycle_a_00170_A1 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } +} + +class Nocycle_a_00170_A2 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } +} + + +class Nocycle_a_00170_A3 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A3(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } +} + +class Nocycle_a_00170_A4 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A4(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } +} + + +class Nocycle_a_00170_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00170_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00170_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_00170 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00170_A1 a1_main = new Nocycle_a_00170_A1("a1_main"); + Nocycle_a_00170_A2 a2_main = new Nocycle_a_00170_A2("a2_main"); + Nocycle_a_00170_A3 a3_main = new Nocycle_a_00170_A3("a3_main"); + Nocycle_a_00170_A4 a4_main = new Nocycle_a_00170_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a2_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a2_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a3_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a3_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a3_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a4_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a4_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a4_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); + a2_main.b3_0.add(); + a3_main.b1_0.add(); + a3_main.b2_0.add(); + a3_main.b3_0.add(); + a4_main.b1_0.add(); + a4_main.b2_0.add(); + a4_main.b3_0.add(); + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; + if (result == 4046) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0099-rc-function-Nocycle_a_00180/Nocycle_a_00180.java b/test/testsuite/ouroboros/memory_management/Function/RC0099-rc-function-Nocycle_a_00180/Nocycle_a_00180.java index 51f17b7f45e38c3953b50812fe623f491ea810f9..6be806959f5065e2b63b41408bb15b43e7fe80b1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0099-rc-function-Nocycle_a_00180/Nocycle_a_00180.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0099-rc-function-Nocycle_a_00180/Nocycle_a_00180.java @@ -1,356 +1,356 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00180.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_00180 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_00180.java - *- @ExecuteClass: Nocycle_a_00180 - *- @ExecuteArgs: - */ -class Nocycle_a_00180_A1 { - Nocycle_a_00180_B1 b1_0; - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } -} - - -class Nocycle_a_00180_A2 { - Nocycle_a_00180_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } -} - - -class Nocycle_a_00180_A3 { - Nocycle_a_00180_B2 b2_0; - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } -} - -class Nocycle_a_00180_A4 { - Nocycle_a_00180_B3 b3_0; - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } -} - - -class Nocycle_a_00180_B1 { - Nocycle_a_00180_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } -} - - -class Nocycle_a_00180_B2 { - Nocycle_a_00180_C1 c1_0; - Nocycle_a_00180_D1 d1_0; - Nocycle_a_00180_D2 d2_0; - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_a_00180_B3 { - Nocycle_a_00180_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_a_00180_C1 { - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_a_00180_C2 { - Nocycle_a_00180_D2 d2_0; - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_a_00180_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00180_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_00180_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_a_00180 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); - Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); - Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); - Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); - a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - - a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a2_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a2_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - - a3_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); - a3_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a3_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a3_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a3_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); - a3_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a3_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); - a4_main.b3_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a4_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); - a4_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a4_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.d1_0.add(); - a1_main.b1_0.d2_0.add(); - - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; - if (result == 9260) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_00180.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_00180 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_00180.java + *- @ExecuteClass: Nocycle_a_00180 + *- @ExecuteArgs: + */ +class Nocycle_a_00180_A1 { + Nocycle_a_00180_B1 b1_0; + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } +} + + +class Nocycle_a_00180_A2 { + Nocycle_a_00180_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } +} + + +class Nocycle_a_00180_A3 { + Nocycle_a_00180_B2 b2_0; + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } +} + +class Nocycle_a_00180_A4 { + Nocycle_a_00180_B3 b3_0; + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } +} + + +class Nocycle_a_00180_B1 { + Nocycle_a_00180_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } +} + + +class Nocycle_a_00180_B2 { + Nocycle_a_00180_C1 c1_0; + Nocycle_a_00180_D1 d1_0; + Nocycle_a_00180_D2 d2_0; + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_a_00180_B3 { + Nocycle_a_00180_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_a_00180_C1 { + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_a_00180_C2 { + Nocycle_a_00180_D2 d2_0; + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_a_00180_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00180_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_00180_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_a_00180 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); + Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); + Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); + Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); + a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + + a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a2_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a2_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + + a3_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); + a3_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a3_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a3_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a3_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); + a3_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a3_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); + a4_main.b3_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a4_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); + a4_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a4_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.d1_0.add(); + a1_main.b1_0.d2_0.add(); + + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; + if (result == 9260) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0100-rc-function-Nocycle_a_2_00010/Nocycle_a_2_00010.java b/test/testsuite/ouroboros/memory_management/Function/RC0100-rc-function-Nocycle_a_2_00010/Nocycle_a_2_00010.java index d6369d39a168a38c76a3637c2fcf5b5cfd79a2dc..9aaebb01af0bd71c381ead603aabedae04611fed 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0100-rc-function-Nocycle_a_2_00010/Nocycle_a_2_00010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0100-rc-function-Nocycle_a_2_00010/Nocycle_a_2_00010.java @@ -1,144 +1,144 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_2_00010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_2_00010 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_2_00010.java - *- @ExecuteClass: Nocycle_a_2_00010 - *- @ExecuteArgs: - */ -class Nocycle_a_2_00010_A1 { - Nocycle_a_2_00010_B1 b1_0; - Nocycle_a_2_00010_B2 b2_0; - Nocycle_a_2_00010_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } -} - -class Nocycle_a_2_00010_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00010_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00010_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00010_A2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_A2(String strObjectName) { - a = 10; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_2_00010 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_2_00010_A1 a1_main = new Nocycle_a_2_00010_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_2_00010_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_2_00010_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_2_00010_B3("b3_0"); - Nocycle_a_2_00010_A2 a2_main = new Nocycle_a_2_00010_A2("a2_main"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a2_main.add(); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a2_main.sum; - if (result == 1939) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_2_00010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_2_00010 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_2_00010.java + *- @ExecuteClass: Nocycle_a_2_00010 + *- @ExecuteArgs: + */ +class Nocycle_a_2_00010_A1 { + Nocycle_a_2_00010_B1 b1_0; + Nocycle_a_2_00010_B2 b2_0; + Nocycle_a_2_00010_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } +} + +class Nocycle_a_2_00010_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00010_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00010_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00010_A2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_A2(String strObjectName) { + a = 10; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_2_00010 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_2_00010_A1 a1_main = new Nocycle_a_2_00010_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_2_00010_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_2_00010_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_2_00010_B3("b3_0"); + Nocycle_a_2_00010_A2 a2_main = new Nocycle_a_2_00010_A2("a2_main"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a2_main.add(); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a2_main.sum; + if (result == 1939) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0101-rc-function-Nocycle_a_2_00020/Nocycle_a_2_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0101-rc-function-Nocycle_a_2_00020/Nocycle_a_2_00020.java index c7e312435e5d373cb59325381703c867d1184b72..d3a2aa9f36723d6dfc1f032b246b7676b8f98121 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0101-rc-function-Nocycle_a_2_00020/Nocycle_a_2_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0101-rc-function-Nocycle_a_2_00020/Nocycle_a_2_00020.java @@ -1,734 +1,734 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_2_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_a_2_00020 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_a_2_00020.java - *- @ExecuteClass: Nocycle_a_2_00020 - *- @ExecuteArgs: - */ -class Nocycle_a_2_00020_A1 { - Nocycle_a_2_00020_B1 b1_0; - Nocycle_a_2_00020_B2 b2_0; - Nocycle_a_2_00020_B3 b3_0; - Nocycle_a_2_00020_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } -} - -class Nocycle_a_2_00020_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_2_00020_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_2_00020_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_a_2_00020_B4 { - Nocycle_a_2_00020_C1 c1_0; - Nocycle_a_2_00020_C2 c2_0; - Nocycle_a_2_00020_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B4(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } -} - - -class Nocycle_a_2_00020_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00020_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00020_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00020_2A1 { - Nocycle_a_2_00020_2B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class Nocycle_a_2_00020_2B1 { - Nocycle_a_2_00020_2C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_a_2_00020_2C1 { - Nocycle_a_2_00020_2D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_a_2_00020_2D1 { - Nocycle_a_2_00020_2E1 e1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2D1(String strObjectName) { - e1_0 = null; - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + e1_0.a; - } -} - -class Nocycle_a_2_00020_2E1 { - Nocycle_a_2_00020_2F1 f1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2E1(String strObjectName) { - f1_0 = null; - a = 501; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_E1_"+strObjectName); - } - - void add() { - sum = a + f1_0.a; - } -} - - -class Nocycle_a_2_00020_2F1 { - Nocycle_a_2_00020_2G1 g1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2F1(String strObjectName) { - g1_0 = null; - a = 601; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_F1_"+strObjectName); - } - - void add() { - sum = a + g1_0.a; - } -} - -class Nocycle_a_2_00020_2G1 { - Nocycle_a_2_00020_2H1 h1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2G1(String strObjectName) { - h1_0 = null; - a = 701; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_G1_"+strObjectName); - } - - void add() { - sum = a + h1_0.a; - } -} - - -class Nocycle_a_2_00020_2H1 { - Nocycle_a_2_00020_2I1 i1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2H1(String strObjectName) { - i1_0 = null; - a = 801; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_H1_"+strObjectName); - } - - void add() { - sum = a + i1_0.a; - } -} - - -class Nocycle_a_2_00020_2I1 { - Nocycle_a_2_00020_2J1 j1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2I1(String strObjectName) { - j1_0 = null; - a = 901; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_I1_"+strObjectName); - } - - void add() { - sum = a + j1_0.a; - } -} - -class Nocycle_a_2_00020_2J1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2J1(String strObjectName) { - a = 1001; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_J1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00020_3A1 { - Nocycle_a_2_00020_3B1 b1_0; - Nocycle_a_2_00020_3D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } -} - - -class Nocycle_a_2_00020_3A2 { - Nocycle_a_2_00020_3B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } -} - - -class Nocycle_a_2_00020_3A3 { - Nocycle_a_2_00020_3B2 b2_0; - Nocycle_a_2_00020_3C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } -} - -class Nocycle_a_2_00020_3A4 { - Nocycle_a_2_00020_3B3 b3_0; - Nocycle_a_2_00020_3C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } -} - - -class Nocycle_a_2_00020_3B1 { - Nocycle_a_2_00020_3D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } -} - - -class Nocycle_a_2_00020_3B2 { - Nocycle_a_2_00020_3C1 c1_0; - Nocycle_a_2_00020_3D1 d1_0; - Nocycle_a_2_00020_3D2 d2_0; - Nocycle_a_2_00020_3D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_a_2_00020_3B3 { - Nocycle_a_2_00020_3C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_a_2_00020_3C1 { - Nocycle_a_2_00020_3D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_a_2_00020_3C2 { - Nocycle_a_2_00020_3D2 d2_0; - Nocycle_a_2_00020_3D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_a_2_00020_3D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00020_3D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_a_2_00020_3D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_a_2_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_a_2_00020_A1 a1_main = new Nocycle_a_2_00020_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_2_00020_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_2_00020_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_2_00020_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_2_00020_B4("b4_0"); - a1_main.b4_0.c1_0 = new Nocycle_a_2_00020_C1("c1_0"); - a1_main.b4_0.c2_0 = new Nocycle_a_2_00020_C2("c2_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_2_00020_C3("c3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b4_0.c1_0.add(); - a1_main.b4_0.c2_0.add(); - a1_main.b4_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); - - int result1 = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result1); - Nocycle_a_2_00020_2A1 a1_main2 = new Nocycle_a_2_00020_2A1("a1_main2"); - a1_main2.b1_0 = new Nocycle_a_2_00020_2B1("b1_0"); - a1_main2.b1_0.c1_0 = new Nocycle_a_2_00020_2C1("c1_0"); - a1_main2.b1_0.c1_0.d1_0 = new Nocycle_a_2_00020_2D1("d1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_2_00020_2E1("e1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_2_00020_2F1("f1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_2_00020_2G1("g1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_2_00020_2H1("h1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_2_00020_2I1("i1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_2_00020_2J1("j1_0"); - a1_main2.add(); - a1_main2.b1_0.add(); - a1_main2.b1_0.c1_0.add(); - a1_main2.b1_0.c1_0.d1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); - - int result2 = a1_main2.sum + a1_main2.b1_0.sum + a1_main2.b1_0.c1_0.sum + a1_main2.b1_0.c1_0.d1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; - Nocycle_a_2_00020_3A1 a1_main3 = new Nocycle_a_2_00020_3A1("a1_main3"); - Nocycle_a_2_00020_3A2 a2_main = new Nocycle_a_2_00020_3A2("a2_main"); - Nocycle_a_2_00020_3A3 a3_main = new Nocycle_a_2_00020_3A3("a3_main"); - Nocycle_a_2_00020_3A4 a4_main = new Nocycle_a_2_00020_3A4("a4_main"); - a1_main3.b1_0 = new Nocycle_a_2_00020_3B1("b1_0"); - a1_main3.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a1_main3.b1_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a2_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a2_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a2_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a3_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); - a3_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a3_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a3_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a3_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - a3_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); - a3_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a3_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - a4_main.b3_0 = new Nocycle_a_2_00020_3B3("b3_0"); - a4_main.b3_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a4_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); - a4_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a4_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - a1_main3.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main3.b1_0.add(); - a1_main3.d1_0.add(); - a1_main3.b1_0.d2_0.add(); - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - int result3 = a1_main3.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main3.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main3.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; - - int result = result1 + result2 + result3; - if (result == 26225) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/Nocycle_a_2_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_a_2_00020 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_a_2_00020.java + *- @ExecuteClass: Nocycle_a_2_00020 + *- @ExecuteArgs: + */ +class Nocycle_a_2_00020_A1 { + Nocycle_a_2_00020_B1 b1_0; + Nocycle_a_2_00020_B2 b2_0; + Nocycle_a_2_00020_B3 b3_0; + Nocycle_a_2_00020_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } +} + +class Nocycle_a_2_00020_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_2_00020_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_2_00020_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_a_2_00020_B4 { + Nocycle_a_2_00020_C1 c1_0; + Nocycle_a_2_00020_C2 c2_0; + Nocycle_a_2_00020_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B4(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } +} + + +class Nocycle_a_2_00020_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00020_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00020_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00020_2A1 { + Nocycle_a_2_00020_2B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class Nocycle_a_2_00020_2B1 { + Nocycle_a_2_00020_2C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_a_2_00020_2C1 { + Nocycle_a_2_00020_2D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_a_2_00020_2D1 { + Nocycle_a_2_00020_2E1 e1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2D1(String strObjectName) { + e1_0 = null; + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + e1_0.a; + } +} + +class Nocycle_a_2_00020_2E1 { + Nocycle_a_2_00020_2F1 f1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2E1(String strObjectName) { + f1_0 = null; + a = 501; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_E1_"+strObjectName); + } + + void add() { + sum = a + f1_0.a; + } +} + + +class Nocycle_a_2_00020_2F1 { + Nocycle_a_2_00020_2G1 g1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2F1(String strObjectName) { + g1_0 = null; + a = 601; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_F1_"+strObjectName); + } + + void add() { + sum = a + g1_0.a; + } +} + +class Nocycle_a_2_00020_2G1 { + Nocycle_a_2_00020_2H1 h1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2G1(String strObjectName) { + h1_0 = null; + a = 701; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_G1_"+strObjectName); + } + + void add() { + sum = a + h1_0.a; + } +} + + +class Nocycle_a_2_00020_2H1 { + Nocycle_a_2_00020_2I1 i1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2H1(String strObjectName) { + i1_0 = null; + a = 801; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_H1_"+strObjectName); + } + + void add() { + sum = a + i1_0.a; + } +} + + +class Nocycle_a_2_00020_2I1 { + Nocycle_a_2_00020_2J1 j1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2I1(String strObjectName) { + j1_0 = null; + a = 901; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_I1_"+strObjectName); + } + + void add() { + sum = a + j1_0.a; + } +} + +class Nocycle_a_2_00020_2J1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2J1(String strObjectName) { + a = 1001; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_J1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00020_3A1 { + Nocycle_a_2_00020_3B1 b1_0; + Nocycle_a_2_00020_3D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } +} + + +class Nocycle_a_2_00020_3A2 { + Nocycle_a_2_00020_3B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } +} + + +class Nocycle_a_2_00020_3A3 { + Nocycle_a_2_00020_3B2 b2_0; + Nocycle_a_2_00020_3C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } +} + +class Nocycle_a_2_00020_3A4 { + Nocycle_a_2_00020_3B3 b3_0; + Nocycle_a_2_00020_3C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } +} + + +class Nocycle_a_2_00020_3B1 { + Nocycle_a_2_00020_3D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } +} + + +class Nocycle_a_2_00020_3B2 { + Nocycle_a_2_00020_3C1 c1_0; + Nocycle_a_2_00020_3D1 d1_0; + Nocycle_a_2_00020_3D2 d2_0; + Nocycle_a_2_00020_3D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_a_2_00020_3B3 { + Nocycle_a_2_00020_3C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_a_2_00020_3C1 { + Nocycle_a_2_00020_3D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_a_2_00020_3C2 { + Nocycle_a_2_00020_3D2 d2_0; + Nocycle_a_2_00020_3D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_a_2_00020_3D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00020_3D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_a_2_00020_3D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_a_2_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_a_2_00020_A1 a1_main = new Nocycle_a_2_00020_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_2_00020_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_2_00020_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_2_00020_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_2_00020_B4("b4_0"); + a1_main.b4_0.c1_0 = new Nocycle_a_2_00020_C1("c1_0"); + a1_main.b4_0.c2_0 = new Nocycle_a_2_00020_C2("c2_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_2_00020_C3("c3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b4_0.c1_0.add(); + a1_main.b4_0.c2_0.add(); + a1_main.b4_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); + + int result1 = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result1); + Nocycle_a_2_00020_2A1 a1_main2 = new Nocycle_a_2_00020_2A1("a1_main2"); + a1_main2.b1_0 = new Nocycle_a_2_00020_2B1("b1_0"); + a1_main2.b1_0.c1_0 = new Nocycle_a_2_00020_2C1("c1_0"); + a1_main2.b1_0.c1_0.d1_0 = new Nocycle_a_2_00020_2D1("d1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_2_00020_2E1("e1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_2_00020_2F1("f1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_2_00020_2G1("g1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_2_00020_2H1("h1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_2_00020_2I1("i1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_2_00020_2J1("j1_0"); + a1_main2.add(); + a1_main2.b1_0.add(); + a1_main2.b1_0.c1_0.add(); + a1_main2.b1_0.c1_0.d1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); + + int result2 = a1_main2.sum + a1_main2.b1_0.sum + a1_main2.b1_0.c1_0.sum + a1_main2.b1_0.c1_0.d1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; + Nocycle_a_2_00020_3A1 a1_main3 = new Nocycle_a_2_00020_3A1("a1_main3"); + Nocycle_a_2_00020_3A2 a2_main = new Nocycle_a_2_00020_3A2("a2_main"); + Nocycle_a_2_00020_3A3 a3_main = new Nocycle_a_2_00020_3A3("a3_main"); + Nocycle_a_2_00020_3A4 a4_main = new Nocycle_a_2_00020_3A4("a4_main"); + a1_main3.b1_0 = new Nocycle_a_2_00020_3B1("b1_0"); + a1_main3.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a1_main3.b1_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a2_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a2_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a2_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a3_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); + a3_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a3_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a3_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a3_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + a3_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); + a3_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a3_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + a4_main.b3_0 = new Nocycle_a_2_00020_3B3("b3_0"); + a4_main.b3_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a4_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); + a4_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a4_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + a1_main3.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main3.b1_0.add(); + a1_main3.d1_0.add(); + a1_main3.b1_0.d2_0.add(); + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + int result3 = a1_main3.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main3.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main3.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; + + int result = result1 + result2 + result3; + if (result == 26225) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0102-rc-function-RC_basic/RC_basic.java b/test/testsuite/ouroboros/memory_management/Function/RC0102-rc-function-RC_basic/RC_basic.java index 590ed6836aede5f885d93926fe12d3576bb4bc1c..5e488558b1693dffcd5d5b48ccb25d05e3fc5acc 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0102-rc-function-RC_basic/RC_basic.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0102-rc-function-RC_basic/RC_basic.java @@ -1,120 +1,120 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_basic.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: test RC basic operation. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_basic.java - *- @ExecuteClass: RC_basic - *- @ExecuteArgs: - */ -public class RC_basic { - private Object obj; - private String[] str; - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - public static void rc_testcase_main_wrapper() { - RC_basic rc = new RC_basic(); - rc.obj = new Object(); - rc.str = new String[10]; - Test1(); - Test2(); - Test3(); - Test4(rc); - Test5(rc); - Test6(rc); - Test7(rc); - Test8(); - Test9(); - Test10(); - } - - // simple new and recycle - static void Test1() { - RC_basic obj = new RC_basic(); - consume(obj); - } - - // new and return - static RC_basic Test2() { - RC_basic obj = new RC_basic(); - return obj; - } - - // new and consume and return - static Object Test3() { - RC_basic obj = new RC_basic(); - consume(obj); - return obj; - } - - // load and dec - static void Test4(RC_basic rc) { - Object obj = rc.obj; - consume(obj); - } - - // load and dec - static void Test5(RC_basic rc) { - consume(rc.obj); - } - - // load and return - static Object Test6(RC_basic rc) { - return rc.obj; - } - - // load consume and return - static Object Test7(RC_basic rc) { - Object o = rc.str; - consume(o); - return o; - } - - - // call and consume - static void Test8() { - RC_basic obj = Test2(); - consume(obj); - } - - // call consume and return - static Object Test9() { - RC_basic obj = Test2(); - consume(obj); - return obj; - } - - // call and not consume - static void Test10() { - Test2(); - } - - public static void consume(Object obj) { - //System.out.println("do noting"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_basic.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: test RC basic operation. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_basic.java + *- @ExecuteClass: RC_basic + *- @ExecuteArgs: + */ +public class RC_basic { + private Object obj; + private String[] str; + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + public static void rc_testcase_main_wrapper() { + RC_basic rc = new RC_basic(); + rc.obj = new Object(); + rc.str = new String[10]; + Test1(); + Test2(); + Test3(); + Test4(rc); + Test5(rc); + Test6(rc); + Test7(rc); + Test8(); + Test9(); + Test10(); + } + + // simple new and recycle + static void Test1() { + RC_basic obj = new RC_basic(); + consume(obj); + } + + // new and return + static RC_basic Test2() { + RC_basic obj = new RC_basic(); + return obj; + } + + // new and consume and return + static Object Test3() { + RC_basic obj = new RC_basic(); + consume(obj); + return obj; + } + + // load and dec + static void Test4(RC_basic rc) { + Object obj = rc.obj; + consume(obj); + } + + // load and dec + static void Test5(RC_basic rc) { + consume(rc.obj); + } + + // load and return + static Object Test6(RC_basic rc) { + return rc.obj; + } + + // load consume and return + static Object Test7(RC_basic rc) { + Object o = rc.str; + consume(o); + return o; + } + + + // call and consume + static void Test8() { + RC_basic obj = Test2(); + consume(obj); + } + + // call consume and return + static Object Test9() { + RC_basic obj = Test2(); + consume(obj); + return obj; + } + + // call and not consume + static void Test10() { + Test2(); + } + + public static void consume(Object obj) { + //System.out.println("do noting"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0103-rc-function-RC_eh_01/RC_eh_01.java b/test/testsuite/ouroboros/memory_management/Function/RC0103-rc-function-RC_eh_01/RC_eh_01.java index b779d9dcca05aaafc154fc867a671b993e432f0a..c9177c4af3b0ade370e3957679b3b9a2b9e8cb3d 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0103-rc-function-RC_eh_01/RC_eh_01.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0103-rc-function-RC_eh_01/RC_eh_01.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_eh_01.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: test eh for RC. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_eh_01.java - *- @ExecuteClass: RC_eh_01 - *- @ExecuteArgs: - */ - -import java.nio.charset.IllegalCharsetNameException; - -public class RC_eh_01 { - static int res = 0; - - public static void main(String argv[]) { - run1(); - System.out.println("ExpectResult"); - } - - public static void run1() { - - try { - new RC_eh_01().run2(); - } catch (IllegalArgumentException e) { - RC_eh_01.res = 1; - - } - - } - - public void run2() { - Foo f1 = new Foo(1); - Foo f2 = new Foo(2); - run3(); - int result = f1.i + f2.i; - - } - - public static void run3() { - try { - Integer.parseInt("123#456"); - } catch (IllegalCharsetNameException e) { - RC_eh_01.res = 3; - - } - } - - class Foo { - public int i; - - public Foo(int i) { - this.i = i; - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_eh_01.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: test eh for RC. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_eh_01.java + *- @ExecuteClass: RC_eh_01 + *- @ExecuteArgs: + */ + +import java.nio.charset.IllegalCharsetNameException; + +public class RC_eh_01 { + static int res = 0; + + public static void main(String argv[]) { + run1(); + System.out.println("ExpectResult"); + } + + public static void run1() { + + try { + new RC_eh_01().run2(); + } catch (IllegalArgumentException e) { + RC_eh_01.res = 1; + + } + + } + + public void run2() { + Foo f1 = new Foo(1); + Foo f2 = new Foo(2); + run3(); + int result = f1.i + f2.i; + + } + + public static void run3() { + try { + Integer.parseInt("123#456"); + } catch (IllegalCharsetNameException e) { + RC_eh_01.res = 3; + + } + } + + class Foo { + public int i; + + public Foo(int i) { + this.i = i; + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0104-rc-function-RC_Finalize_01/RC_Finalize_01.java b/test/testsuite/ouroboros/memory_management/Function/RC0104-rc-function-RC_Finalize_01/RC_Finalize_01.java index 662165e5d082f0ec4738ce283d540c7b887f60a9..578f774ed25826792bc7c1096ed0ad585ccbe232 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0104-rc-function-RC_Finalize_01/RC_Finalize_01.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0104-rc-function-RC_Finalize_01/RC_Finalize_01.java @@ -1,86 +1,86 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Finalize_01.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: test Finalizer for RC . - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Finalize_01.java - *- @ExecuteClass: RC_Finalize_01 - *- @ExecuteArgs: - */ -class C { - static A a; -} - -class A { - B b; - - public A(B b) { - - this.b = b; - - } - - @Override - public void finalize() throws Throwable { - super.finalize(); -// System.out.println("A finalize"); - - C.a = this; - - } - -} - - -class B { - int num1; - int num2; - - public B(int num1, int num2) { - this.num1 = num1; - this.num2 = num2; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); -// System.out.println("B finalize"); - } - - public int sum() { - return num1 + num2; - } - -} - -public class RC_Finalize_01 { - - public static void main(String[] args) throws Exception { - A a = new A(new B(12, 18)); - a = null; - //System.gc(); - - Thread.sleep(5000); - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Finalize_01.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: test Finalizer for RC . + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Finalize_01.java + *- @ExecuteClass: RC_Finalize_01 + *- @ExecuteArgs: + */ +class C { + static A a; +} + +class A { + B b; + + public A(B b) { + + this.b = b; + + } + + @Override + public void finalize() throws Throwable { + super.finalize(); +// System.out.println("A finalize"); + + C.a = this; + + } + +} + + +class B { + int num1; + int num2; + + public B(int num1, int num2) { + this.num1 = num1; + this.num2 = num2; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); +// System.out.println("B finalize"); + } + + public int sum() { + return num1 + num2; + } + +} + +public class RC_Finalize_01 { + + public static void main(String[] args) throws Exception { + A a = new A(new B(12, 18)); + a = null; + //System.gc(); + + Thread.sleep(5000); + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0105-rc-function-RC_flow/RC_flow.java b/test/testsuite/ouroboros/memory_management/Function/RC0105-rc-function-RC_flow/RC_flow.java index dd79f4e339f2d7548a0282593bf6dec35ecf2df6..30a082692cd533b58ba5a624c4b5ff6c5f8c7882 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0105-rc-function-RC_flow/RC_flow.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0105-rc-function-RC_flow/RC_flow.java @@ -1,80 +1,80 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_flow.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: test RC basic operation in For flow. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_flow.java - *- @ExecuteClass: RC_flow - *- @ExecuteArgs: - */ -public class RC_flow { - private Object obj; - private byte[] b; - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - public static void rc_testcase_main_wrapper() { - TestFlow1(21); - TestFlow2(30); - TestFlow3(56); - } - - static Object TestFlow1(int num) { - Object rc = null; - for (int i = 1; i < num; i++) { - if ((i % 5) == 0) { - rc = new RC_flow(); - } - } - return rc; - } - - static Object TestFlow2(int num) { - Object rc = null; - for (int i = 1; i < num; i++) { - if ((i % 5) == 0) { - rc = Test2(); - } - } - return rc; - } - - static void TestFlow3(int num) { - Object rc = null; - for (int i = 1; i < num; i++) { - if ((i % 5) == 0) { - rc = Test2(); - } - } - - } - - static RC_flow Test2() { - RC_flow obj = new RC_flow(); - return obj; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_flow.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: test RC basic operation in For flow. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_flow.java + *- @ExecuteClass: RC_flow + *- @ExecuteArgs: + */ +public class RC_flow { + private Object obj; + private byte[] b; + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + public static void rc_testcase_main_wrapper() { + TestFlow1(21); + TestFlow2(30); + TestFlow3(56); + } + + static Object TestFlow1(int num) { + Object rc = null; + for (int i = 1; i < num; i++) { + if ((i % 5) == 0) { + rc = new RC_flow(); + } + } + return rc; + } + + static Object TestFlow2(int num) { + Object rc = null; + for (int i = 1; i < num; i++) { + if ((i % 5) == 0) { + rc = Test2(); + } + } + return rc; + } + + static void TestFlow3(int num) { + Object rc = null; + for (int i = 1; i < num; i++) { + if ((i % 5) == 0) { + rc = Test2(); + } + } + + } + + static RC_flow Test2() { + RC_flow obj = new RC_flow(); + return obj; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0106-rc-function-RC_multest/RC_multest.java b/test/testsuite/ouroboros/memory_management/Function/RC0106-rc-function-RC_multest/RC_multest.java index 6a6782522521c624e5583311f1b27d5dd7a1978a..7f12a537179b626223d696f6afbca60a14bc40d4 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0106-rc-function-RC_multest/RC_multest.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0106-rc-function-RC_multest/RC_multest.java @@ -1,214 +1,214 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_multest.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: test RC basic operation in For flow. - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_multest.java - *- @ExecuteClass: RC_multest - *- @ExecuteArgs: - */ -public class RC_multest { - static Foo f; - private Object obj; - private byte[] b; - - { - f = new Bar(); - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - TestSimple(); - TestParam(); - TestFlow(); - f = null; - } - - static void TestSimple() { - RC_multest rc = new RC_multest(); - rc.obj = new Object(); - rc.b = new byte[10]; - Test1(); - Test2(); - Test3(); - Test4(rc); - Test5(rc); - Test6(rc); - Test7(rc); - Test8(); - Test9(); - Test10(); - } - - static void TestParam() { - RC_multest rc = new RC_multest(); - rc.obj = new Object(); - rc.b = new byte[10]; - TestParam1(rc); - TestParam2(rc); - TestParam3(rc); - } - - static void TestFlow() { - TestFlow1(21); - TestFlow2(30); - } - - // simple new and recycle - static void Test1() { - RC_multest obj = new RC_multest(); - consume(obj); - } - - // new and return - static RC_multest Test2() { - RC_multest obj = new RC_multest(); - return obj; - } - - // new and consume and return - static Object Test3() { - RC_multest obj = new RC_multest(); - consume(obj); - return obj; - } - - // load and dec - static void Test4(RC_multest rc) { - Object obj = rc.obj; - consume(obj); - } - - // load and dec - static void Test5(RC_multest rc) { - consume(rc.obj); - } - - // load and return - static Object Test6(RC_multest rc) { - return rc.obj; - } - - // load consume and return - static Object Test7(RC_multest rc) { - Object o = rc.b; - consume(o); - return o; - } - - // call and consume - static void Test8() { - RC_multest obj = Test2(); - consume(obj); - } - - // call consume and return - static Object Test9() { - RC_multest obj = Test2(); - consume(obj); - return obj; - } - - // call and not consume - static void Test10() { - Test2(); - } - - // parameter related - // 1. parameter is returned - // 2. parameter is redefined - // 3. parameter is redefined conditionally - static Object TestParam1(RC_multest rc) { - consume(rc); - return rc; - } - - static Object TestParam2(RC_multest rc) { - consume(rc); - rc = Test2(); - return rc; - } - - static Object TestParam3(RC_multest rc) { - consume(rc); - if (rc.b != null) { - rc = Test2(); - } - return rc; - } - - static Object TestParam4() { - RC_multest rc = new RC_multest(); - consume_return(rc); - return rc; - } - - // object field store - - // local variable - // 1. local varaible is redefined in if/loop - static Object TestFlow1(int num) { - Object rc = null; - for (int i = 1; i < num; i++) { - if ((i % 5) == 0) { - rc = new RC_multest(); - } - } - return rc; - } - - static Object TestFlow2(int num) { - Object rc = null; - for (int i = 1; i < num; i++) { - if ((i % 5) == 0) { - rc = Test2(); - } - } - return rc; - } - - // class info - // exception - static Object consume_return(Object obj) { - return obj; - } - - static void consume(Object obj) { - f.consume(obj); - } -} - -class Foo { - void consume(Object obj) { - } -} - -class Bar extends Foo { - void consume(Object obj) { - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_multest.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: test RC basic operation in For flow. + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_multest.java + *- @ExecuteClass: RC_multest + *- @ExecuteArgs: + */ +public class RC_multest { + static Foo f; + private Object obj; + private byte[] b; + + { + f = new Bar(); + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + TestSimple(); + TestParam(); + TestFlow(); + f = null; + } + + static void TestSimple() { + RC_multest rc = new RC_multest(); + rc.obj = new Object(); + rc.b = new byte[10]; + Test1(); + Test2(); + Test3(); + Test4(rc); + Test5(rc); + Test6(rc); + Test7(rc); + Test8(); + Test9(); + Test10(); + } + + static void TestParam() { + RC_multest rc = new RC_multest(); + rc.obj = new Object(); + rc.b = new byte[10]; + TestParam1(rc); + TestParam2(rc); + TestParam3(rc); + } + + static void TestFlow() { + TestFlow1(21); + TestFlow2(30); + } + + // simple new and recycle + static void Test1() { + RC_multest obj = new RC_multest(); + consume(obj); + } + + // new and return + static RC_multest Test2() { + RC_multest obj = new RC_multest(); + return obj; + } + + // new and consume and return + static Object Test3() { + RC_multest obj = new RC_multest(); + consume(obj); + return obj; + } + + // load and dec + static void Test4(RC_multest rc) { + Object obj = rc.obj; + consume(obj); + } + + // load and dec + static void Test5(RC_multest rc) { + consume(rc.obj); + } + + // load and return + static Object Test6(RC_multest rc) { + return rc.obj; + } + + // load consume and return + static Object Test7(RC_multest rc) { + Object o = rc.b; + consume(o); + return o; + } + + // call and consume + static void Test8() { + RC_multest obj = Test2(); + consume(obj); + } + + // call consume and return + static Object Test9() { + RC_multest obj = Test2(); + consume(obj); + return obj; + } + + // call and not consume + static void Test10() { + Test2(); + } + + // parameter related + // 1. parameter is returned + // 2. parameter is redefined + // 3. parameter is redefined conditionally + static Object TestParam1(RC_multest rc) { + consume(rc); + return rc; + } + + static Object TestParam2(RC_multest rc) { + consume(rc); + rc = Test2(); + return rc; + } + + static Object TestParam3(RC_multest rc) { + consume(rc); + if (rc.b != null) { + rc = Test2(); + } + return rc; + } + + static Object TestParam4() { + RC_multest rc = new RC_multest(); + consume_return(rc); + return rc; + } + + // object field store + + // local variable + // 1. local varaible is redefined in if/loop + static Object TestFlow1(int num) { + Object rc = null; + for (int i = 1; i < num; i++) { + if ((i % 5) == 0) { + rc = new RC_multest(); + } + } + return rc; + } + + static Object TestFlow2(int num) { + Object rc = null; + for (int i = 1; i < num; i++) { + if ((i % 5) == 0) { + rc = Test2(); + } + } + return rc; + } + + // class info + // exception + static Object consume_return(Object obj) { + return obj; + } + + static void consume(Object obj) { + f.consume(obj); + } +} + +class Foo { + void consume(Object obj) { + } +} + +class Bar extends Foo { + void consume(Object obj) { + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0107-rc-function-RC_Dec-Cycle_aDec_00010/Cycle_aDec_00010.java b/test/testsuite/ouroboros/memory_management/Function/RC0107-rc-function-RC_Dec-Cycle_aDec_00010/Cycle_aDec_00010.java index e427c41f142d34289f2443b711be4ac3866a7d46..fbdf5c98c235e908c81c6c2086167ef71a1a646d 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0107-rc-function-RC_Dec-Cycle_aDec_00010/Cycle_aDec_00010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0107-rc-function-RC_Dec-Cycle_aDec_00010/Cycle_aDec_00010.java @@ -1,192 +1,192 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/ Cycle_aDec_00010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_aDec_00010 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source:Cycle_aDec_00010.java - *- @ExecuteClass:Cycle_aDec_00010 - *- @ExecuteArgs: - * - */ - -class Cycle_aDec_00010_A1 { - Cycle_aDec_00010_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00010_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } -} - -class Cycle_aDec_00010_A2 { - Cycle_aDec_00010_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00010_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_aDec_00010_A3 { - Cycle_aDec_00010_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00010_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_aDec_00010_A4 { - Cycle_aDec_00010_A1 a1_0; - Cycle_aDec_00010_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00010_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } -} - -class Cycle_aDec_00010_A5 { - Cycle_aDec_00010_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00010_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_aDec_00010_A6 { - Cycle_aDec_00010_A1 a1_0; - Cycle_aDec_00010_A4 a4_0; - Cycle_aDec_00010_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00010_A6(String strObjectName) { - a1_0 = null; - a4_0 = null; - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a + a5_0.a; - } -} - - -public class Cycle_aDec_00010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void Modify(Cycle_aDec_00010_A1 a1_main) { - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a1_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_aDec_00010_A1 a1_main = new Cycle_aDec_00010_A1("a1_main"); - Cycle_aDec_00010_A5 a5_main = new Cycle_aDec_00010_A5("a5_main"); - a1_main.a2_0 = new Cycle_aDec_00010_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_aDec_00010_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_aDec_00010_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_aDec_00010_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; - Modify(a1_main); - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0 = null; - int result = a1_main.sum + a5_main.sum + a5_main.a3_0.sum + a5_main.a3_0.a4_0.sum + a5_main.a3_0.a4_0.a6_0.sum; - if (result == 1137) - System.out.println("ExpectResult"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/ Cycle_aDec_00010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_aDec_00010 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source:Cycle_aDec_00010.java + *- @ExecuteClass:Cycle_aDec_00010 + *- @ExecuteArgs: + * + */ + +class Cycle_aDec_00010_A1 { + Cycle_aDec_00010_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00010_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } +} + +class Cycle_aDec_00010_A2 { + Cycle_aDec_00010_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00010_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_aDec_00010_A3 { + Cycle_aDec_00010_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00010_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_aDec_00010_A4 { + Cycle_aDec_00010_A1 a1_0; + Cycle_aDec_00010_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00010_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } +} + +class Cycle_aDec_00010_A5 { + Cycle_aDec_00010_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00010_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_aDec_00010_A6 { + Cycle_aDec_00010_A1 a1_0; + Cycle_aDec_00010_A4 a4_0; + Cycle_aDec_00010_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00010_A6(String strObjectName) { + a1_0 = null; + a4_0 = null; + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a + a5_0.a; + } +} + + +public class Cycle_aDec_00010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void Modify(Cycle_aDec_00010_A1 a1_main) { + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a1_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_aDec_00010_A1 a1_main = new Cycle_aDec_00010_A1("a1_main"); + Cycle_aDec_00010_A5 a5_main = new Cycle_aDec_00010_A5("a5_main"); + a1_main.a2_0 = new Cycle_aDec_00010_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_aDec_00010_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_aDec_00010_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_aDec_00010_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; + Modify(a1_main); + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0 = null; + int result = a1_main.sum + a5_main.sum + a5_main.a3_0.sum + a5_main.a3_0.a4_0.sum + a5_main.a3_0.a4_0.a6_0.sum; + if (result == 1137) + System.out.println("ExpectResult"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0108-rc-function-RC_Dec-Cycle_aDec_00020/Cycle_aDec_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0108-rc-function-RC_Dec-Cycle_aDec_00020/Cycle_aDec_00020.java index f9860b56c3d5eef443810b613c79c5ad96b329b0..d51e8ee2e1c3f5a4b0bd71d2efba924bcb592fa5 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0108-rc-function-RC_Dec-Cycle_aDec_00020/Cycle_aDec_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0108-rc-function-RC_Dec-Cycle_aDec_00020/Cycle_aDec_00020.java @@ -1,193 +1,193 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/ Cycle_aDec_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_aDec_00020 in RC测试-Cycle-01 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_aDec_00020.java - *- @ExecuteClass: Cycle_aDec_00020 - *- @ExecuteArgs: - * - */ - -class Cycle_aDec_00020_A1 { - Cycle_aDec_00020_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00020_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Cycle_aDec_00020_A2 { - Cycle_aDec_00020_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00020_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_aDec_00020_A3 { - Cycle_aDec_00020_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00020_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_aDec_00020_A4 { - Cycle_aDec_00020_A1 a1_0; - Cycle_aDec_00020_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00020_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } -} - -class Cycle_aDec_00020_A5 { - Cycle_aDec_00020_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00020_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } -} - -class Cycle_aDec_00020_A6 { - Cycle_aDec_00020_A1 a1_0; - Cycle_aDec_00020_A4 a4_0; - Cycle_aDec_00020_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_aDec_00020_A6(String strObjectName) { - a1_0 = null; - a4_0 = null; - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a + a5_0.a; - } -} - - -public class Cycle_aDec_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - } - - private static void Modify(Cycle_aDec_00020_A1 a1_main) { - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a1_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_aDec_00020_A1 a1_main = new Cycle_aDec_00020_A1("a1_main"); - Cycle_aDec_00020_A5 a5_main = new Cycle_aDec_00020_A5("a5_main"); - a1_main.a2_0 = new Cycle_aDec_00020_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_aDec_00020_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_aDec_00020_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_aDec_00020_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; - Modify(a1_main); - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0 = null; - a5_main = null; - a1_main.add(); - int result = a1_main.sum; - if (result == 202) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/ Cycle_aDec_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_aDec_00020 in RC测试-Cycle-01 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_aDec_00020.java + *- @ExecuteClass: Cycle_aDec_00020 + *- @ExecuteArgs: + * + */ + +class Cycle_aDec_00020_A1 { + Cycle_aDec_00020_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00020_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Cycle_aDec_00020_A2 { + Cycle_aDec_00020_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00020_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_aDec_00020_A3 { + Cycle_aDec_00020_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00020_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_aDec_00020_A4 { + Cycle_aDec_00020_A1 a1_0; + Cycle_aDec_00020_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00020_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } +} + +class Cycle_aDec_00020_A5 { + Cycle_aDec_00020_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00020_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } +} + +class Cycle_aDec_00020_A6 { + Cycle_aDec_00020_A1 a1_0; + Cycle_aDec_00020_A4 a4_0; + Cycle_aDec_00020_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_aDec_00020_A6(String strObjectName) { + a1_0 = null; + a4_0 = null; + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a + a5_0.a; + } +} + + +public class Cycle_aDec_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + } + + private static void Modify(Cycle_aDec_00020_A1 a1_main) { + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a1_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_aDec_00020_A1 a1_main = new Cycle_aDec_00020_A1("a1_main"); + Cycle_aDec_00020_A5 a5_main = new Cycle_aDec_00020_A5("a5_main"); + a1_main.a2_0 = new Cycle_aDec_00020_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_aDec_00020_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_aDec_00020_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_aDec_00020_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; + Modify(a1_main); + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0 = null; + a5_main = null; + a1_main.add(); + int result = a1_main.sum; + if (result == 202) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0109-rc-function-RC_Dec-Cycle_BDec_00010/Cycle_BDec_00010.java b/test/testsuite/ouroboros/memory_management/Function/RC0109-rc-function-RC_Dec-Cycle_BDec_00010/Cycle_BDec_00010.java index bdf9e662437af8224c12fc790c44760bc51cc8ba..1556ed109f7e57fc16f521b996544d024b478215 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0109-rc-function-RC_Dec-Cycle_BDec_00010/Cycle_BDec_00010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0109-rc-function-RC_Dec-Cycle_BDec_00010/Cycle_BDec_00010.java @@ -1,93 +1,93 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_BDec_00010 in RC测试-Cycle-00.vsd - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_BDec_00010.java - *- @ExecuteClass: Cycle_BDec_00010 - *- @ExecuteArgs: - */ -class Cycle_BDec_00010_A1 { - Cycle_BDec_00010_A2 a2_0; - int a; - int sum; - - Cycle_BDec_00010_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_BDec_00010_A2 { - Cycle_BDec_00010_A1 a1_0; - int a; - int sum; - - Cycle_BDec_00010_A2() { - a1_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - - -public class Cycle_BDec_00010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static boolean ModifyA1(Cycle_BDec_00010_A1 a1_0) { - a1_0.add(); - a1_0.a2_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum); - //System.out.println(nsum); - if (nsum == 6) - return true; - else - return false; - - } - - public static void rc_testcase_main_wrapper() { - Cycle_BDec_00010_A1 a1_0 = new Cycle_BDec_00010_A1(); - a1_0.a2_0 = new Cycle_BDec_00010_A2(); - a1_0.a2_0.a1_0 = a1_0; - boolean ret = ModifyA1(a1_0); - a1_0 = null; - if (ret == true && a1_0 == null) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_BDec_00010 in RC测试-Cycle-00.vsd + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_BDec_00010.java + *- @ExecuteClass: Cycle_BDec_00010 + *- @ExecuteArgs: + */ +class Cycle_BDec_00010_A1 { + Cycle_BDec_00010_A2 a2_0; + int a; + int sum; + + Cycle_BDec_00010_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_BDec_00010_A2 { + Cycle_BDec_00010_A1 a1_0; + int a; + int sum; + + Cycle_BDec_00010_A2() { + a1_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + + +public class Cycle_BDec_00010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static boolean ModifyA1(Cycle_BDec_00010_A1 a1_0) { + a1_0.add(); + a1_0.a2_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum); + //System.out.println(nsum); + if (nsum == 6) + return true; + else + return false; + + } + + public static void rc_testcase_main_wrapper() { + Cycle_BDec_00010_A1 a1_0 = new Cycle_BDec_00010_A1(); + a1_0.a2_0 = new Cycle_BDec_00010_A2(); + a1_0.a2_0.a1_0 = a1_0; + boolean ret = ModifyA1(a1_0); + a1_0 = null; + if (ret == true && a1_0 == null) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0110-rc-function-RC_Dec-Cycle_BDec_00020/Cycle_BDec_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0110-rc-function-RC_Dec-Cycle_BDec_00020/Cycle_BDec_00020.java index a3b71a63f9c608535a682899ae148ffce0e4dd56..a6de06f5041c646f06ca397572b0bfb34acf66cd 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0110-rc-function-RC_Dec-Cycle_BDec_00020/Cycle_BDec_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0110-rc-function-RC_Dec-Cycle_BDec_00020/Cycle_BDec_00020.java @@ -1,147 +1,147 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_BDec_00020 in RC测试-Cycle-00.vsd - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_BDec_00020.java - *- @ExecuteClass: Cycle_BDec_00020 - *- @ExecuteArgs: - */ -class Cycle_BDec_00020_A1 { - Cycle_BDec_00020_A2 a2_0; - int a; - int sum; - - Cycle_BDec_00020_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_BDec_00020_A2 { - Cycle_BDec_00020_A3 a3_0; - Cycle_BDec_00020_A4 a4_0; - int a; - int sum; - - Cycle_BDec_00020_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_BDec_00020_A3 { - Cycle_BDec_00020_A1 a1_0; - int a; - int sum; - - Cycle_BDec_00020_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_BDec_00020_A4 { - - int a; - int sum; - Cycle_BDec_00020_A5 a5_0; - - Cycle_BDec_00020_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - a5_0.add(); - sum = a + a5_0.sum; - } -} - -class Cycle_BDec_00020_A5 { - - int a; - int sum; - - Cycle_BDec_00020_A5() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } -} - - -public class Cycle_BDec_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void ModifyA1(Cycle_BDec_00020_A1 a1) { - a1.add(); - a1.a2_0.add(); - a1.a2_0.a3_0.add(); - } - - public static void rc_testcase_main_wrapper() { - Cycle_BDec_00020_A1 a1_0 = new Cycle_BDec_00020_A1(); - a1_0.a2_0 = new Cycle_BDec_00020_A2(); - a1_0.a2_0.a3_0 = new Cycle_BDec_00020_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a4_0 = new Cycle_BDec_00020_A4(); - a1_0.a2_0.a4_0.a5_0 = new Cycle_BDec_00020_A5(); - ModifyA1(a1_0); - a1_0.a2_0.a4_0 = null; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int result = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum; - if (result == 12) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_BDec_00020 in RC测试-Cycle-00.vsd + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_BDec_00020.java + *- @ExecuteClass: Cycle_BDec_00020 + *- @ExecuteArgs: + */ +class Cycle_BDec_00020_A1 { + Cycle_BDec_00020_A2 a2_0; + int a; + int sum; + + Cycle_BDec_00020_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_BDec_00020_A2 { + Cycle_BDec_00020_A3 a3_0; + Cycle_BDec_00020_A4 a4_0; + int a; + int sum; + + Cycle_BDec_00020_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_BDec_00020_A3 { + Cycle_BDec_00020_A1 a1_0; + int a; + int sum; + + Cycle_BDec_00020_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_BDec_00020_A4 { + + int a; + int sum; + Cycle_BDec_00020_A5 a5_0; + + Cycle_BDec_00020_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + a5_0.add(); + sum = a + a5_0.sum; + } +} + +class Cycle_BDec_00020_A5 { + + int a; + int sum; + + Cycle_BDec_00020_A5() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } +} + + +public class Cycle_BDec_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void ModifyA1(Cycle_BDec_00020_A1 a1) { + a1.add(); + a1.a2_0.add(); + a1.a2_0.a3_0.add(); + } + + public static void rc_testcase_main_wrapper() { + Cycle_BDec_00020_A1 a1_0 = new Cycle_BDec_00020_A1(); + a1_0.a2_0 = new Cycle_BDec_00020_A2(); + a1_0.a2_0.a3_0 = new Cycle_BDec_00020_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a4_0 = new Cycle_BDec_00020_A4(); + a1_0.a2_0.a4_0.a5_0 = new Cycle_BDec_00020_A5(); + ModifyA1(a1_0); + a1_0.a2_0.a4_0 = null; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int result = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum; + if (result == 12) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0111-rc-function-RC_Dec-Cycle_BDec_00030/Cycle_BDec_00030.java b/test/testsuite/ouroboros/memory_management/Function/RC0111-rc-function-RC_Dec-Cycle_BDec_00030/Cycle_BDec_00030.java index 147a02809bcf4e6ef4c26d9aabd2d9057ed59b38..66812c8a3a2f5e79ad369f6298e2c2ef0d5708d9 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0111-rc-function-RC_Dec-Cycle_BDec_00030/Cycle_BDec_00030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0111-rc-function-RC_Dec-Cycle_BDec_00030/Cycle_BDec_00030.java @@ -1,131 +1,131 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_BDec_00030 in RC测试-Cycle-00.vsd - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_BDec_00030.java - *- @ExecuteClass: Cycle_BDec_00030 - *- @ExecuteArgs: - */ -class Cycle_BDec_00030_A1 { - Cycle_BDec_00030_A2 a2_0; - int a; - int sum; - - Cycle_BDec_00030_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_BDec_00030_A2 { - Cycle_BDec_00030_A3 a3_0; - Cycle_BDec_00030_A4 a4_0; - int a; - int sum; - - Cycle_BDec_00030_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_BDec_00030_A3 { - Cycle_BDec_00030_A1 a1_0; - Cycle_BDec_00030_A4 a4_0; - int a; - int sum; - - Cycle_BDec_00030_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } -} - - -class Cycle_BDec_00030_A4 { - Cycle_BDec_00030_A3 a3_0; - int a; - int sum; - - Cycle_BDec_00030_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - -public class Cycle_BDec_00030 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void ModifyA1(Cycle_BDec_00030_A1 a1) { - a1 = null; - a1 = new Cycle_BDec_00030_A1(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_BDec_00030_A1 a1_0 = new Cycle_BDec_00030_A1(); - a1_0.a2_0 = new Cycle_BDec_00030_A2(); - a1_0.a2_0.a3_0 = new Cycle_BDec_00030_A3(); - Cycle_BDec_00030_A4 a4_0 = new Cycle_BDec_00030_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a4_0 = a4_0; - ModifyA1(a1_0); - a1_0 = null; - a4_0.add(); - a4_0.a3_0.add(); - int nsum = (a4_0.a3_0.sum + a4_0.sum); - if (nsum == 14) - System.out.println("ExpectResult"); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_BDec_00030 in RC测试-Cycle-00.vsd + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_BDec_00030.java + *- @ExecuteClass: Cycle_BDec_00030 + *- @ExecuteArgs: + */ +class Cycle_BDec_00030_A1 { + Cycle_BDec_00030_A2 a2_0; + int a; + int sum; + + Cycle_BDec_00030_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_BDec_00030_A2 { + Cycle_BDec_00030_A3 a3_0; + Cycle_BDec_00030_A4 a4_0; + int a; + int sum; + + Cycle_BDec_00030_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_BDec_00030_A3 { + Cycle_BDec_00030_A1 a1_0; + Cycle_BDec_00030_A4 a4_0; + int a; + int sum; + + Cycle_BDec_00030_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } +} + + +class Cycle_BDec_00030_A4 { + Cycle_BDec_00030_A3 a3_0; + int a; + int sum; + + Cycle_BDec_00030_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + +public class Cycle_BDec_00030 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void ModifyA1(Cycle_BDec_00030_A1 a1) { + a1 = null; + a1 = new Cycle_BDec_00030_A1(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_BDec_00030_A1 a1_0 = new Cycle_BDec_00030_A1(); + a1_0.a2_0 = new Cycle_BDec_00030_A2(); + a1_0.a2_0.a3_0 = new Cycle_BDec_00030_A3(); + Cycle_BDec_00030_A4 a4_0 = new Cycle_BDec_00030_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a4_0 = a4_0; + ModifyA1(a1_0); + a1_0 = null; + a4_0.add(); + a4_0.a3_0.add(); + int nsum = (a4_0.a3_0.sum + a4_0.sum); + if (nsum == 14) + System.out.println("ExpectResult"); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0112-rc-function-RC_Dec-Cycle_BDec_00040/Cycle_BDec_00040.java b/test/testsuite/ouroboros/memory_management/Function/RC0112-rc-function-RC_Dec-Cycle_BDec_00040/Cycle_BDec_00040.java index 289617480f5d18c5c7932f4a26d57f69be4e8343..aa41e91b5ea4bfb68cad1e9de4faa784b9afc1d3 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0112-rc-function-RC_Dec-Cycle_BDec_00040/Cycle_BDec_00040.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0112-rc-function-RC_Dec-Cycle_BDec_00040/Cycle_BDec_00040.java @@ -1,129 +1,129 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00040.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_BDec_00040 in RC测试-Cycle-00.vsd - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Cycle_BDec_00040.java - *- @ExecuteClass: Cycle_BDec_00040 - *- @ExecuteArgs: - */ -class Cycle_BDec_00040_A1 { - Cycle_BDec_00040_A2 a2_0; - int a; - int sum; - - Cycle_BDec_00040_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_BDec_00040_A2 { - Cycle_BDec_00040_A3 a3_0; - Cycle_BDec_00040_A4 a4_0; - int a; - int sum; - - Cycle_BDec_00040_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_BDec_00040_A3 { - Cycle_BDec_00040_A1 a1_0; - Cycle_BDec_00040_A4 a4_0; - int a; - int sum; - - Cycle_BDec_00040_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_BDec_00040_A4 { - Cycle_BDec_00040_A3 a3_0; - int a; - int sum; - - Cycle_BDec_00040_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - -public class Cycle_BDec_00040 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void modifyA1(Cycle_BDec_00040_A1 a1) { - a1.add(); - a1.a2_0.add(); - a1.a2_0.a3_0.add(); - a1.a2_0.a3_0.a4_0.add(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_BDec_00040_A1 a1_0 = new Cycle_BDec_00040_A1(); - a1_0.a2_0 = new Cycle_BDec_00040_A2(); - a1_0.a2_0.a3_0 = new Cycle_BDec_00040_A3(); - Cycle_BDec_00040_A4 a4_0 = new Cycle_BDec_00040_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a4_0 = a4_0; - modifyA1(a1_0); - a1_0 = null; - a4_0 = null; - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00040.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_BDec_00040 in RC测试-Cycle-00.vsd + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Cycle_BDec_00040.java + *- @ExecuteClass: Cycle_BDec_00040 + *- @ExecuteArgs: + */ +class Cycle_BDec_00040_A1 { + Cycle_BDec_00040_A2 a2_0; + int a; + int sum; + + Cycle_BDec_00040_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_BDec_00040_A2 { + Cycle_BDec_00040_A3 a3_0; + Cycle_BDec_00040_A4 a4_0; + int a; + int sum; + + Cycle_BDec_00040_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_BDec_00040_A3 { + Cycle_BDec_00040_A1 a1_0; + Cycle_BDec_00040_A4 a4_0; + int a; + int sum; + + Cycle_BDec_00040_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_BDec_00040_A4 { + Cycle_BDec_00040_A3 a3_0; + int a; + int sum; + + Cycle_BDec_00040_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + +public class Cycle_BDec_00040 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void modifyA1(Cycle_BDec_00040_A1 a1) { + a1.add(); + a1.a2_0.add(); + a1.a2_0.a3_0.add(); + a1.a2_0.a3_0.a4_0.add(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_BDec_00040_A1 a1_0 = new Cycle_BDec_00040_A1(); + a1_0.a2_0 = new Cycle_BDec_00040_A2(); + a1_0.a2_0.a3_0 = new Cycle_BDec_00040_A3(); + Cycle_BDec_00040_A4 a4_0 = new Cycle_BDec_00040_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a4_0 = a4_0; + modifyA1(a1_0); + a1_0 = null; + a4_0 = null; + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0113-rc-function-RC_Dec-Cycle_BDec_00050/Cycle_BDec_00050.java b/test/testsuite/ouroboros/memory_management/Function/RC0113-rc-function-RC_Dec-Cycle_BDec_00050/Cycle_BDec_00050.java index df4b06b6827f952fb374d53742b148caff94e6e3..24a3dc8346c009e2747ad5916fab4211e2c49183 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0113-rc-function-RC_Dec-Cycle_BDec_00050/Cycle_BDec_00050.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0113-rc-function-RC_Dec-Cycle_BDec_00050/Cycle_BDec_00050.java @@ -1,135 +1,135 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00050.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Cycle_BDec_00050 in RC测试-Cycle-00.vsd - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Cycle_BDec_00050.java - *- @ExecuteClass: Cycle_BDec_00050 - *- @ExecuteArgs: - */ -class Cycle_BDec_00050_A1 { - Cycle_BDec_00050_A2 a2_0; - int a; - int sum; - - Cycle_BDec_00050_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } -} - - -class Cycle_BDec_00050_A2 { - Cycle_BDec_00050_A3 a3_0; - Cycle_BDec_00050_A4 a4_0; - int a; - int sum; - - Cycle_BDec_00050_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - - -class Cycle_BDec_00050_A3 { - Cycle_BDec_00050_A1 a1_0; - Cycle_BDec_00050_A4 a4_0; - int a; - int sum; - - Cycle_BDec_00050_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } -} - - -class Cycle_BDec_00050_A4 { - Cycle_BDec_00050_A3 a3_0; - int a; - int sum; - - Cycle_BDec_00050_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } -} - -public class Cycle_BDec_00050 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - - } - - private static void modifyA1(Cycle_BDec_00050_A1 a1) { - a1.add(); - a1.a2_0.add(); - a1.a2_0.a3_0.add(); - a1.a2_0.a3_0.a4_0.add(); - } - - private static void rc_testcase_main_wrapper() { - Cycle_BDec_00050_A1 a1_0 = new Cycle_BDec_00050_A1(); - a1_0.a2_0 = new Cycle_BDec_00050_A2(); - a1_0.a2_0.a3_0 = new Cycle_BDec_00050_A3(); - Cycle_BDec_00050_A4 a4_0 = new Cycle_BDec_00050_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a4_0 = a4_0; - modifyA1(a1_0); - //cancel inline by for flow - int sum = 0; - for (int i = 0; i < 100; i++) - sum += i; - a1_0.a2_0.a3_0.a1_0 = null; - a4_0.a3_0 = null; - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Cycle_BDec_00050.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Cycle_BDec_00050 in RC测试-Cycle-00.vsd + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Cycle_BDec_00050.java + *- @ExecuteClass: Cycle_BDec_00050 + *- @ExecuteArgs: + */ +class Cycle_BDec_00050_A1 { + Cycle_BDec_00050_A2 a2_0; + int a; + int sum; + + Cycle_BDec_00050_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } +} + + +class Cycle_BDec_00050_A2 { + Cycle_BDec_00050_A3 a3_0; + Cycle_BDec_00050_A4 a4_0; + int a; + int sum; + + Cycle_BDec_00050_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + + +class Cycle_BDec_00050_A3 { + Cycle_BDec_00050_A1 a1_0; + Cycle_BDec_00050_A4 a4_0; + int a; + int sum; + + Cycle_BDec_00050_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } +} + + +class Cycle_BDec_00050_A4 { + Cycle_BDec_00050_A3 a3_0; + int a; + int sum; + + Cycle_BDec_00050_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } +} + +public class Cycle_BDec_00050 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + + } + + private static void modifyA1(Cycle_BDec_00050_A1 a1) { + a1.add(); + a1.a2_0.add(); + a1.a2_0.a3_0.add(); + a1.a2_0.a3_0.a4_0.add(); + } + + private static void rc_testcase_main_wrapper() { + Cycle_BDec_00050_A1 a1_0 = new Cycle_BDec_00050_A1(); + a1_0.a2_0 = new Cycle_BDec_00050_A2(); + a1_0.a2_0.a3_0 = new Cycle_BDec_00050_A3(); + Cycle_BDec_00050_A4 a4_0 = new Cycle_BDec_00050_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a4_0 = a4_0; + modifyA1(a1_0); + //cancel inline by for flow + int sum = 0; + for (int i = 0; i < 100; i++) + sum += i; + a1_0.a2_0.a3_0.a1_0 = null; + a4_0.a3_0 = null; + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0114-rc-function-RC_Dec-Nocycle_aDec_00010/Nocycle_aDec_00010.java b/test/testsuite/ouroboros/memory_management/Function/RC0114-rc-function-RC_Dec-Nocycle_aDec_00010/Nocycle_aDec_00010.java index 55dabc7e03c7a37be89aaf71b8e2aafacecf3918..8ecfddd51e027e820dae3be62c783c3c2a03cd0c 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0114-rc-function-RC_Dec-Nocycle_aDec_00010/Nocycle_aDec_00010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0114-rc-function-RC_Dec-Nocycle_aDec_00010/Nocycle_aDec_00010.java @@ -1,225 +1,225 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_aDec_00010 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_aDec_00010.java - *- @ExecuteClass: Nocycle_aDec_00010 - *- @ExecuteArgs: - */ - - -class Nocycle_aDec_00010_A1 { - Nocycle_aDec_00010_B1 b1_0; - Nocycle_aDec_00010_B2 b2_0; - Nocycle_aDec_00010_B3 b3_0; - Nocycle_aDec_00010_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00010_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } -} - -class Nocycle_aDec_00010_B1 { - Nocycle_aDec_00010_C1 c1_0; - Nocycle_aDec_00010_C2 c2_0; - Nocycle_aDec_00010_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00010_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } -} - -class Nocycle_aDec_00010_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00010_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_aDec_00010_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00010_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00010_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00010_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00010_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00010_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00010_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00010_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00010_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00010_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_aDec_00010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_aDec_00010_A1 a1_main = new Nocycle_aDec_00010_A1("a1_main"); - a1_main.b1_0 = new Nocycle_aDec_00010_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_aDec_00010_C1("c1_0"); - a1_main.b1_0.c2_0 = new Nocycle_aDec_00010_C2("c2_0"); - a1_main.b1_0.c3_0 = new Nocycle_aDec_00010_C3("c3_0"); - a1_main.b2_0 = new Nocycle_aDec_00010_B2("b2_0"); - a1_main.b3_0 = new Nocycle_aDec_00010_B3("b3_0"); - a1_main.b4_0 = new Nocycle_aDec_00010_B4("b4_0"); - Nocycle_aDec_00010_A1 a1_copy = modifyA1(a1_main); - a1_main = null; - a1_copy.add(); - a1_copy.b1_0.add(); - a1_copy.b2_0.add(); - a1_copy.b3_0.add(); - a1_copy.b4_0.add(); - a1_copy.b1_0.c1_0.add(); - a1_copy.b1_0.c2_0.add(); - a1_copy.b1_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_copy.sum+a1_copy.b1_0.sum+a1_copy.b2_0.sum+a1_copy.b3_0.sum+a1_copy.b4_0.sum+a1_copy.b1_0.c1_0.sum+a1_copy.b1_0.c2_0.sum+a1_copy.b1_0.c3_0.sum); - - int result = a1_copy.sum + a1_copy.b1_0.sum + a1_copy.b2_0.sum + a1_copy.b3_0.sum + a1_copy.b4_0.sum + a1_copy.b1_0.c1_0.sum + a1_copy.b1_0.c2_0.sum + a1_copy.b1_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 5049) - System.out.println("ExpectResult"); - } - - public static Nocycle_aDec_00010_A1 modifyA1(Nocycle_aDec_00010_A1 a1) { - a1.a = 102; - return a1; - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_aDec_00010 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_aDec_00010.java + *- @ExecuteClass: Nocycle_aDec_00010 + *- @ExecuteArgs: + */ + + +class Nocycle_aDec_00010_A1 { + Nocycle_aDec_00010_B1 b1_0; + Nocycle_aDec_00010_B2 b2_0; + Nocycle_aDec_00010_B3 b3_0; + Nocycle_aDec_00010_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00010_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } +} + +class Nocycle_aDec_00010_B1 { + Nocycle_aDec_00010_C1 c1_0; + Nocycle_aDec_00010_C2 c2_0; + Nocycle_aDec_00010_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00010_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } +} + +class Nocycle_aDec_00010_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00010_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_aDec_00010_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00010_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00010_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00010_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00010_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00010_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00010_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00010_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00010_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00010_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_aDec_00010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_aDec_00010_A1 a1_main = new Nocycle_aDec_00010_A1("a1_main"); + a1_main.b1_0 = new Nocycle_aDec_00010_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_aDec_00010_C1("c1_0"); + a1_main.b1_0.c2_0 = new Nocycle_aDec_00010_C2("c2_0"); + a1_main.b1_0.c3_0 = new Nocycle_aDec_00010_C3("c3_0"); + a1_main.b2_0 = new Nocycle_aDec_00010_B2("b2_0"); + a1_main.b3_0 = new Nocycle_aDec_00010_B3("b3_0"); + a1_main.b4_0 = new Nocycle_aDec_00010_B4("b4_0"); + Nocycle_aDec_00010_A1 a1_copy = modifyA1(a1_main); + a1_main = null; + a1_copy.add(); + a1_copy.b1_0.add(); + a1_copy.b2_0.add(); + a1_copy.b3_0.add(); + a1_copy.b4_0.add(); + a1_copy.b1_0.c1_0.add(); + a1_copy.b1_0.c2_0.add(); + a1_copy.b1_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_copy.sum+a1_copy.b1_0.sum+a1_copy.b2_0.sum+a1_copy.b3_0.sum+a1_copy.b4_0.sum+a1_copy.b1_0.c1_0.sum+a1_copy.b1_0.c2_0.sum+a1_copy.b1_0.c3_0.sum); + + int result = a1_copy.sum + a1_copy.b1_0.sum + a1_copy.b2_0.sum + a1_copy.b3_0.sum + a1_copy.b4_0.sum + a1_copy.b1_0.c1_0.sum + a1_copy.b1_0.c2_0.sum + a1_copy.b1_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 5049) + System.out.println("ExpectResult"); + } + + public static Nocycle_aDec_00010_A1 modifyA1(Nocycle_aDec_00010_A1 a1) { + a1.a = 102; + return a1; + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0115-rc-function-RC_Dec-Nocycle_aDec_00020/Nocycle_aDec_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0115-rc-function-RC_Dec-Nocycle_aDec_00020/Nocycle_aDec_00020.java index 6b25128fbdb7fb8478da11a6d2e4f5511b8137ea..50d71bcd89503ffd07dd7d4fc98346bb39d89e0a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0115-rc-function-RC_Dec-Nocycle_aDec_00020/Nocycle_aDec_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0115-rc-function-RC_Dec-Nocycle_aDec_00020/Nocycle_aDec_00020.java @@ -1,218 +1,218 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_aDec_00020 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_aDec_00020.java - *- @ExecuteClass: Nocycle_aDec_00020 - *- @ExecuteArgs: - */ - -class Nocycle_aDec_00020_A1 { - Nocycle_aDec_00020_B1 b1_0; - Nocycle_aDec_00020_B2 b2_0; - Nocycle_aDec_00020_B3 b3_0; - Nocycle_aDec_00020_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00020_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + b3_0.a + b4_0.a; - } -} - -class Nocycle_aDec_00020_B1 { - Nocycle_aDec_00020_C1 c1_0; - Nocycle_aDec_00020_C2 c2_0; - Nocycle_aDec_00020_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00020_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } -} - -class Nocycle_aDec_00020_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00020_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - - } -} - - -class Nocycle_aDec_00020_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00020_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - - } -} - -class Nocycle_aDec_00020_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00020_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - - } -} - -class Nocycle_aDec_00020_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00020_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00020_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00020_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00020_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00020_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_aDec_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_aDec_00020_A1 a1_main = new Nocycle_aDec_00020_A1("a1_main"); - a1_main.b1_0 = new Nocycle_aDec_00020_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_aDec_00020_C1("c1_0"); - a1_main.b1_0.c2_0 = new Nocycle_aDec_00020_C2("c2_0"); - a1_main.b1_0.c3_0 = new Nocycle_aDec_00020_C3("c3_0"); - a1_main.b2_0 = new Nocycle_aDec_00020_B2("b2_0"); - a1_main.b3_0 = new Nocycle_aDec_00020_B3("b3_0"); - a1_main.b4_0 = new Nocycle_aDec_00020_B4("b4_0"); - modifyB1(a1_main.b1_0); - a1_main.b1_0 = null; - a1_main.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - int result = a1_main.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum; - - if (result == 1928) - System.out.println("ExpectResult"); - } - - public static void modifyB1(Nocycle_aDec_00020_B1 b1) { - b1.a = 202; - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_aDec_00020 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_aDec_00020.java + *- @ExecuteClass: Nocycle_aDec_00020 + *- @ExecuteArgs: + */ + +class Nocycle_aDec_00020_A1 { + Nocycle_aDec_00020_B1 b1_0; + Nocycle_aDec_00020_B2 b2_0; + Nocycle_aDec_00020_B3 b3_0; + Nocycle_aDec_00020_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00020_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + b3_0.a + b4_0.a; + } +} + +class Nocycle_aDec_00020_B1 { + Nocycle_aDec_00020_C1 c1_0; + Nocycle_aDec_00020_C2 c2_0; + Nocycle_aDec_00020_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00020_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } +} + +class Nocycle_aDec_00020_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00020_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + + } +} + + +class Nocycle_aDec_00020_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00020_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + + } +} + +class Nocycle_aDec_00020_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00020_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + + } +} + +class Nocycle_aDec_00020_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00020_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00020_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00020_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00020_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00020_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_aDec_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_aDec_00020_A1 a1_main = new Nocycle_aDec_00020_A1("a1_main"); + a1_main.b1_0 = new Nocycle_aDec_00020_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_aDec_00020_C1("c1_0"); + a1_main.b1_0.c2_0 = new Nocycle_aDec_00020_C2("c2_0"); + a1_main.b1_0.c3_0 = new Nocycle_aDec_00020_C3("c3_0"); + a1_main.b2_0 = new Nocycle_aDec_00020_B2("b2_0"); + a1_main.b3_0 = new Nocycle_aDec_00020_B3("b3_0"); + a1_main.b4_0 = new Nocycle_aDec_00020_B4("b4_0"); + modifyB1(a1_main.b1_0); + a1_main.b1_0 = null; + a1_main.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + int result = a1_main.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum; + + if (result == 1928) + System.out.println("ExpectResult"); + } + + public static void modifyB1(Nocycle_aDec_00020_B1 b1) { + b1.a = 202; + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0116-rc-function-RC_Dec-Nocycle_aDec_00030/Nocycle_aDec_00030.java b/test/testsuite/ouroboros/memory_management/Function/RC0116-rc-function-RC_Dec-Nocycle_aDec_00030/Nocycle_aDec_00030.java index a0a0645e7e9c51852e1940bc4d3d779fa77d4705..80c318f43333e8f93de8360fa4315e49924d8a82 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0116-rc-function-RC_Dec-Nocycle_aDec_00030/Nocycle_aDec_00030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0116-rc-function-RC_Dec-Nocycle_aDec_00030/Nocycle_aDec_00030.java @@ -1,221 +1,221 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_aDec_00030 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_aDec_00030.java - *- @ExecuteClass: Nocycle_aDec_00030 - *- @ExecuteArgs: - */ - -class Nocycle_aDec_00030_A1 { - Nocycle_aDec_00030_B1 b1_0; - Nocycle_aDec_00030_B2 b2_0; - Nocycle_aDec_00030_B3 b3_0; - Nocycle_aDec_00030_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00030_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } -} - -class Nocycle_aDec_00030_B1 { - Nocycle_aDec_00030_C1 c1_0; - Nocycle_aDec_00030_C2 c2_0; - Nocycle_aDec_00030_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00030_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a; - } -} - -class Nocycle_aDec_00030_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00030_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - - } -} - - -class Nocycle_aDec_00030_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00030_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - - } -} - -class Nocycle_aDec_00030_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00030_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - - } -} - -class Nocycle_aDec_00030_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00030_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00030_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00030_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00030_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00030_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -public class Nocycle_aDec_00030 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_aDec_00030_A1 a1_main = new Nocycle_aDec_00030_A1("a1_main"); - a1_main.b1_0 = new Nocycle_aDec_00030_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_aDec_00030_C1("c1_0"); - a1_main.b1_0.c2_0 = new Nocycle_aDec_00030_C2("c2_0"); - a1_main.b1_0.c3_0 = new Nocycle_aDec_00030_C3("c3_0"); - a1_main.b2_0 = new Nocycle_aDec_00030_B2("b2_0"); - a1_main.b3_0 = new Nocycle_aDec_00030_B3("b3_0"); - a1_main.b4_0 = new Nocycle_aDec_00030_B4("b4_0"); - modifyC3(a1_main.b1_0.c3_0); - a1_main.b1_0.c3_0 = null; - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c2_0.add(); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c2_0.sum; - if (result == 4139) - System.out.println("ExpectResult"); - } - - public static void modifyC3(Nocycle_aDec_00030_C3 c3) { - c3.a += 1; - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_aDec_00030 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_aDec_00030.java + *- @ExecuteClass: Nocycle_aDec_00030 + *- @ExecuteArgs: + */ + +class Nocycle_aDec_00030_A1 { + Nocycle_aDec_00030_B1 b1_0; + Nocycle_aDec_00030_B2 b2_0; + Nocycle_aDec_00030_B3 b3_0; + Nocycle_aDec_00030_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00030_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } +} + +class Nocycle_aDec_00030_B1 { + Nocycle_aDec_00030_C1 c1_0; + Nocycle_aDec_00030_C2 c2_0; + Nocycle_aDec_00030_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00030_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a; + } +} + +class Nocycle_aDec_00030_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00030_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + + } +} + + +class Nocycle_aDec_00030_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00030_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + + } +} + +class Nocycle_aDec_00030_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00030_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + + } +} + +class Nocycle_aDec_00030_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00030_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00030_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00030_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00030_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00030_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +public class Nocycle_aDec_00030 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_aDec_00030_A1 a1_main = new Nocycle_aDec_00030_A1("a1_main"); + a1_main.b1_0 = new Nocycle_aDec_00030_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_aDec_00030_C1("c1_0"); + a1_main.b1_0.c2_0 = new Nocycle_aDec_00030_C2("c2_0"); + a1_main.b1_0.c3_0 = new Nocycle_aDec_00030_C3("c3_0"); + a1_main.b2_0 = new Nocycle_aDec_00030_B2("b2_0"); + a1_main.b3_0 = new Nocycle_aDec_00030_B3("b3_0"); + a1_main.b4_0 = new Nocycle_aDec_00030_B4("b4_0"); + modifyC3(a1_main.b1_0.c3_0); + a1_main.b1_0.c3_0 = null; + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c2_0.add(); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c2_0.sum; + if (result == 4139) + System.out.println("ExpectResult"); + } + + public static void modifyC3(Nocycle_aDec_00030_C3 c3) { + c3.a += 1; + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0117-rc-function-RC_Dec-Nocycle_aDec_00040/Nocycle_aDec_00040.java b/test/testsuite/ouroboros/memory_management/Function/RC0117-rc-function-RC_Dec-Nocycle_aDec_00040/Nocycle_aDec_00040.java index 57a00f098f967ff6bdadcf4ccfb4604002c134e1..b9eb25ae215820a2e513282b19eb252a178ffe7f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0117-rc-function-RC_Dec-Nocycle_aDec_00040/Nocycle_aDec_00040.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0117-rc-function-RC_Dec-Nocycle_aDec_00040/Nocycle_aDec_00040.java @@ -1,363 +1,363 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00040.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_aDec_00040 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_aDec_00040.java - *- @ExecuteClass: Nocycle_aDec_00040 - *- @ExecuteArgs: - */ - - -class Nocycle_aDec_00040_A1 { - Nocycle_aDec_00040_B1 b1_0; - Nocycle_aDec_00040_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } -} - - -class Nocycle_aDec_00040_A2 { - Nocycle_aDec_00040_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } -} - - -class Nocycle_aDec_00040_A3 { - Nocycle_aDec_00040_B2 b2_0; - Nocycle_aDec_00040_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } -} - -class Nocycle_aDec_00040_A4 { - Nocycle_aDec_00040_B3 b3_0; - Nocycle_aDec_00040_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } -} - - -class Nocycle_aDec_00040_B1 { - Nocycle_aDec_00040_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } -} - - -class Nocycle_aDec_00040_B2 { - Nocycle_aDec_00040_C1 c1_0; - Nocycle_aDec_00040_D1 d1_0; - Nocycle_aDec_00040_D2 d2_0; - Nocycle_aDec_00040_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_aDec_00040_B3 { - Nocycle_aDec_00040_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_aDec_00040_C1 { - Nocycle_aDec_00040_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_aDec_00040_C2 { - Nocycle_aDec_00040_D2 d2_0; - Nocycle_aDec_00040_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_aDec_00040_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00040_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00040_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00040_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_aDec_00040 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_aDec_00040_A1 a1_main = new Nocycle_aDec_00040_A1("a1_main"); - Nocycle_aDec_00040_A2 a2_main = new Nocycle_aDec_00040_A2("a2_main"); - Nocycle_aDec_00040_A3 a3_main = new Nocycle_aDec_00040_A3("a3_main"); - Nocycle_aDec_00040_A4 a4_main = new Nocycle_aDec_00040_A4("a4_main"); - a1_main.b1_0 = new Nocycle_aDec_00040_B1("b1_0"); - a1_main.d1_0 = new Nocycle_aDec_00040_D1("d1_0"); - a1_main.b1_0.d2_0 = new Nocycle_aDec_00040_D2("d2_0"); - - a2_main.b2_0 = new Nocycle_aDec_00040_B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_aDec_00040_C1("c1_0"); - a2_main.b2_0.d1_0 = a1_main.d1_0; - a2_main.b2_0.d2_0 = new Nocycle_aDec_00040_D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_aDec_00040_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - - a3_main.b2_0 = a2_main.b2_0; - a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; - a3_main.b2_0.c1_0.d1_0 = a2_main.b2_0.c1_0.d1_0; - a3_main.b2_0.d1_0 = a2_main.b2_0.d1_0; - a3_main.b2_0.d2_0 = a2_main.b2_0.d2_0; - a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; - - a3_main.c2_0 = new Nocycle_aDec_00040_C2("c2_0"); - a3_main.c2_0.d2_0 = a2_main.b2_0.d2_0; - a3_main.c2_0.d3_0 = new Nocycle_aDec_00040_D3("d3_0"); - - a4_main.b3_0 = new Nocycle_aDec_00040_B3("b3_0"); - a4_main.b3_0.c1_0 = a3_main.b2_0.c1_0; - a4_main.b3_0.c1_0.d1_0 = a3_main.b2_0.c1_0.d1_0; - a4_main.c2_0 = a3_main.c2_0; - a4_main.c2_0.d2_0 = a3_main.c2_0.d2_0; - a4_main.c2_0.d3_0 = a3_main.c2_0.d3_0; - modifyA1(a1_main); - a1_main = null; - a2_main.add(); - a3_main.add(); - a4_main.add(); - - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - - - int result = a2_main.sum + a3_main.sum + a4_main.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a4_main.b3_0.c1_0.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; - if (result == 7954) - System.out.println("ExpectResult"); - } - - private static void modifyA1(Nocycle_aDec_00040_A1 a1) { - a1.a += 1; - a1.add(); - a1.b1_0.add(); - a1.d1_0.add(); - a1.b1_0.d2_0.add(); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00040.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_aDec_00040 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_aDec_00040.java + *- @ExecuteClass: Nocycle_aDec_00040 + *- @ExecuteArgs: + */ + + +class Nocycle_aDec_00040_A1 { + Nocycle_aDec_00040_B1 b1_0; + Nocycle_aDec_00040_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } +} + + +class Nocycle_aDec_00040_A2 { + Nocycle_aDec_00040_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } +} + + +class Nocycle_aDec_00040_A3 { + Nocycle_aDec_00040_B2 b2_0; + Nocycle_aDec_00040_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } +} + +class Nocycle_aDec_00040_A4 { + Nocycle_aDec_00040_B3 b3_0; + Nocycle_aDec_00040_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } +} + + +class Nocycle_aDec_00040_B1 { + Nocycle_aDec_00040_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } +} + + +class Nocycle_aDec_00040_B2 { + Nocycle_aDec_00040_C1 c1_0; + Nocycle_aDec_00040_D1 d1_0; + Nocycle_aDec_00040_D2 d2_0; + Nocycle_aDec_00040_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_aDec_00040_B3 { + Nocycle_aDec_00040_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_aDec_00040_C1 { + Nocycle_aDec_00040_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_aDec_00040_C2 { + Nocycle_aDec_00040_D2 d2_0; + Nocycle_aDec_00040_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_aDec_00040_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00040_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00040_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00040_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_aDec_00040 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_aDec_00040_A1 a1_main = new Nocycle_aDec_00040_A1("a1_main"); + Nocycle_aDec_00040_A2 a2_main = new Nocycle_aDec_00040_A2("a2_main"); + Nocycle_aDec_00040_A3 a3_main = new Nocycle_aDec_00040_A3("a3_main"); + Nocycle_aDec_00040_A4 a4_main = new Nocycle_aDec_00040_A4("a4_main"); + a1_main.b1_0 = new Nocycle_aDec_00040_B1("b1_0"); + a1_main.d1_0 = new Nocycle_aDec_00040_D1("d1_0"); + a1_main.b1_0.d2_0 = new Nocycle_aDec_00040_D2("d2_0"); + + a2_main.b2_0 = new Nocycle_aDec_00040_B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_aDec_00040_C1("c1_0"); + a2_main.b2_0.d1_0 = a1_main.d1_0; + a2_main.b2_0.d2_0 = new Nocycle_aDec_00040_D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_aDec_00040_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + + a3_main.b2_0 = a2_main.b2_0; + a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; + a3_main.b2_0.c1_0.d1_0 = a2_main.b2_0.c1_0.d1_0; + a3_main.b2_0.d1_0 = a2_main.b2_0.d1_0; + a3_main.b2_0.d2_0 = a2_main.b2_0.d2_0; + a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; + + a3_main.c2_0 = new Nocycle_aDec_00040_C2("c2_0"); + a3_main.c2_0.d2_0 = a2_main.b2_0.d2_0; + a3_main.c2_0.d3_0 = new Nocycle_aDec_00040_D3("d3_0"); + + a4_main.b3_0 = new Nocycle_aDec_00040_B3("b3_0"); + a4_main.b3_0.c1_0 = a3_main.b2_0.c1_0; + a4_main.b3_0.c1_0.d1_0 = a3_main.b2_0.c1_0.d1_0; + a4_main.c2_0 = a3_main.c2_0; + a4_main.c2_0.d2_0 = a3_main.c2_0.d2_0; + a4_main.c2_0.d3_0 = a3_main.c2_0.d3_0; + modifyA1(a1_main); + a1_main = null; + a2_main.add(); + a3_main.add(); + a4_main.add(); + + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + + + int result = a2_main.sum + a3_main.sum + a4_main.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a4_main.b3_0.c1_0.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; + if (result == 7954) + System.out.println("ExpectResult"); + } + + private static void modifyA1(Nocycle_aDec_00040_A1 a1) { + a1.a += 1; + a1.add(); + a1.b1_0.add(); + a1.d1_0.add(); + a1.b1_0.d2_0.add(); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0118-rc-function-RC_Dec-Nocycle_aDec_00050/Nocycle_aDec_00050.java b/test/testsuite/ouroboros/memory_management/Function/RC0118-rc-function-RC_Dec-Nocycle_aDec_00050/Nocycle_aDec_00050.java index a657bdd95ec8fdd689c5664dd7afb591f166fb6d..c1f8b7152fe2ccf2494d57e26b90dd26cc6d1f42 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0118-rc-function-RC_Dec-Nocycle_aDec_00050/Nocycle_aDec_00050.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0118-rc-function-RC_Dec-Nocycle_aDec_00050/Nocycle_aDec_00050.java @@ -1,357 +1,357 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00050.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_aDec_00050 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_aDec_00050.java - *- @ExecuteClass: Nocycle_aDec_00050 - *- @ExecuteArgs: - */ - -class Nocycle_aDec_00050_A1 { - Nocycle_aDec_00050_B1 b1_0; - Nocycle_aDec_00050_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } -} - - -class Nocycle_aDec_00050_A2 { - Nocycle_aDec_00050_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -class Nocycle_aDec_00050_A3 { - Nocycle_aDec_00050_B2 b2_0; - Nocycle_aDec_00050_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + c2_0.a; - } -} - -class Nocycle_aDec_00050_A4 { - Nocycle_aDec_00050_B3 b3_0; - Nocycle_aDec_00050_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } -} - - -class Nocycle_aDec_00050_B1 { - Nocycle_aDec_00050_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } -} - - -class Nocycle_aDec_00050_B2 { - Nocycle_aDec_00050_C1 c1_0; - Nocycle_aDec_00050_D1 d1_0; - Nocycle_aDec_00050_D2 d2_0; - Nocycle_aDec_00050_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_aDec_00050_B3 { - Nocycle_aDec_00050_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_aDec_00050_C1 { - Nocycle_aDec_00050_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_aDec_00050_C2 { - Nocycle_aDec_00050_D2 d2_0; - Nocycle_aDec_00050_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_aDec_00050_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00050_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00050_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00050_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_aDec_00050 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_aDec_00050_A1 a1_main = new Nocycle_aDec_00050_A1("a1_main"); - Nocycle_aDec_00050_A2 a2_main = new Nocycle_aDec_00050_A2("a2_main"); - Nocycle_aDec_00050_A3 a3_main = new Nocycle_aDec_00050_A3("a3_main"); - Nocycle_aDec_00050_A4 a4_main = new Nocycle_aDec_00050_A4("a4_main"); - a1_main.b1_0 = new Nocycle_aDec_00050_B1("b1_0"); - a1_main.d1_0 = new Nocycle_aDec_00050_D1("d1_0"); - a1_main.b1_0.d2_0 = new Nocycle_aDec_00050_D2("d2_0"); - - a2_main.b2_0 = new Nocycle_aDec_00050_B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_aDec_00050_C1("c1_0"); - a2_main.b2_0.d1_0 = a1_main.d1_0; - a2_main.b2_0.d2_0 = new Nocycle_aDec_00050_D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_aDec_00050_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - - a3_main.b2_0 = a2_main.b2_0; - a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; - a3_main.b2_0.c1_0.d1_0 = a2_main.b2_0.c1_0.d1_0; - a3_main.b2_0.d1_0 = a2_main.b2_0.d1_0; - a3_main.b2_0.d2_0 = a2_main.b2_0.d2_0; - a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; - - a3_main.c2_0 = new Nocycle_aDec_00050_C2("c2_0"); - a3_main.c2_0.d2_0 = a2_main.b2_0.d2_0; - a3_main.c2_0.d3_0 = new Nocycle_aDec_00050_D3("d3_0"); - - a4_main.b3_0 = new Nocycle_aDec_00050_B3("b3_0"); - a4_main.b3_0.c1_0 = a3_main.b2_0.c1_0; - a4_main.b3_0.c1_0.d1_0 = a3_main.b2_0.c1_0.d1_0; - a4_main.c2_0 = a3_main.c2_0; - a4_main.c2_0.d2_0 = a3_main.c2_0.d2_0; - a4_main.c2_0.d3_0 = a3_main.c2_0.d3_0; - modifyB2(a2_main.b2_0); - a2_main.b2_0 = null; - a3_main.b2_0 = null; - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.d1_0.add(); - a1_main.b1_0.d2_0.add(); - - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a4_main.b3_0.sum + a4_main.b3_0.c1_0.sum + a3_main.c2_0.sum + a1_main.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; - - if (result == 7249) - System.out.println("ExpectResult"); - } - - private static void modifyB2(Nocycle_aDec_00050_B2 b2) { - b2.a += 1; - b2.add(); - b2.c1_0.add(); - b2.d1_0.add(); - b2.d2_0.add(); - b2.d3_0.add(); - b2.c1_0.d1_0.add(); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00050.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_aDec_00050 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_aDec_00050.java + *- @ExecuteClass: Nocycle_aDec_00050 + *- @ExecuteArgs: + */ + +class Nocycle_aDec_00050_A1 { + Nocycle_aDec_00050_B1 b1_0; + Nocycle_aDec_00050_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } +} + + +class Nocycle_aDec_00050_A2 { + Nocycle_aDec_00050_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +class Nocycle_aDec_00050_A3 { + Nocycle_aDec_00050_B2 b2_0; + Nocycle_aDec_00050_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + c2_0.a; + } +} + +class Nocycle_aDec_00050_A4 { + Nocycle_aDec_00050_B3 b3_0; + Nocycle_aDec_00050_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } +} + + +class Nocycle_aDec_00050_B1 { + Nocycle_aDec_00050_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } +} + + +class Nocycle_aDec_00050_B2 { + Nocycle_aDec_00050_C1 c1_0; + Nocycle_aDec_00050_D1 d1_0; + Nocycle_aDec_00050_D2 d2_0; + Nocycle_aDec_00050_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_aDec_00050_B3 { + Nocycle_aDec_00050_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_aDec_00050_C1 { + Nocycle_aDec_00050_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_aDec_00050_C2 { + Nocycle_aDec_00050_D2 d2_0; + Nocycle_aDec_00050_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_aDec_00050_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00050_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00050_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00050_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_aDec_00050 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_aDec_00050_A1 a1_main = new Nocycle_aDec_00050_A1("a1_main"); + Nocycle_aDec_00050_A2 a2_main = new Nocycle_aDec_00050_A2("a2_main"); + Nocycle_aDec_00050_A3 a3_main = new Nocycle_aDec_00050_A3("a3_main"); + Nocycle_aDec_00050_A4 a4_main = new Nocycle_aDec_00050_A4("a4_main"); + a1_main.b1_0 = new Nocycle_aDec_00050_B1("b1_0"); + a1_main.d1_0 = new Nocycle_aDec_00050_D1("d1_0"); + a1_main.b1_0.d2_0 = new Nocycle_aDec_00050_D2("d2_0"); + + a2_main.b2_0 = new Nocycle_aDec_00050_B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_aDec_00050_C1("c1_0"); + a2_main.b2_0.d1_0 = a1_main.d1_0; + a2_main.b2_0.d2_0 = new Nocycle_aDec_00050_D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_aDec_00050_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + + a3_main.b2_0 = a2_main.b2_0; + a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; + a3_main.b2_0.c1_0.d1_0 = a2_main.b2_0.c1_0.d1_0; + a3_main.b2_0.d1_0 = a2_main.b2_0.d1_0; + a3_main.b2_0.d2_0 = a2_main.b2_0.d2_0; + a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; + + a3_main.c2_0 = new Nocycle_aDec_00050_C2("c2_0"); + a3_main.c2_0.d2_0 = a2_main.b2_0.d2_0; + a3_main.c2_0.d3_0 = new Nocycle_aDec_00050_D3("d3_0"); + + a4_main.b3_0 = new Nocycle_aDec_00050_B3("b3_0"); + a4_main.b3_0.c1_0 = a3_main.b2_0.c1_0; + a4_main.b3_0.c1_0.d1_0 = a3_main.b2_0.c1_0.d1_0; + a4_main.c2_0 = a3_main.c2_0; + a4_main.c2_0.d2_0 = a3_main.c2_0.d2_0; + a4_main.c2_0.d3_0 = a3_main.c2_0.d3_0; + modifyB2(a2_main.b2_0); + a2_main.b2_0 = null; + a3_main.b2_0 = null; + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.d1_0.add(); + a1_main.b1_0.d2_0.add(); + + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a4_main.b3_0.sum + a4_main.b3_0.c1_0.sum + a3_main.c2_0.sum + a1_main.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; + + if (result == 7249) + System.out.println("ExpectResult"); + } + + private static void modifyB2(Nocycle_aDec_00050_B2 b2) { + b2.a += 1; + b2.add(); + b2.c1_0.add(); + b2.d1_0.add(); + b2.d2_0.add(); + b2.d3_0.add(); + b2.c1_0.d1_0.add(); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0119-rc-function-RC_Dec-Nocycle_aDec_00060/Nocycle_aDec_00060.java b/test/testsuite/ouroboros/memory_management/Function/RC0119-rc-function-RC_Dec-Nocycle_aDec_00060/Nocycle_aDec_00060.java index 934c573eeb0bf57a88c8a03c058fd3bd391f3f68..3e0055a170f756ad28b2ef782ae9a2be6d9b7a73 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0119-rc-function-RC_Dec-Nocycle_aDec_00060/Nocycle_aDec_00060.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0119-rc-function-RC_Dec-Nocycle_aDec_00060/Nocycle_aDec_00060.java @@ -1,369 +1,369 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00060.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: Nocycle_aDec_00060 in RC测试-No-Cycle-00.vsd. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_aDec_00060.java - *- @ExecuteClass: Nocycle_aDec_00060 - *- @ExecuteArgs: - */ - - -class Nocycle_aDec_00060_A1 { - Nocycle_aDec_00060_B1 b1_0; - Nocycle_aDec_00060_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } -} - - -class Nocycle_aDec_00060_A2 { - Nocycle_aDec_00060_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } -} - - -class Nocycle_aDec_00060_A3 { - Nocycle_aDec_00060_B2 b2_0; - Nocycle_aDec_00060_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } -} - -class Nocycle_aDec_00060_A4 { - Nocycle_aDec_00060_B3 b3_0; - Nocycle_aDec_00060_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } -} - - -class Nocycle_aDec_00060_B1 { - Nocycle_aDec_00060_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } -} - - -class Nocycle_aDec_00060_B2 { - Nocycle_aDec_00060_C1 c1_0; - Nocycle_aDec_00060_D1 d1_0; - Nocycle_aDec_00060_D2 d2_0; - Nocycle_aDec_00060_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_aDec_00060_B3 { - Nocycle_aDec_00060_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class Nocycle_aDec_00060_C1 { - Nocycle_aDec_00060_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class Nocycle_aDec_00060_C2 { - Nocycle_aDec_00060_D2 d2_0; - Nocycle_aDec_00060_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } -} - - -class Nocycle_aDec_00060_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00060_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class Nocycle_aDec_00060_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_aDec_00060_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - - -public class Nocycle_aDec_00060 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - Nocycle_aDec_00060_A1 a1_main = new Nocycle_aDec_00060_A1("a1_main"); - Nocycle_aDec_00060_A2 a2_main = new Nocycle_aDec_00060_A2("a2_main"); - Nocycle_aDec_00060_A3 a3_main = new Nocycle_aDec_00060_A3("a3_main"); - Nocycle_aDec_00060_A4 a4_main = new Nocycle_aDec_00060_A4("a4_main"); - a1_main.b1_0 = new Nocycle_aDec_00060_B1("b1_0"); - a1_main.d1_0 = new Nocycle_aDec_00060_D1("d1_0"); - a1_main.b1_0.d2_0 = new Nocycle_aDec_00060_D2("d2_0"); - - a2_main.b2_0 = new Nocycle_aDec_00060_B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_aDec_00060_C1("c1_0"); - a2_main.b2_0.d1_0 = a1_main.d1_0; - a2_main.b2_0.d2_0 = new Nocycle_aDec_00060_D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_aDec_00060_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; - - a3_main.b2_0 = a2_main.b2_0; - a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; - a3_main.b2_0.c1_0.d1_0 = a2_main.b2_0.c1_0.d1_0; - a3_main.b2_0.d1_0 = a2_main.b2_0.d1_0; - a3_main.b2_0.d2_0 = a2_main.b2_0.d2_0; - a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; - - a3_main.c2_0 = new Nocycle_aDec_00060_C2("c2_0"); - a3_main.c2_0.d2_0 = a2_main.b2_0.d2_0; - a3_main.c2_0.d3_0 = new Nocycle_aDec_00060_D3("d3_0"); - - a4_main.b3_0 = new Nocycle_aDec_00060_B3("b3_0"); - a4_main.b3_0.c1_0 = a3_main.b2_0.c1_0; - a4_main.b3_0.c1_0.d1_0 = a3_main.b2_0.c1_0.d1_0; - a4_main.c2_0 = a3_main.c2_0; - a4_main.c2_0.d2_0 = a3_main.c2_0.d2_0; - a4_main.c2_0.d3_0 = a3_main.c2_0.d3_0; - ModifyA1(a1_main); - ModifyA2(a2_main); - ModifyA3(a3_main); - a4_main.add(); - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - - - int result = a4_main.sum + a4_main.b3_0.sum + a4_main.b3_0.c1_0.sum + a4_main.c2_0.sum + a4_main.b3_0.c1_0.d1_0.sum + a4_main.c2_0.d2_0.sum + a4_main.c2_0.d3_0.sum; - - if (result == 5334) - System.out.println("ExpectResult"); - } - - private static void ModifyA1(Nocycle_aDec_00060_A1 a1) { - a1.a += 1; - a1.add(); - a1.b1_0.add(); - a1.d1_0.add(); - a1.b1_0.d2_0.add(); - } - - private static void ModifyA2(Nocycle_aDec_00060_A2 a2) { - a2.a += 1; - a2.add(); - a2.b2_0.add(); - a2.b2_0.c1_0.add(); - a2.b2_0.d1_0.add(); - a2.b2_0.d2_0.add(); - a2.b2_0.d3_0.add(); - a2.b2_0.c1_0.d1_0.add(); - } - - private static void ModifyA3(Nocycle_aDec_00060_A3 a3) { - a3.a += 1; - a3.add(); - a3.b2_0.add(); - a3.b2_0.c1_0.add(); - a3.b2_0.c1_0.d1_0.add(); - a3.b2_0.d1_0.add(); - a3.b2_0.d2_0.add(); - a3.b2_0.d3_0.add(); - a3.c2_0.add(); - a3.c2_0.d2_0.add(); - a3.c2_0.d3_0.add(); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Dec/Nocycle_aDec_00060.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: Nocycle_aDec_00060 in RC测试-No-Cycle-00.vsd. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_aDec_00060.java + *- @ExecuteClass: Nocycle_aDec_00060 + *- @ExecuteArgs: + */ + + +class Nocycle_aDec_00060_A1 { + Nocycle_aDec_00060_B1 b1_0; + Nocycle_aDec_00060_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } +} + + +class Nocycle_aDec_00060_A2 { + Nocycle_aDec_00060_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } +} + + +class Nocycle_aDec_00060_A3 { + Nocycle_aDec_00060_B2 b2_0; + Nocycle_aDec_00060_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } +} + +class Nocycle_aDec_00060_A4 { + Nocycle_aDec_00060_B3 b3_0; + Nocycle_aDec_00060_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } +} + + +class Nocycle_aDec_00060_B1 { + Nocycle_aDec_00060_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } +} + + +class Nocycle_aDec_00060_B2 { + Nocycle_aDec_00060_C1 c1_0; + Nocycle_aDec_00060_D1 d1_0; + Nocycle_aDec_00060_D2 d2_0; + Nocycle_aDec_00060_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_aDec_00060_B3 { + Nocycle_aDec_00060_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class Nocycle_aDec_00060_C1 { + Nocycle_aDec_00060_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class Nocycle_aDec_00060_C2 { + Nocycle_aDec_00060_D2 d2_0; + Nocycle_aDec_00060_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } +} + + +class Nocycle_aDec_00060_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00060_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class Nocycle_aDec_00060_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_aDec_00060_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + + +public class Nocycle_aDec_00060 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + Nocycle_aDec_00060_A1 a1_main = new Nocycle_aDec_00060_A1("a1_main"); + Nocycle_aDec_00060_A2 a2_main = new Nocycle_aDec_00060_A2("a2_main"); + Nocycle_aDec_00060_A3 a3_main = new Nocycle_aDec_00060_A3("a3_main"); + Nocycle_aDec_00060_A4 a4_main = new Nocycle_aDec_00060_A4("a4_main"); + a1_main.b1_0 = new Nocycle_aDec_00060_B1("b1_0"); + a1_main.d1_0 = new Nocycle_aDec_00060_D1("d1_0"); + a1_main.b1_0.d2_0 = new Nocycle_aDec_00060_D2("d2_0"); + + a2_main.b2_0 = new Nocycle_aDec_00060_B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_aDec_00060_C1("c1_0"); + a2_main.b2_0.d1_0 = a1_main.d1_0; + a2_main.b2_0.d2_0 = new Nocycle_aDec_00060_D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_aDec_00060_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = a1_main.d1_0; + + a3_main.b2_0 = a2_main.b2_0; + a3_main.b2_0.c1_0 = a2_main.b2_0.c1_0; + a3_main.b2_0.c1_0.d1_0 = a2_main.b2_0.c1_0.d1_0; + a3_main.b2_0.d1_0 = a2_main.b2_0.d1_0; + a3_main.b2_0.d2_0 = a2_main.b2_0.d2_0; + a3_main.b2_0.d3_0 = a2_main.b2_0.d3_0; + + a3_main.c2_0 = new Nocycle_aDec_00060_C2("c2_0"); + a3_main.c2_0.d2_0 = a2_main.b2_0.d2_0; + a3_main.c2_0.d3_0 = new Nocycle_aDec_00060_D3("d3_0"); + + a4_main.b3_0 = new Nocycle_aDec_00060_B3("b3_0"); + a4_main.b3_0.c1_0 = a3_main.b2_0.c1_0; + a4_main.b3_0.c1_0.d1_0 = a3_main.b2_0.c1_0.d1_0; + a4_main.c2_0 = a3_main.c2_0; + a4_main.c2_0.d2_0 = a3_main.c2_0.d2_0; + a4_main.c2_0.d3_0 = a3_main.c2_0.d3_0; + ModifyA1(a1_main); + ModifyA2(a2_main); + ModifyA3(a3_main); + a4_main.add(); + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + + + int result = a4_main.sum + a4_main.b3_0.sum + a4_main.b3_0.c1_0.sum + a4_main.c2_0.sum + a4_main.b3_0.c1_0.d1_0.sum + a4_main.c2_0.d2_0.sum + a4_main.c2_0.d3_0.sum; + + if (result == 5334) + System.out.println("ExpectResult"); + } + + private static void ModifyA1(Nocycle_aDec_00060_A1 a1) { + a1.a += 1; + a1.add(); + a1.b1_0.add(); + a1.d1_0.add(); + a1.b1_0.d2_0.add(); + } + + private static void ModifyA2(Nocycle_aDec_00060_A2 a2) { + a2.a += 1; + a2.add(); + a2.b2_0.add(); + a2.b2_0.c1_0.add(); + a2.b2_0.d1_0.add(); + a2.b2_0.d2_0.add(); + a2.b2_0.d3_0.add(); + a2.b2_0.c1_0.d1_0.add(); + } + + private static void ModifyA3(Nocycle_aDec_00060_A3 a3) { + a3.a += 1; + a3.add(); + a3.b2_0.add(); + a3.b2_0.c1_0.add(); + a3.b2_0.c1_0.d1_0.add(); + a3.b2_0.d1_0.add(); + a3.b2_0.d2_0.add(); + a3.b2_0.d3_0.add(); + a3.c2_0.add(); + a3.c2_0.d2_0.add(); + a3.c2_0.d3_0.add(); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0120-rc-function-RC_Thread01-Cycle_am_00180/Cycle_am_00180.java b/test/testsuite/ouroboros/memory_management/Function/RC0120-rc-function-RC_Thread01-Cycle_am_00180/Cycle_am_00180.java index 02128568c93ec6fe2e9b8f4fbdbfac222cacae87..2e9b539fddebc19f88d71d0ae3333335e96c0602 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0120-rc-function-RC_Thread01-Cycle_am_00180/Cycle_am_00180.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0120-rc-function-RC_Thread01-Cycle_am_00180/Cycle_am_00180.java @@ -1,285 +1,285 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00180.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00180 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00180.java - *- @ExecuteClass: Cycle_am_00180 - *- @ExecuteArgs: - * A1 depend A2 A8; - * A2 depend A3 ; A3 depend A4; A4 depend A5 ; A5 depend A6; A6 depend A1 ; - * A8 depend A9 ; A9 depend A7; A7 depend A4 - * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 - * RC-Testing_Result=(101+102+108)+(102+103)+(103+104)+(104+105)+(105+106)+(106+101)+(107+104)+(108+109)+(109+107)=1994 - * - */ -class ThreadRc_Cycle_am_00180 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00180_A1 a1_main = new Cycle_a_00180_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00180_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00180_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00180_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00180_A5("a5_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00180_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; - a1_main.a8_0 = new Cycle_a_00180_A8("a8_0"); - a1_main.a8_0.a9_0 = new Cycle_a_00180_A9("a9_0"); - a1_main.a8_0.a9_0.a7_0 = new Cycle_a_00180_A7("a7_0"); - a1_main.a8_0.a9_0.a7_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a1_main.a8_0.add(); - a1_main.a8_0.a9_0.add(); - a1_main.a8_0.a9_0.a7_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_main.a8_0.sum + a1_main.a8_0.a9_0.sum + a1_main.a8_0.a9_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1994) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00180_A1 { - Cycle_a_00180_A2 a2_0; - Cycle_a_00180_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A1(String strObjectName) { - a2_0 = null; - a8_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a8_0.a; - } - } - - class Cycle_a_00180_A2 { - Cycle_a_00180_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00180_A3 { - Cycle_a_00180_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00180_A4 { - Cycle_a_00180_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00180_A5 { - Cycle_a_00180_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00180_A6 { - Cycle_a_00180_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A6(String strObjectName) { - a1_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00180_A7 { - Cycle_a_00180_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A7(String strObjectName) { - a4_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00180_A8 { - Cycle_a_00180_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A8(String strObjectName) { - a9_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_00180_A9 { - Cycle_a_00180_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A9(String strObjectName) { - a7_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - - -public class Cycle_am_00180 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00180 A1_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); - ThreadRc_Cycle_am_00180 A2_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); - ThreadRc_Cycle_am_00180 A3_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); - ThreadRc_Cycle_am_00180 A4_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); - ThreadRc_Cycle_am_00180 A5_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); - ThreadRc_Cycle_am_00180 A6_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); - - A1_Cycle_am_00180.start(); - A2_Cycle_am_00180.start(); - A3_Cycle_am_00180.start(); - A4_Cycle_am_00180.start(); - A5_Cycle_am_00180.start(); - A6_Cycle_am_00180.start(); - - try { - A1_Cycle_am_00180.join(); - A2_Cycle_am_00180.join(); - A3_Cycle_am_00180.join(); - A4_Cycle_am_00180.join(); - A5_Cycle_am_00180.join(); - A6_Cycle_am_00180.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00180.check() && A2_Cycle_am_00180.check() && A3_Cycle_am_00180.check() && A4_Cycle_am_00180.check() && A5_Cycle_am_00180.check() && A6_Cycle_am_00180.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00180.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00180 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00180.java + *- @ExecuteClass: Cycle_am_00180 + *- @ExecuteArgs: + * A1 depend A2 A8; + * A2 depend A3 ; A3 depend A4; A4 depend A5 ; A5 depend A6; A6 depend A1 ; + * A8 depend A9 ; A9 depend A7; A7 depend A4 + * A1.a=101 A2.a=102 A3.a=103 ... A9.a=109 + * RC-Testing_Result=(101+102+108)+(102+103)+(103+104)+(104+105)+(105+106)+(106+101)+(107+104)+(108+109)+(109+107)=1994 + * + */ +class ThreadRc_Cycle_am_00180 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00180_A1 a1_main = new Cycle_a_00180_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00180_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00180_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00180_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00180_A5("a5_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00180_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; + a1_main.a8_0 = new Cycle_a_00180_A8("a8_0"); + a1_main.a8_0.a9_0 = new Cycle_a_00180_A9("a9_0"); + a1_main.a8_0.a9_0.a7_0 = new Cycle_a_00180_A7("a7_0"); + a1_main.a8_0.a9_0.a7_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a1_main.a8_0.add(); + a1_main.a8_0.a9_0.add(); + a1_main.a8_0.a9_0.a7_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_main.a8_0.sum + a1_main.a8_0.a9_0.sum + a1_main.a8_0.a9_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1994) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00180_A1 { + Cycle_a_00180_A2 a2_0; + Cycle_a_00180_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A1(String strObjectName) { + a2_0 = null; + a8_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a8_0.a; + } + } + + class Cycle_a_00180_A2 { + Cycle_a_00180_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00180_A3 { + Cycle_a_00180_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00180_A4 { + Cycle_a_00180_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00180_A5 { + Cycle_a_00180_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00180_A6 { + Cycle_a_00180_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A6(String strObjectName) { + a1_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00180_A7 { + Cycle_a_00180_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A7(String strObjectName) { + a4_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00180_A8 { + Cycle_a_00180_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A8(String strObjectName) { + a9_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_00180_A9 { + Cycle_a_00180_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A9(String strObjectName) { + a7_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + + +public class Cycle_am_00180 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00180 A1_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); + ThreadRc_Cycle_am_00180 A2_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); + ThreadRc_Cycle_am_00180 A3_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); + ThreadRc_Cycle_am_00180 A4_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); + ThreadRc_Cycle_am_00180 A5_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); + ThreadRc_Cycle_am_00180 A6_Cycle_am_00180 = new ThreadRc_Cycle_am_00180(); + + A1_Cycle_am_00180.start(); + A2_Cycle_am_00180.start(); + A3_Cycle_am_00180.start(); + A4_Cycle_am_00180.start(); + A5_Cycle_am_00180.start(); + A6_Cycle_am_00180.start(); + + try { + A1_Cycle_am_00180.join(); + A2_Cycle_am_00180.join(); + A3_Cycle_am_00180.join(); + A4_Cycle_am_00180.join(); + A5_Cycle_am_00180.join(); + A6_Cycle_am_00180.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00180.check() && A2_Cycle_am_00180.check() && A3_Cycle_am_00180.check() && A4_Cycle_am_00180.check() && A5_Cycle_am_00180.check() && A6_Cycle_am_00180.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0121-rc-function-RC_Thread01-Cycle_am_00190/Cycle_am_00190.java b/test/testsuite/ouroboros/memory_management/Function/RC0121-rc-function-RC_Thread01-Cycle_am_00190/Cycle_am_00190.java index ccb30a422bba71dd6d7d8c99a220d320b0aec7be..3598814acfc122ad91c836f76f209378753d26ed 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0121-rc-function-RC_Thread01-Cycle_am_00190/Cycle_am_00190.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0121-rc-function-RC_Thread01-Cycle_am_00190/Cycle_am_00190.java @@ -1,302 +1,302 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00190.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00190 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00190.java - *- @ExecuteClass: Cycle_am_00190 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_am_00190 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00190_A1 a1_main = new Cycle_a_00190_A1("a1_main"); - Cycle_a_00190_A10 a10_main = new Cycle_a_00190_A10("a10_main"); - a1_main.a2_0 = new Cycle_a_00190_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00190_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00190_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00190_A5("a5_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00190_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_main; - - a10_main.a8_0 = new Cycle_a_00190_A8("a8_0"); - a10_main.a8_0.a9_0 = new Cycle_a_00190_A9("a9_0"); - a10_main.a8_0.a9_0.a7_0 = new Cycle_a_00190_A7("a7_0"); - a10_main.a8_0.a9_0.a7_0.a5_0 = a1_main.a2_0.a3_0.a4_0.a5_0; - - a1_main.add(); - a10_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a10_main.a8_0.add(); - a10_main.a8_0.a9_0.add(); - a10_main.a8_0.a9_0.a7_0.add(); - - - int result = a1_main.sum + a10_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_main.a8_0.sum + a10_main.a8_0.a9_0.sum + a10_main.a8_0.a9_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2215) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00190_A1 { - Cycle_a_00190_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00190_A2 { - Cycle_a_00190_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00190_A3 { - Cycle_a_00190_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00190_A4 { - Cycle_a_00190_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00190_A5 { - Cycle_a_00190_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00190_A6 { - Cycle_a_00190_A1 a1_0; - Cycle_a_00190_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A6(String strObjectName) { - a1_0 = null; - a10_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a10_0.a; - } - } - - class Cycle_a_00190_A7 { - Cycle_a_00190_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A7(String strObjectName) { - a5_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00190_A8 { - Cycle_a_00190_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A8(String strObjectName) { - a9_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_00190_A9 { - Cycle_a_00190_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A9(String strObjectName) { - a7_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00190_A10 { - Cycle_a_00190_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A10(String strObjectName) { - a8_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } - } -} - - -public class Cycle_am_00190 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00190 A1_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); - ThreadRc_Cycle_am_00190 A2_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); - ThreadRc_Cycle_am_00190 A3_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); - ThreadRc_Cycle_am_00190 A4_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); - ThreadRc_Cycle_am_00190 A5_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); - ThreadRc_Cycle_am_00190 A6_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); - - A1_Cycle_am_00190.start(); - A2_Cycle_am_00190.start(); - A3_Cycle_am_00190.start(); - A4_Cycle_am_00190.start(); - A5_Cycle_am_00190.start(); - A6_Cycle_am_00190.start(); - - try { - A1_Cycle_am_00190.join(); - A2_Cycle_am_00190.join(); - A3_Cycle_am_00190.join(); - A4_Cycle_am_00190.join(); - A5_Cycle_am_00190.join(); - A6_Cycle_am_00190.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00190.check() && A2_Cycle_am_00190.check() && A3_Cycle_am_00190.check() && A4_Cycle_am_00190.check() && A5_Cycle_am_00190.check() && A6_Cycle_am_00190.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00190.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00190 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00190.java + *- @ExecuteClass: Cycle_am_00190 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_am_00190 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00190_A1 a1_main = new Cycle_a_00190_A1("a1_main"); + Cycle_a_00190_A10 a10_main = new Cycle_a_00190_A10("a10_main"); + a1_main.a2_0 = new Cycle_a_00190_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00190_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00190_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00190_A5("a5_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00190_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_main; + + a10_main.a8_0 = new Cycle_a_00190_A8("a8_0"); + a10_main.a8_0.a9_0 = new Cycle_a_00190_A9("a9_0"); + a10_main.a8_0.a9_0.a7_0 = new Cycle_a_00190_A7("a7_0"); + a10_main.a8_0.a9_0.a7_0.a5_0 = a1_main.a2_0.a3_0.a4_0.a5_0; + + a1_main.add(); + a10_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a10_main.a8_0.add(); + a10_main.a8_0.a9_0.add(); + a10_main.a8_0.a9_0.a7_0.add(); + + + int result = a1_main.sum + a10_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_main.a8_0.sum + a10_main.a8_0.a9_0.sum + a10_main.a8_0.a9_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2215) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00190_A1 { + Cycle_a_00190_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00190_A2 { + Cycle_a_00190_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00190_A3 { + Cycle_a_00190_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00190_A4 { + Cycle_a_00190_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00190_A5 { + Cycle_a_00190_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00190_A6 { + Cycle_a_00190_A1 a1_0; + Cycle_a_00190_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A6(String strObjectName) { + a1_0 = null; + a10_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a10_0.a; + } + } + + class Cycle_a_00190_A7 { + Cycle_a_00190_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A7(String strObjectName) { + a5_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00190_A8 { + Cycle_a_00190_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A8(String strObjectName) { + a9_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_00190_A9 { + Cycle_a_00190_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A9(String strObjectName) { + a7_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00190_A10 { + Cycle_a_00190_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A10(String strObjectName) { + a8_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } + } +} + + +public class Cycle_am_00190 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00190 A1_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); + ThreadRc_Cycle_am_00190 A2_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); + ThreadRc_Cycle_am_00190 A3_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); + ThreadRc_Cycle_am_00190 A4_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); + ThreadRc_Cycle_am_00190 A5_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); + ThreadRc_Cycle_am_00190 A6_Cycle_am_00190 = new ThreadRc_Cycle_am_00190(); + + A1_Cycle_am_00190.start(); + A2_Cycle_am_00190.start(); + A3_Cycle_am_00190.start(); + A4_Cycle_am_00190.start(); + A5_Cycle_am_00190.start(); + A6_Cycle_am_00190.start(); + + try { + A1_Cycle_am_00190.join(); + A2_Cycle_am_00190.join(); + A3_Cycle_am_00190.join(); + A4_Cycle_am_00190.join(); + A5_Cycle_am_00190.join(); + A6_Cycle_am_00190.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00190.check() && A2_Cycle_am_00190.check() && A3_Cycle_am_00190.check() && A4_Cycle_am_00190.check() && A5_Cycle_am_00190.check() && A6_Cycle_am_00190.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0122-rc-function-RC_Thread01-Cycle_am_00200/Cycle_am_00200.java b/test/testsuite/ouroboros/memory_management/Function/RC0122-rc-function-RC_Thread01-Cycle_am_00200/Cycle_am_00200.java index ef550657c737291fca89fd14a3f35a7740190871..0f50cd6684cbb681f85e0e97a264bd144ba2f25f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0122-rc-function-RC_Thread01-Cycle_am_00200/Cycle_am_00200.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0122-rc-function-RC_Thread01-Cycle_am_00200/Cycle_am_00200.java @@ -1,240 +1,240 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00200.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00200 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00200.java - *- @ExecuteClass: Cycle_am_00200 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_am_00200 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00200_A1 a1_main = new Cycle_a_00200_A1("a1_main"); - Cycle_a_00200_A4 a4_main = new Cycle_a_00200_A4("a4_main"); - a1_main.a2_0 = new Cycle_a_00200_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00200_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00200_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a6_0 = new Cycle_a_00200_A6("a6_0"); - a1_main.a2_0.a6_0.a7_0 = new Cycle_a_00200_A7("a7_0"); - a1_main.a2_0.a7_0 = a1_main.a2_0.a6_0.a7_0; - - a1_main.add(); - a4_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a6_0.add(); - a1_main.a2_0.a6_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a6_0.sum + a1_main.a2_0.a6_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1773) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00200_A1 { - Cycle_a_00200_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00200_A2 { - Cycle_a_00200_A3 a3_0; - Cycle_a_00200_A6 a6_0; - Cycle_a_00200_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A2(String strObjectName) { - a3_0 = null; - a6_0 = null; - a7_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a6_0.a + a7_0.a; - } - } - - class Cycle_a_00200_A3 { - Cycle_a_00200_A1 a1_0; - Cycle_a_00200_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00200_A4 { - Cycle_a_00200_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00200_A5 { - Cycle_a_00200_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A5(String strObjectName) { - a4_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00200_A6 { - Cycle_a_00200_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00200_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Cycle_am_00200 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00200 A1_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); - ThreadRc_Cycle_am_00200 A2_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); - ThreadRc_Cycle_am_00200 A3_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); - ThreadRc_Cycle_am_00200 A4_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); - ThreadRc_Cycle_am_00200 A5_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); - ThreadRc_Cycle_am_00200 A6_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); - - A1_Cycle_am_00200.start(); - A2_Cycle_am_00200.start(); - A3_Cycle_am_00200.start(); - A4_Cycle_am_00200.start(); - A5_Cycle_am_00200.start(); - A6_Cycle_am_00200.start(); - - try { - A1_Cycle_am_00200.join(); - A2_Cycle_am_00200.join(); - A3_Cycle_am_00200.join(); - A4_Cycle_am_00200.join(); - A5_Cycle_am_00200.join(); - A6_Cycle_am_00200.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00200.check() && A2_Cycle_am_00200.check() && A3_Cycle_am_00200.check() && A4_Cycle_am_00200.check() && A5_Cycle_am_00200.check() && A6_Cycle_am_00200.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00200.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00200 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00200.java + *- @ExecuteClass: Cycle_am_00200 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_am_00200 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00200_A1 a1_main = new Cycle_a_00200_A1("a1_main"); + Cycle_a_00200_A4 a4_main = new Cycle_a_00200_A4("a4_main"); + a1_main.a2_0 = new Cycle_a_00200_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00200_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00200_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a6_0 = new Cycle_a_00200_A6("a6_0"); + a1_main.a2_0.a6_0.a7_0 = new Cycle_a_00200_A7("a7_0"); + a1_main.a2_0.a7_0 = a1_main.a2_0.a6_0.a7_0; + + a1_main.add(); + a4_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a6_0.add(); + a1_main.a2_0.a6_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a6_0.sum + a1_main.a2_0.a6_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1773) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00200_A1 { + Cycle_a_00200_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00200_A2 { + Cycle_a_00200_A3 a3_0; + Cycle_a_00200_A6 a6_0; + Cycle_a_00200_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A2(String strObjectName) { + a3_0 = null; + a6_0 = null; + a7_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a6_0.a + a7_0.a; + } + } + + class Cycle_a_00200_A3 { + Cycle_a_00200_A1 a1_0; + Cycle_a_00200_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00200_A4 { + Cycle_a_00200_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00200_A5 { + Cycle_a_00200_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A5(String strObjectName) { + a4_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00200_A6 { + Cycle_a_00200_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00200_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Cycle_am_00200 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00200 A1_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); + ThreadRc_Cycle_am_00200 A2_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); + ThreadRc_Cycle_am_00200 A3_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); + ThreadRc_Cycle_am_00200 A4_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); + ThreadRc_Cycle_am_00200 A5_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); + ThreadRc_Cycle_am_00200 A6_Cycle_am_00200 = new ThreadRc_Cycle_am_00200(); + + A1_Cycle_am_00200.start(); + A2_Cycle_am_00200.start(); + A3_Cycle_am_00200.start(); + A4_Cycle_am_00200.start(); + A5_Cycle_am_00200.start(); + A6_Cycle_am_00200.start(); + + try { + A1_Cycle_am_00200.join(); + A2_Cycle_am_00200.join(); + A3_Cycle_am_00200.join(); + A4_Cycle_am_00200.join(); + A5_Cycle_am_00200.join(); + A6_Cycle_am_00200.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00200.check() && A2_Cycle_am_00200.check() && A3_Cycle_am_00200.check() && A4_Cycle_am_00200.check() && A5_Cycle_am_00200.check() && A6_Cycle_am_00200.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0123-rc-function-RC_Thread01-Cycle_am_00210/Cycle_am_00210.java b/test/testsuite/ouroboros/memory_management/Function/RC0123-rc-function-RC_Thread01-Cycle_am_00210/Cycle_am_00210.java index 7be297bf445b83912636e4222ea765cdf6a08329..2aac6abff40dcad7f6b29bb0a6f50d5ab32a30cc 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0123-rc-function-RC_Thread01-Cycle_am_00210/Cycle_am_00210.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0123-rc-function-RC_Thread01-Cycle_am_00210/Cycle_am_00210.java @@ -1,241 +1,241 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00210.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00210 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00210.java - *- @ExecuteClass: Cycle_am_00210 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_am_00210 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00210_A1 a1_main = new Cycle_a_00210_A1("a1_main"); - Cycle_a_00210_A4 a4_main = new Cycle_a_00210_A4("a4_main"); - a1_main.a2_0 = new Cycle_a_00210_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00210_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00210_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00210_A6("a6_0"); - a1_main.a2_0.a3_0.a6_0.a7_0 = new Cycle_a_00210_A7("a7_0"); - a1_main.a2_0.a3_0.a6_0.a7_0.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a4_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a6_0.add(); - a1_main.a2_0.a3_0.a6_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a6_0.sum + a1_main.a2_0.a3_0.a6_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1662) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00210_A1 { - Cycle_a_00210_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00210_A2 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00210_A3 { - Cycle_a_00210_A1 a1_0; - Cycle_a_00210_A5 a5_0; - Cycle_a_00210_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a6_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a6_0.a; - } - } - - class Cycle_a_00210_A4 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00210_A5 { - Cycle_a_00210_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A5(String strObjectName) { - a4_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00210_A6 { - Cycle_a_00210_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00210_A7 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_am_00210 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00210 A1_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); - ThreadRc_Cycle_am_00210 A2_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); - ThreadRc_Cycle_am_00210 A3_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); - ThreadRc_Cycle_am_00210 A4_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); - ThreadRc_Cycle_am_00210 A5_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); - ThreadRc_Cycle_am_00210 A6_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); - - A1_Cycle_am_00210.start(); - A2_Cycle_am_00210.start(); - A3_Cycle_am_00210.start(); - A4_Cycle_am_00210.start(); - A5_Cycle_am_00210.start(); - A6_Cycle_am_00210.start(); - - try { - A1_Cycle_am_00210.join(); - A2_Cycle_am_00210.join(); - A3_Cycle_am_00210.join(); - A4_Cycle_am_00210.join(); - A5_Cycle_am_00210.join(); - A6_Cycle_am_00210.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00210.check() && A2_Cycle_am_00210.check() && A3_Cycle_am_00210.check() && A4_Cycle_am_00210.check() && A5_Cycle_am_00210.check() && A6_Cycle_am_00210.check()) - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00210.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00210 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00210.java + *- @ExecuteClass: Cycle_am_00210 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_am_00210 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00210_A1 a1_main = new Cycle_a_00210_A1("a1_main"); + Cycle_a_00210_A4 a4_main = new Cycle_a_00210_A4("a4_main"); + a1_main.a2_0 = new Cycle_a_00210_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00210_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00210_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00210_A6("a6_0"); + a1_main.a2_0.a3_0.a6_0.a7_0 = new Cycle_a_00210_A7("a7_0"); + a1_main.a2_0.a3_0.a6_0.a7_0.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a4_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a6_0.add(); + a1_main.a2_0.a3_0.a6_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a6_0.sum + a1_main.a2_0.a3_0.a6_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1662) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00210_A1 { + Cycle_a_00210_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00210_A2 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00210_A3 { + Cycle_a_00210_A1 a1_0; + Cycle_a_00210_A5 a5_0; + Cycle_a_00210_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a6_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a6_0.a; + } + } + + class Cycle_a_00210_A4 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00210_A5 { + Cycle_a_00210_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A5(String strObjectName) { + a4_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00210_A6 { + Cycle_a_00210_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00210_A7 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_am_00210 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00210 A1_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); + ThreadRc_Cycle_am_00210 A2_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); + ThreadRc_Cycle_am_00210 A3_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); + ThreadRc_Cycle_am_00210 A4_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); + ThreadRc_Cycle_am_00210 A5_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); + ThreadRc_Cycle_am_00210 A6_Cycle_am_00210 = new ThreadRc_Cycle_am_00210(); + + A1_Cycle_am_00210.start(); + A2_Cycle_am_00210.start(); + A3_Cycle_am_00210.start(); + A4_Cycle_am_00210.start(); + A5_Cycle_am_00210.start(); + A6_Cycle_am_00210.start(); + + try { + A1_Cycle_am_00210.join(); + A2_Cycle_am_00210.join(); + A3_Cycle_am_00210.join(); + A4_Cycle_am_00210.join(); + A5_Cycle_am_00210.join(); + A6_Cycle_am_00210.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00210.check() && A2_Cycle_am_00210.check() && A3_Cycle_am_00210.check() && A4_Cycle_am_00210.check() && A5_Cycle_am_00210.check() && A6_Cycle_am_00210.check()) + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0124-rc-function-RC_Thread01-Cycle_am_00220/Cycle_am_00220.java b/test/testsuite/ouroboros/memory_management/Function/RC0124-rc-function-RC_Thread01-Cycle_am_00220/Cycle_am_00220.java index 7bf53106886c228c330a69e6df53c02a6407ce18..78c3e6d8f62c1fb4839c7bbf6d3d8caaecc91668 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0124-rc-function-RC_Thread01-Cycle_am_00220/Cycle_am_00220.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0124-rc-function-RC_Thread01-Cycle_am_00220/Cycle_am_00220.java @@ -1,242 +1,242 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00220.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00220 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00220.java - *- @ExecuteClass: Cycle_am_00220 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00220 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00220_A1 a1_main = new Cycle_a_00220_A1("a1_main"); - Cycle_a_00220_A4 a4_main = new Cycle_a_00220_A4("a4_main"); - Cycle_a_00220_A6 a6_main = new Cycle_a_00220_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00220_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00220_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00220_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_00220_A7("a7_0"); - a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; - a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1772) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00220_A1 { - Cycle_a_00220_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00220_A2 { - Cycle_a_00220_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00220_A3 { - Cycle_a_00220_A1 a1_0; - Cycle_a_00220_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00220_A4 { - Cycle_a_00220_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00220_A5 { - Cycle_a_00220_A4 a4_0; - Cycle_a_00220_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A5(String strObjectName) { - a4_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a + a7_0.a; - } - } - - class Cycle_a_00220_A6 { - Cycle_a_00220_A5 a5_0; - Cycle_a_00220_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A6(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a7_0.a; - } - } - - class Cycle_a_00220_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Cycle_am_00220 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00220 A1_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); - ThreadRc_Cycle_am_00220 A2_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); - ThreadRc_Cycle_am_00220 A3_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); - ThreadRc_Cycle_am_00220 A4_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); - ThreadRc_Cycle_am_00220 A5_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); - ThreadRc_Cycle_am_00220 A6_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); - - A1_Cycle_am_00220.start(); - A2_Cycle_am_00220.start(); - A3_Cycle_am_00220.start(); - A4_Cycle_am_00220.start(); - A5_Cycle_am_00220.start(); - A6_Cycle_am_00220.start(); - - try { - A1_Cycle_am_00220.join(); - A2_Cycle_am_00220.join(); - A3_Cycle_am_00220.join(); - A4_Cycle_am_00220.join(); - A5_Cycle_am_00220.join(); - A6_Cycle_am_00220.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00220.check() && A2_Cycle_am_00220.check() && A3_Cycle_am_00220.check() && A4_Cycle_am_00220.check() && A5_Cycle_am_00220.check() && A6_Cycle_am_00220.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00220.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00220 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00220.java + *- @ExecuteClass: Cycle_am_00220 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00220 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00220_A1 a1_main = new Cycle_a_00220_A1("a1_main"); + Cycle_a_00220_A4 a4_main = new Cycle_a_00220_A4("a4_main"); + Cycle_a_00220_A6 a6_main = new Cycle_a_00220_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00220_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00220_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00220_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_00220_A7("a7_0"); + a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; + a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1772) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00220_A1 { + Cycle_a_00220_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00220_A2 { + Cycle_a_00220_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00220_A3 { + Cycle_a_00220_A1 a1_0; + Cycle_a_00220_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00220_A4 { + Cycle_a_00220_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00220_A5 { + Cycle_a_00220_A4 a4_0; + Cycle_a_00220_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A5(String strObjectName) { + a4_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a + a7_0.a; + } + } + + class Cycle_a_00220_A6 { + Cycle_a_00220_A5 a5_0; + Cycle_a_00220_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A6(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a7_0.a; + } + } + + class Cycle_a_00220_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Cycle_am_00220 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00220 A1_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); + ThreadRc_Cycle_am_00220 A2_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); + ThreadRc_Cycle_am_00220 A3_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); + ThreadRc_Cycle_am_00220 A4_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); + ThreadRc_Cycle_am_00220 A5_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); + ThreadRc_Cycle_am_00220 A6_Cycle_am_00220 = new ThreadRc_Cycle_am_00220(); + + A1_Cycle_am_00220.start(); + A2_Cycle_am_00220.start(); + A3_Cycle_am_00220.start(); + A4_Cycle_am_00220.start(); + A5_Cycle_am_00220.start(); + A6_Cycle_am_00220.start(); + + try { + A1_Cycle_am_00220.join(); + A2_Cycle_am_00220.join(); + A3_Cycle_am_00220.join(); + A4_Cycle_am_00220.join(); + A5_Cycle_am_00220.join(); + A6_Cycle_am_00220.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00220.check() && A2_Cycle_am_00220.check() && A3_Cycle_am_00220.check() && A4_Cycle_am_00220.check() && A5_Cycle_am_00220.check() && A6_Cycle_am_00220.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0125-rc-function-RC_Thread01-Cycle_am_00230/Cycle_am_00230.java b/test/testsuite/ouroboros/memory_management/Function/RC0125-rc-function-RC_Thread01-Cycle_am_00230/Cycle_am_00230.java index 40f3443a11e36b37860694c23d9c13c20db822b0..a17ffbc2b605213b77764bce20dfede39ea8da14 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0125-rc-function-RC_Thread01-Cycle_am_00230/Cycle_am_00230.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0125-rc-function-RC_Thread01-Cycle_am_00230/Cycle_am_00230.java @@ -1,241 +1,241 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00230.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00230 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00230.java - *- @ExecuteClass: Cycle_am_00230 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00230 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00230_A1 a1_main = new Cycle_a_00230_A1("a1_main"); - Cycle_a_00230_A5 a5_main = new Cycle_a_00230_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00230_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00230_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00230_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a7_0 = new Cycle_a_00230_A7("a7_0"); - a5_main.a6_0 = new Cycle_a_00230_A6("a6_0"); - a5_main.a6_0.a7_0 = a5_main.a7_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a5_main.a7_0.add(); - a5_main.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a5_main.a6_0.sum + a5_main.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1773) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00230_A1 { - Cycle_a_00230_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00230_A2 { - Cycle_a_00230_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00230_A3 { - Cycle_a_00230_A1 a1_0; - Cycle_a_00230_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } - } - - class Cycle_a_00230_A4 { - Cycle_a_00230_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00230_A5 { - Cycle_a_00230_A3 a3_0; - Cycle_a_00230_A6 a6_0; - Cycle_a_00230_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A5(String strObjectName) { - a3_0 = null; - a6_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a6_0.a + a7_0.a; - } - } - - class Cycle_a_00230_A6 { - Cycle_a_00230_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00230_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Cycle_am_00230 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00230 A1_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); - ThreadRc_Cycle_am_00230 A2_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); - ThreadRc_Cycle_am_00230 A3_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); - ThreadRc_Cycle_am_00230 A4_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); - ThreadRc_Cycle_am_00230 A5_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); - ThreadRc_Cycle_am_00230 A6_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); - - A1_Cycle_am_00230.start(); - A2_Cycle_am_00230.start(); - A3_Cycle_am_00230.start(); - A4_Cycle_am_00230.start(); - A5_Cycle_am_00230.start(); - A6_Cycle_am_00230.start(); - - try { - A1_Cycle_am_00230.join(); - A2_Cycle_am_00230.join(); - A3_Cycle_am_00230.join(); - A4_Cycle_am_00230.join(); - A5_Cycle_am_00230.join(); - A6_Cycle_am_00230.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00230.check() && A2_Cycle_am_00230.check() && A3_Cycle_am_00230.check() && A4_Cycle_am_00230.check() && A5_Cycle_am_00230.check() && A6_Cycle_am_00230.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00230.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00230 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00230.java + *- @ExecuteClass: Cycle_am_00230 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00230 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00230_A1 a1_main = new Cycle_a_00230_A1("a1_main"); + Cycle_a_00230_A5 a5_main = new Cycle_a_00230_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00230_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00230_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00230_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a7_0 = new Cycle_a_00230_A7("a7_0"); + a5_main.a6_0 = new Cycle_a_00230_A6("a6_0"); + a5_main.a6_0.a7_0 = a5_main.a7_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a5_main.a7_0.add(); + a5_main.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a5_main.a6_0.sum + a5_main.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1773) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00230_A1 { + Cycle_a_00230_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00230_A2 { + Cycle_a_00230_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00230_A3 { + Cycle_a_00230_A1 a1_0; + Cycle_a_00230_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } + } + + class Cycle_a_00230_A4 { + Cycle_a_00230_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00230_A5 { + Cycle_a_00230_A3 a3_0; + Cycle_a_00230_A6 a6_0; + Cycle_a_00230_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A5(String strObjectName) { + a3_0 = null; + a6_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a6_0.a + a7_0.a; + } + } + + class Cycle_a_00230_A6 { + Cycle_a_00230_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00230_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Cycle_am_00230 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00230 A1_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); + ThreadRc_Cycle_am_00230 A2_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); + ThreadRc_Cycle_am_00230 A3_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); + ThreadRc_Cycle_am_00230 A4_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); + ThreadRc_Cycle_am_00230 A5_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); + ThreadRc_Cycle_am_00230 A6_Cycle_am_00230 = new ThreadRc_Cycle_am_00230(); + + A1_Cycle_am_00230.start(); + A2_Cycle_am_00230.start(); + A3_Cycle_am_00230.start(); + A4_Cycle_am_00230.start(); + A5_Cycle_am_00230.start(); + A6_Cycle_am_00230.start(); + + try { + A1_Cycle_am_00230.join(); + A2_Cycle_am_00230.join(); + A3_Cycle_am_00230.join(); + A4_Cycle_am_00230.join(); + A5_Cycle_am_00230.join(); + A6_Cycle_am_00230.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00230.check() && A2_Cycle_am_00230.check() && A3_Cycle_am_00230.check() && A4_Cycle_am_00230.check() && A5_Cycle_am_00230.check() && A6_Cycle_am_00230.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0126-rc-function-RC_Thread01-Cycle_am_00240/Cycle_am_00240.java b/test/testsuite/ouroboros/memory_management/Function/RC0126-rc-function-RC_Thread01-Cycle_am_00240/Cycle_am_00240.java index 46e56f858dace568d2e48c3860e0a605f79a7f3e..f69316291fd1166a0ce725cfdb4c1d9483995ac8 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0126-rc-function-RC_Thread01-Cycle_am_00240/Cycle_am_00240.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0126-rc-function-RC_Thread01-Cycle_am_00240/Cycle_am_00240.java @@ -1,241 +1,241 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00240.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00240 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00240.java - *- @ExecuteClass: Cycle_am_00240 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00240 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00240_A1 a1_main = new Cycle_a_00240_A1("a1_main"); - Cycle_a_00240_A5 a5_main = new Cycle_a_00240_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00240_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00240_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00240_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a1_main.a6_0 = new Cycle_a_00240_A6("a6_0"); - a1_main.a6_0.a7_0 = new Cycle_a_00240_A7("a7_0"); - a1_main.a6_0.a7_0.a1_0 = a1_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a6_0.add(); - a1_main.a6_0.a7_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a6_0.sum + a1_main.a6_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1660) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00240_A1 { - Cycle_a_00240_A2 a2_0; - Cycle_a_00240_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A1(String strObjectName) { - a2_0 = null; - a6_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a6_0.a; - } - } - - class Cycle_a_00240_A2 { - Cycle_a_00240_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00240_A3 { - Cycle_a_00240_A1 a1_0; - Cycle_a_00240_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } - } - - class Cycle_a_00240_A4 { - Cycle_a_00240_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00240_A5 { - Cycle_a_00240_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00240_A6 { - Cycle_a_00240_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00240_A7 { - Cycle_a_00240_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A7(String strObjectName) { - a1_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_am_00240 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00240 A1_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); - ThreadRc_Cycle_am_00240 A2_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); - ThreadRc_Cycle_am_00240 A3_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); - ThreadRc_Cycle_am_00240 A4_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); - ThreadRc_Cycle_am_00240 A5_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); - ThreadRc_Cycle_am_00240 A6_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); - - A1_Cycle_am_00240.start(); - A2_Cycle_am_00240.start(); - A3_Cycle_am_00240.start(); - A4_Cycle_am_00240.start(); - A5_Cycle_am_00240.start(); - A6_Cycle_am_00240.start(); - - try { - A1_Cycle_am_00240.join(); - A2_Cycle_am_00240.join(); - A3_Cycle_am_00240.join(); - A4_Cycle_am_00240.join(); - A5_Cycle_am_00240.join(); - A6_Cycle_am_00240.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00240.check() && A2_Cycle_am_00240.check() && A3_Cycle_am_00240.check() && A4_Cycle_am_00240.check() && A5_Cycle_am_00240.check() && A6_Cycle_am_00240.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00240.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00240 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00240.java + *- @ExecuteClass: Cycle_am_00240 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00240 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00240_A1 a1_main = new Cycle_a_00240_A1("a1_main"); + Cycle_a_00240_A5 a5_main = new Cycle_a_00240_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00240_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00240_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00240_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a1_main.a6_0 = new Cycle_a_00240_A6("a6_0"); + a1_main.a6_0.a7_0 = new Cycle_a_00240_A7("a7_0"); + a1_main.a6_0.a7_0.a1_0 = a1_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a6_0.add(); + a1_main.a6_0.a7_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a6_0.sum + a1_main.a6_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1660) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00240_A1 { + Cycle_a_00240_A2 a2_0; + Cycle_a_00240_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A1(String strObjectName) { + a2_0 = null; + a6_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a6_0.a; + } + } + + class Cycle_a_00240_A2 { + Cycle_a_00240_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00240_A3 { + Cycle_a_00240_A1 a1_0; + Cycle_a_00240_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } + } + + class Cycle_a_00240_A4 { + Cycle_a_00240_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00240_A5 { + Cycle_a_00240_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00240_A6 { + Cycle_a_00240_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00240_A7 { + Cycle_a_00240_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A7(String strObjectName) { + a1_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_am_00240 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00240 A1_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); + ThreadRc_Cycle_am_00240 A2_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); + ThreadRc_Cycle_am_00240 A3_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); + ThreadRc_Cycle_am_00240 A4_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); + ThreadRc_Cycle_am_00240 A5_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); + ThreadRc_Cycle_am_00240 A6_Cycle_am_00240 = new ThreadRc_Cycle_am_00240(); + + A1_Cycle_am_00240.start(); + A2_Cycle_am_00240.start(); + A3_Cycle_am_00240.start(); + A4_Cycle_am_00240.start(); + A5_Cycle_am_00240.start(); + A6_Cycle_am_00240.start(); + + try { + A1_Cycle_am_00240.join(); + A2_Cycle_am_00240.join(); + A3_Cycle_am_00240.join(); + A4_Cycle_am_00240.join(); + A5_Cycle_am_00240.join(); + A6_Cycle_am_00240.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00240.check() && A2_Cycle_am_00240.check() && A3_Cycle_am_00240.check() && A4_Cycle_am_00240.check() && A5_Cycle_am_00240.check() && A6_Cycle_am_00240.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0127-rc-function-RC_Thread01-Cycle_am_00250/Cycle_am_00250.java b/test/testsuite/ouroboros/memory_management/Function/RC0127-rc-function-RC_Thread01-Cycle_am_00250/Cycle_am_00250.java index 155d8274d2520f11465cd4eb73ef27cd8fd0a1ec..97f5e46f1f3b3fece55b5e52b88e97d92fbdc8d6 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0127-rc-function-RC_Thread01-Cycle_am_00250/Cycle_am_00250.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0127-rc-function-RC_Thread01-Cycle_am_00250/Cycle_am_00250.java @@ -1,199 +1,199 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00250.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00250 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00250.java - *- @ExecuteClass: Cycle_am_00250 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00250 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00250_A1 a1_main = new Cycle_a_00250_A1("a1_main"); - Cycle_a_00250_A6 a6_main = new Cycle_a_00250_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00250_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00250_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00250_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1238) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00250_A1 { - Cycle_a_00250_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00250_A2 { - Cycle_a_00250_A1 a1_0; - Cycle_a_00250_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00250_A3 { - Cycle_a_00250_A1 a1_0; - Cycle_a_00250_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00250_A5 { - Cycle_a_00250_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00250_A6 { - Cycle_a_00250_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_am_00250 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00250 A1_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); - ThreadRc_Cycle_am_00250 A2_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); - ThreadRc_Cycle_am_00250 A3_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); - ThreadRc_Cycle_am_00250 A4_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); - ThreadRc_Cycle_am_00250 A5_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); - ThreadRc_Cycle_am_00250 A6_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); - - A1_Cycle_am_00250.start(); - A2_Cycle_am_00250.start(); - A3_Cycle_am_00250.start(); - A4_Cycle_am_00250.start(); - A5_Cycle_am_00250.start(); - A6_Cycle_am_00250.start(); - - try { - A1_Cycle_am_00250.join(); - A2_Cycle_am_00250.join(); - A3_Cycle_am_00250.join(); - A4_Cycle_am_00250.join(); - A5_Cycle_am_00250.join(); - A6_Cycle_am_00250.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00250.check() && A2_Cycle_am_00250.check() && A3_Cycle_am_00250.check() && A4_Cycle_am_00250.check() && A5_Cycle_am_00250.check() && A6_Cycle_am_00250.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00250.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00250 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00250.java + *- @ExecuteClass: Cycle_am_00250 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00250 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00250_A1 a1_main = new Cycle_a_00250_A1("a1_main"); + Cycle_a_00250_A6 a6_main = new Cycle_a_00250_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00250_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00250_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00250_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1238) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00250_A1 { + Cycle_a_00250_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00250_A2 { + Cycle_a_00250_A1 a1_0; + Cycle_a_00250_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00250_A3 { + Cycle_a_00250_A1 a1_0; + Cycle_a_00250_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00250_A5 { + Cycle_a_00250_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00250_A6 { + Cycle_a_00250_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_am_00250 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00250 A1_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); + ThreadRc_Cycle_am_00250 A2_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); + ThreadRc_Cycle_am_00250 A3_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); + ThreadRc_Cycle_am_00250 A4_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); + ThreadRc_Cycle_am_00250 A5_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); + ThreadRc_Cycle_am_00250 A6_Cycle_am_00250 = new ThreadRc_Cycle_am_00250(); + + A1_Cycle_am_00250.start(); + A2_Cycle_am_00250.start(); + A3_Cycle_am_00250.start(); + A4_Cycle_am_00250.start(); + A5_Cycle_am_00250.start(); + A6_Cycle_am_00250.start(); + + try { + A1_Cycle_am_00250.join(); + A2_Cycle_am_00250.join(); + A3_Cycle_am_00250.join(); + A4_Cycle_am_00250.join(); + A5_Cycle_am_00250.join(); + A6_Cycle_am_00250.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00250.check() && A2_Cycle_am_00250.check() && A3_Cycle_am_00250.check() && A4_Cycle_am_00250.check() && A5_Cycle_am_00250.check() && A6_Cycle_am_00250.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0128-rc-function-RC_Thread01-Cycle_am_00260/Cycle_am_00260.java b/test/testsuite/ouroboros/memory_management/Function/RC0128-rc-function-RC_Thread01-Cycle_am_00260/Cycle_am_00260.java index 3e4b6b873c3a66937d24da0810ea8ac6a264fed3..b77e5970ef44e1613445f2f2c83004c2b668559c 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0128-rc-function-RC_Thread01-Cycle_am_00260/Cycle_am_00260.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0128-rc-function-RC_Thread01-Cycle_am_00260/Cycle_am_00260.java @@ -1,199 +1,199 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00260.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00260 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00260.java - *- @ExecuteClass: Cycle_am_00260 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00260 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00260_A1 a1_main = new Cycle_a_00260_A1("a1_main"); - Cycle_a_00260_A6 a6_main = new Cycle_a_00260_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00260_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00260_A3("a3_0"); - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00260_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1239) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00260_A1 { - Cycle_a_00260_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00260_A2 { - Cycle_a_00260_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00260_A3 { - Cycle_a_00260_A1 a1_0; - Cycle_a_00260_A2 a2_0; - Cycle_a_00260_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a + a5_0.a; - } - } - - class Cycle_a_00260_A5 { - Cycle_a_00260_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00260_A6 { - Cycle_a_00260_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_am_00260 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00260 A1_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); - ThreadRc_Cycle_am_00260 A2_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); - ThreadRc_Cycle_am_00260 A3_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); - ThreadRc_Cycle_am_00260 A4_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); - ThreadRc_Cycle_am_00260 A5_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); - ThreadRc_Cycle_am_00260 A6_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); - - A1_Cycle_am_00260.start(); - A2_Cycle_am_00260.start(); - A3_Cycle_am_00260.start(); - A4_Cycle_am_00260.start(); - A5_Cycle_am_00260.start(); - A6_Cycle_am_00260.start(); - - try { - A1_Cycle_am_00260.join(); - A2_Cycle_am_00260.join(); - A3_Cycle_am_00260.join(); - A4_Cycle_am_00260.join(); - A5_Cycle_am_00260.join(); - A6_Cycle_am_00260.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00260.check() && A2_Cycle_am_00260.check() && A3_Cycle_am_00260.check() && A4_Cycle_am_00260.check() && A5_Cycle_am_00260.check() && A6_Cycle_am_00260.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00260.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00260 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00260.java + *- @ExecuteClass: Cycle_am_00260 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00260 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00260_A1 a1_main = new Cycle_a_00260_A1("a1_main"); + Cycle_a_00260_A6 a6_main = new Cycle_a_00260_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00260_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00260_A3("a3_0"); + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00260_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1239) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00260_A1 { + Cycle_a_00260_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00260_A2 { + Cycle_a_00260_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00260_A3 { + Cycle_a_00260_A1 a1_0; + Cycle_a_00260_A2 a2_0; + Cycle_a_00260_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a + a5_0.a; + } + } + + class Cycle_a_00260_A5 { + Cycle_a_00260_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00260_A6 { + Cycle_a_00260_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_am_00260 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00260 A1_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); + ThreadRc_Cycle_am_00260 A2_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); + ThreadRc_Cycle_am_00260 A3_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); + ThreadRc_Cycle_am_00260 A4_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); + ThreadRc_Cycle_am_00260 A5_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); + ThreadRc_Cycle_am_00260 A6_Cycle_am_00260 = new ThreadRc_Cycle_am_00260(); + + A1_Cycle_am_00260.start(); + A2_Cycle_am_00260.start(); + A3_Cycle_am_00260.start(); + A4_Cycle_am_00260.start(); + A5_Cycle_am_00260.start(); + A6_Cycle_am_00260.start(); + + try { + A1_Cycle_am_00260.join(); + A2_Cycle_am_00260.join(); + A3_Cycle_am_00260.join(); + A4_Cycle_am_00260.join(); + A5_Cycle_am_00260.join(); + A6_Cycle_am_00260.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00260.check() && A2_Cycle_am_00260.check() && A3_Cycle_am_00260.check() && A4_Cycle_am_00260.check() && A5_Cycle_am_00260.check() && A6_Cycle_am_00260.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0129-rc-function-RC_Thread01-Cycle_am_00270/Cycle_am_00270.java b/test/testsuite/ouroboros/memory_management/Function/RC0129-rc-function-RC_Thread01-Cycle_am_00270/Cycle_am_00270.java index 3fcd2f06f6d573f7aaf31715130f1cc4a3f50b65..0fb29f2ec02a369d43e6aaf6d331e30bf7f6ab06 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0129-rc-function-RC_Thread01-Cycle_am_00270/Cycle_am_00270.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0129-rc-function-RC_Thread01-Cycle_am_00270/Cycle_am_00270.java @@ -1,199 +1,199 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00270.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00270 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00270.java - *- @ExecuteClass: Cycle_am_00270 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00270 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00270_A1 a1_main = new Cycle_a_00270_A1("a1_main"); - Cycle_a_00270_A6 a6_main = new Cycle_a_00270_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00270_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00270_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00270_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1240) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00270_A1 { - Cycle_a_00270_A2 a2_0; - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00270_A2 { - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00270_A3 { - Cycle_a_00270_A1 a1_0; - Cycle_a_00270_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00270_A5 { - Cycle_a_00270_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00270_A6 { - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_am_00270 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00270 A1_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); - ThreadRc_Cycle_am_00270 A2_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); - ThreadRc_Cycle_am_00270 A3_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); - ThreadRc_Cycle_am_00270 A4_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); - ThreadRc_Cycle_am_00270 A5_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); - ThreadRc_Cycle_am_00270 A6_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); - - A1_Cycle_am_00270.start(); - A2_Cycle_am_00270.start(); - A3_Cycle_am_00270.start(); - A4_Cycle_am_00270.start(); - A5_Cycle_am_00270.start(); - A6_Cycle_am_00270.start(); - - try { - A1_Cycle_am_00270.join(); - A2_Cycle_am_00270.join(); - A3_Cycle_am_00270.join(); - A4_Cycle_am_00270.join(); - A5_Cycle_am_00270.join(); - A6_Cycle_am_00270.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00270.check() && A2_Cycle_am_00270.check() && A3_Cycle_am_00270.check() && A4_Cycle_am_00270.check() && A5_Cycle_am_00270.check() && A6_Cycle_am_00270.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00270.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00270 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00270.java + *- @ExecuteClass: Cycle_am_00270 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00270 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00270_A1 a1_main = new Cycle_a_00270_A1("a1_main"); + Cycle_a_00270_A6 a6_main = new Cycle_a_00270_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00270_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00270_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00270_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1240) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00270_A1 { + Cycle_a_00270_A2 a2_0; + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00270_A2 { + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00270_A3 { + Cycle_a_00270_A1 a1_0; + Cycle_a_00270_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00270_A5 { + Cycle_a_00270_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00270_A6 { + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_am_00270 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00270 A1_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); + ThreadRc_Cycle_am_00270 A2_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); + ThreadRc_Cycle_am_00270 A3_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); + ThreadRc_Cycle_am_00270 A4_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); + ThreadRc_Cycle_am_00270 A5_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); + ThreadRc_Cycle_am_00270 A6_Cycle_am_00270 = new ThreadRc_Cycle_am_00270(); + + A1_Cycle_am_00270.start(); + A2_Cycle_am_00270.start(); + A3_Cycle_am_00270.start(); + A4_Cycle_am_00270.start(); + A5_Cycle_am_00270.start(); + A6_Cycle_am_00270.start(); + + try { + A1_Cycle_am_00270.join(); + A2_Cycle_am_00270.join(); + A3_Cycle_am_00270.join(); + A4_Cycle_am_00270.join(); + A5_Cycle_am_00270.join(); + A6_Cycle_am_00270.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00270.check() && A2_Cycle_am_00270.check() && A3_Cycle_am_00270.check() && A4_Cycle_am_00270.check() && A5_Cycle_am_00270.check() && A6_Cycle_am_00270.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0130-rc-function-RC_Thread01-Cycle_am_00280/Cycle_am_00280.java b/test/testsuite/ouroboros/memory_management/Function/RC0130-rc-function-RC_Thread01-Cycle_am_00280/Cycle_am_00280.java index c8d11bb41ab508bcb26ab31e9dbe0b65ddc2eb84..d391dbfca373f5f26e01e611b9cb23dedf6f0e2d 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0130-rc-function-RC_Thread01-Cycle_am_00280/Cycle_am_00280.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0130-rc-function-RC_Thread01-Cycle_am_00280/Cycle_am_00280.java @@ -1,205 +1,205 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00280.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00280 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00280.java - *- @ExecuteClass: Cycle_am_00280 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00280 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); - Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a3_0 = a1_main.a2_0.a3_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1443) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00280_A1 { - Cycle_a_00280_A2 a2_0; - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00280_A2 { - Cycle_a_00280_A1 a1_0; - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00280_A3 { - Cycle_a_00280_A1 a1_0; - Cycle_a_00280_A2 a2_0; - Cycle_a_00280_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a + a5_0.a; - } - } - - class Cycle_a_00280_A5 { - Cycle_a_00280_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00280_A6 { - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_am_00280 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00280 A1_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A2_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A3_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A4_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A5_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - ThreadRc_Cycle_am_00280 A6_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); - - A1_Cycle_am_00280.start(); - A2_Cycle_am_00280.start(); - A3_Cycle_am_00280.start(); - A4_Cycle_am_00280.start(); - A5_Cycle_am_00280.start(); - A6_Cycle_am_00280.start(); - - try { - A1_Cycle_am_00280.join(); - A2_Cycle_am_00280.join(); - A3_Cycle_am_00280.join(); - A4_Cycle_am_00280.join(); - A5_Cycle_am_00280.join(); - A6_Cycle_am_00280.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00280.check() && A2_Cycle_am_00280.check() && A3_Cycle_am_00280.check() && A4_Cycle_am_00280.check() && A5_Cycle_am_00280.check() && A6_Cycle_am_00280.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00280.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00280 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00280.java + *- @ExecuteClass: Cycle_am_00280 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00280 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); + Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a3_0 = a1_main.a2_0.a3_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1443) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00280_A1 { + Cycle_a_00280_A2 a2_0; + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00280_A2 { + Cycle_a_00280_A1 a1_0; + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00280_A3 { + Cycle_a_00280_A1 a1_0; + Cycle_a_00280_A2 a2_0; + Cycle_a_00280_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a + a5_0.a; + } + } + + class Cycle_a_00280_A5 { + Cycle_a_00280_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00280_A6 { + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_am_00280 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00280 A1_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A2_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A3_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A4_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A5_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + ThreadRc_Cycle_am_00280 A6_Cycle_am_00280 = new ThreadRc_Cycle_am_00280(); + + A1_Cycle_am_00280.start(); + A2_Cycle_am_00280.start(); + A3_Cycle_am_00280.start(); + A4_Cycle_am_00280.start(); + A5_Cycle_am_00280.start(); + A6_Cycle_am_00280.start(); + + try { + A1_Cycle_am_00280.join(); + A2_Cycle_am_00280.join(); + A3_Cycle_am_00280.join(); + A4_Cycle_am_00280.join(); + A5_Cycle_am_00280.join(); + A6_Cycle_am_00280.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00280.check() && A2_Cycle_am_00280.check() && A3_Cycle_am_00280.check() && A4_Cycle_am_00280.check() && A5_Cycle_am_00280.check() && A6_Cycle_am_00280.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0131-rc-function-RC_Thread01-Cycle_am_00290/Cycle_am_00290.java b/test/testsuite/ouroboros/memory_management/Function/RC0131-rc-function-RC_Thread01-Cycle_am_00290/Cycle_am_00290.java index efe02f6f758de2f776775d95414ab01ce8170d0f..df70e93f1cd66ebdaf92ad077bb6535fd0b298c9 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0131-rc-function-RC_Thread01-Cycle_am_00290/Cycle_am_00290.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0131-rc-function-RC_Thread01-Cycle_am_00290/Cycle_am_00290.java @@ -1,221 +1,221 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00290.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00290 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00290.java - *- @ExecuteClass: Cycle_am_00290 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00290 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00290_A1 a1_main = new Cycle_a_00290_A1("a1_main"); - Cycle_a_00290_A5 a5_main = new Cycle_a_00290_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00290_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00290_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00290_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00290_A6("a6_0"); - a1_main.a2_0.a3_0.a6_0.a2_0 = a1_main.a2_0; - a5_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1447) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00290_A1 { - Cycle_a_00290_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00290_A2 { - Cycle_a_00290_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00290_A3 { - Cycle_a_00290_A1 a1_0; - Cycle_a_00290_A4 a4_0; - Cycle_a_00290_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a6_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a + a6_0.a; - } - } - - class Cycle_a_00290_A4 { - Cycle_a_00290_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00290_A5 { - Cycle_a_00290_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00290_A6 { - Cycle_a_00290_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A6(String strObjectName) { - a2_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_am_00290 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00290 A1_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); - ThreadRc_Cycle_am_00290 A2_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); - ThreadRc_Cycle_am_00290 A3_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); - ThreadRc_Cycle_am_00290 A4_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); - ThreadRc_Cycle_am_00290 A5_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); - ThreadRc_Cycle_am_00290 A6_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); - - A1_Cycle_am_00290.start(); - A2_Cycle_am_00290.start(); - A3_Cycle_am_00290.start(); - A4_Cycle_am_00290.start(); - A5_Cycle_am_00290.start(); - A6_Cycle_am_00290.start(); - - try { - A1_Cycle_am_00290.join(); - A2_Cycle_am_00290.join(); - A3_Cycle_am_00290.join(); - A4_Cycle_am_00290.join(); - A5_Cycle_am_00290.join(); - A6_Cycle_am_00290.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00290.check() && A2_Cycle_am_00290.check() && A3_Cycle_am_00290.check() && A4_Cycle_am_00290.check() && A5_Cycle_am_00290.check() && A6_Cycle_am_00290.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00290.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00290 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00290.java + *- @ExecuteClass: Cycle_am_00290 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00290 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00290_A1 a1_main = new Cycle_a_00290_A1("a1_main"); + Cycle_a_00290_A5 a5_main = new Cycle_a_00290_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00290_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00290_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00290_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00290_A6("a6_0"); + a1_main.a2_0.a3_0.a6_0.a2_0 = a1_main.a2_0; + a5_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1447) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00290_A1 { + Cycle_a_00290_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00290_A2 { + Cycle_a_00290_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00290_A3 { + Cycle_a_00290_A1 a1_0; + Cycle_a_00290_A4 a4_0; + Cycle_a_00290_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a6_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a + a6_0.a; + } + } + + class Cycle_a_00290_A4 { + Cycle_a_00290_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00290_A5 { + Cycle_a_00290_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00290_A6 { + Cycle_a_00290_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A6(String strObjectName) { + a2_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_am_00290 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00290 A1_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); + ThreadRc_Cycle_am_00290 A2_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); + ThreadRc_Cycle_am_00290 A3_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); + ThreadRc_Cycle_am_00290 A4_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); + ThreadRc_Cycle_am_00290 A5_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); + ThreadRc_Cycle_am_00290 A6_Cycle_am_00290 = new ThreadRc_Cycle_am_00290(); + + A1_Cycle_am_00290.start(); + A2_Cycle_am_00290.start(); + A3_Cycle_am_00290.start(); + A4_Cycle_am_00290.start(); + A5_Cycle_am_00290.start(); + A6_Cycle_am_00290.start(); + + try { + A1_Cycle_am_00290.join(); + A2_Cycle_am_00290.join(); + A3_Cycle_am_00290.join(); + A4_Cycle_am_00290.join(); + A5_Cycle_am_00290.join(); + A6_Cycle_am_00290.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00290.check() && A2_Cycle_am_00290.check() && A3_Cycle_am_00290.check() && A4_Cycle_am_00290.check() && A5_Cycle_am_00290.check() && A6_Cycle_am_00290.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0132-rc-function-RC_Thread01-Cycle_am_00300/Cycle_am_00300.java b/test/testsuite/ouroboros/memory_management/Function/RC0132-rc-function-RC_Thread01-Cycle_am_00300/Cycle_am_00300.java index 79f7f33a989da829f4f81605b86dbe1c3fbedf89..cceb11740739254156b5effcb685e8b64f694842 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0132-rc-function-RC_Thread01-Cycle_am_00300/Cycle_am_00300.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0132-rc-function-RC_Thread01-Cycle_am_00300/Cycle_am_00300.java @@ -1,221 +1,221 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00300.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00300 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00300.java - *- @ExecuteClass: Cycle_am_00300 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00300 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00300_A1 a1_main = new Cycle_a_00300_A1("a1_main"); - Cycle_a_00300_A5 a5_main = new Cycle_a_00300_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00300_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00300_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00300_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0.a6_0 = new Cycle_a_00300_A6("a6_0"); - a5_main.a3_0.a4_0.a6_0.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0.a5_0 = a5_main; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1448) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00300_A1 { - Cycle_a_00300_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00300_A2 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00300_A3 { - Cycle_a_00300_A1 a1_0; - Cycle_a_00300_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } - } - - class Cycle_a_00300_A4 { - Cycle_a_00300_A5 a5_0; - Cycle_a_00300_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A4(String strObjectName) { - a5_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a6_0.a; - } - } - - class Cycle_a_00300_A5 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00300_A6 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_am_00300 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00300 A1_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); - ThreadRc_Cycle_am_00300 A2_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); - ThreadRc_Cycle_am_00300 A3_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); - ThreadRc_Cycle_am_00300 A4_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); - ThreadRc_Cycle_am_00300 A5_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); - ThreadRc_Cycle_am_00300 A6_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); - - A1_Cycle_am_00300.start(); - A2_Cycle_am_00300.start(); - A3_Cycle_am_00300.start(); - A4_Cycle_am_00300.start(); - A5_Cycle_am_00300.start(); - A6_Cycle_am_00300.start(); - - try { - A1_Cycle_am_00300.join(); - A2_Cycle_am_00300.join(); - A3_Cycle_am_00300.join(); - A4_Cycle_am_00300.join(); - A5_Cycle_am_00300.join(); - A6_Cycle_am_00300.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00300.check() && A2_Cycle_am_00300.check() && A3_Cycle_am_00300.check() && A4_Cycle_am_00300.check() && A5_Cycle_am_00300.check() && A6_Cycle_am_00300.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00300.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00300 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00300.java + *- @ExecuteClass: Cycle_am_00300 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00300 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00300_A1 a1_main = new Cycle_a_00300_A1("a1_main"); + Cycle_a_00300_A5 a5_main = new Cycle_a_00300_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00300_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00300_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00300_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0.a6_0 = new Cycle_a_00300_A6("a6_0"); + a5_main.a3_0.a4_0.a6_0.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0.a5_0 = a5_main; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1448) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00300_A1 { + Cycle_a_00300_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00300_A2 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00300_A3 { + Cycle_a_00300_A1 a1_0; + Cycle_a_00300_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } + } + + class Cycle_a_00300_A4 { + Cycle_a_00300_A5 a5_0; + Cycle_a_00300_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A4(String strObjectName) { + a5_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a6_0.a; + } + } + + class Cycle_a_00300_A5 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00300_A6 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_am_00300 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00300 A1_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); + ThreadRc_Cycle_am_00300 A2_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); + ThreadRc_Cycle_am_00300 A3_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); + ThreadRc_Cycle_am_00300 A4_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); + ThreadRc_Cycle_am_00300 A5_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); + ThreadRc_Cycle_am_00300 A6_Cycle_am_00300 = new ThreadRc_Cycle_am_00300(); + + A1_Cycle_am_00300.start(); + A2_Cycle_am_00300.start(); + A3_Cycle_am_00300.start(); + A4_Cycle_am_00300.start(); + A5_Cycle_am_00300.start(); + A6_Cycle_am_00300.start(); + + try { + A1_Cycle_am_00300.join(); + A2_Cycle_am_00300.join(); + A3_Cycle_am_00300.join(); + A4_Cycle_am_00300.join(); + A5_Cycle_am_00300.join(); + A6_Cycle_am_00300.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00300.check() && A2_Cycle_am_00300.check() && A3_Cycle_am_00300.check() && A4_Cycle_am_00300.check() && A5_Cycle_am_00300.check() && A6_Cycle_am_00300.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0133-rc-function-RC_Thread01-Cycle_am_00310/Cycle_am_00310.java b/test/testsuite/ouroboros/memory_management/Function/RC0133-rc-function-RC_Thread01-Cycle_am_00310/Cycle_am_00310.java index c0637b0012ca247eca3ff0c73bb4dd773add4d60..9caa5d08c3f9541d4e2ee64f8c62cd488173c485 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0133-rc-function-RC_Thread01-Cycle_am_00310/Cycle_am_00310.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0133-rc-function-RC_Thread01-Cycle_am_00310/Cycle_am_00310.java @@ -1,225 +1,225 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00310.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00310 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00310.java - *- @ExecuteClass: Cycle_am_00310 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00310 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00310_A1 a1_main = new Cycle_a_00310_A1("a1_main"); - Cycle_a_00310_A4 a4_main = new Cycle_a_00310_A4("a4_main"); - Cycle_a_00310_A6 a6_main = new Cycle_a_00310_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00310_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00310_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00310_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a4_0 = a4_main; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a6_main.a3_0.a5_0 = a1_main.a2_0.a3_0.a5_0; - a4_main.a6_0 = a6_main; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1552) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00310_A1 { - Cycle_a_00310_A2 a2_0; - Cycle_a_00310_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } - } - - class Cycle_a_00310_A2 { - Cycle_a_00310_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00310_A3 { - Cycle_a_00310_A1 a1_0; - Cycle_a_00310_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00310_A4 { - Cycle_a_00310_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A4(String strObjectName) { - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00310_A5 { - Cycle_a_00310_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00310_A6 { - Cycle_a_00310_A1 a1_0; - Cycle_a_00310_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } -} - - -public class Cycle_am_00310 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00310 A1_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); - ThreadRc_Cycle_am_00310 A2_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); - ThreadRc_Cycle_am_00310 A3_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); - ThreadRc_Cycle_am_00310 A4_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); - ThreadRc_Cycle_am_00310 A5_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); - ThreadRc_Cycle_am_00310 A6_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); - - A1_Cycle_am_00310.start(); - A2_Cycle_am_00310.start(); - A3_Cycle_am_00310.start(); - A4_Cycle_am_00310.start(); - A5_Cycle_am_00310.start(); - A6_Cycle_am_00310.start(); - - try { - A1_Cycle_am_00310.join(); - A2_Cycle_am_00310.join(); - A3_Cycle_am_00310.join(); - A4_Cycle_am_00310.join(); - A5_Cycle_am_00310.join(); - A6_Cycle_am_00310.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00310.check() && A2_Cycle_am_00310.check() && A3_Cycle_am_00310.check() && A4_Cycle_am_00310.check() && A5_Cycle_am_00310.check() && A6_Cycle_am_00310.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00310.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00310 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00310.java + *- @ExecuteClass: Cycle_am_00310 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00310 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00310_A1 a1_main = new Cycle_a_00310_A1("a1_main"); + Cycle_a_00310_A4 a4_main = new Cycle_a_00310_A4("a4_main"); + Cycle_a_00310_A6 a6_main = new Cycle_a_00310_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00310_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00310_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00310_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a4_0 = a4_main; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a6_main.a3_0.a5_0 = a1_main.a2_0.a3_0.a5_0; + a4_main.a6_0 = a6_main; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1552) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00310_A1 { + Cycle_a_00310_A2 a2_0; + Cycle_a_00310_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } + } + + class Cycle_a_00310_A2 { + Cycle_a_00310_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00310_A3 { + Cycle_a_00310_A1 a1_0; + Cycle_a_00310_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00310_A4 { + Cycle_a_00310_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A4(String strObjectName) { + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00310_A5 { + Cycle_a_00310_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00310_A6 { + Cycle_a_00310_A1 a1_0; + Cycle_a_00310_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } +} + + +public class Cycle_am_00310 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00310 A1_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); + ThreadRc_Cycle_am_00310 A2_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); + ThreadRc_Cycle_am_00310 A3_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); + ThreadRc_Cycle_am_00310 A4_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); + ThreadRc_Cycle_am_00310 A5_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); + ThreadRc_Cycle_am_00310 A6_Cycle_am_00310 = new ThreadRc_Cycle_am_00310(); + + A1_Cycle_am_00310.start(); + A2_Cycle_am_00310.start(); + A3_Cycle_am_00310.start(); + A4_Cycle_am_00310.start(); + A5_Cycle_am_00310.start(); + A6_Cycle_am_00310.start(); + + try { + A1_Cycle_am_00310.join(); + A2_Cycle_am_00310.join(); + A3_Cycle_am_00310.join(); + A4_Cycle_am_00310.join(); + A5_Cycle_am_00310.join(); + A6_Cycle_am_00310.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00310.check() && A2_Cycle_am_00310.check() && A3_Cycle_am_00310.check() && A4_Cycle_am_00310.check() && A5_Cycle_am_00310.check() && A6_Cycle_am_00310.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0134-rc-function-RC_Thread01-Cycle_am_00320/Cycle_am_00320.java b/test/testsuite/ouroboros/memory_management/Function/RC0134-rc-function-RC_Thread01-Cycle_am_00320/Cycle_am_00320.java index 828abca113d8b012ddf33a661703f23bce5d0665..4987716b4afb83ad8056f78654cfd1bfde02f6c9 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0134-rc-function-RC_Thread01-Cycle_am_00320/Cycle_am_00320.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0134-rc-function-RC_Thread01-Cycle_am_00320/Cycle_am_00320.java @@ -1,224 +1,224 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00320.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00320 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00320.java - *- @ExecuteClass: Cycle_am_00320 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00320 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00320_A1 a1_main = new Cycle_a_00320_A1("a1_main"); - Cycle_a_00320_A4 a4_main = new Cycle_a_00320_A4("a4_main"); - Cycle_a_00320_A6 a6_main = new Cycle_a_00320_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00320_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00320_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00320_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a4_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - a6_main.a4_0 = a4_main; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1551) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00320_A1 { - Cycle_a_00320_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00320_A2 { - Cycle_a_00320_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00320_A3 { - Cycle_a_00320_A1 a1_0; - Cycle_a_00320_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00320_A4 { - Cycle_a_00320_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00320_A5 { - Cycle_a_00320_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00320_A6 { - Cycle_a_00320_A1 a1_0; - Cycle_a_00320_A3 a3_0; - Cycle_a_00320_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } -} - - -public class Cycle_am_00320 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00320 A1_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); - ThreadRc_Cycle_am_00320 A2_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); - ThreadRc_Cycle_am_00320 A3_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); - ThreadRc_Cycle_am_00320 A4_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); - ThreadRc_Cycle_am_00320 A5_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); - ThreadRc_Cycle_am_00320 A6_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); - - A1_Cycle_am_00320.start(); - A2_Cycle_am_00320.start(); - A3_Cycle_am_00320.start(); - A4_Cycle_am_00320.start(); - A5_Cycle_am_00320.start(); - A6_Cycle_am_00320.start(); - - try { - A1_Cycle_am_00320.join(); - A2_Cycle_am_00320.join(); - A3_Cycle_am_00320.join(); - A4_Cycle_am_00320.join(); - A5_Cycle_am_00320.join(); - A6_Cycle_am_00320.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00320.check() && A2_Cycle_am_00320.check() && A3_Cycle_am_00320.check() && A4_Cycle_am_00320.check() && A5_Cycle_am_00320.check() && A6_Cycle_am_00320.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00320.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00320 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00320.java + *- @ExecuteClass: Cycle_am_00320 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00320 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00320_A1 a1_main = new Cycle_a_00320_A1("a1_main"); + Cycle_a_00320_A4 a4_main = new Cycle_a_00320_A4("a4_main"); + Cycle_a_00320_A6 a6_main = new Cycle_a_00320_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00320_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00320_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00320_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a4_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + a6_main.a4_0 = a4_main; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1551) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00320_A1 { + Cycle_a_00320_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00320_A2 { + Cycle_a_00320_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00320_A3 { + Cycle_a_00320_A1 a1_0; + Cycle_a_00320_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00320_A4 { + Cycle_a_00320_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00320_A5 { + Cycle_a_00320_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00320_A6 { + Cycle_a_00320_A1 a1_0; + Cycle_a_00320_A3 a3_0; + Cycle_a_00320_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } +} + + +public class Cycle_am_00320 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00320 A1_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); + ThreadRc_Cycle_am_00320 A2_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); + ThreadRc_Cycle_am_00320 A3_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); + ThreadRc_Cycle_am_00320 A4_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); + ThreadRc_Cycle_am_00320 A5_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); + ThreadRc_Cycle_am_00320 A6_Cycle_am_00320 = new ThreadRc_Cycle_am_00320(); + + A1_Cycle_am_00320.start(); + A2_Cycle_am_00320.start(); + A3_Cycle_am_00320.start(); + A4_Cycle_am_00320.start(); + A5_Cycle_am_00320.start(); + A6_Cycle_am_00320.start(); + + try { + A1_Cycle_am_00320.join(); + A2_Cycle_am_00320.join(); + A3_Cycle_am_00320.join(); + A4_Cycle_am_00320.join(); + A5_Cycle_am_00320.join(); + A6_Cycle_am_00320.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00320.check() && A2_Cycle_am_00320.check() && A3_Cycle_am_00320.check() && A4_Cycle_am_00320.check() && A5_Cycle_am_00320.check() && A6_Cycle_am_00320.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0135-rc-function-RC_Thread01-Cycle_am_00330/Cycle_am_00330.java b/test/testsuite/ouroboros/memory_management/Function/RC0135-rc-function-RC_Thread01-Cycle_am_00330/Cycle_am_00330.java index 46a69fd88024d10a69487855cbcb96ee99c9fde1..83d8fe90cd552859602fb0e298b8dbd13a934d92 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0135-rc-function-RC_Thread01-Cycle_am_00330/Cycle_am_00330.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0135-rc-function-RC_Thread01-Cycle_am_00330/Cycle_am_00330.java @@ -1,271 +1,271 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00330.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00330 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00330.java - *- @ExecuteClass: Cycle_am_00330 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00330 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00330_A1 a1_main = new Cycle_a_00330_A1("a1_main"); - Cycle_a_00330_A4 a4_main = new Cycle_a_00330_A4("a4_main"); - Cycle_a_00330_A6 a6_main = new Cycle_a_00330_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00330_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00330_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00330_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00330_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00330_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_main.a2_0.a3_0; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2080) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00330_A1 { - Cycle_a_00330_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00330_A2 { - Cycle_a_00330_A3 a3_0; - Cycle_a_00330_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00330_A3 { - Cycle_a_00330_A1 a1_0; - Cycle_a_00330_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00330_A4 { - Cycle_a_00330_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00330_A5 { - Cycle_a_00330_A6 a6_0; - Cycle_a_00330_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00330_A6 { - Cycle_a_00330_A1 a1_0; - Cycle_a_00330_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00330_A7 { - Cycle_a_00330_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00330_A8 { - Cycle_a_00330_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - - -public class Cycle_am_00330 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00330 A1_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); - ThreadRc_Cycle_am_00330 A2_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); - ThreadRc_Cycle_am_00330 A3_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); - ThreadRc_Cycle_am_00330 A4_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); - ThreadRc_Cycle_am_00330 A5_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); - ThreadRc_Cycle_am_00330 A6_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); - - A1_Cycle_am_00330.start(); - A2_Cycle_am_00330.start(); - A3_Cycle_am_00330.start(); - A4_Cycle_am_00330.start(); - A5_Cycle_am_00330.start(); - A6_Cycle_am_00330.start(); - - try { - A1_Cycle_am_00330.join(); - A2_Cycle_am_00330.join(); - A3_Cycle_am_00330.join(); - A4_Cycle_am_00330.join(); - A5_Cycle_am_00330.join(); - A6_Cycle_am_00330.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00330.check() && A2_Cycle_am_00330.check() && A3_Cycle_am_00330.check() && A4_Cycle_am_00330.check() && A5_Cycle_am_00330.check() && A6_Cycle_am_00330.check()) - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00330.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00330 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00330.java + *- @ExecuteClass: Cycle_am_00330 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00330 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00330_A1 a1_main = new Cycle_a_00330_A1("a1_main"); + Cycle_a_00330_A4 a4_main = new Cycle_a_00330_A4("a4_main"); + Cycle_a_00330_A6 a6_main = new Cycle_a_00330_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00330_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00330_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00330_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00330_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00330_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_main.a2_0.a3_0; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2080) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00330_A1 { + Cycle_a_00330_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00330_A2 { + Cycle_a_00330_A3 a3_0; + Cycle_a_00330_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00330_A3 { + Cycle_a_00330_A1 a1_0; + Cycle_a_00330_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00330_A4 { + Cycle_a_00330_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00330_A5 { + Cycle_a_00330_A6 a6_0; + Cycle_a_00330_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00330_A6 { + Cycle_a_00330_A1 a1_0; + Cycle_a_00330_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00330_A7 { + Cycle_a_00330_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00330_A8 { + Cycle_a_00330_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + + +public class Cycle_am_00330 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00330 A1_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); + ThreadRc_Cycle_am_00330 A2_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); + ThreadRc_Cycle_am_00330 A3_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); + ThreadRc_Cycle_am_00330 A4_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); + ThreadRc_Cycle_am_00330 A5_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); + ThreadRc_Cycle_am_00330 A6_Cycle_am_00330 = new ThreadRc_Cycle_am_00330(); + + A1_Cycle_am_00330.start(); + A2_Cycle_am_00330.start(); + A3_Cycle_am_00330.start(); + A4_Cycle_am_00330.start(); + A5_Cycle_am_00330.start(); + A6_Cycle_am_00330.start(); + + try { + A1_Cycle_am_00330.join(); + A2_Cycle_am_00330.join(); + A3_Cycle_am_00330.join(); + A4_Cycle_am_00330.join(); + A5_Cycle_am_00330.join(); + A6_Cycle_am_00330.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00330.check() && A2_Cycle_am_00330.check() && A3_Cycle_am_00330.check() && A4_Cycle_am_00330.check() && A5_Cycle_am_00330.check() && A6_Cycle_am_00330.check()) + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0136-rc-function-RC_Thread01-Cycle_am_00340/Cycle_am_00340.java b/test/testsuite/ouroboros/memory_management/Function/RC0136-rc-function-RC_Thread01-Cycle_am_00340/Cycle_am_00340.java index c02f538753c916f5d506f613f3e4dd0402f6028b..241346d7d4d41b3fe85ffc85651d9e0e3c7d8728 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0136-rc-function-RC_Thread01-Cycle_am_00340/Cycle_am_00340.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0136-rc-function-RC_Thread01-Cycle_am_00340/Cycle_am_00340.java @@ -1,270 +1,270 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00340.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00340 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00340.java - *- @ExecuteClass: Cycle_am_00340 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00340 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00340_A1 a1_main = new Cycle_a_00340_A1("a1_main"); - Cycle_a_00340_A4 a4_main = new Cycle_a_00340_A4("a4_main"); - Cycle_a_00340_A6 a6_main = new Cycle_a_00340_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00340_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00340_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00340_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a2_0.a3_0.a8_0 = new Cycle_a_00340_A8("a8_0"); - a1_main.a2_0.a3_0.a8_0.a7_0 = new Cycle_a_00340_A7("a7_0"); - a1_main.a2_0.a3_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a8_0.add(); - a1_main.a2_0.a3_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a8_0.a7_0.sum + a6_main.a3_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2079) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00340_A1 { - Cycle_a_00340_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00340_A2 { - Cycle_a_00340_A3 a3_0; - Cycle_a_00340_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00340_A3 { - Cycle_a_00340_A1 a1_0; - Cycle_a_00340_A5 a5_0; - Cycle_a_00340_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a8_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a8_0.a; - } - } - - class Cycle_a_00340_A4 { - Cycle_a_00340_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00340_A5 { - Cycle_a_00340_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00340_A6 { - Cycle_a_00340_A1 a1_0; - Cycle_a_00340_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00340_A7 { - Cycle_a_00340_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00340_A8 { - Cycle_a_00340_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - - -public class Cycle_am_00340 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00340 A1_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); - ThreadRc_Cycle_am_00340 A2_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); - ThreadRc_Cycle_am_00340 A3_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); - ThreadRc_Cycle_am_00340 A4_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); - ThreadRc_Cycle_am_00340 A5_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); - ThreadRc_Cycle_am_00340 A6_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); - - A1_Cycle_am_00340.start(); - A2_Cycle_am_00340.start(); - A3_Cycle_am_00340.start(); - A4_Cycle_am_00340.start(); - A5_Cycle_am_00340.start(); - A6_Cycle_am_00340.start(); - - try { - A1_Cycle_am_00340.join(); - A2_Cycle_am_00340.join(); - A3_Cycle_am_00340.join(); - A4_Cycle_am_00340.join(); - A5_Cycle_am_00340.join(); - A6_Cycle_am_00340.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00340.check() && A2_Cycle_am_00340.check() && A3_Cycle_am_00340.check() && A4_Cycle_am_00340.check() && A5_Cycle_am_00340.check() && A6_Cycle_am_00340.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00340.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00340 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00340.java + *- @ExecuteClass: Cycle_am_00340 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00340 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00340_A1 a1_main = new Cycle_a_00340_A1("a1_main"); + Cycle_a_00340_A4 a4_main = new Cycle_a_00340_A4("a4_main"); + Cycle_a_00340_A6 a6_main = new Cycle_a_00340_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00340_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00340_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00340_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a2_0.a3_0.a8_0 = new Cycle_a_00340_A8("a8_0"); + a1_main.a2_0.a3_0.a8_0.a7_0 = new Cycle_a_00340_A7("a7_0"); + a1_main.a2_0.a3_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a8_0.add(); + a1_main.a2_0.a3_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a8_0.a7_0.sum + a6_main.a3_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2079) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00340_A1 { + Cycle_a_00340_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00340_A2 { + Cycle_a_00340_A3 a3_0; + Cycle_a_00340_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00340_A3 { + Cycle_a_00340_A1 a1_0; + Cycle_a_00340_A5 a5_0; + Cycle_a_00340_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a8_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a8_0.a; + } + } + + class Cycle_a_00340_A4 { + Cycle_a_00340_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00340_A5 { + Cycle_a_00340_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00340_A6 { + Cycle_a_00340_A1 a1_0; + Cycle_a_00340_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00340_A7 { + Cycle_a_00340_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00340_A8 { + Cycle_a_00340_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + + +public class Cycle_am_00340 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00340 A1_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); + ThreadRc_Cycle_am_00340 A2_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); + ThreadRc_Cycle_am_00340 A3_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); + ThreadRc_Cycle_am_00340 A4_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); + ThreadRc_Cycle_am_00340 A5_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); + ThreadRc_Cycle_am_00340 A6_Cycle_am_00340 = new ThreadRc_Cycle_am_00340(); + + A1_Cycle_am_00340.start(); + A2_Cycle_am_00340.start(); + A3_Cycle_am_00340.start(); + A4_Cycle_am_00340.start(); + A5_Cycle_am_00340.start(); + A6_Cycle_am_00340.start(); + + try { + A1_Cycle_am_00340.join(); + A2_Cycle_am_00340.join(); + A3_Cycle_am_00340.join(); + A4_Cycle_am_00340.join(); + A5_Cycle_am_00340.join(); + A6_Cycle_am_00340.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00340.check() && A2_Cycle_am_00340.check() && A3_Cycle_am_00340.check() && A4_Cycle_am_00340.check() && A5_Cycle_am_00340.check() && A6_Cycle_am_00340.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0137-rc-function-RC_Thread01-Cycle_am_00350/Cycle_am_00350.java b/test/testsuite/ouroboros/memory_management/Function/RC0137-rc-function-RC_Thread01-Cycle_am_00350/Cycle_am_00350.java index 60ccb7786a569ae24ee88c35d777085094ded2d8..9564b740e7e6ee1ad6a88492868482a7589ee672 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0137-rc-function-RC_Thread01-Cycle_am_00350/Cycle_am_00350.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0137-rc-function-RC_Thread01-Cycle_am_00350/Cycle_am_00350.java @@ -1,270 +1,270 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00350.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00350 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00350.java - *- @ExecuteClass: Cycle_am_00350 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00350 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00350_A1 a1_main = new Cycle_a_00350_A1("a1_main"); - Cycle_a_00350_A4 a4_main = new Cycle_a_00350_A4("a4_main"); - Cycle_a_00350_A6 a6_main = new Cycle_a_00350_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00350_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00350_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00350_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00350_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00350_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2079) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00350_A1 { - Cycle_a_00350_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00350_A2 { - Cycle_a_00350_A3 a3_0; - Cycle_a_00350_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00350_A3 { - Cycle_a_00350_A1 a1_0; - Cycle_a_00350_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00350_A4 { - Cycle_a_00350_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00350_A5 { - Cycle_a_00350_A6 a6_0; - Cycle_a_00350_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00350_A6 { - Cycle_a_00350_A1 a1_0; - Cycle_a_00350_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00350_A7 { - Cycle_a_00350_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00350_A8 { - Cycle_a_00350_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - - -public class Cycle_am_00350 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00350 A1_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); - ThreadRc_Cycle_am_00350 A2_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); - ThreadRc_Cycle_am_00350 A3_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); - ThreadRc_Cycle_am_00350 A4_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); - ThreadRc_Cycle_am_00350 A5_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); - ThreadRc_Cycle_am_00350 A6_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); - - A1_Cycle_am_00350.start(); - A2_Cycle_am_00350.start(); - A3_Cycle_am_00350.start(); - A4_Cycle_am_00350.start(); - A5_Cycle_am_00350.start(); - A6_Cycle_am_00350.start(); - - try { - A1_Cycle_am_00350.join(); - A2_Cycle_am_00350.join(); - A3_Cycle_am_00350.join(); - A4_Cycle_am_00350.join(); - A5_Cycle_am_00350.join(); - A6_Cycle_am_00350.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00350.check() && A2_Cycle_am_00350.check() && A3_Cycle_am_00350.check() && A4_Cycle_am_00350.check() && A5_Cycle_am_00350.check() && A6_Cycle_am_00350.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00350.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00350 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00350.java + *- @ExecuteClass: Cycle_am_00350 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00350 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00350_A1 a1_main = new Cycle_a_00350_A1("a1_main"); + Cycle_a_00350_A4 a4_main = new Cycle_a_00350_A4("a4_main"); + Cycle_a_00350_A6 a6_main = new Cycle_a_00350_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00350_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00350_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00350_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00350_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00350_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2079) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00350_A1 { + Cycle_a_00350_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00350_A2 { + Cycle_a_00350_A3 a3_0; + Cycle_a_00350_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00350_A3 { + Cycle_a_00350_A1 a1_0; + Cycle_a_00350_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00350_A4 { + Cycle_a_00350_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00350_A5 { + Cycle_a_00350_A6 a6_0; + Cycle_a_00350_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00350_A6 { + Cycle_a_00350_A1 a1_0; + Cycle_a_00350_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00350_A7 { + Cycle_a_00350_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00350_A8 { + Cycle_a_00350_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + + +public class Cycle_am_00350 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00350 A1_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); + ThreadRc_Cycle_am_00350 A2_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); + ThreadRc_Cycle_am_00350 A3_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); + ThreadRc_Cycle_am_00350 A4_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); + ThreadRc_Cycle_am_00350 A5_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); + ThreadRc_Cycle_am_00350 A6_Cycle_am_00350 = new ThreadRc_Cycle_am_00350(); + + A1_Cycle_am_00350.start(); + A2_Cycle_am_00350.start(); + A3_Cycle_am_00350.start(); + A4_Cycle_am_00350.start(); + A5_Cycle_am_00350.start(); + A6_Cycle_am_00350.start(); + + try { + A1_Cycle_am_00350.join(); + A2_Cycle_am_00350.join(); + A3_Cycle_am_00350.join(); + A4_Cycle_am_00350.join(); + A5_Cycle_am_00350.join(); + A6_Cycle_am_00350.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00350.check() && A2_Cycle_am_00350.check() && A3_Cycle_am_00350.check() && A4_Cycle_am_00350.check() && A5_Cycle_am_00350.check() && A6_Cycle_am_00350.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0138-rc-function-RC_Thread01-Cycle_am_00360/Cycle_am_00360.java b/test/testsuite/ouroboros/memory_management/Function/RC0138-rc-function-RC_Thread01-Cycle_am_00360/Cycle_am_00360.java index ccc00743d73165c21082490b8ddc0a2b2defc9f6..2ee82c303cd9bd3bdf40a1b263b22afa91d35e97 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0138-rc-function-RC_Thread01-Cycle_am_00360/Cycle_am_00360.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0138-rc-function-RC_Thread01-Cycle_am_00360/Cycle_am_00360.java @@ -1,295 +1,295 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00360.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00360 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00360.java - *- @ExecuteClass: Cycle_am_00360 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00360 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00360_A1 a1_main = new Cycle_a_00360_A1("a1_main"); - Cycle_a_00360_A4 a4_main = new Cycle_a_00360_A4("a4_main"); - Cycle_a_00360_A6 a6_main = new Cycle_a_00360_A6("a6_main"); - Cycle_a_00360_A9 a9_main = new Cycle_a_00360_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_00360_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00360_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00360_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00360_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00360_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a5_0.a9_0 = a9_main; - a9_main.a2_0 = a1_main.a2_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2399) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00360_A1 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00360_A2 { - Cycle_a_00360_A3 a3_0; - Cycle_a_00360_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00360_A3 { - Cycle_a_00360_A1 a1_0; - Cycle_a_00360_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00360_A4 { - Cycle_a_00360_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00360_A5 { - Cycle_a_00360_A6 a6_0; - Cycle_a_00360_A8 a8_0; - Cycle_a_00360_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a9_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a + a9_0.a; - } - } - - class Cycle_a_00360_A6 { - Cycle_a_00360_A1 a1_0; - Cycle_a_00360_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00360_A7 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00360_A8 { - Cycle_a_00360_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00360_A9 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A9(String strObjectName) { - a2_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_am_00360 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00360 A1_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); - ThreadRc_Cycle_am_00360 A2_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); - ThreadRc_Cycle_am_00360 A3_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); - ThreadRc_Cycle_am_00360 A4_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); - ThreadRc_Cycle_am_00360 A5_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); - ThreadRc_Cycle_am_00360 A6_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); - - A1_Cycle_am_00360.start(); - A2_Cycle_am_00360.start(); - A3_Cycle_am_00360.start(); - A4_Cycle_am_00360.start(); - A5_Cycle_am_00360.start(); - A6_Cycle_am_00360.start(); - - try { - A1_Cycle_am_00360.join(); - A2_Cycle_am_00360.join(); - A3_Cycle_am_00360.join(); - A4_Cycle_am_00360.join(); - A5_Cycle_am_00360.join(); - A6_Cycle_am_00360.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00360.check() && A2_Cycle_am_00360.check() && A3_Cycle_am_00360.check() && A4_Cycle_am_00360.check() && A5_Cycle_am_00360.check() && A6_Cycle_am_00360.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00360.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00360 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00360.java + *- @ExecuteClass: Cycle_am_00360 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00360 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00360_A1 a1_main = new Cycle_a_00360_A1("a1_main"); + Cycle_a_00360_A4 a4_main = new Cycle_a_00360_A4("a4_main"); + Cycle_a_00360_A6 a6_main = new Cycle_a_00360_A6("a6_main"); + Cycle_a_00360_A9 a9_main = new Cycle_a_00360_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_00360_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00360_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00360_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00360_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00360_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a5_0.a9_0 = a9_main; + a9_main.a2_0 = a1_main.a2_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2399) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00360_A1 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00360_A2 { + Cycle_a_00360_A3 a3_0; + Cycle_a_00360_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00360_A3 { + Cycle_a_00360_A1 a1_0; + Cycle_a_00360_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00360_A4 { + Cycle_a_00360_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00360_A5 { + Cycle_a_00360_A6 a6_0; + Cycle_a_00360_A8 a8_0; + Cycle_a_00360_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a9_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a + a9_0.a; + } + } + + class Cycle_a_00360_A6 { + Cycle_a_00360_A1 a1_0; + Cycle_a_00360_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00360_A7 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00360_A8 { + Cycle_a_00360_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00360_A9 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A9(String strObjectName) { + a2_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_am_00360 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00360 A1_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); + ThreadRc_Cycle_am_00360 A2_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); + ThreadRc_Cycle_am_00360 A3_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); + ThreadRc_Cycle_am_00360 A4_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); + ThreadRc_Cycle_am_00360 A5_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); + ThreadRc_Cycle_am_00360 A6_Cycle_am_00360 = new ThreadRc_Cycle_am_00360(); + + A1_Cycle_am_00360.start(); + A2_Cycle_am_00360.start(); + A3_Cycle_am_00360.start(); + A4_Cycle_am_00360.start(); + A5_Cycle_am_00360.start(); + A6_Cycle_am_00360.start(); + + try { + A1_Cycle_am_00360.join(); + A2_Cycle_am_00360.join(); + A3_Cycle_am_00360.join(); + A4_Cycle_am_00360.join(); + A5_Cycle_am_00360.join(); + A6_Cycle_am_00360.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00360.check() && A2_Cycle_am_00360.check() && A3_Cycle_am_00360.check() && A4_Cycle_am_00360.check() && A5_Cycle_am_00360.check() && A6_Cycle_am_00360.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0139-rc-function-RC_Thread01-Cycle_am_00370/Cycle_am_00370.java b/test/testsuite/ouroboros/memory_management/Function/RC0139-rc-function-RC_Thread01-Cycle_am_00370/Cycle_am_00370.java index e77421bc5db1751e9d3dd352929a5caa76a93ca2..938f06cd99fface8d448c1cde9607b3fe74aefba 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0139-rc-function-RC_Thread01-Cycle_am_00370/Cycle_am_00370.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0139-rc-function-RC_Thread01-Cycle_am_00370/Cycle_am_00370.java @@ -1,316 +1,316 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00370.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00370 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00370.java - *- @ExecuteClass: Cycle_am_00370 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00370 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); - Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); - Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); - Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); - a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; - a9_main.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a10_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2623) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00370_A1 { - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00370_A2 { - Cycle_a_00370_A3 a3_0; - Cycle_a_00370_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00370_A3 { - Cycle_a_00370_A1 a1_0; - Cycle_a_00370_A5 a5_0; - Cycle_a_00370_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a10_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a10_0.a; - } - } - - class Cycle_a_00370_A4 { - Cycle_a_00370_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00370_A5 { - Cycle_a_00370_A6 a6_0; - Cycle_a_00370_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00370_A6 { - Cycle_a_00370_A1 a1_0; - Cycle_a_00370_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00370_A7 { - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00370_A8 { - Cycle_a_00370_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00370_A9 { - Cycle_a_00370_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A9(String strObjectName) { - a6_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00370_A10 { - Cycle_a_00370_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A10(String strObjectName) { - a9_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } -} - - -public class Cycle_am_00370 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00370 A1_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A2_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A3_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A4_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A5_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - ThreadRc_Cycle_am_00370 A6_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); - - A1_Cycle_am_00370.start(); - A2_Cycle_am_00370.start(); - A3_Cycle_am_00370.start(); - A4_Cycle_am_00370.start(); - A5_Cycle_am_00370.start(); - A6_Cycle_am_00370.start(); - - try { - A1_Cycle_am_00370.join(); - A2_Cycle_am_00370.join(); - A3_Cycle_am_00370.join(); - A4_Cycle_am_00370.join(); - A5_Cycle_am_00370.join(); - A6_Cycle_am_00370.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00370.check() && A2_Cycle_am_00370.check() && A3_Cycle_am_00370.check() && A4_Cycle_am_00370.check() && A5_Cycle_am_00370.check() && A6_Cycle_am_00370.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00370.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00370 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00370.java + *- @ExecuteClass: Cycle_am_00370 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00370 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); + Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); + Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); + Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); + a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; + a9_main.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a10_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2623) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00370_A1 { + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00370_A2 { + Cycle_a_00370_A3 a3_0; + Cycle_a_00370_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00370_A3 { + Cycle_a_00370_A1 a1_0; + Cycle_a_00370_A5 a5_0; + Cycle_a_00370_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a10_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a10_0.a; + } + } + + class Cycle_a_00370_A4 { + Cycle_a_00370_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00370_A5 { + Cycle_a_00370_A6 a6_0; + Cycle_a_00370_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00370_A6 { + Cycle_a_00370_A1 a1_0; + Cycle_a_00370_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00370_A7 { + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00370_A8 { + Cycle_a_00370_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00370_A9 { + Cycle_a_00370_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A9(String strObjectName) { + a6_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00370_A10 { + Cycle_a_00370_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A10(String strObjectName) { + a9_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } +} + + +public class Cycle_am_00370 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00370 A1_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A2_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A3_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A4_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A5_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + ThreadRc_Cycle_am_00370 A6_Cycle_am_00370 = new ThreadRc_Cycle_am_00370(); + + A1_Cycle_am_00370.start(); + A2_Cycle_am_00370.start(); + A3_Cycle_am_00370.start(); + A4_Cycle_am_00370.start(); + A5_Cycle_am_00370.start(); + A6_Cycle_am_00370.start(); + + try { + A1_Cycle_am_00370.join(); + A2_Cycle_am_00370.join(); + A3_Cycle_am_00370.join(); + A4_Cycle_am_00370.join(); + A5_Cycle_am_00370.join(); + A6_Cycle_am_00370.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00370.check() && A2_Cycle_am_00370.check() && A3_Cycle_am_00370.check() && A4_Cycle_am_00370.check() && A5_Cycle_am_00370.check() && A6_Cycle_am_00370.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0140-rc-function-RC_Thread01-Cycle_am_00380/Cycle_am_00380.java b/test/testsuite/ouroboros/memory_management/Function/RC0140-rc-function-RC_Thread01-Cycle_am_00380/Cycle_am_00380.java index a51bd9b9fddef5f0d24fe67fdb96cfc5018c45cc..5608964aa1ee2a890391d469a6f1df360a67d5f1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0140-rc-function-RC_Thread01-Cycle_am_00380/Cycle_am_00380.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0140-rc-function-RC_Thread01-Cycle_am_00380/Cycle_am_00380.java @@ -1,158 +1,158 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00380.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00380 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00380.java - *- @ExecuteClass: Cycle_am_00380 - *- @ExecuteArgs: - */ - - -class ThreadRc_Cycle_am_00380 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00380_A1 a1_main = new Cycle_a_00380_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00380_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00380_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 815) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00380_A1 { - Cycle_a_00380_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00380_A2 { - Cycle_a_00380_A1 a1_0; - Cycle_a_00380_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00380_A3 { - Cycle_a_00380_A1 a1_0; - Cycle_a_00380_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - - -public class Cycle_am_00380 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00380 A1_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); - ThreadRc_Cycle_am_00380 A2_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); - ThreadRc_Cycle_am_00380 A3_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); - ThreadRc_Cycle_am_00380 A4_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); - ThreadRc_Cycle_am_00380 A5_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); - ThreadRc_Cycle_am_00380 A6_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); - - A1_Cycle_am_00380.start(); - A2_Cycle_am_00380.start(); - A3_Cycle_am_00380.start(); - A4_Cycle_am_00380.start(); - A5_Cycle_am_00380.start(); - A6_Cycle_am_00380.start(); - - try { - A1_Cycle_am_00380.join(); - A2_Cycle_am_00380.join(); - A3_Cycle_am_00380.join(); - A4_Cycle_am_00380.join(); - A5_Cycle_am_00380.join(); - A6_Cycle_am_00380.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00380.check() && A2_Cycle_am_00380.check() && A3_Cycle_am_00380.check() && A4_Cycle_am_00380.check() && A5_Cycle_am_00380.check() && A6_Cycle_am_00380.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00380.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00380 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00380.java + *- @ExecuteClass: Cycle_am_00380 + *- @ExecuteArgs: + */ + + +class ThreadRc_Cycle_am_00380 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00380_A1 a1_main = new Cycle_a_00380_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00380_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00380_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 815) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00380_A1 { + Cycle_a_00380_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00380_A2 { + Cycle_a_00380_A1 a1_0; + Cycle_a_00380_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00380_A3 { + Cycle_a_00380_A1 a1_0; + Cycle_a_00380_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + + +public class Cycle_am_00380 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00380 A1_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); + ThreadRc_Cycle_am_00380 A2_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); + ThreadRc_Cycle_am_00380 A3_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); + ThreadRc_Cycle_am_00380 A4_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); + ThreadRc_Cycle_am_00380 A5_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); + ThreadRc_Cycle_am_00380 A6_Cycle_am_00380 = new ThreadRc_Cycle_am_00380(); + + A1_Cycle_am_00380.start(); + A2_Cycle_am_00380.start(); + A3_Cycle_am_00380.start(); + A4_Cycle_am_00380.start(); + A5_Cycle_am_00380.start(); + A6_Cycle_am_00380.start(); + + try { + A1_Cycle_am_00380.join(); + A2_Cycle_am_00380.join(); + A3_Cycle_am_00380.join(); + A4_Cycle_am_00380.join(); + A5_Cycle_am_00380.join(); + A6_Cycle_am_00380.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00380.check() && A2_Cycle_am_00380.check() && A3_Cycle_am_00380.check() && A4_Cycle_am_00380.check() && A5_Cycle_am_00380.check() && A6_Cycle_am_00380.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0141-rc-function-RC_Thread01-Cycle_am_00390/Cycle_am_00390.java b/test/testsuite/ouroboros/memory_management/Function/RC0141-rc-function-RC_Thread01-Cycle_am_00390/Cycle_am_00390.java index d9d0f59615ae8bcfb3cc4643eb7401b33ee11869..01b1e5c41bc4de0a37e0e889d4a2a1cc0fc9d0ea 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0141-rc-function-RC_Thread01-Cycle_am_00390/Cycle_am_00390.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0141-rc-function-RC_Thread01-Cycle_am_00390/Cycle_am_00390.java @@ -1,160 +1,160 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00390.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00390 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00390.java - *- @ExecuteClass: Cycle_am_00390 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00390 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00390_A1 a1_main = new Cycle_a_00390_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00390_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00390_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 918) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00390_A1 { - Cycle_a_00390_A2 a2_0; - Cycle_a_00390_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00390_A2 { - Cycle_a_00390_A1 a1_0; - Cycle_a_00390_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00390_A3 { - Cycle_a_00390_A1 a1_0; - Cycle_a_00390_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - - -public class Cycle_am_00390 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00390 A1_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); - ThreadRc_Cycle_am_00390 A2_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); - ThreadRc_Cycle_am_00390 A3_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); - ThreadRc_Cycle_am_00390 A4_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); - ThreadRc_Cycle_am_00390 A5_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); - ThreadRc_Cycle_am_00390 A6_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); - - A1_Cycle_am_00390.start(); - A2_Cycle_am_00390.start(); - A3_Cycle_am_00390.start(); - A4_Cycle_am_00390.start(); - A5_Cycle_am_00390.start(); - A6_Cycle_am_00390.start(); - - try { - A1_Cycle_am_00390.join(); - A2_Cycle_am_00390.join(); - A3_Cycle_am_00390.join(); - A4_Cycle_am_00390.join(); - A5_Cycle_am_00390.join(); - A6_Cycle_am_00390.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00390.check() && A2_Cycle_am_00390.check() && A3_Cycle_am_00390.check() && A4_Cycle_am_00390.check() && A5_Cycle_am_00390.check() && A6_Cycle_am_00390.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00390.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00390 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00390.java + *- @ExecuteClass: Cycle_am_00390 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00390 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00390_A1 a1_main = new Cycle_a_00390_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00390_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00390_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 918) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00390_A1 { + Cycle_a_00390_A2 a2_0; + Cycle_a_00390_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00390_A2 { + Cycle_a_00390_A1 a1_0; + Cycle_a_00390_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00390_A3 { + Cycle_a_00390_A1 a1_0; + Cycle_a_00390_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + + +public class Cycle_am_00390 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00390 A1_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); + ThreadRc_Cycle_am_00390 A2_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); + ThreadRc_Cycle_am_00390 A3_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); + ThreadRc_Cycle_am_00390 A4_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); + ThreadRc_Cycle_am_00390 A5_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); + ThreadRc_Cycle_am_00390 A6_Cycle_am_00390 = new ThreadRc_Cycle_am_00390(); + + A1_Cycle_am_00390.start(); + A2_Cycle_am_00390.start(); + A3_Cycle_am_00390.start(); + A4_Cycle_am_00390.start(); + A5_Cycle_am_00390.start(); + A6_Cycle_am_00390.start(); + + try { + A1_Cycle_am_00390.join(); + A2_Cycle_am_00390.join(); + A3_Cycle_am_00390.join(); + A4_Cycle_am_00390.join(); + A5_Cycle_am_00390.join(); + A6_Cycle_am_00390.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00390.check() && A2_Cycle_am_00390.check() && A3_Cycle_am_00390.check() && A4_Cycle_am_00390.check() && A5_Cycle_am_00390.check() && A6_Cycle_am_00390.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0142-rc-function-RC_Thread01-Cycle_am_00400/Cycle_am_00400.java b/test/testsuite/ouroboros/memory_management/Function/RC0142-rc-function-RC_Thread01-Cycle_am_00400/Cycle_am_00400.java index bd904397774de740d3b7843ddce2cb9ffd46a5c2..502ceac5a1204a76624a00904c89b68e49b80a50 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0142-rc-function-RC_Thread01-Cycle_am_00400/Cycle_am_00400.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0142-rc-function-RC_Thread01-Cycle_am_00400/Cycle_am_00400.java @@ -1,174 +1,174 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00400.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00400 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00400.java - *- @ExecuteClass: Cycle_am_00400 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00400 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00400_A1 a1_main = new Cycle_a_00400_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00400_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00400_A3("a3_0"); - a1_main.a4_0 = new Cycle_a_00400_A4("a4_0"); - a1_main.a4_0.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 923) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00400_A1 { - Cycle_a_00400_A2 a2_0; - Cycle_a_00400_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } - } - - class Cycle_a_00400_A2 { - Cycle_a_00400_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00400_A3 { - Cycle_a_00400_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00400_A4 { - Cycle_a_00400_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_am_00400 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00400 A1_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); - ThreadRc_Cycle_am_00400 A2_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); - ThreadRc_Cycle_am_00400 A3_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); - ThreadRc_Cycle_am_00400 A4_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); - ThreadRc_Cycle_am_00400 A5_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); - ThreadRc_Cycle_am_00400 A6_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); - - A1_Cycle_am_00400.start(); - A2_Cycle_am_00400.start(); - A3_Cycle_am_00400.start(); - A4_Cycle_am_00400.start(); - A5_Cycle_am_00400.start(); - A6_Cycle_am_00400.start(); - - try { - A1_Cycle_am_00400.join(); - A2_Cycle_am_00400.join(); - A3_Cycle_am_00400.join(); - A4_Cycle_am_00400.join(); - A5_Cycle_am_00400.join(); - A6_Cycle_am_00400.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00400.check() && A2_Cycle_am_00400.check() && A3_Cycle_am_00400.check() && A4_Cycle_am_00400.check() && A5_Cycle_am_00400.check() && A6_Cycle_am_00400.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00400.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00400 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00400.java + *- @ExecuteClass: Cycle_am_00400 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00400 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00400_A1 a1_main = new Cycle_a_00400_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00400_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00400_A3("a3_0"); + a1_main.a4_0 = new Cycle_a_00400_A4("a4_0"); + a1_main.a4_0.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 923) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00400_A1 { + Cycle_a_00400_A2 a2_0; + Cycle_a_00400_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } + } + + class Cycle_a_00400_A2 { + Cycle_a_00400_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00400_A3 { + Cycle_a_00400_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00400_A4 { + Cycle_a_00400_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_am_00400 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00400 A1_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); + ThreadRc_Cycle_am_00400 A2_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); + ThreadRc_Cycle_am_00400 A3_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); + ThreadRc_Cycle_am_00400 A4_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); + ThreadRc_Cycle_am_00400 A5_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); + ThreadRc_Cycle_am_00400 A6_Cycle_am_00400 = new ThreadRc_Cycle_am_00400(); + + A1_Cycle_am_00400.start(); + A2_Cycle_am_00400.start(); + A3_Cycle_am_00400.start(); + A4_Cycle_am_00400.start(); + A5_Cycle_am_00400.start(); + A6_Cycle_am_00400.start(); + + try { + A1_Cycle_am_00400.join(); + A2_Cycle_am_00400.join(); + A3_Cycle_am_00400.join(); + A4_Cycle_am_00400.join(); + A5_Cycle_am_00400.join(); + A6_Cycle_am_00400.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00400.check() && A2_Cycle_am_00400.check() && A3_Cycle_am_00400.check() && A4_Cycle_am_00400.check() && A5_Cycle_am_00400.check() && A6_Cycle_am_00400.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0143-rc-function-RC_Thread01-Cycle_am_00410/Cycle_am_00410.java b/test/testsuite/ouroboros/memory_management/Function/RC0143-rc-function-RC_Thread01-Cycle_am_00410/Cycle_am_00410.java index ccc6b8ad991d542e15931eb434357a8f53ef8a1f..25c803dedc9acb5c9cb1705f97fa23bc444352a8 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0143-rc-function-RC_Thread01-Cycle_am_00410/Cycle_am_00410.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0143-rc-function-RC_Thread01-Cycle_am_00410/Cycle_am_00410.java @@ -1,174 +1,174 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00410.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00410 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00410.java - *- @ExecuteClass: Cycle_am_00410 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00410 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00410_A1 a1_main = new Cycle_a_00410_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00410_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00410_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00410_A4("a4_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 921) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00410_A1 { - Cycle_a_00410_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00410_A2 { - Cycle_a_00410_A3 a3_0; - Cycle_a_00410_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00410_A3 { - Cycle_a_00410_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00410_A4 { - Cycle_a_00410_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_am_00410 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00410 A1_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); - ThreadRc_Cycle_am_00410 A2_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); - ThreadRc_Cycle_am_00410 A3_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); - ThreadRc_Cycle_am_00410 A4_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); - ThreadRc_Cycle_am_00410 A5_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); - ThreadRc_Cycle_am_00410 A6_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); - - A1_Cycle_am_00410.start(); - A2_Cycle_am_00410.start(); - A3_Cycle_am_00410.start(); - A4_Cycle_am_00410.start(); - A5_Cycle_am_00410.start(); - A6_Cycle_am_00410.start(); - - try { - A1_Cycle_am_00410.join(); - A2_Cycle_am_00410.join(); - A3_Cycle_am_00410.join(); - A4_Cycle_am_00410.join(); - A5_Cycle_am_00410.join(); - A6_Cycle_am_00410.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00410.check() && A2_Cycle_am_00410.check() && A3_Cycle_am_00410.check() && A4_Cycle_am_00410.check() && A5_Cycle_am_00410.check() && A6_Cycle_am_00410.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00410.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00410 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00410.java + *- @ExecuteClass: Cycle_am_00410 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00410 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00410_A1 a1_main = new Cycle_a_00410_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00410_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00410_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00410_A4("a4_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 921) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00410_A1 { + Cycle_a_00410_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00410_A2 { + Cycle_a_00410_A3 a3_0; + Cycle_a_00410_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00410_A3 { + Cycle_a_00410_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00410_A4 { + Cycle_a_00410_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_am_00410 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00410 A1_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); + ThreadRc_Cycle_am_00410 A2_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); + ThreadRc_Cycle_am_00410 A3_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); + ThreadRc_Cycle_am_00410 A4_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); + ThreadRc_Cycle_am_00410 A5_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); + ThreadRc_Cycle_am_00410 A6_Cycle_am_00410 = new ThreadRc_Cycle_am_00410(); + + A1_Cycle_am_00410.start(); + A2_Cycle_am_00410.start(); + A3_Cycle_am_00410.start(); + A4_Cycle_am_00410.start(); + A5_Cycle_am_00410.start(); + A6_Cycle_am_00410.start(); + + try { + A1_Cycle_am_00410.join(); + A2_Cycle_am_00410.join(); + A3_Cycle_am_00410.join(); + A4_Cycle_am_00410.join(); + A5_Cycle_am_00410.join(); + A6_Cycle_am_00410.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00410.check() && A2_Cycle_am_00410.check() && A3_Cycle_am_00410.check() && A4_Cycle_am_00410.check() && A5_Cycle_am_00410.check() && A6_Cycle_am_00410.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0144-rc-function-RC_Thread01-Cycle_am_00420/Cycle_am_00420.java b/test/testsuite/ouroboros/memory_management/Function/RC0144-rc-function-RC_Thread01-Cycle_am_00420/Cycle_am_00420.java index ad657968a733fc2812b1f9b64c02e5222409eda1..69891e4471457a67eb563c9abd04a8d0ba4e1cdf 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0144-rc-function-RC_Thread01-Cycle_am_00420/Cycle_am_00420.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0144-rc-function-RC_Thread01-Cycle_am_00420/Cycle_am_00420.java @@ -1,175 +1,175 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00420.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00420 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00420.java - *- @ExecuteClass: Cycle_am_00420 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00420 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00420_A1 a1_main = new Cycle_a_00420_A1("a1_main"); -// Cycle_a_00420_A4 a4_main = new Cycle_a_00420_A4("a4_main"); - a1_main.a2_0 = new Cycle_a_00420_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00420_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00420_A4("a4_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 923) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00420_A1 { - Cycle_a_00420_A2 a2_0; - Cycle_a_00420_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00420_A2 { - Cycle_a_00420_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00420_A3 { - Cycle_a_00420_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00420_A4 { - Cycle_a_00420_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_am_00420 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00420 A1_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); - ThreadRc_Cycle_am_00420 A2_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); - ThreadRc_Cycle_am_00420 A3_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); - ThreadRc_Cycle_am_00420 A4_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); - ThreadRc_Cycle_am_00420 A5_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); - ThreadRc_Cycle_am_00420 A6_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); - - A1_Cycle_am_00420.start(); - A2_Cycle_am_00420.start(); - A3_Cycle_am_00420.start(); - A4_Cycle_am_00420.start(); - A5_Cycle_am_00420.start(); - A6_Cycle_am_00420.start(); - - try { - A1_Cycle_am_00420.join(); - A2_Cycle_am_00420.join(); - A3_Cycle_am_00420.join(); - A4_Cycle_am_00420.join(); - A5_Cycle_am_00420.join(); - A6_Cycle_am_00420.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00420.check() && A2_Cycle_am_00420.check() && A3_Cycle_am_00420.check() && A4_Cycle_am_00420.check() && A5_Cycle_am_00420.check() && A6_Cycle_am_00420.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00420.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00420 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00420.java + *- @ExecuteClass: Cycle_am_00420 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00420 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00420_A1 a1_main = new Cycle_a_00420_A1("a1_main"); +// Cycle_a_00420_A4 a4_main = new Cycle_a_00420_A4("a4_main"); + a1_main.a2_0 = new Cycle_a_00420_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00420_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00420_A4("a4_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 923) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00420_A1 { + Cycle_a_00420_A2 a2_0; + Cycle_a_00420_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00420_A2 { + Cycle_a_00420_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00420_A3 { + Cycle_a_00420_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00420_A4 { + Cycle_a_00420_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_am_00420 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00420 A1_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); + ThreadRc_Cycle_am_00420 A2_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); + ThreadRc_Cycle_am_00420 A3_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); + ThreadRc_Cycle_am_00420 A4_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); + ThreadRc_Cycle_am_00420 A5_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); + ThreadRc_Cycle_am_00420 A6_Cycle_am_00420 = new ThreadRc_Cycle_am_00420(); + + A1_Cycle_am_00420.start(); + A2_Cycle_am_00420.start(); + A3_Cycle_am_00420.start(); + A4_Cycle_am_00420.start(); + A5_Cycle_am_00420.start(); + A6_Cycle_am_00420.start(); + + try { + A1_Cycle_am_00420.join(); + A2_Cycle_am_00420.join(); + A3_Cycle_am_00420.join(); + A4_Cycle_am_00420.join(); + A5_Cycle_am_00420.join(); + A6_Cycle_am_00420.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00420.check() && A2_Cycle_am_00420.check() && A3_Cycle_am_00420.check() && A4_Cycle_am_00420.check() && A5_Cycle_am_00420.check() && A6_Cycle_am_00420.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0145-rc-function-RC_Thread01-Cycle_am_00430/Cycle_am_00430.java b/test/testsuite/ouroboros/memory_management/Function/RC0145-rc-function-RC_Thread01-Cycle_am_00430/Cycle_am_00430.java index e0acababa971290f71b3e86fe69c31ec44d98f44..94493b0bd32065ed4fd01815806206d3a0857541 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0145-rc-function-RC_Thread01-Cycle_am_00430/Cycle_am_00430.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0145-rc-function-RC_Thread01-Cycle_am_00430/Cycle_am_00430.java @@ -1,181 +1,181 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00430.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00430 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00430.java - *- @ExecuteClass: Cycle_am_00430 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00430 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00430_A1 a1_main = new Cycle_a_00430_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00430_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00430_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00430_A4("a4_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a4_0.a1_0 = a1_main; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1124) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00430_A1 { - Cycle_a_00430_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00430_A2 { - Cycle_a_00430_A1 a1_0; - Cycle_a_00430_A3 a3_0; - Cycle_a_00430_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00430_A3 { - Cycle_a_00430_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00430_A4 { - Cycle_a_00430_A1 a1_0; - Cycle_a_00430_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A4(String strObjectName) { - a2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - - -public class Cycle_am_00430 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00430 A1_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); - ThreadRc_Cycle_am_00430 A2_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); - ThreadRc_Cycle_am_00430 A3_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); - ThreadRc_Cycle_am_00430 A4_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); - ThreadRc_Cycle_am_00430 A5_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); - ThreadRc_Cycle_am_00430 A6_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); - - A1_Cycle_am_00430.start(); - A2_Cycle_am_00430.start(); - A3_Cycle_am_00430.start(); - A4_Cycle_am_00430.start(); - A5_Cycle_am_00430.start(); - A6_Cycle_am_00430.start(); - - try { - A1_Cycle_am_00430.join(); - A2_Cycle_am_00430.join(); - A3_Cycle_am_00430.join(); - A4_Cycle_am_00430.join(); - A5_Cycle_am_00430.join(); - A6_Cycle_am_00430.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00430.check() && A2_Cycle_am_00430.check() && A3_Cycle_am_00430.check() && A4_Cycle_am_00430.check() && A5_Cycle_am_00430.check() && A6_Cycle_am_00430.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00430.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00430 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00430.java + *- @ExecuteClass: Cycle_am_00430 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00430 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00430_A1 a1_main = new Cycle_a_00430_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00430_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00430_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00430_A4("a4_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a4_0.a1_0 = a1_main; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1124) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00430_A1 { + Cycle_a_00430_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00430_A2 { + Cycle_a_00430_A1 a1_0; + Cycle_a_00430_A3 a3_0; + Cycle_a_00430_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00430_A3 { + Cycle_a_00430_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00430_A4 { + Cycle_a_00430_A1 a1_0; + Cycle_a_00430_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A4(String strObjectName) { + a2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + + +public class Cycle_am_00430 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00430 A1_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); + ThreadRc_Cycle_am_00430 A2_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); + ThreadRc_Cycle_am_00430 A3_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); + ThreadRc_Cycle_am_00430 A4_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); + ThreadRc_Cycle_am_00430 A5_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); + ThreadRc_Cycle_am_00430 A6_Cycle_am_00430 = new ThreadRc_Cycle_am_00430(); + + A1_Cycle_am_00430.start(); + A2_Cycle_am_00430.start(); + A3_Cycle_am_00430.start(); + A4_Cycle_am_00430.start(); + A5_Cycle_am_00430.start(); + A6_Cycle_am_00430.start(); + + try { + A1_Cycle_am_00430.join(); + A2_Cycle_am_00430.join(); + A3_Cycle_am_00430.join(); + A4_Cycle_am_00430.join(); + A5_Cycle_am_00430.join(); + A6_Cycle_am_00430.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00430.check() && A2_Cycle_am_00430.check() && A3_Cycle_am_00430.check() && A4_Cycle_am_00430.check() && A5_Cycle_am_00430.check() && A6_Cycle_am_00430.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0146-rc-function-RC_Thread01-Cycle_am_00440/Cycle_am_00440.java b/test/testsuite/ouroboros/memory_management/Function/RC0146-rc-function-RC_Thread01-Cycle_am_00440/Cycle_am_00440.java index a4d4c88c25ab7af54467ec5a0815a1176971fe12..5db80cbd50dfa47108a4929b7ea8e98b60447c15 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0146-rc-function-RC_Thread01-Cycle_am_00440/Cycle_am_00440.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0146-rc-function-RC_Thread01-Cycle_am_00440/Cycle_am_00440.java @@ -1,179 +1,179 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00440.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00440 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00440.java - *- @ExecuteClass: Cycle_am_00440 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00440 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00440_A1 a1_main = new Cycle_a_00440_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00440_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00440_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00440_A4("a4_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1023) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00440_A1 { - Cycle_a_00440_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00440_A2 { - Cycle_a_00440_A1 a1_0; - Cycle_a_00440_A3 a3_0; - Cycle_a_00440_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00440_A3 { - Cycle_a_00440_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00440_A4 { - Cycle_a_00440_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A4(String strObjectName) { - a2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_am_00440 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00440 A1_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); - ThreadRc_Cycle_am_00440 A2_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); - ThreadRc_Cycle_am_00440 A3_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); - ThreadRc_Cycle_am_00440 A4_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); - ThreadRc_Cycle_am_00440 A5_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); - ThreadRc_Cycle_am_00440 A6_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); - - A1_Cycle_am_00440.start(); - A2_Cycle_am_00440.start(); - A3_Cycle_am_00440.start(); - A4_Cycle_am_00440.start(); - A5_Cycle_am_00440.start(); - A6_Cycle_am_00440.start(); - - try { - A1_Cycle_am_00440.join(); - A2_Cycle_am_00440.join(); - A3_Cycle_am_00440.join(); - A4_Cycle_am_00440.join(); - A5_Cycle_am_00440.join(); - A6_Cycle_am_00440.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00440.check() && A2_Cycle_am_00440.check() && A3_Cycle_am_00440.check() && A4_Cycle_am_00440.check() && A5_Cycle_am_00440.check() && A6_Cycle_am_00440.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00440.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00440 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00440.java + *- @ExecuteClass: Cycle_am_00440 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00440 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00440_A1 a1_main = new Cycle_a_00440_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00440_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00440_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00440_A4("a4_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1023) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00440_A1 { + Cycle_a_00440_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00440_A2 { + Cycle_a_00440_A1 a1_0; + Cycle_a_00440_A3 a3_0; + Cycle_a_00440_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00440_A3 { + Cycle_a_00440_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00440_A4 { + Cycle_a_00440_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A4(String strObjectName) { + a2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_am_00440 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00440 A1_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); + ThreadRc_Cycle_am_00440 A2_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); + ThreadRc_Cycle_am_00440 A3_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); + ThreadRc_Cycle_am_00440 A4_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); + ThreadRc_Cycle_am_00440 A5_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); + ThreadRc_Cycle_am_00440 A6_Cycle_am_00440 = new ThreadRc_Cycle_am_00440(); + + A1_Cycle_am_00440.start(); + A2_Cycle_am_00440.start(); + A3_Cycle_am_00440.start(); + A4_Cycle_am_00440.start(); + A5_Cycle_am_00440.start(); + A6_Cycle_am_00440.start(); + + try { + A1_Cycle_am_00440.join(); + A2_Cycle_am_00440.join(); + A3_Cycle_am_00440.join(); + A4_Cycle_am_00440.join(); + A5_Cycle_am_00440.join(); + A6_Cycle_am_00440.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00440.check() && A2_Cycle_am_00440.check() && A3_Cycle_am_00440.check() && A4_Cycle_am_00440.check() && A5_Cycle_am_00440.check() && A6_Cycle_am_00440.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0147-rc-function-RC_Thread01-Cycle_am_00450/Cycle_am_00450.java b/test/testsuite/ouroboros/memory_management/Function/RC0147-rc-function-RC_Thread01-Cycle_am_00450/Cycle_am_00450.java index eb825fade14ad1a048c806bd96f59b3866baad2a..b981b2532a3b71a3cf38d2ea0763827d8dc6c143 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0147-rc-function-RC_Thread01-Cycle_am_00450/Cycle_am_00450.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0147-rc-function-RC_Thread01-Cycle_am_00450/Cycle_am_00450.java @@ -1,222 +1,222 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00450.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00450 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00450.java - *- @ExecuteClass: Cycle_am_00450 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00450 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00450_A1 a1_main = new Cycle_a_00450_A1("a1_main"); - Cycle_a_00450_A6 a6_main = new Cycle_a_00450_A6("a6_main"); - Cycle_a_00450_A7 a7_main = new Cycle_a_00450_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00450_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00450_A3("a3_0"); - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00450_A5("a5_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = a7_main; - a7_main.a2_0 = a1_main.a2_0; - - a1_main.add(); - a6_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - - int result = a1_main.sum + a6_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1453) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00450_A1 { - Cycle_a_00450_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00450_A2 { - Cycle_a_00450_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00450_A3 { - Cycle_a_00450_A1 a1_0; - Cycle_a_00450_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00450_A5 { - Cycle_a_00450_A6 a6_0; - Cycle_a_00450_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A5(String strObjectName) { - a6_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a7_0.a; - } - } - - class Cycle_a_00450_A6 { - Cycle_a_00450_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00450_A7 { - Cycle_a_00450_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_am_00450 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00450 A1_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); - ThreadRc_Cycle_am_00450 A2_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); - ThreadRc_Cycle_am_00450 A3_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); - ThreadRc_Cycle_am_00450 A4_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); - ThreadRc_Cycle_am_00450 A5_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); - ThreadRc_Cycle_am_00450 A6_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); - - A1_Cycle_am_00450.start(); - A2_Cycle_am_00450.start(); - A3_Cycle_am_00450.start(); - A4_Cycle_am_00450.start(); - A5_Cycle_am_00450.start(); - A6_Cycle_am_00450.start(); - - try { - A1_Cycle_am_00450.join(); - A2_Cycle_am_00450.join(); - A3_Cycle_am_00450.join(); - A4_Cycle_am_00450.join(); - A5_Cycle_am_00450.join(); - A6_Cycle_am_00450.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00450.check() && A2_Cycle_am_00450.check() && A3_Cycle_am_00450.check() && A4_Cycle_am_00450.check() && A5_Cycle_am_00450.check() && A6_Cycle_am_00450.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00450.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00450 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00450.java + *- @ExecuteClass: Cycle_am_00450 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00450 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00450_A1 a1_main = new Cycle_a_00450_A1("a1_main"); + Cycle_a_00450_A6 a6_main = new Cycle_a_00450_A6("a6_main"); + Cycle_a_00450_A7 a7_main = new Cycle_a_00450_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00450_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00450_A3("a3_0"); + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00450_A5("a5_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = a7_main; + a7_main.a2_0 = a1_main.a2_0; + + a1_main.add(); + a6_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + + int result = a1_main.sum + a6_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1453) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00450_A1 { + Cycle_a_00450_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00450_A2 { + Cycle_a_00450_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00450_A3 { + Cycle_a_00450_A1 a1_0; + Cycle_a_00450_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00450_A5 { + Cycle_a_00450_A6 a6_0; + Cycle_a_00450_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A5(String strObjectName) { + a6_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a7_0.a; + } + } + + class Cycle_a_00450_A6 { + Cycle_a_00450_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00450_A7 { + Cycle_a_00450_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_am_00450 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00450 A1_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); + ThreadRc_Cycle_am_00450 A2_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); + ThreadRc_Cycle_am_00450 A3_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); + ThreadRc_Cycle_am_00450 A4_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); + ThreadRc_Cycle_am_00450 A5_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); + ThreadRc_Cycle_am_00450 A6_Cycle_am_00450 = new ThreadRc_Cycle_am_00450(); + + A1_Cycle_am_00450.start(); + A2_Cycle_am_00450.start(); + A3_Cycle_am_00450.start(); + A4_Cycle_am_00450.start(); + A5_Cycle_am_00450.start(); + A6_Cycle_am_00450.start(); + + try { + A1_Cycle_am_00450.join(); + A2_Cycle_am_00450.join(); + A3_Cycle_am_00450.join(); + A4_Cycle_am_00450.join(); + A5_Cycle_am_00450.join(); + A6_Cycle_am_00450.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00450.check() && A2_Cycle_am_00450.check() && A3_Cycle_am_00450.check() && A4_Cycle_am_00450.check() && A5_Cycle_am_00450.check() && A6_Cycle_am_00450.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0148-rc-function-RC_Thread01-Cycle_am_00460/Cycle_am_00460.java b/test/testsuite/ouroboros/memory_management/Function/RC0148-rc-function-RC_Thread01-Cycle_am_00460/Cycle_am_00460.java index 0ec72ab5729718b9ab44f297b3c0eaf8b7359028..4276fc791288d27247f421e45f1667197b849b10 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0148-rc-function-RC_Thread01-Cycle_am_00460/Cycle_am_00460.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0148-rc-function-RC_Thread01-Cycle_am_00460/Cycle_am_00460.java @@ -1,225 +1,225 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00460.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00460 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00460.java - *- @ExecuteClass: Cycle_am_00460 - *- @ExecuteArgs: - */ - - -class ThreadRc_Cycle_am_00460 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00460_A1 a1_main = new Cycle_a_00460_A1("a1_main"); - Cycle_a_00460_A5 a5_main = new Cycle_a_00460_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00460_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00460_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00460_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00460_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; - - a5_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1550) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00460_A1 { - Cycle_a_00460_A2 a2_0; - Cycle_a_00460_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } - } - - class Cycle_a_00460_A2 { - Cycle_a_00460_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00460_A3 { - Cycle_a_00460_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00460_A4 { - Cycle_a_00460_A1 a1_0; - Cycle_a_00460_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - class Cycle_a_00460_A5 { - Cycle_a_00460_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00460_A6 { - Cycle_a_00460_A1 a1_0; - Cycle_a_00460_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A6(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } -} - - -public class Cycle_am_00460 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00460 A1_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); - ThreadRc_Cycle_am_00460 A2_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); - ThreadRc_Cycle_am_00460 A3_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); - ThreadRc_Cycle_am_00460 A4_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); - ThreadRc_Cycle_am_00460 A5_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); - ThreadRc_Cycle_am_00460 A6_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); - - A1_Cycle_am_00460.start(); - A2_Cycle_am_00460.start(); - A3_Cycle_am_00460.start(); - A4_Cycle_am_00460.start(); - A5_Cycle_am_00460.start(); - A6_Cycle_am_00460.start(); - - try { - A1_Cycle_am_00460.join(); - A2_Cycle_am_00460.join(); - A3_Cycle_am_00460.join(); - A4_Cycle_am_00460.join(); - A5_Cycle_am_00460.join(); - A6_Cycle_am_00460.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00460.check() && A2_Cycle_am_00460.check() && A3_Cycle_am_00460.check() && A4_Cycle_am_00460.check() && A5_Cycle_am_00460.check() && A6_Cycle_am_00460.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00460.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00460 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00460.java + *- @ExecuteClass: Cycle_am_00460 + *- @ExecuteArgs: + */ + + +class ThreadRc_Cycle_am_00460 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00460_A1 a1_main = new Cycle_a_00460_A1("a1_main"); + Cycle_a_00460_A5 a5_main = new Cycle_a_00460_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00460_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00460_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00460_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00460_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; + + a5_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1550) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00460_A1 { + Cycle_a_00460_A2 a2_0; + Cycle_a_00460_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } + } + + class Cycle_a_00460_A2 { + Cycle_a_00460_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00460_A3 { + Cycle_a_00460_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00460_A4 { + Cycle_a_00460_A1 a1_0; + Cycle_a_00460_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + class Cycle_a_00460_A5 { + Cycle_a_00460_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00460_A6 { + Cycle_a_00460_A1 a1_0; + Cycle_a_00460_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A6(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } +} + + +public class Cycle_am_00460 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00460 A1_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); + ThreadRc_Cycle_am_00460 A2_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); + ThreadRc_Cycle_am_00460 A3_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); + ThreadRc_Cycle_am_00460 A4_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); + ThreadRc_Cycle_am_00460 A5_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); + ThreadRc_Cycle_am_00460 A6_Cycle_am_00460 = new ThreadRc_Cycle_am_00460(); + + A1_Cycle_am_00460.start(); + A2_Cycle_am_00460.start(); + A3_Cycle_am_00460.start(); + A4_Cycle_am_00460.start(); + A5_Cycle_am_00460.start(); + A6_Cycle_am_00460.start(); + + try { + A1_Cycle_am_00460.join(); + A2_Cycle_am_00460.join(); + A3_Cycle_am_00460.join(); + A4_Cycle_am_00460.join(); + A5_Cycle_am_00460.join(); + A6_Cycle_am_00460.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00460.check() && A2_Cycle_am_00460.check() && A3_Cycle_am_00460.check() && A4_Cycle_am_00460.check() && A5_Cycle_am_00460.check() && A6_Cycle_am_00460.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0149-rc-function-RC_Thread01-Cycle_am_00470/Cycle_am_00470.java b/test/testsuite/ouroboros/memory_management/Function/RC0149-rc-function-RC_Thread01-Cycle_am_00470/Cycle_am_00470.java index d900b45380fe2ea8506983aeb819ff27aa2e7d3f..c3aa52fa0de741fbe90788d857603f05439a3235 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0149-rc-function-RC_Thread01-Cycle_am_00470/Cycle_am_00470.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0149-rc-function-RC_Thread01-Cycle_am_00470/Cycle_am_00470.java @@ -1,221 +1,221 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00470.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00470 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00470.java - *- @ExecuteClass: Cycle_am_00470 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00470 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00470_A1 a1_main = new Cycle_a_00470_A1("a1_main"); - Cycle_a_00470_A5 a5_main = new Cycle_a_00470_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00470_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00470_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00470_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00470_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a1_0 = a1_main; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1446) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00470_A1 { - Cycle_a_00470_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00470_A2 { - Cycle_a_00470_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00470_A3 { - Cycle_a_00470_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00470_A4 { - Cycle_a_00470_A1 a1_0; - Cycle_a_00470_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - class Cycle_a_00470_A5 { - Cycle_a_00470_A1 a1_0; - Cycle_a_00470_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A5(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00470_A6 { - Cycle_a_00470_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A6(String strObjectName) { - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } -} - - -public class Cycle_am_00470 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00470 A1_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); - ThreadRc_Cycle_am_00470 A2_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); - ThreadRc_Cycle_am_00470 A3_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); - ThreadRc_Cycle_am_00470 A4_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); - ThreadRc_Cycle_am_00470 A5_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); - ThreadRc_Cycle_am_00470 A6_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); - - A1_Cycle_am_00470.start(); - A2_Cycle_am_00470.start(); - A3_Cycle_am_00470.start(); - A4_Cycle_am_00470.start(); - A5_Cycle_am_00470.start(); - A6_Cycle_am_00470.start(); - - try { - A1_Cycle_am_00470.join(); - A2_Cycle_am_00470.join(); - A3_Cycle_am_00470.join(); - A4_Cycle_am_00470.join(); - A5_Cycle_am_00470.join(); - A6_Cycle_am_00470.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00470.check() && A2_Cycle_am_00470.check() && A3_Cycle_am_00470.check() && A4_Cycle_am_00470.check() && A5_Cycle_am_00470.check() && A6_Cycle_am_00470.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00470.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00470 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00470.java + *- @ExecuteClass: Cycle_am_00470 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00470 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00470_A1 a1_main = new Cycle_a_00470_A1("a1_main"); + Cycle_a_00470_A5 a5_main = new Cycle_a_00470_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00470_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00470_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00470_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00470_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a1_0 = a1_main; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1446) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00470_A1 { + Cycle_a_00470_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00470_A2 { + Cycle_a_00470_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00470_A3 { + Cycle_a_00470_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00470_A4 { + Cycle_a_00470_A1 a1_0; + Cycle_a_00470_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + class Cycle_a_00470_A5 { + Cycle_a_00470_A1 a1_0; + Cycle_a_00470_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A5(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00470_A6 { + Cycle_a_00470_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A6(String strObjectName) { + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } +} + + +public class Cycle_am_00470 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00470 A1_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); + ThreadRc_Cycle_am_00470 A2_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); + ThreadRc_Cycle_am_00470 A3_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); + ThreadRc_Cycle_am_00470 A4_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); + ThreadRc_Cycle_am_00470 A5_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); + ThreadRc_Cycle_am_00470 A6_Cycle_am_00470 = new ThreadRc_Cycle_am_00470(); + + A1_Cycle_am_00470.start(); + A2_Cycle_am_00470.start(); + A3_Cycle_am_00470.start(); + A4_Cycle_am_00470.start(); + A5_Cycle_am_00470.start(); + A6_Cycle_am_00470.start(); + + try { + A1_Cycle_am_00470.join(); + A2_Cycle_am_00470.join(); + A3_Cycle_am_00470.join(); + A4_Cycle_am_00470.join(); + A5_Cycle_am_00470.join(); + A6_Cycle_am_00470.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00470.check() && A2_Cycle_am_00470.check() && A3_Cycle_am_00470.check() && A4_Cycle_am_00470.check() && A5_Cycle_am_00470.check() && A6_Cycle_am_00470.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0150-rc-function-RC_Thread01-Cycle_am_00480/Cycle_am_00480.java b/test/testsuite/ouroboros/memory_management/Function/RC0150-rc-function-RC_Thread01-Cycle_am_00480/Cycle_am_00480.java index cf54a2c094a0cd2762f49ead17b0a3aa5cfcb1cd..53127d6b360f7ed0633d889175d747c24c394537 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0150-rc-function-RC_Thread01-Cycle_am_00480/Cycle_am_00480.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0150-rc-function-RC_Thread01-Cycle_am_00480/Cycle_am_00480.java @@ -1,244 +1,244 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00480.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00480 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00480.java - *- @ExecuteClass: Cycle_am_00480 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00480 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00480_A1 a1_main = new Cycle_a_00480_A1("a1_main"); - Cycle_a_00480_A5 a5_main = new Cycle_a_00480_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00480_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00480_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00480_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00480_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; - - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a1_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); -// a1_main.a2_0.a3_0.a4_0.a6_0.a5_0.add(); -// a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.add(); -// a1_main.a2_0.a3_0.a4_0.a6_0.a1_0.add(); - - a5_main.a3_0.add(); - a5_main.a3_0.a4_0.add(); - -// System.out.println("a1_main.sum:"+a1_main.sum); -// System.out.println("a4_main.sum:"+a5_main.sum); -// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); -// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); -// System.out.println("a1_main.a2_0.a3_0.a4_0.sum:"+a1_main.a2_0.a3_0.a4_0.sum); -// System.out.println("a1_main.a2_0.a3_0.a4_0.a6_0.sum:"+a1_main.a2_0.a3_0.a4_0.a6_0.sum); -// System.out.println("a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.sum:"+a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.sum); - - -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a5_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a1_main.a2_0.a3_0.a4_0.sum+a1_main.a2_0.a3_0.a4_0.a6_0.sum); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1550) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00480_A1 { - Cycle_a_00480_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00480_A2 { - Cycle_a_00480_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00480_A3 { - Cycle_a_00480_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00480_A4 { - Cycle_a_00480_A1 a1_0; - Cycle_a_00480_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - class Cycle_a_00480_A5 { - Cycle_a_00480_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00480_A6 { - Cycle_a_00480_A1 a1_0; - Cycle_a_00480_A4 a4_0; - Cycle_a_00480_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A6(String strObjectName) { - a1_0 = null; - a4_0 = null; - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a + a5_0.a; - } - } -} - - -public class Cycle_am_00480 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00480 A1_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); - ThreadRc_Cycle_am_00480 A2_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); - ThreadRc_Cycle_am_00480 A3_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); - ThreadRc_Cycle_am_00480 A4_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); - ThreadRc_Cycle_am_00480 A5_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); - ThreadRc_Cycle_am_00480 A6_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); - - A1_Cycle_am_00480.start(); - A2_Cycle_am_00480.start(); - A3_Cycle_am_00480.start(); - A4_Cycle_am_00480.start(); - A5_Cycle_am_00480.start(); - A6_Cycle_am_00480.start(); - - try { - A1_Cycle_am_00480.join(); - A2_Cycle_am_00480.join(); - A3_Cycle_am_00480.join(); - A4_Cycle_am_00480.join(); - A5_Cycle_am_00480.join(); - A6_Cycle_am_00480.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00480.check() && A2_Cycle_am_00480.check() && A3_Cycle_am_00480.check() && A4_Cycle_am_00480.check() && A5_Cycle_am_00480.check() && A6_Cycle_am_00480.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00480.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00480 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00480.java + *- @ExecuteClass: Cycle_am_00480 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00480 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00480_A1 a1_main = new Cycle_a_00480_A1("a1_main"); + Cycle_a_00480_A5 a5_main = new Cycle_a_00480_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00480_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00480_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00480_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00480_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; + + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a1_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); +// a1_main.a2_0.a3_0.a4_0.a6_0.a5_0.add(); +// a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.add(); +// a1_main.a2_0.a3_0.a4_0.a6_0.a1_0.add(); + + a5_main.a3_0.add(); + a5_main.a3_0.a4_0.add(); + +// System.out.println("a1_main.sum:"+a1_main.sum); +// System.out.println("a4_main.sum:"+a5_main.sum); +// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); +// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); +// System.out.println("a1_main.a2_0.a3_0.a4_0.sum:"+a1_main.a2_0.a3_0.a4_0.sum); +// System.out.println("a1_main.a2_0.a3_0.a4_0.a6_0.sum:"+a1_main.a2_0.a3_0.a4_0.a6_0.sum); +// System.out.println("a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.sum:"+a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.sum); + + +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a5_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a1_main.a2_0.a3_0.a4_0.sum+a1_main.a2_0.a3_0.a4_0.a6_0.sum); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1550) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00480_A1 { + Cycle_a_00480_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00480_A2 { + Cycle_a_00480_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00480_A3 { + Cycle_a_00480_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00480_A4 { + Cycle_a_00480_A1 a1_0; + Cycle_a_00480_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + class Cycle_a_00480_A5 { + Cycle_a_00480_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00480_A6 { + Cycle_a_00480_A1 a1_0; + Cycle_a_00480_A4 a4_0; + Cycle_a_00480_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A6(String strObjectName) { + a1_0 = null; + a4_0 = null; + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a + a5_0.a; + } + } +} + + +public class Cycle_am_00480 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00480 A1_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); + ThreadRc_Cycle_am_00480 A2_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); + ThreadRc_Cycle_am_00480 A3_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); + ThreadRc_Cycle_am_00480 A4_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); + ThreadRc_Cycle_am_00480 A5_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); + ThreadRc_Cycle_am_00480 A6_Cycle_am_00480 = new ThreadRc_Cycle_am_00480(); + + A1_Cycle_am_00480.start(); + A2_Cycle_am_00480.start(); + A3_Cycle_am_00480.start(); + A4_Cycle_am_00480.start(); + A5_Cycle_am_00480.start(); + A6_Cycle_am_00480.start(); + + try { + A1_Cycle_am_00480.join(); + A2_Cycle_am_00480.join(); + A3_Cycle_am_00480.join(); + A4_Cycle_am_00480.join(); + A5_Cycle_am_00480.join(); + A6_Cycle_am_00480.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00480.check() && A2_Cycle_am_00480.check() && A3_Cycle_am_00480.check() && A4_Cycle_am_00480.check() && A5_Cycle_am_00480.check() && A6_Cycle_am_00480.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0151-rc-function-RC_Thread01-Cycle_am_00490/Cycle_am_00490.java b/test/testsuite/ouroboros/memory_management/Function/RC0151-rc-function-RC_Thread01-Cycle_am_00490/Cycle_am_00490.java index 0262d19aef193a6866bc74efa5ca091e174b942a..33a481f6bfc7654429cae91b3e06dfd296f0e1cb 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0151-rc-function-RC_Thread01-Cycle_am_00490/Cycle_am_00490.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0151-rc-function-RC_Thread01-Cycle_am_00490/Cycle_am_00490.java @@ -1,310 +1,310 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00490.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00490 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00490.java - *- @ExecuteClass: Cycle_am_00490 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_am_00490 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00490_A1 a1_main = new Cycle_a_00490_A1("a1_main"); - Cycle_a_00490_A4 a4_main = new Cycle_a_00490_A4("a4_main"); - Cycle_a_00490_A7 a7_main = new Cycle_a_00490_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00490_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00490_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a4_main.a5_0 = new Cycle_a_00490_A5("a5_0"); - a4_main.a5_0.a6_0 = new Cycle_a_00490_A6("a6_0"); - a4_main.a5_0.a6_0.a4_0 = a4_main; -// a4_main.a5_0.a6_0.a3_0 = new Cycle_a_00490_A3("a3_0"); - a4_main.a5_0.a6_0.a3_0 = a1_main.a2_0.a3_0; - a4_main.a5_0.a6_0.a3_0.a1_0 = a1_main; - - a7_main.a9_0 = new Cycle_a_00490_A9("a9_0"); - a7_main.a9_0.a8_0 = new Cycle_a_00490_A8("a8_0"); - a7_main.a9_0.a8_0.a7_0 = a7_main; - a7_main.a9_0.a8_0.a5_0 = a4_main.a5_0; - - a1_main.add(); - a4_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a1_0.add(); - a4_main.a5_0.add(); - a4_main.a5_0.a6_0.add(); - a4_main.a5_0.a6_0.a4_0.add(); - a4_main.a5_0.a6_0.a3_0.add(); - a4_main.a5_0.a6_0.a3_0.a1_0.add(); - - a7_main.a9_0.add(); - a7_main.a9_0.a8_0.add(); - a7_main.a9_0.a8_0.a7_0.add(); - a7_main.a9_0.a8_0.a5_0.add(); -// -// System.out.println("a1_main.sum:"+a1_main.sum); -// System.out.println("a4_main.sum:"+a4_main.sum); -// System.out.println("a7_main.sum:"+a7_main.sum); -// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); -// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); -// System.out.println("a4_main.a5_0.sum:"+a4_main.a5_0.sum); -// System.out.println("a4_main.a5_0.a6_0.sum:"+a4_main.a5_0.a6_0.sum); -// System.out.println("a7_main.a9_0.sum:"+a7_main.a9_0.sum); -// System.out.println("a7_main.a9_0.a8_0.sum:"+a7_main.a9_0.a8_0.sum); - - -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a4_main.sum+a7_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a4_main.a5_0.sum+a4_main.a5_0.a6_0.sum+a7_main.a9_0.sum+a7_main.a9_0.a8_0.sum); - - int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2098) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00490_A1 { - Cycle_a_00490_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00490_A2 { - Cycle_a_00490_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00490_A3 { - Cycle_a_00490_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00490_A4 { - Cycle_a_00490_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00490_A5 { - Cycle_a_00490_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00490_A6 { - Cycle_a_00490_A3 a3_0; - Cycle_a_00490_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A6(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00490_A7 { - Cycle_a_00490_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A7(String strObjectName) { - a9_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_00490_A8 { - Cycle_a_00490_A5 a5_0; - Cycle_a_00490_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A8(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a + a5_0.a; - } - } - - class Cycle_a_00490_A9 { - Cycle_a_00490_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A9(String strObjectName) { - a8_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } - } -} - - -public class Cycle_am_00490 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00490 A1_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); - ThreadRc_Cycle_am_00490 A2_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); - ThreadRc_Cycle_am_00490 A3_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); - ThreadRc_Cycle_am_00490 A4_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); - ThreadRc_Cycle_am_00490 A5_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); - ThreadRc_Cycle_am_00490 A6_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); - - A1_Cycle_am_00490.start(); - A2_Cycle_am_00490.start(); - A3_Cycle_am_00490.start(); - A4_Cycle_am_00490.start(); - A5_Cycle_am_00490.start(); - A6_Cycle_am_00490.start(); - - try { - A1_Cycle_am_00490.join(); - A2_Cycle_am_00490.join(); - A3_Cycle_am_00490.join(); - A4_Cycle_am_00490.join(); - A5_Cycle_am_00490.join(); - A6_Cycle_am_00490.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00490.check() && A2_Cycle_am_00490.check() && A3_Cycle_am_00490.check() && A4_Cycle_am_00490.check() && A5_Cycle_am_00490.check() && A6_Cycle_am_00490.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00490.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00490 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00490.java + *- @ExecuteClass: Cycle_am_00490 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_am_00490 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00490_A1 a1_main = new Cycle_a_00490_A1("a1_main"); + Cycle_a_00490_A4 a4_main = new Cycle_a_00490_A4("a4_main"); + Cycle_a_00490_A7 a7_main = new Cycle_a_00490_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00490_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00490_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a4_main.a5_0 = new Cycle_a_00490_A5("a5_0"); + a4_main.a5_0.a6_0 = new Cycle_a_00490_A6("a6_0"); + a4_main.a5_0.a6_0.a4_0 = a4_main; +// a4_main.a5_0.a6_0.a3_0 = new Cycle_a_00490_A3("a3_0"); + a4_main.a5_0.a6_0.a3_0 = a1_main.a2_0.a3_0; + a4_main.a5_0.a6_0.a3_0.a1_0 = a1_main; + + a7_main.a9_0 = new Cycle_a_00490_A9("a9_0"); + a7_main.a9_0.a8_0 = new Cycle_a_00490_A8("a8_0"); + a7_main.a9_0.a8_0.a7_0 = a7_main; + a7_main.a9_0.a8_0.a5_0 = a4_main.a5_0; + + a1_main.add(); + a4_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a1_0.add(); + a4_main.a5_0.add(); + a4_main.a5_0.a6_0.add(); + a4_main.a5_0.a6_0.a4_0.add(); + a4_main.a5_0.a6_0.a3_0.add(); + a4_main.a5_0.a6_0.a3_0.a1_0.add(); + + a7_main.a9_0.add(); + a7_main.a9_0.a8_0.add(); + a7_main.a9_0.a8_0.a7_0.add(); + a7_main.a9_0.a8_0.a5_0.add(); +// +// System.out.println("a1_main.sum:"+a1_main.sum); +// System.out.println("a4_main.sum:"+a4_main.sum); +// System.out.println("a7_main.sum:"+a7_main.sum); +// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); +// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); +// System.out.println("a4_main.a5_0.sum:"+a4_main.a5_0.sum); +// System.out.println("a4_main.a5_0.a6_0.sum:"+a4_main.a5_0.a6_0.sum); +// System.out.println("a7_main.a9_0.sum:"+a7_main.a9_0.sum); +// System.out.println("a7_main.a9_0.a8_0.sum:"+a7_main.a9_0.a8_0.sum); + + +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a4_main.sum+a7_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a4_main.a5_0.sum+a4_main.a5_0.a6_0.sum+a7_main.a9_0.sum+a7_main.a9_0.a8_0.sum); + + int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2098) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00490_A1 { + Cycle_a_00490_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00490_A2 { + Cycle_a_00490_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00490_A3 { + Cycle_a_00490_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00490_A4 { + Cycle_a_00490_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00490_A5 { + Cycle_a_00490_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00490_A6 { + Cycle_a_00490_A3 a3_0; + Cycle_a_00490_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A6(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00490_A7 { + Cycle_a_00490_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A7(String strObjectName) { + a9_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_00490_A8 { + Cycle_a_00490_A5 a5_0; + Cycle_a_00490_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A8(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a + a5_0.a; + } + } + + class Cycle_a_00490_A9 { + Cycle_a_00490_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A9(String strObjectName) { + a8_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } + } +} + + +public class Cycle_am_00490 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00490 A1_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); + ThreadRc_Cycle_am_00490 A2_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); + ThreadRc_Cycle_am_00490 A3_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); + ThreadRc_Cycle_am_00490 A4_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); + ThreadRc_Cycle_am_00490 A5_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); + ThreadRc_Cycle_am_00490 A6_Cycle_am_00490 = new ThreadRc_Cycle_am_00490(); + + A1_Cycle_am_00490.start(); + A2_Cycle_am_00490.start(); + A3_Cycle_am_00490.start(); + A4_Cycle_am_00490.start(); + A5_Cycle_am_00490.start(); + A6_Cycle_am_00490.start(); + + try { + A1_Cycle_am_00490.join(); + A2_Cycle_am_00490.join(); + A3_Cycle_am_00490.join(); + A4_Cycle_am_00490.join(); + A5_Cycle_am_00490.join(); + A6_Cycle_am_00490.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00490.check() && A2_Cycle_am_00490.check() && A3_Cycle_am_00490.check() && A4_Cycle_am_00490.check() && A5_Cycle_am_00490.check() && A6_Cycle_am_00490.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\nExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0152-rc-function-RC_Thread01-Cycle_am_00500/Cycle_am_00500.java b/test/testsuite/ouroboros/memory_management/Function/RC0152-rc-function-RC_Thread01-Cycle_am_00500/Cycle_am_00500.java index 86f73475fdc7d4b60deb0936ac187781aa1cd6c5..f028129db654048e1af84a19214bbe1b372fffc1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0152-rc-function-RC_Thread01-Cycle_am_00500/Cycle_am_00500.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0152-rc-function-RC_Thread01-Cycle_am_00500/Cycle_am_00500.java @@ -1,311 +1,311 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00500.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_00500 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00500.java - *- @ExecuteClass: Cycle_am_00500 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_am_00500 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00500_A1 a1_main = new Cycle_a_00500_A1("a1_main"); - Cycle_a_00500_A4 a4_main = new Cycle_a_00500_A4("a4_main"); - Cycle_a_00500_A7 a7_main = new Cycle_a_00500_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00500_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00500_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a4_main.a1_0 = a1_main; - a4_main.a5_0 = new Cycle_a_00500_A5("a5_0"); - a4_main.a5_0.a6_0 = new Cycle_a_00500_A6("a6_0"); - a4_main.a5_0.a6_0.a4_0 = a4_main; - - a4_main.a5_0.a8_0 = new Cycle_a_00500_A8("a8_0"); - a4_main.a5_0.a8_0.a7_0 = a7_main; - - a7_main.a9_0 = new Cycle_a_00500_A9("a9_0"); - a7_main.a9_0.a8_0 = new Cycle_a_00500_A8("a8_0"); - a7_main.a9_0.a8_0.a7_0 = a7_main; - - a1_main.add(); - a4_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a1_0.add(); - a4_main.a1_0.add(); - a4_main.a5_0.add(); - a4_main.a5_0.a6_0.add(); - a4_main.a5_0.a6_0.a4_0.add(); - a4_main.a5_0.a8_0.add(); - a4_main.a5_0.a8_0.a7_0.add(); - a7_main.a9_0.add(); - a7_main.a9_0.a8_0.add(); - a7_main.a9_0.a8_0.a7_0.add(); - - -// System.out.println("a1_main.sum:"+a1_main.sum); -// System.out.println("a4_main.sum:"+a4_main.sum); -// System.out.println("a7_main.sum:"+a7_main.sum); -// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); -// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); -// System.out.println("a4_main.a5_0.sum:"+a4_main.a5_0.sum); -// System.out.println("a4_main.a5_0.a6_0.sum:"+a4_main.a5_0.a6_0.sum); -// System.out.println("a7_main.a9_0.sum:"+a7_main.a9_0.sum); -// System.out.println("a7_main.a9_0.a8_0.sum:"+a7_main.a9_0.a8_0.sum); - - -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a4_main.sum+a7_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a4_main.a5_0.sum+a4_main.a5_0.a6_0.sum+a7_main.a9_0.sum+a7_main.a9_0.a8_0.sum); - - int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2099) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00500_A1 { - Cycle_a_00500_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00500_A2 { - Cycle_a_00500_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00500_A3 { - Cycle_a_00500_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00500_A4 { - Cycle_a_00500_A1 a1_0; - Cycle_a_00500_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A4(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00500_A5 { - Cycle_a_00500_A6 a6_0; - Cycle_a_00500_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00500_A6 { - Cycle_a_00500_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A6(String strObjectName) { - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00500_A7 { - Cycle_a_00500_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A7(String strObjectName) { - a9_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_00500_A8 { - Cycle_a_00500_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00500_A9 { - Cycle_a_00500_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A9(String strObjectName) { - a8_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } - } -} - - -public class Cycle_am_00500 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00500 A1_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); - ThreadRc_Cycle_am_00500 A2_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); - ThreadRc_Cycle_am_00500 A3_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); - ThreadRc_Cycle_am_00500 A4_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); - ThreadRc_Cycle_am_00500 A5_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); - ThreadRc_Cycle_am_00500 A6_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); - - A1_Cycle_am_00500.start(); - A2_Cycle_am_00500.start(); - A3_Cycle_am_00500.start(); - A4_Cycle_am_00500.start(); - A5_Cycle_am_00500.start(); - A6_Cycle_am_00500.start(); - - try { - A1_Cycle_am_00500.join(); - A2_Cycle_am_00500.join(); - A3_Cycle_am_00500.join(); - A4_Cycle_am_00500.join(); - A5_Cycle_am_00500.join(); - A6_Cycle_am_00500.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00500.check() && A2_Cycle_am_00500.check() && A3_Cycle_am_00500.check() && A4_Cycle_am_00500.check() && A5_Cycle_am_00500.check() && A6_Cycle_am_00500.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00500.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_00500 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00500.java + *- @ExecuteClass: Cycle_am_00500 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_am_00500 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00500_A1 a1_main = new Cycle_a_00500_A1("a1_main"); + Cycle_a_00500_A4 a4_main = new Cycle_a_00500_A4("a4_main"); + Cycle_a_00500_A7 a7_main = new Cycle_a_00500_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00500_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00500_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a4_main.a1_0 = a1_main; + a4_main.a5_0 = new Cycle_a_00500_A5("a5_0"); + a4_main.a5_0.a6_0 = new Cycle_a_00500_A6("a6_0"); + a4_main.a5_0.a6_0.a4_0 = a4_main; + + a4_main.a5_0.a8_0 = new Cycle_a_00500_A8("a8_0"); + a4_main.a5_0.a8_0.a7_0 = a7_main; + + a7_main.a9_0 = new Cycle_a_00500_A9("a9_0"); + a7_main.a9_0.a8_0 = new Cycle_a_00500_A8("a8_0"); + a7_main.a9_0.a8_0.a7_0 = a7_main; + + a1_main.add(); + a4_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a1_0.add(); + a4_main.a1_0.add(); + a4_main.a5_0.add(); + a4_main.a5_0.a6_0.add(); + a4_main.a5_0.a6_0.a4_0.add(); + a4_main.a5_0.a8_0.add(); + a4_main.a5_0.a8_0.a7_0.add(); + a7_main.a9_0.add(); + a7_main.a9_0.a8_0.add(); + a7_main.a9_0.a8_0.a7_0.add(); + + +// System.out.println("a1_main.sum:"+a1_main.sum); +// System.out.println("a4_main.sum:"+a4_main.sum); +// System.out.println("a7_main.sum:"+a7_main.sum); +// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); +// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); +// System.out.println("a4_main.a5_0.sum:"+a4_main.a5_0.sum); +// System.out.println("a4_main.a5_0.a6_0.sum:"+a4_main.a5_0.a6_0.sum); +// System.out.println("a7_main.a9_0.sum:"+a7_main.a9_0.sum); +// System.out.println("a7_main.a9_0.a8_0.sum:"+a7_main.a9_0.a8_0.sum); + + +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a4_main.sum+a7_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a4_main.a5_0.sum+a4_main.a5_0.a6_0.sum+a7_main.a9_0.sum+a7_main.a9_0.a8_0.sum); + + int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2099) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00500_A1 { + Cycle_a_00500_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00500_A2 { + Cycle_a_00500_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00500_A3 { + Cycle_a_00500_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00500_A4 { + Cycle_a_00500_A1 a1_0; + Cycle_a_00500_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A4(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00500_A5 { + Cycle_a_00500_A6 a6_0; + Cycle_a_00500_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00500_A6 { + Cycle_a_00500_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A6(String strObjectName) { + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00500_A7 { + Cycle_a_00500_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A7(String strObjectName) { + a9_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_00500_A8 { + Cycle_a_00500_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00500_A9 { + Cycle_a_00500_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A9(String strObjectName) { + a8_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } + } +} + + +public class Cycle_am_00500 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00500 A1_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); + ThreadRc_Cycle_am_00500 A2_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); + ThreadRc_Cycle_am_00500 A3_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); + ThreadRc_Cycle_am_00500 A4_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); + ThreadRc_Cycle_am_00500 A5_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); + ThreadRc_Cycle_am_00500 A6_Cycle_am_00500 = new ThreadRc_Cycle_am_00500(); + + A1_Cycle_am_00500.start(); + A2_Cycle_am_00500.start(); + A3_Cycle_am_00500.start(); + A4_Cycle_am_00500.start(); + A5_Cycle_am_00500.start(); + A6_Cycle_am_00500.start(); + + try { + A1_Cycle_am_00500.join(); + A2_Cycle_am_00500.join(); + A3_Cycle_am_00500.join(); + A4_Cycle_am_00500.join(); + A5_Cycle_am_00500.join(); + A6_Cycle_am_00500.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00500.check() && A2_Cycle_am_00500.check() && A3_Cycle_am_00500.check() && A4_Cycle_am_00500.check() && A5_Cycle_am_00500.check() && A6_Cycle_am_00500.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\nExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0153-rc-function-RC_Thread01-Cycle_am_00510/Cycle_am_00510.java b/test/testsuite/ouroboros/memory_management/Function/RC0153-rc-function-RC_Thread01-Cycle_am_00510/Cycle_am_00510.java index cf43a68131c7214e48fd6254b92fb6e14f94c607..8396eaf6062fb70f9e9f01ea3afed12375a484ef 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0153-rc-function-RC_Thread01-Cycle_am_00510/Cycle_am_00510.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0153-rc-function-RC_Thread01-Cycle_am_00510/Cycle_am_00510.java @@ -1,5650 +1,5650 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00510.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:make all Cycle_a_xx together to this Multi thread testcase for Performance Testing. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_00510.java - *- @ExecuteClass: Cycle_am_00510 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_am_00180B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00180_A1 a1_main = new Cycle_a_00180_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00180_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00180_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00180_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00180_A5("a5_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00180_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; - a1_main.a8_0 = new Cycle_a_00180_A8("a8_0"); - a1_main.a8_0.a9_0 = new Cycle_a_00180_A9("a9_0"); - a1_main.a8_0.a9_0.a7_0 = new Cycle_a_00180_A7("a7_0"); - a1_main.a8_0.a9_0.a7_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a1_main.a8_0.add(); - a1_main.a8_0.a9_0.add(); - a1_main.a8_0.a9_0.a7_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_main.a8_0.sum + a1_main.a8_0.a9_0.sum + a1_main.a8_0.a9_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1994) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00180_A1 { - Cycle_a_00180_A2 a2_0; - Cycle_a_00180_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A1(String strObjectName) { - a2_0 = null; - a8_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a8_0.a; - } - } - - class Cycle_a_00180_A2 { - Cycle_a_00180_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00180_A3 { - Cycle_a_00180_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00180_A4 { - Cycle_a_00180_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00180_A5 { - Cycle_a_00180_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00180_A6 { - Cycle_a_00180_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A6(String strObjectName) { - a1_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00180_A7 { - Cycle_a_00180_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A7(String strObjectName) { - a4_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00180_A8 { - Cycle_a_00180_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A8(String strObjectName) { - a9_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_00180_A9 { - Cycle_a_00180_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00180_A9(String strObjectName) { - a7_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - -class ThreadRc_Cycle_am_00190B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00190_A1 a1_main = new Cycle_a_00190_A1("a1_main"); - Cycle_a_00190_A10 a10_main = new Cycle_a_00190_A10("a10_main"); - a1_main.a2_0 = new Cycle_a_00190_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00190_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00190_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00190_A5("a5_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00190_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_main; - - a10_main.a8_0 = new Cycle_a_00190_A8("a8_0"); - a10_main.a8_0.a9_0 = new Cycle_a_00190_A9("a9_0"); - a10_main.a8_0.a9_0.a7_0 = new Cycle_a_00190_A7("a7_0"); - a10_main.a8_0.a9_0.a7_0.a5_0 = a1_main.a2_0.a3_0.a4_0.a5_0; - - a1_main.add(); - a10_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.add(); - a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a10_main.a8_0.add(); - a10_main.a8_0.a9_0.add(); - a10_main.a8_0.a9_0.a7_0.add(); - - - int result = a1_main.sum + a10_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_main.a8_0.sum + a10_main.a8_0.a9_0.sum + a10_main.a8_0.a9_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2215) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00190_A1 { - Cycle_a_00190_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00190_A2 { - Cycle_a_00190_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00190_A3 { - Cycle_a_00190_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00190_A4 { - Cycle_a_00190_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00190_A5 { - Cycle_a_00190_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00190_A6 { - Cycle_a_00190_A1 a1_0; - Cycle_a_00190_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A6(String strObjectName) { - a1_0 = null; - a10_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a10_0.a; - } - } - - class Cycle_a_00190_A7 { - Cycle_a_00190_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A7(String strObjectName) { - a5_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00190_A8 { - Cycle_a_00190_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A8(String strObjectName) { - a9_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_00190_A9 { - Cycle_a_00190_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A9(String strObjectName) { - a7_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00190_A10 { - Cycle_a_00190_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00190_A10(String strObjectName) { - a8_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } - } -} - -class ThreadRc_Cycle_am_00200B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00200_A1 a1_main = new Cycle_a_00200_A1("a1_main"); - Cycle_a_00200_A4 a4_main = new Cycle_a_00200_A4("a4_main"); - a1_main.a2_0 = new Cycle_a_00200_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00200_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00200_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a6_0 = new Cycle_a_00200_A6("a6_0"); - a1_main.a2_0.a6_0.a7_0 = new Cycle_a_00200_A7("a7_0"); - a1_main.a2_0.a7_0 = a1_main.a2_0.a6_0.a7_0; - - a1_main.add(); - a4_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a6_0.add(); - a1_main.a2_0.a6_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a6_0.sum + a1_main.a2_0.a6_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1773) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00200_A1 { - Cycle_a_00200_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00200_A2 { - Cycle_a_00200_A3 a3_0; - Cycle_a_00200_A6 a6_0; - Cycle_a_00200_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A2(String strObjectName) { - a3_0 = null; - a6_0 = null; - a7_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a6_0.a + a7_0.a; - } - } - - class Cycle_a_00200_A3 { - Cycle_a_00200_A1 a1_0; - Cycle_a_00200_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00200_A4 { - Cycle_a_00200_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00200_A5 { - Cycle_a_00200_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A5(String strObjectName) { - a4_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00200_A6 { - Cycle_a_00200_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00200_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00200_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_Cycle_am_00210B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00210_A1 a1_main = new Cycle_a_00210_A1("a1_main"); - Cycle_a_00210_A4 a4_main = new Cycle_a_00210_A4("a4_main"); - a1_main.a2_0 = new Cycle_a_00210_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00210_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00210_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00210_A6("a6_0"); - a1_main.a2_0.a3_0.a6_0.a7_0 = new Cycle_a_00210_A7("a7_0"); - a1_main.a2_0.a3_0.a6_0.a7_0.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a4_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a6_0.add(); - a1_main.a2_0.a3_0.a6_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a6_0.sum + a1_main.a2_0.a3_0.a6_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1662) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00210_A1 { - Cycle_a_00210_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00210_A2 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00210_A3 { - Cycle_a_00210_A1 a1_0; - Cycle_a_00210_A5 a5_0; - Cycle_a_00210_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a6_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a6_0.a; - } - } - - class Cycle_a_00210_A4 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00210_A5 { - Cycle_a_00210_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A5(String strObjectName) { - a4_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00210_A6 { - Cycle_a_00210_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00210_A7 { - Cycle_a_00210_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00210_A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_am_00220B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00220_A1 a1_main = new Cycle_a_00220_A1("a1_main"); - Cycle_a_00220_A4 a4_main = new Cycle_a_00220_A4("a4_main"); - Cycle_a_00220_A6 a6_main = new Cycle_a_00220_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00220_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00220_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00220_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_00220_A7("a7_0"); - a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; - a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1772) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00220_A1 { - Cycle_a_00220_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00220_A2 { - Cycle_a_00220_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00220_A3 { - Cycle_a_00220_A1 a1_0; - Cycle_a_00220_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00220_A4 { - Cycle_a_00220_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00220_A5 { - Cycle_a_00220_A4 a4_0; - Cycle_a_00220_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A5(String strObjectName) { - a4_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a + a7_0.a; - } - } - - class Cycle_a_00220_A6 { - Cycle_a_00220_A5 a5_0; - Cycle_a_00220_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A6(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a7_0.a; - } - } - - class Cycle_a_00220_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00220_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_Cycle_am_00230B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00230_A1 a1_main = new Cycle_a_00230_A1("a1_main"); - Cycle_a_00230_A5 a5_main = new Cycle_a_00230_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00230_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00230_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00230_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a7_0 = new Cycle_a_00230_A7("a7_0"); - a5_main.a6_0 = new Cycle_a_00230_A6("a6_0"); - a5_main.a6_0.a7_0 = a5_main.a7_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a5_main.a7_0.add(); - a5_main.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a5_main.a6_0.sum + a5_main.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1773) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00230_A1 { - Cycle_a_00230_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00230_A2 { - Cycle_a_00230_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00230_A3 { - Cycle_a_00230_A1 a1_0; - Cycle_a_00230_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } - } - - class Cycle_a_00230_A4 { - Cycle_a_00230_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00230_A5 { - Cycle_a_00230_A3 a3_0; - Cycle_a_00230_A6 a6_0; - Cycle_a_00230_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A5(String strObjectName) { - a3_0 = null; - a6_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a6_0.a + a7_0.a; - } - } - - class Cycle_a_00230_A6 { - Cycle_a_00230_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00230_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_00230_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_Cycle_am_00240B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00240_A1 a1_main = new Cycle_a_00240_A1("a1_main"); - Cycle_a_00240_A5 a5_main = new Cycle_a_00240_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00240_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00240_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00240_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a1_main.a6_0 = new Cycle_a_00240_A6("a6_0"); - a1_main.a6_0.a7_0 = new Cycle_a_00240_A7("a7_0"); - a1_main.a6_0.a7_0.a1_0 = a1_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a6_0.add(); - a1_main.a6_0.a7_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a6_0.sum + a1_main.a6_0.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1660) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00240_A1 { - Cycle_a_00240_A2 a2_0; - Cycle_a_00240_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A1(String strObjectName) { - a2_0 = null; - a6_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a6_0.a; - } - } - - class Cycle_a_00240_A2 { - Cycle_a_00240_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00240_A3 { - Cycle_a_00240_A1 a1_0; - Cycle_a_00240_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } - } - - class Cycle_a_00240_A4 { - Cycle_a_00240_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00240_A5 { - Cycle_a_00240_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00240_A6 { - Cycle_a_00240_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A6(String strObjectName) { - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00240_A7 { - Cycle_a_00240_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00240_A7(String strObjectName) { - a1_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_am_00250B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00250_A1 a1_main = new Cycle_a_00250_A1("a1_main"); - Cycle_a_00250_A6 a6_main = new Cycle_a_00250_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00250_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00250_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00250_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1238) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00250_A1 { - Cycle_a_00250_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00250_A2 { - Cycle_a_00250_A1 a1_0; - Cycle_a_00250_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00250_A3 { - Cycle_a_00250_A1 a1_0; - Cycle_a_00250_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00250_A5 { - Cycle_a_00250_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00250_A6 { - Cycle_a_00250_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00250_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_am_00260B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00260_A1 a1_main = new Cycle_a_00260_A1("a1_main"); - Cycle_a_00260_A6 a6_main = new Cycle_a_00260_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00260_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00260_A3("a3_0"); - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00260_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1239) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00260_A1 { - Cycle_a_00260_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00260_A2 { - Cycle_a_00260_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00260_A3 { - Cycle_a_00260_A1 a1_0; - Cycle_a_00260_A2 a2_0; - Cycle_a_00260_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a + a5_0.a; - } - } - - class Cycle_a_00260_A5 { - Cycle_a_00260_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00260_A6 { - Cycle_a_00260_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00260_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_am_00270B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00270_A1 a1_main = new Cycle_a_00270_A1("a1_main"); - Cycle_a_00270_A6 a6_main = new Cycle_a_00270_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00270_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00270_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00270_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1240) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00270_A1 { - Cycle_a_00270_A2 a2_0; - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00270_A2 { - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00270_A3 { - Cycle_a_00270_A1 a1_0; - Cycle_a_00270_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00270_A5 { - Cycle_a_00270_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00270_A6 { - Cycle_a_00270_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00270_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_am_00280B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); - Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a3_0 = a1_main.a2_0.a3_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1443) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00280_A1 { - Cycle_a_00280_A2 a2_0; - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00280_A2 { - Cycle_a_00280_A1 a1_0; - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00280_A3 { - Cycle_a_00280_A1 a1_0; - Cycle_a_00280_A2 a2_0; - Cycle_a_00280_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a + a5_0.a; - } - } - - class Cycle_a_00280_A5 { - Cycle_a_00280_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00280_A6 { - Cycle_a_00280_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00280_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_am_00290B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00290_A1 a1_main = new Cycle_a_00290_A1("a1_main"); - Cycle_a_00290_A5 a5_main = new Cycle_a_00290_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00290_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00290_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00290_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00290_A6("a6_0"); - a1_main.a2_0.a3_0.a6_0.a2_0 = a1_main.a2_0; - a5_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1447) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00290_A1 { - Cycle_a_00290_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00290_A2 { - Cycle_a_00290_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00290_A3 { - Cycle_a_00290_A1 a1_0; - Cycle_a_00290_A4 a4_0; - Cycle_a_00290_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a6_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a + a6_0.a; - } - } - - class Cycle_a_00290_A4 { - Cycle_a_00290_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00290_A5 { - Cycle_a_00290_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00290_A6 { - Cycle_a_00290_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00290_A6(String strObjectName) { - a2_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_am_00300B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00300_A1 a1_main = new Cycle_a_00300_A1("a1_main"); - Cycle_a_00300_A5 a5_main = new Cycle_a_00300_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00300_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00300_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00300_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0.a6_0 = new Cycle_a_00300_A6("a6_0"); - a5_main.a3_0.a4_0.a6_0.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0.a5_0 = a5_main; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1448) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00300_A1 { - Cycle_a_00300_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00300_A2 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00300_A3 { - Cycle_a_00300_A1 a1_0; - Cycle_a_00300_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A3(String strObjectName) { - a1_0 = null; - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } - } - - class Cycle_a_00300_A4 { - Cycle_a_00300_A5 a5_0; - Cycle_a_00300_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A4(String strObjectName) { - a5_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a6_0.a; - } - } - - class Cycle_a_00300_A5 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00300_A6 { - Cycle_a_00300_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00300_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_am_00310B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00310_A1 a1_main = new Cycle_a_00310_A1("a1_main"); - Cycle_a_00310_A4 a4_main = new Cycle_a_00310_A4("a4_main"); - Cycle_a_00310_A6 a6_main = new Cycle_a_00310_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00310_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00310_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00310_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a4_0 = a4_main; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a6_main.a3_0.a5_0 = a1_main.a2_0.a3_0.a5_0; - a4_main.a6_0 = a6_main; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1552) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00310_A1 { - Cycle_a_00310_A2 a2_0; - Cycle_a_00310_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } - } - - class Cycle_a_00310_A2 { - Cycle_a_00310_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00310_A3 { - Cycle_a_00310_A1 a1_0; - Cycle_a_00310_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00310_A4 { - Cycle_a_00310_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A4(String strObjectName) { - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00310_A5 { - Cycle_a_00310_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00310_A6 { - Cycle_a_00310_A1 a1_0; - Cycle_a_00310_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00310_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_am_00320B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00320_A1 a1_main = new Cycle_a_00320_A1("a1_main"); - Cycle_a_00320_A4 a4_main = new Cycle_a_00320_A4("a4_main"); - Cycle_a_00320_A6 a6_main = new Cycle_a_00320_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00320_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00320_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00320_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a4_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - a6_main.a4_0 = a4_main; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1551) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00320_A1 { - Cycle_a_00320_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00320_A2 { - Cycle_a_00320_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00320_A3 { - Cycle_a_00320_A1 a1_0; - Cycle_a_00320_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00320_A4 { - Cycle_a_00320_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00320_A5 { - Cycle_a_00320_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00320_A6 { - Cycle_a_00320_A1 a1_0; - Cycle_a_00320_A3 a3_0; - Cycle_a_00320_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00320_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_am_00330B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00330_A1 a1_main = new Cycle_a_00330_A1("a1_main"); - Cycle_a_00330_A4 a4_main = new Cycle_a_00330_A4("a4_main"); - Cycle_a_00330_A6 a6_main = new Cycle_a_00330_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00330_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00330_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00330_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00330_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00330_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_main.a2_0.a3_0; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2080) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00330_A1 { - Cycle_a_00330_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00330_A2 { - Cycle_a_00330_A3 a3_0; - Cycle_a_00330_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00330_A3 { - Cycle_a_00330_A1 a1_0; - Cycle_a_00330_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00330_A4 { - Cycle_a_00330_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00330_A5 { - Cycle_a_00330_A6 a6_0; - Cycle_a_00330_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00330_A6 { - Cycle_a_00330_A1 a1_0; - Cycle_a_00330_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00330_A7 { - Cycle_a_00330_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00330_A8 { - Cycle_a_00330_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00330_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - -class ThreadRc_Cycle_am_00340B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00340_A1 a1_main = new Cycle_a_00340_A1("a1_main"); - Cycle_a_00340_A4 a4_main = new Cycle_a_00340_A4("a4_main"); - Cycle_a_00340_A6 a6_main = new Cycle_a_00340_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00340_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00340_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00340_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a1_main.a2_0.a3_0.a8_0 = new Cycle_a_00340_A8("a8_0"); - a1_main.a2_0.a3_0.a8_0.a7_0 = new Cycle_a_00340_A7("a7_0"); - a1_main.a2_0.a3_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a6_main.a1_0 = a1_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a8_0.add(); - a1_main.a2_0.a3_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a8_0.a7_0.sum + a6_main.a3_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2079) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00340_A1 { - Cycle_a_00340_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00340_A2 { - Cycle_a_00340_A3 a3_0; - Cycle_a_00340_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00340_A3 { - Cycle_a_00340_A1 a1_0; - Cycle_a_00340_A5 a5_0; - Cycle_a_00340_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a8_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a8_0.a; - } - } - - class Cycle_a_00340_A4 { - Cycle_a_00340_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00340_A5 { - Cycle_a_00340_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00340_A6 { - Cycle_a_00340_A1 a1_0; - Cycle_a_00340_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00340_A7 { - Cycle_a_00340_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00340_A8 { - Cycle_a_00340_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00340_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - -class ThreadRc_Cycle_am_00350B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00350_A1 a1_main = new Cycle_a_00350_A1("a1_main"); - Cycle_a_00350_A4 a4_main = new Cycle_a_00350_A4("a4_main"); - Cycle_a_00350_A6 a6_main = new Cycle_a_00350_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_00350_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00350_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00350_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00350_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00350_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2079) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00350_A1 { - Cycle_a_00350_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00350_A2 { - Cycle_a_00350_A3 a3_0; - Cycle_a_00350_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00350_A3 { - Cycle_a_00350_A1 a1_0; - Cycle_a_00350_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00350_A4 { - Cycle_a_00350_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00350_A5 { - Cycle_a_00350_A6 a6_0; - Cycle_a_00350_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00350_A6 { - Cycle_a_00350_A1 a1_0; - Cycle_a_00350_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00350_A7 { - Cycle_a_00350_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00350_A8 { - Cycle_a_00350_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00350_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - -class ThreadRc_Cycle_am_00360B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00360_A1 a1_main = new Cycle_a_00360_A1("a1_main"); - Cycle_a_00360_A4 a4_main = new Cycle_a_00360_A4("a4_main"); - Cycle_a_00360_A6 a6_main = new Cycle_a_00360_A6("a6_main"); - Cycle_a_00360_A9 a9_main = new Cycle_a_00360_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_00360_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00360_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00360_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00360_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00360_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a5_0.a9_0 = a9_main; - a9_main.a2_0 = a1_main.a2_0; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2399) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00360_A1 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00360_A2 { - Cycle_a_00360_A3 a3_0; - Cycle_a_00360_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00360_A3 { - Cycle_a_00360_A1 a1_0; - Cycle_a_00360_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00360_A4 { - Cycle_a_00360_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00360_A5 { - Cycle_a_00360_A6 a6_0; - Cycle_a_00360_A8 a8_0; - Cycle_a_00360_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a9_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a + a9_0.a; - } - } - - class Cycle_a_00360_A6 { - Cycle_a_00360_A1 a1_0; - Cycle_a_00360_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00360_A7 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00360_A8 { - Cycle_a_00360_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00360_A9 { - Cycle_a_00360_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00360_A9(String strObjectName) { - a2_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_am_00370B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); - Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); - Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); - Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); - a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; - a9_main.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a10_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2623) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00370_A1 { - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00370_A2 { - Cycle_a_00370_A3 a3_0; - Cycle_a_00370_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00370_A3 { - Cycle_a_00370_A1 a1_0; - Cycle_a_00370_A5 a5_0; - Cycle_a_00370_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a10_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a10_0.a; - } - } - - class Cycle_a_00370_A4 { - Cycle_a_00370_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00370_A5 { - Cycle_a_00370_A6 a6_0; - Cycle_a_00370_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00370_A6 { - Cycle_a_00370_A1 a1_0; - Cycle_a_00370_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00370_A7 { - Cycle_a_00370_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00370_A8 { - Cycle_a_00370_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00370_A9 { - Cycle_a_00370_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A9(String strObjectName) { - a6_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00370_A10 { - Cycle_a_00370_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00370_A10(String strObjectName) { - a9_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } -} - -class ThreadRc_Cycle_am_00380B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00380_A1 a1_main = new Cycle_a_00380_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00380_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00380_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 815) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00380_A1 { - Cycle_a_00380_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00380_A2 { - Cycle_a_00380_A1 a1_0; - Cycle_a_00380_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00380_A3 { - Cycle_a_00380_A1 a1_0; - Cycle_a_00380_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00380_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_am_00390B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00390_A1 a1_main = new Cycle_a_00390_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00390_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new Cycle_a_00390_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 918) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00390_A1 { - Cycle_a_00390_A2 a2_0; - Cycle_a_00390_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00390_A2 { - Cycle_a_00390_A1 a1_0; - Cycle_a_00390_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00390_A3 { - Cycle_a_00390_A1 a1_0; - Cycle_a_00390_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00390_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_am_00400B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00400_A1 a1_main = new Cycle_a_00400_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00400_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00400_A3("a3_0"); - a1_main.a4_0 = new Cycle_a_00400_A4("a4_0"); - a1_main.a4_0.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 923) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00400_A1 { - Cycle_a_00400_A2 a2_0; - Cycle_a_00400_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } - } - - class Cycle_a_00400_A2 { - Cycle_a_00400_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00400_A3 { - Cycle_a_00400_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00400_A4 { - Cycle_a_00400_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00400_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_am_00410B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00410_A1 a1_main = new Cycle_a_00410_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00410_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00410_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00410_A4("a4_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 921) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00410_A1 { - Cycle_a_00410_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00410_A2 { - Cycle_a_00410_A3 a3_0; - Cycle_a_00410_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00410_A3 { - Cycle_a_00410_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00410_A4 { - Cycle_a_00410_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00410_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_am_00420B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00420_A1 a1_main = new Cycle_a_00420_A1("a1_main"); -// Cycle_a_00420_A4 a4_main = new Cycle_a_00420_A4("a4_main"); - a1_main.a2_0 = new Cycle_a_00420_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00420_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00420_A4("a4_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 923) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00420_A1 { - Cycle_a_00420_A2 a2_0; - Cycle_a_00420_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_a_00420_A2 { - Cycle_a_00420_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00420_A3 { - Cycle_a_00420_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00420_A4 { - Cycle_a_00420_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00420_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_am_00430B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00430_A1 a1_main = new Cycle_a_00430_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00430_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00430_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00430_A4("a4_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a4_0.a1_0 = a1_main; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1124) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00430_A1 { - Cycle_a_00430_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00430_A2 { - Cycle_a_00430_A1 a1_0; - Cycle_a_00430_A3 a3_0; - Cycle_a_00430_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00430_A3 { - Cycle_a_00430_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00430_A4 { - Cycle_a_00430_A1 a1_0; - Cycle_a_00430_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00430_A4(String strObjectName) { - a2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_am_00440B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00440_A1 a1_main = new Cycle_a_00440_A1("a1_main"); - a1_main.a2_0 = new Cycle_a_00440_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00440_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_a_00440_A4("a4_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1023) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00440_A1 { - Cycle_a_00440_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00440_A2 { - Cycle_a_00440_A1 a1_0; - Cycle_a_00440_A3 a3_0; - Cycle_a_00440_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00440_A3 { - Cycle_a_00440_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00440_A4 { - Cycle_a_00440_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00440_A4(String strObjectName) { - a2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_am_00450B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00450_A1 a1_main = new Cycle_a_00450_A1("a1_main"); - Cycle_a_00450_A6 a6_main = new Cycle_a_00450_A6("a6_main"); - Cycle_a_00450_A7 a7_main = new Cycle_a_00450_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00450_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00450_A3("a3_0"); - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00450_A5("a5_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = a7_main; - a7_main.a2_0 = a1_main.a2_0; - - a1_main.add(); - a6_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - - - int result = a1_main.sum + a6_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1453) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00450_A1 { - Cycle_a_00450_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00450_A2 { - Cycle_a_00450_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00450_A3 { - Cycle_a_00450_A1 a1_0; - Cycle_a_00450_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00450_A5 { - Cycle_a_00450_A6 a6_0; - Cycle_a_00450_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A5(String strObjectName) { - a6_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a7_0.a; - } - } - - class Cycle_a_00450_A6 { - Cycle_a_00450_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A6(String strObjectName) { - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00450_A7 { - Cycle_a_00450_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00450_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_am_00460B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00460_A1 a1_main = new Cycle_a_00460_A1("a1_main"); - Cycle_a_00460_A5 a5_main = new Cycle_a_00460_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00460_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00460_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00460_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00460_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; - - a5_main.a3_0 = a1_main.a2_0.a3_0; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1550) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00460_A1 { - Cycle_a_00460_A2 a2_0; - Cycle_a_00460_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A1(String strObjectName) { - a2_0 = null; - a4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a4_0.a; - } - } - - class Cycle_a_00460_A2 { - Cycle_a_00460_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00460_A3 { - Cycle_a_00460_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00460_A4 { - Cycle_a_00460_A1 a1_0; - Cycle_a_00460_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - class Cycle_a_00460_A5 { - Cycle_a_00460_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00460_A6 { - Cycle_a_00460_A1 a1_0; - Cycle_a_00460_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00460_A6(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } -} - -class ThreadRc_Cycle_am_00470B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00470_A1 a1_main = new Cycle_a_00470_A1("a1_main"); - Cycle_a_00470_A5 a5_main = new Cycle_a_00470_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00470_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00470_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00470_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00470_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a1_0 = a1_main; - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1446) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00470_A1 { - Cycle_a_00470_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00470_A2 { - Cycle_a_00470_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00470_A3 { - Cycle_a_00470_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00470_A4 { - Cycle_a_00470_A1 a1_0; - Cycle_a_00470_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - class Cycle_a_00470_A5 { - Cycle_a_00470_A1 a1_0; - Cycle_a_00470_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A5(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_00470_A6 { - Cycle_a_00470_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00470_A6(String strObjectName) { - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } -} - -class ThreadRc_Cycle_am_00480B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00480_A1 a1_main = new Cycle_a_00480_A1("a1_main"); - Cycle_a_00480_A5 a5_main = new Cycle_a_00480_A5("a5_main"); - a1_main.a2_0 = new Cycle_a_00480_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00480_A3("a3_0"); - a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00480_A4("a4_0"); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00480_A6("a6_0"); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; - - a5_main.a3_0 = a1_main.a2_0.a3_0; - a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; - - - a1_main.add(); - a5_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a4_0.add(); - a1_main.a2_0.a3_0.a4_0.a1_0.add(); - a1_main.a2_0.a3_0.a4_0.a6_0.add(); -// a1_main.a2_0.a3_0.a4_0.a6_0.a5_0.add(); -// a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.add(); -// a1_main.a2_0.a3_0.a4_0.a6_0.a1_0.add(); - - a5_main.a3_0.add(); - a5_main.a3_0.a4_0.add(); - -// System.out.println("a1_main.sum:"+a1_main.sum); -// System.out.println("a4_main.sum:"+a5_main.sum); -// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); -// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); -// System.out.println("a1_main.a2_0.a3_0.a4_0.sum:"+a1_main.a2_0.a3_0.a4_0.sum); -// System.out.println("a1_main.a2_0.a3_0.a4_0.a6_0.sum:"+a1_main.a2_0.a3_0.a4_0.a6_0.sum); -// System.out.println("a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.sum:"+a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.sum); - - -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a5_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a1_main.a2_0.a3_0.a4_0.sum+a1_main.a2_0.a3_0.a4_0.a6_0.sum); - - int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1550) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00480_A1 { - Cycle_a_00480_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00480_A2 { - Cycle_a_00480_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00480_A3 { - Cycle_a_00480_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A3(String strObjectName) { - a4_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00480_A4 { - Cycle_a_00480_A1 a1_0; - Cycle_a_00480_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A4(String strObjectName) { - a1_0 = null; - a6_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - class Cycle_a_00480_A5 { - Cycle_a_00480_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A5(String strObjectName) { - a3_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00480_A6 { - Cycle_a_00480_A1 a1_0; - Cycle_a_00480_A4 a4_0; - Cycle_a_00480_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00480_A6(String strObjectName) { - a1_0 = null; - a4_0 = null; - a5_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a4_0.a + a5_0.a; - } - } -} - -class ThreadRc_Cycle_am_00490B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00490_A1 a1_main = new Cycle_a_00490_A1("a1_main"); - Cycle_a_00490_A4 a4_main = new Cycle_a_00490_A4("a4_main"); - Cycle_a_00490_A7 a7_main = new Cycle_a_00490_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00490_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00490_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a4_main.a5_0 = new Cycle_a_00490_A5("a5_0"); - a4_main.a5_0.a6_0 = new Cycle_a_00490_A6("a6_0"); - a4_main.a5_0.a6_0.a4_0 = a4_main; -// a4_main.a5_0.a6_0.a3_0 = new Cycle_a_00490_A3("a3_0"); - a4_main.a5_0.a6_0.a3_0 = a1_main.a2_0.a3_0; - a4_main.a5_0.a6_0.a3_0.a1_0 = a1_main; - - a7_main.a9_0 = new Cycle_a_00490_A9("a9_0"); - a7_main.a9_0.a8_0 = new Cycle_a_00490_A8("a8_0"); - a7_main.a9_0.a8_0.a7_0 = a7_main; - a7_main.a9_0.a8_0.a5_0 = a4_main.a5_0; - - a1_main.add(); - a4_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a1_0.add(); - a4_main.a5_0.add(); - a4_main.a5_0.a6_0.add(); - a4_main.a5_0.a6_0.a4_0.add(); - a4_main.a5_0.a6_0.a3_0.add(); - a4_main.a5_0.a6_0.a3_0.a1_0.add(); - - a7_main.a9_0.add(); - a7_main.a9_0.a8_0.add(); - a7_main.a9_0.a8_0.a7_0.add(); - a7_main.a9_0.a8_0.a5_0.add(); -// -// System.out.println("a1_main.sum:"+a1_main.sum); -// System.out.println("a4_main.sum:"+a4_main.sum); -// System.out.println("a7_main.sum:"+a7_main.sum); -// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); -// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); -// System.out.println("a4_main.a5_0.sum:"+a4_main.a5_0.sum); -// System.out.println("a4_main.a5_0.a6_0.sum:"+a4_main.a5_0.a6_0.sum); -// System.out.println("a7_main.a9_0.sum:"+a7_main.a9_0.sum); -// System.out.println("a7_main.a9_0.a8_0.sum:"+a7_main.a9_0.a8_0.sum); - - -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a4_main.sum+a7_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a4_main.a5_0.sum+a4_main.a5_0.a6_0.sum+a7_main.a9_0.sum+a7_main.a9_0.a8_0.sum); - - int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2098) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00490_A1 { - Cycle_a_00490_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00490_A2 { - Cycle_a_00490_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00490_A3 { - Cycle_a_00490_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00490_A4 { - Cycle_a_00490_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_a_00490_A5 { - Cycle_a_00490_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_00490_A6 { - Cycle_a_00490_A3 a3_0; - Cycle_a_00490_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A6(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_00490_A7 { - Cycle_a_00490_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A7(String strObjectName) { - a9_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_00490_A8 { - Cycle_a_00490_A5 a5_0; - Cycle_a_00490_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A8(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a + a5_0.a; - } - } - - class Cycle_a_00490_A9 { - Cycle_a_00490_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00490_A9(String strObjectName) { - a8_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } - } -} - -class ThreadRc_Cycle_am_00500B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_00500_A1 a1_main = new Cycle_a_00500_A1("a1_main"); - Cycle_a_00500_A4 a4_main = new Cycle_a_00500_A4("a4_main"); - Cycle_a_00500_A7 a7_main = new Cycle_a_00500_A7("a7_main"); - a1_main.a2_0 = new Cycle_a_00500_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_00500_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - - a4_main.a1_0 = a1_main; - a4_main.a5_0 = new Cycle_a_00500_A5("a5_0"); - a4_main.a5_0.a6_0 = new Cycle_a_00500_A6("a6_0"); - a4_main.a5_0.a6_0.a4_0 = a4_main; - - a4_main.a5_0.a8_0 = new Cycle_a_00500_A8("a8_0"); - a4_main.a5_0.a8_0.a7_0 = a7_main; - - a7_main.a9_0 = new Cycle_a_00500_A9("a9_0"); - a7_main.a9_0.a8_0 = new Cycle_a_00500_A8("a8_0"); - a7_main.a9_0.a8_0.a7_0 = a7_main; - - a1_main.add(); - a4_main.add(); - a7_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a1_0.add(); - a4_main.a1_0.add(); - a4_main.a5_0.add(); - a4_main.a5_0.a6_0.add(); - a4_main.a5_0.a6_0.a4_0.add(); - a4_main.a5_0.a8_0.add(); - a4_main.a5_0.a8_0.a7_0.add(); - a7_main.a9_0.add(); - a7_main.a9_0.a8_0.add(); - a7_main.a9_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2099) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_00500_A1 { - Cycle_a_00500_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_00500_A2 { - Cycle_a_00500_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_00500_A3 { - Cycle_a_00500_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_00500_A4 { - Cycle_a_00500_A1 a1_0; - Cycle_a_00500_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A4(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_00500_A5 { - Cycle_a_00500_A6 a6_0; - Cycle_a_00500_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_00500_A6 { - Cycle_a_00500_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A6(String strObjectName) { - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_a_00500_A7 { - Cycle_a_00500_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A7(String strObjectName) { - a9_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_00500_A8 { - Cycle_a_00500_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_00500_A9 { - Cycle_a_00500_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_00500_A9(String strObjectName) { - a8_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a8_0.a; - } - } -} - -public class Cycle_am_00510 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_00180B A1_Cycle_am_00180 = new ThreadRc_Cycle_am_00180B(); - ThreadRc_Cycle_am_00180B A2_Cycle_am_00180 = new ThreadRc_Cycle_am_00180B(); - ThreadRc_Cycle_am_00190B A1_Cycle_am_00190 = new ThreadRc_Cycle_am_00190B(); - ThreadRc_Cycle_am_00190B A2_Cycle_am_00190 = new ThreadRc_Cycle_am_00190B(); - ThreadRc_Cycle_am_00200B A1_Cycle_am_00200 = new ThreadRc_Cycle_am_00200B(); - ThreadRc_Cycle_am_00200B A2_Cycle_am_00200 = new ThreadRc_Cycle_am_00200B(); - ThreadRc_Cycle_am_00210B A1_Cycle_am_00210 = new ThreadRc_Cycle_am_00210B(); - ThreadRc_Cycle_am_00210B A2_Cycle_am_00210 = new ThreadRc_Cycle_am_00210B(); - ThreadRc_Cycle_am_00220B A1_Cycle_am_00220 = new ThreadRc_Cycle_am_00220B(); - ThreadRc_Cycle_am_00220B A2_Cycle_am_00220 = new ThreadRc_Cycle_am_00220B(); - ThreadRc_Cycle_am_00230B A1_Cycle_am_00230 = new ThreadRc_Cycle_am_00230B(); - ThreadRc_Cycle_am_00230B A2_Cycle_am_00230 = new ThreadRc_Cycle_am_00230B(); - ThreadRc_Cycle_am_00240B A1_Cycle_am_00240 = new ThreadRc_Cycle_am_00240B(); - ThreadRc_Cycle_am_00240B A2_Cycle_am_00240 = new ThreadRc_Cycle_am_00240B(); - ThreadRc_Cycle_am_00250B A1_Cycle_am_00250 = new ThreadRc_Cycle_am_00250B(); - ThreadRc_Cycle_am_00250B A2_Cycle_am_00250 = new ThreadRc_Cycle_am_00250B(); - ThreadRc_Cycle_am_00260B A1_Cycle_am_00260 = new ThreadRc_Cycle_am_00260B(); - ThreadRc_Cycle_am_00260B A2_Cycle_am_00260 = new ThreadRc_Cycle_am_00260B(); - ThreadRc_Cycle_am_00270B A1_Cycle_am_00270 = new ThreadRc_Cycle_am_00270B(); - ThreadRc_Cycle_am_00270B A2_Cycle_am_00270 = new ThreadRc_Cycle_am_00270B(); - ThreadRc_Cycle_am_00280B A1_Cycle_am_00280 = new ThreadRc_Cycle_am_00280B(); - ThreadRc_Cycle_am_00280B A2_Cycle_am_00280 = new ThreadRc_Cycle_am_00280B(); - ThreadRc_Cycle_am_00290B A1_Cycle_am_00290 = new ThreadRc_Cycle_am_00290B(); - ThreadRc_Cycle_am_00290B A2_Cycle_am_00290 = new ThreadRc_Cycle_am_00290B(); - ThreadRc_Cycle_am_00300B A1_Cycle_am_00300 = new ThreadRc_Cycle_am_00300B(); - ThreadRc_Cycle_am_00300B A2_Cycle_am_00300 = new ThreadRc_Cycle_am_00300B(); - ThreadRc_Cycle_am_00310B A1_Cycle_am_00310 = new ThreadRc_Cycle_am_00310B(); - ThreadRc_Cycle_am_00310B A2_Cycle_am_00310 = new ThreadRc_Cycle_am_00310B(); - ThreadRc_Cycle_am_00320B A1_Cycle_am_00320 = new ThreadRc_Cycle_am_00320B(); - ThreadRc_Cycle_am_00320B A2_Cycle_am_00320 = new ThreadRc_Cycle_am_00320B(); - ThreadRc_Cycle_am_00330B A1_Cycle_am_00330 = new ThreadRc_Cycle_am_00330B(); - ThreadRc_Cycle_am_00330B A2_Cycle_am_00330 = new ThreadRc_Cycle_am_00330B(); - ThreadRc_Cycle_am_00340B A1_Cycle_am_00340 = new ThreadRc_Cycle_am_00340B(); - ThreadRc_Cycle_am_00340B A2_Cycle_am_00340 = new ThreadRc_Cycle_am_00340B(); - ThreadRc_Cycle_am_00350B A1_Cycle_am_00350 = new ThreadRc_Cycle_am_00350B(); - ThreadRc_Cycle_am_00350B A2_Cycle_am_00350 = new ThreadRc_Cycle_am_00350B(); - ThreadRc_Cycle_am_00360B A1_Cycle_am_00360 = new ThreadRc_Cycle_am_00360B(); - ThreadRc_Cycle_am_00360B A2_Cycle_am_00360 = new ThreadRc_Cycle_am_00360B(); - ThreadRc_Cycle_am_00370B A1_Cycle_am_00370 = new ThreadRc_Cycle_am_00370B(); - ThreadRc_Cycle_am_00370B A2_Cycle_am_00370 = new ThreadRc_Cycle_am_00370B(); - ThreadRc_Cycle_am_00380B A1_Cycle_am_00380 = new ThreadRc_Cycle_am_00380B(); - ThreadRc_Cycle_am_00380B A2_Cycle_am_00380 = new ThreadRc_Cycle_am_00380B(); - ThreadRc_Cycle_am_00390B A1_Cycle_am_00390 = new ThreadRc_Cycle_am_00390B(); - ThreadRc_Cycle_am_00390B A2_Cycle_am_00390 = new ThreadRc_Cycle_am_00390B(); - ThreadRc_Cycle_am_00400B A1_Cycle_am_00400 = new ThreadRc_Cycle_am_00400B(); - ThreadRc_Cycle_am_00400B A2_Cycle_am_00400 = new ThreadRc_Cycle_am_00400B(); - ThreadRc_Cycle_am_00410B A1_Cycle_am_00410 = new ThreadRc_Cycle_am_00410B(); - ThreadRc_Cycle_am_00410B A2_Cycle_am_00410 = new ThreadRc_Cycle_am_00410B(); - ThreadRc_Cycle_am_00420B A1_Cycle_am_00420 = new ThreadRc_Cycle_am_00420B(); - ThreadRc_Cycle_am_00420B A2_Cycle_am_00420 = new ThreadRc_Cycle_am_00420B(); - ThreadRc_Cycle_am_00430B A1_Cycle_am_00430 = new ThreadRc_Cycle_am_00430B(); - ThreadRc_Cycle_am_00430B A2_Cycle_am_00430 = new ThreadRc_Cycle_am_00430B(); - ThreadRc_Cycle_am_00440B A1_Cycle_am_00440 = new ThreadRc_Cycle_am_00440B(); - ThreadRc_Cycle_am_00440B A2_Cycle_am_00440 = new ThreadRc_Cycle_am_00440B(); - ThreadRc_Cycle_am_00450B A1_Cycle_am_00450 = new ThreadRc_Cycle_am_00450B(); - ThreadRc_Cycle_am_00450B A2_Cycle_am_00450 = new ThreadRc_Cycle_am_00450B(); - ThreadRc_Cycle_am_00460B A1_Cycle_am_00460 = new ThreadRc_Cycle_am_00460B(); - ThreadRc_Cycle_am_00460B A2_Cycle_am_00460 = new ThreadRc_Cycle_am_00460B(); - ThreadRc_Cycle_am_00470B A1_Cycle_am_00470 = new ThreadRc_Cycle_am_00470B(); - ThreadRc_Cycle_am_00470B A2_Cycle_am_00470 = new ThreadRc_Cycle_am_00470B(); - ThreadRc_Cycle_am_00480B A1_Cycle_am_00480 = new ThreadRc_Cycle_am_00480B(); - ThreadRc_Cycle_am_00480B A2_Cycle_am_00480 = new ThreadRc_Cycle_am_00480B(); - ThreadRc_Cycle_am_00490B A1_Cycle_am_00490 = new ThreadRc_Cycle_am_00490B(); - ThreadRc_Cycle_am_00490B A2_Cycle_am_00490 = new ThreadRc_Cycle_am_00490B(); - ThreadRc_Cycle_am_00500B A1_Cycle_am_00500 = new ThreadRc_Cycle_am_00500B(); - ThreadRc_Cycle_am_00500B A2_Cycle_am_00500 = new ThreadRc_Cycle_am_00500B(); - A1_Cycle_am_00180.start(); - A2_Cycle_am_00180.start(); - A1_Cycle_am_00190.start(); - A2_Cycle_am_00190.start(); - A1_Cycle_am_00200.start(); - A2_Cycle_am_00200.start(); - A1_Cycle_am_00210.start(); - A2_Cycle_am_00210.start(); - A1_Cycle_am_00220.start(); - A2_Cycle_am_00220.start(); - A1_Cycle_am_00230.start(); - A2_Cycle_am_00230.start(); - A1_Cycle_am_00240.start(); - A2_Cycle_am_00240.start(); - A1_Cycle_am_00250.start(); - A2_Cycle_am_00250.start(); - A1_Cycle_am_00260.start(); - A2_Cycle_am_00260.start(); - A1_Cycle_am_00270.start(); - A2_Cycle_am_00270.start(); - A1_Cycle_am_00280.start(); - A2_Cycle_am_00280.start(); - A1_Cycle_am_00290.start(); - A2_Cycle_am_00290.start(); - A1_Cycle_am_00300.start(); - A2_Cycle_am_00300.start(); - A1_Cycle_am_00310.start(); - A2_Cycle_am_00310.start(); - A1_Cycle_am_00320.start(); - A2_Cycle_am_00320.start(); - A1_Cycle_am_00330.start(); - A2_Cycle_am_00330.start(); - A1_Cycle_am_00340.start(); - A2_Cycle_am_00340.start(); - A1_Cycle_am_00350.start(); - A2_Cycle_am_00350.start(); - A1_Cycle_am_00360.start(); - A2_Cycle_am_00360.start(); - A1_Cycle_am_00370.start(); - A2_Cycle_am_00370.start(); - A1_Cycle_am_00380.start(); - A2_Cycle_am_00380.start(); - A1_Cycle_am_00390.start(); - A2_Cycle_am_00390.start(); - A1_Cycle_am_00400.start(); - A2_Cycle_am_00400.start(); - A1_Cycle_am_00410.start(); - A2_Cycle_am_00410.start(); - A1_Cycle_am_00420.start(); - A2_Cycle_am_00420.start(); - A1_Cycle_am_00430.start(); - A2_Cycle_am_00430.start(); - A1_Cycle_am_00440.start(); - A2_Cycle_am_00440.start(); - A1_Cycle_am_00450.start(); - A2_Cycle_am_00450.start(); - A1_Cycle_am_00460.start(); - A2_Cycle_am_00460.start(); - A1_Cycle_am_00470.start(); - A2_Cycle_am_00470.start(); - A1_Cycle_am_00480.start(); - A2_Cycle_am_00480.start(); - A1_Cycle_am_00490.start(); - A2_Cycle_am_00490.start(); - A1_Cycle_am_00500.start(); - A2_Cycle_am_00500.start(); - try { - A1_Cycle_am_00180.join(); - A2_Cycle_am_00180.join(); - A1_Cycle_am_00190.join(); - A2_Cycle_am_00190.join(); - A1_Cycle_am_00200.join(); - A2_Cycle_am_00200.join(); - A1_Cycle_am_00210.join(); - A2_Cycle_am_00210.join(); - A1_Cycle_am_00220.join(); - A2_Cycle_am_00220.join(); - A1_Cycle_am_00230.join(); - A2_Cycle_am_00230.join(); - A1_Cycle_am_00240.join(); - A2_Cycle_am_00240.join(); - A1_Cycle_am_00250.join(); - A2_Cycle_am_00250.join(); - A1_Cycle_am_00260.join(); - A2_Cycle_am_00260.join(); - A1_Cycle_am_00270.join(); - A2_Cycle_am_00270.join(); - A1_Cycle_am_00280.join(); - A2_Cycle_am_00280.join(); - A1_Cycle_am_00290.join(); - A2_Cycle_am_00290.join(); - A1_Cycle_am_00300.join(); - A2_Cycle_am_00300.join(); - A1_Cycle_am_00310.join(); - A2_Cycle_am_00310.join(); - A1_Cycle_am_00320.join(); - A2_Cycle_am_00320.join(); - A1_Cycle_am_00330.join(); - A2_Cycle_am_00330.join(); - A1_Cycle_am_00340.join(); - A2_Cycle_am_00340.join(); - A1_Cycle_am_00350.join(); - A2_Cycle_am_00350.join(); - A1_Cycle_am_00360.join(); - A2_Cycle_am_00360.join(); - A1_Cycle_am_00370.join(); - A2_Cycle_am_00370.join(); - A1_Cycle_am_00380.join(); - A2_Cycle_am_00380.join(); - A1_Cycle_am_00390.join(); - A2_Cycle_am_00390.join(); - A1_Cycle_am_00400.join(); - A2_Cycle_am_00400.join(); - A1_Cycle_am_00410.join(); - A2_Cycle_am_00410.join(); - A1_Cycle_am_00420.join(); - A2_Cycle_am_00420.join(); - A1_Cycle_am_00430.join(); - A2_Cycle_am_00430.join(); - A1_Cycle_am_00440.join(); - A2_Cycle_am_00440.join(); - A1_Cycle_am_00450.join(); - A2_Cycle_am_00450.join(); - A1_Cycle_am_00460.join(); - A2_Cycle_am_00460.join(); - A1_Cycle_am_00470.join(); - A2_Cycle_am_00470.join(); - A1_Cycle_am_00480.join(); - A2_Cycle_am_00480.join(); - A1_Cycle_am_00490.join(); - A2_Cycle_am_00490.join(); - A1_Cycle_am_00500.join(); - A2_Cycle_am_00500.join(); - } catch (InterruptedException e) { - } - if (A1_Cycle_am_00180.check() && A2_Cycle_am_00180.check() && A1_Cycle_am_00190.check() && A2_Cycle_am_00190.check() && A1_Cycle_am_00200.check() && A2_Cycle_am_00200.check() && A1_Cycle_am_00210.check() && A2_Cycle_am_00210.check() && A1_Cycle_am_00220.check() && A2_Cycle_am_00220.check() && A1_Cycle_am_00230.check() && A2_Cycle_am_00230.check() && A1_Cycle_am_00240.check() && A2_Cycle_am_00240.check() && A1_Cycle_am_00250.check() && A2_Cycle_am_00250.check() && A1_Cycle_am_00260.check() && A2_Cycle_am_00260.check() && A1_Cycle_am_00270.check() && A2_Cycle_am_00270.check() && A1_Cycle_am_00280.check() && A2_Cycle_am_00280.check() && A1_Cycle_am_00290.check() && A2_Cycle_am_00290.check() && A1_Cycle_am_00300.check() && A2_Cycle_am_00300.check() && A1_Cycle_am_00310.check() && A2_Cycle_am_00310.check() && A1_Cycle_am_00320.check() && A2_Cycle_am_00320.check() && A1_Cycle_am_00330.check() && A2_Cycle_am_00330.check() && A1_Cycle_am_00340.check() && A2_Cycle_am_00340.check() && A1_Cycle_am_00350.check() && A2_Cycle_am_00350.check() && A1_Cycle_am_00360.check() && A2_Cycle_am_00360.check() && A1_Cycle_am_00370.check() && A2_Cycle_am_00370.check() && A1_Cycle_am_00380.check() && A2_Cycle_am_00380.check() && A1_Cycle_am_00390.check() && A2_Cycle_am_00390.check() && A1_Cycle_am_00400.check() && A2_Cycle_am_00400.check() && A1_Cycle_am_00410.check() && A2_Cycle_am_00410.check() && A1_Cycle_am_00420.check() && A2_Cycle_am_00420.check() && A1_Cycle_am_00430.check() && A2_Cycle_am_00430.check() && A1_Cycle_am_00440.check() && A2_Cycle_am_00440.check() && A1_Cycle_am_00450.check() && A2_Cycle_am_00450.check() && A1_Cycle_am_00460.check() && A2_Cycle_am_00460.check() && A1_Cycle_am_00470.check() && A2_Cycle_am_00470.check() && A1_Cycle_am_00480.check() && A2_Cycle_am_00480.check() && A1_Cycle_am_00490.check() && A2_Cycle_am_00490.check() && A1_Cycle_am_00500.check() && A2_Cycle_am_00500.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_00510.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:make all Cycle_a_xx together to this Multi thread testcase for Performance Testing. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_00510.java + *- @ExecuteClass: Cycle_am_00510 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_am_00180B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00180_A1 a1_main = new Cycle_a_00180_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00180_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00180_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00180_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00180_A5("a5_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00180_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; + a1_main.a8_0 = new Cycle_a_00180_A8("a8_0"); + a1_main.a8_0.a9_0 = new Cycle_a_00180_A9("a9_0"); + a1_main.a8_0.a9_0.a7_0 = new Cycle_a_00180_A7("a7_0"); + a1_main.a8_0.a9_0.a7_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a1_main.a8_0.add(); + a1_main.a8_0.a9_0.add(); + a1_main.a8_0.a9_0.a7_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_main.a8_0.sum + a1_main.a8_0.a9_0.sum + a1_main.a8_0.a9_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1994) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00180_A1 { + Cycle_a_00180_A2 a2_0; + Cycle_a_00180_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A1(String strObjectName) { + a2_0 = null; + a8_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a8_0.a; + } + } + + class Cycle_a_00180_A2 { + Cycle_a_00180_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00180_A3 { + Cycle_a_00180_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00180_A4 { + Cycle_a_00180_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00180_A5 { + Cycle_a_00180_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00180_A6 { + Cycle_a_00180_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A6(String strObjectName) { + a1_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00180_A7 { + Cycle_a_00180_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A7(String strObjectName) { + a4_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00180_A8 { + Cycle_a_00180_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A8(String strObjectName) { + a9_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_00180_A9 { + Cycle_a_00180_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00180_A9(String strObjectName) { + a7_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + +class ThreadRc_Cycle_am_00190B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00190_A1 a1_main = new Cycle_a_00190_A1("a1_main"); + Cycle_a_00190_A10 a10_main = new Cycle_a_00190_A10("a10_main"); + a1_main.a2_0 = new Cycle_a_00190_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00190_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00190_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = new Cycle_a_00190_A5("a5_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_a_00190_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_main; + + a10_main.a8_0 = new Cycle_a_00190_A8("a8_0"); + a10_main.a8_0.a9_0 = new Cycle_a_00190_A9("a9_0"); + a10_main.a8_0.a9_0.a7_0 = new Cycle_a_00190_A7("a7_0"); + a10_main.a8_0.a9_0.a7_0.a5_0 = a1_main.a2_0.a3_0.a4_0.a5_0; + + a1_main.add(); + a10_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.add(); + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a10_main.a8_0.add(); + a10_main.a8_0.a9_0.add(); + a10_main.a8_0.a9_0.a7_0.add(); + + + int result = a1_main.sum + a10_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.sum + a1_main.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_main.a8_0.sum + a10_main.a8_0.a9_0.sum + a10_main.a8_0.a9_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2215) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00190_A1 { + Cycle_a_00190_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00190_A2 { + Cycle_a_00190_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00190_A3 { + Cycle_a_00190_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00190_A4 { + Cycle_a_00190_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00190_A5 { + Cycle_a_00190_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00190_A6 { + Cycle_a_00190_A1 a1_0; + Cycle_a_00190_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A6(String strObjectName) { + a1_0 = null; + a10_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a10_0.a; + } + } + + class Cycle_a_00190_A7 { + Cycle_a_00190_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A7(String strObjectName) { + a5_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00190_A8 { + Cycle_a_00190_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A8(String strObjectName) { + a9_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_00190_A9 { + Cycle_a_00190_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A9(String strObjectName) { + a7_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00190_A10 { + Cycle_a_00190_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00190_A10(String strObjectName) { + a8_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } + } +} + +class ThreadRc_Cycle_am_00200B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00200_A1 a1_main = new Cycle_a_00200_A1("a1_main"); + Cycle_a_00200_A4 a4_main = new Cycle_a_00200_A4("a4_main"); + a1_main.a2_0 = new Cycle_a_00200_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00200_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00200_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a6_0 = new Cycle_a_00200_A6("a6_0"); + a1_main.a2_0.a6_0.a7_0 = new Cycle_a_00200_A7("a7_0"); + a1_main.a2_0.a7_0 = a1_main.a2_0.a6_0.a7_0; + + a1_main.add(); + a4_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a6_0.add(); + a1_main.a2_0.a6_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a6_0.sum + a1_main.a2_0.a6_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1773) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00200_A1 { + Cycle_a_00200_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00200_A2 { + Cycle_a_00200_A3 a3_0; + Cycle_a_00200_A6 a6_0; + Cycle_a_00200_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A2(String strObjectName) { + a3_0 = null; + a6_0 = null; + a7_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a6_0.a + a7_0.a; + } + } + + class Cycle_a_00200_A3 { + Cycle_a_00200_A1 a1_0; + Cycle_a_00200_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00200_A4 { + Cycle_a_00200_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00200_A5 { + Cycle_a_00200_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A5(String strObjectName) { + a4_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00200_A6 { + Cycle_a_00200_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00200_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00200_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_Cycle_am_00210B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00210_A1 a1_main = new Cycle_a_00210_A1("a1_main"); + Cycle_a_00210_A4 a4_main = new Cycle_a_00210_A4("a4_main"); + a1_main.a2_0 = new Cycle_a_00210_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00210_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00210_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00210_A6("a6_0"); + a1_main.a2_0.a3_0.a6_0.a7_0 = new Cycle_a_00210_A7("a7_0"); + a1_main.a2_0.a3_0.a6_0.a7_0.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a4_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a6_0.add(); + a1_main.a2_0.a3_0.a6_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a1_main.a2_0.a3_0.a6_0.sum + a1_main.a2_0.a3_0.a6_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1662) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00210_A1 { + Cycle_a_00210_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00210_A2 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00210_A3 { + Cycle_a_00210_A1 a1_0; + Cycle_a_00210_A5 a5_0; + Cycle_a_00210_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a6_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a6_0.a; + } + } + + class Cycle_a_00210_A4 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00210_A5 { + Cycle_a_00210_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A5(String strObjectName) { + a4_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00210_A6 { + Cycle_a_00210_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00210_A7 { + Cycle_a_00210_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00210_A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_am_00220B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00220_A1 a1_main = new Cycle_a_00220_A1("a1_main"); + Cycle_a_00220_A4 a4_main = new Cycle_a_00220_A4("a4_main"); + Cycle_a_00220_A6 a6_main = new Cycle_a_00220_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00220_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00220_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00220_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_00220_A7("a7_0"); + a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; + a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1772) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00220_A1 { + Cycle_a_00220_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00220_A2 { + Cycle_a_00220_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00220_A3 { + Cycle_a_00220_A1 a1_0; + Cycle_a_00220_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00220_A4 { + Cycle_a_00220_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00220_A5 { + Cycle_a_00220_A4 a4_0; + Cycle_a_00220_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A5(String strObjectName) { + a4_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a + a7_0.a; + } + } + + class Cycle_a_00220_A6 { + Cycle_a_00220_A5 a5_0; + Cycle_a_00220_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A6(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a7_0.a; + } + } + + class Cycle_a_00220_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00220_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_Cycle_am_00230B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00230_A1 a1_main = new Cycle_a_00230_A1("a1_main"); + Cycle_a_00230_A5 a5_main = new Cycle_a_00230_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00230_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00230_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00230_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a7_0 = new Cycle_a_00230_A7("a7_0"); + a5_main.a6_0 = new Cycle_a_00230_A6("a6_0"); + a5_main.a6_0.a7_0 = a5_main.a7_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a5_main.a7_0.add(); + a5_main.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a5_main.a6_0.sum + a5_main.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1773) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00230_A1 { + Cycle_a_00230_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00230_A2 { + Cycle_a_00230_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00230_A3 { + Cycle_a_00230_A1 a1_0; + Cycle_a_00230_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } + } + + class Cycle_a_00230_A4 { + Cycle_a_00230_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00230_A5 { + Cycle_a_00230_A3 a3_0; + Cycle_a_00230_A6 a6_0; + Cycle_a_00230_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A5(String strObjectName) { + a3_0 = null; + a6_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a6_0.a + a7_0.a; + } + } + + class Cycle_a_00230_A6 { + Cycle_a_00230_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00230_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_00230_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_Cycle_am_00240B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00240_A1 a1_main = new Cycle_a_00240_A1("a1_main"); + Cycle_a_00240_A5 a5_main = new Cycle_a_00240_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00240_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00240_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00240_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a1_main.a6_0 = new Cycle_a_00240_A6("a6_0"); + a1_main.a6_0.a7_0 = new Cycle_a_00240_A7("a7_0"); + a1_main.a6_0.a7_0.a1_0 = a1_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a6_0.add(); + a1_main.a6_0.a7_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a6_0.sum + a1_main.a6_0.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1660) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00240_A1 { + Cycle_a_00240_A2 a2_0; + Cycle_a_00240_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A1(String strObjectName) { + a2_0 = null; + a6_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a6_0.a; + } + } + + class Cycle_a_00240_A2 { + Cycle_a_00240_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00240_A3 { + Cycle_a_00240_A1 a1_0; + Cycle_a_00240_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } + } + + class Cycle_a_00240_A4 { + Cycle_a_00240_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00240_A5 { + Cycle_a_00240_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00240_A6 { + Cycle_a_00240_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A6(String strObjectName) { + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00240_A7 { + Cycle_a_00240_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00240_A7(String strObjectName) { + a1_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_am_00250B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00250_A1 a1_main = new Cycle_a_00250_A1("a1_main"); + Cycle_a_00250_A6 a6_main = new Cycle_a_00250_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00250_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00250_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00250_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1238) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00250_A1 { + Cycle_a_00250_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00250_A2 { + Cycle_a_00250_A1 a1_0; + Cycle_a_00250_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00250_A3 { + Cycle_a_00250_A1 a1_0; + Cycle_a_00250_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00250_A5 { + Cycle_a_00250_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00250_A6 { + Cycle_a_00250_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00250_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_am_00260B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00260_A1 a1_main = new Cycle_a_00260_A1("a1_main"); + Cycle_a_00260_A6 a6_main = new Cycle_a_00260_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00260_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00260_A3("a3_0"); + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00260_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1239) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00260_A1 { + Cycle_a_00260_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00260_A2 { + Cycle_a_00260_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00260_A3 { + Cycle_a_00260_A1 a1_0; + Cycle_a_00260_A2 a2_0; + Cycle_a_00260_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a + a5_0.a; + } + } + + class Cycle_a_00260_A5 { + Cycle_a_00260_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00260_A6 { + Cycle_a_00260_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00260_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_am_00270B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00270_A1 a1_main = new Cycle_a_00270_A1("a1_main"); + Cycle_a_00270_A6 a6_main = new Cycle_a_00270_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00270_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00270_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00270_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1240) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00270_A1 { + Cycle_a_00270_A2 a2_0; + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00270_A2 { + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00270_A3 { + Cycle_a_00270_A1 a1_0; + Cycle_a_00270_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00270_A5 { + Cycle_a_00270_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00270_A6 { + Cycle_a_00270_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00270_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_am_00280B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00280_A1 a1_main = new Cycle_a_00280_A1("a1_main"); + Cycle_a_00280_A6 a6_main = new Cycle_a_00280_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00280_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00280_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00280_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a3_0 = a1_main.a2_0.a3_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1443) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00280_A1 { + Cycle_a_00280_A2 a2_0; + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00280_A2 { + Cycle_a_00280_A1 a1_0; + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00280_A3 { + Cycle_a_00280_A1 a1_0; + Cycle_a_00280_A2 a2_0; + Cycle_a_00280_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a + a5_0.a; + } + } + + class Cycle_a_00280_A5 { + Cycle_a_00280_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00280_A6 { + Cycle_a_00280_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00280_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_am_00290B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00290_A1 a1_main = new Cycle_a_00290_A1("a1_main"); + Cycle_a_00290_A5 a5_main = new Cycle_a_00290_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00290_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00290_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00290_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a6_0 = new Cycle_a_00290_A6("a6_0"); + a1_main.a2_0.a3_0.a6_0.a2_0 = a1_main.a2_0; + a5_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1447) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00290_A1 { + Cycle_a_00290_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00290_A2 { + Cycle_a_00290_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00290_A3 { + Cycle_a_00290_A1 a1_0; + Cycle_a_00290_A4 a4_0; + Cycle_a_00290_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a6_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a + a6_0.a; + } + } + + class Cycle_a_00290_A4 { + Cycle_a_00290_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00290_A5 { + Cycle_a_00290_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00290_A6 { + Cycle_a_00290_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00290_A6(String strObjectName) { + a2_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_am_00300B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00300_A1 a1_main = new Cycle_a_00300_A1("a1_main"); + Cycle_a_00300_A5 a5_main = new Cycle_a_00300_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00300_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00300_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00300_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0.a6_0 = new Cycle_a_00300_A6("a6_0"); + a5_main.a3_0.a4_0.a6_0.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0.a5_0 = a5_main; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1448) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00300_A1 { + Cycle_a_00300_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00300_A2 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00300_A3 { + Cycle_a_00300_A1 a1_0; + Cycle_a_00300_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A3(String strObjectName) { + a1_0 = null; + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } + } + + class Cycle_a_00300_A4 { + Cycle_a_00300_A5 a5_0; + Cycle_a_00300_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A4(String strObjectName) { + a5_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a6_0.a; + } + } + + class Cycle_a_00300_A5 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00300_A6 { + Cycle_a_00300_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00300_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_am_00310B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00310_A1 a1_main = new Cycle_a_00310_A1("a1_main"); + Cycle_a_00310_A4 a4_main = new Cycle_a_00310_A4("a4_main"); + Cycle_a_00310_A6 a6_main = new Cycle_a_00310_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00310_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00310_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00310_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a4_0 = a4_main; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a6_main.a3_0.a5_0 = a1_main.a2_0.a3_0.a5_0; + a4_main.a6_0 = a6_main; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1552) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00310_A1 { + Cycle_a_00310_A2 a2_0; + Cycle_a_00310_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } + } + + class Cycle_a_00310_A2 { + Cycle_a_00310_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00310_A3 { + Cycle_a_00310_A1 a1_0; + Cycle_a_00310_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00310_A4 { + Cycle_a_00310_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A4(String strObjectName) { + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00310_A5 { + Cycle_a_00310_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00310_A6 { + Cycle_a_00310_A1 a1_0; + Cycle_a_00310_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00310_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_am_00320B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00320_A1 a1_main = new Cycle_a_00320_A1("a1_main"); + Cycle_a_00320_A4 a4_main = new Cycle_a_00320_A4("a4_main"); + Cycle_a_00320_A6 a6_main = new Cycle_a_00320_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00320_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00320_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00320_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a4_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + a6_main.a4_0 = a4_main; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1551) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00320_A1 { + Cycle_a_00320_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00320_A2 { + Cycle_a_00320_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00320_A3 { + Cycle_a_00320_A1 a1_0; + Cycle_a_00320_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00320_A4 { + Cycle_a_00320_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00320_A5 { + Cycle_a_00320_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00320_A6 { + Cycle_a_00320_A1 a1_0; + Cycle_a_00320_A3 a3_0; + Cycle_a_00320_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00320_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_am_00330B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00330_A1 a1_main = new Cycle_a_00330_A1("a1_main"); + Cycle_a_00330_A4 a4_main = new Cycle_a_00330_A4("a4_main"); + Cycle_a_00330_A6 a6_main = new Cycle_a_00330_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00330_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00330_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00330_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00330_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00330_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_main.a2_0.a3_0; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2080) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00330_A1 { + Cycle_a_00330_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00330_A2 { + Cycle_a_00330_A3 a3_0; + Cycle_a_00330_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00330_A3 { + Cycle_a_00330_A1 a1_0; + Cycle_a_00330_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00330_A4 { + Cycle_a_00330_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00330_A5 { + Cycle_a_00330_A6 a6_0; + Cycle_a_00330_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00330_A6 { + Cycle_a_00330_A1 a1_0; + Cycle_a_00330_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00330_A7 { + Cycle_a_00330_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00330_A8 { + Cycle_a_00330_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00330_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + +class ThreadRc_Cycle_am_00340B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00340_A1 a1_main = new Cycle_a_00340_A1("a1_main"); + Cycle_a_00340_A4 a4_main = new Cycle_a_00340_A4("a4_main"); + Cycle_a_00340_A6 a6_main = new Cycle_a_00340_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00340_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00340_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00340_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a1_main.a2_0.a3_0.a8_0 = new Cycle_a_00340_A8("a8_0"); + a1_main.a2_0.a3_0.a8_0.a7_0 = new Cycle_a_00340_A7("a7_0"); + a1_main.a2_0.a3_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a6_main.a1_0 = a1_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a8_0.add(); + a1_main.a2_0.a3_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a8_0.a7_0.sum + a6_main.a3_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2079) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00340_A1 { + Cycle_a_00340_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00340_A2 { + Cycle_a_00340_A3 a3_0; + Cycle_a_00340_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00340_A3 { + Cycle_a_00340_A1 a1_0; + Cycle_a_00340_A5 a5_0; + Cycle_a_00340_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a8_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a8_0.a; + } + } + + class Cycle_a_00340_A4 { + Cycle_a_00340_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00340_A5 { + Cycle_a_00340_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00340_A6 { + Cycle_a_00340_A1 a1_0; + Cycle_a_00340_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00340_A7 { + Cycle_a_00340_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00340_A8 { + Cycle_a_00340_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00340_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + +class ThreadRc_Cycle_am_00350B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00350_A1 a1_main = new Cycle_a_00350_A1("a1_main"); + Cycle_a_00350_A4 a4_main = new Cycle_a_00350_A4("a4_main"); + Cycle_a_00350_A6 a6_main = new Cycle_a_00350_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_00350_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00350_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00350_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00350_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00350_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2079) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00350_A1 { + Cycle_a_00350_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00350_A2 { + Cycle_a_00350_A3 a3_0; + Cycle_a_00350_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00350_A3 { + Cycle_a_00350_A1 a1_0; + Cycle_a_00350_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00350_A4 { + Cycle_a_00350_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00350_A5 { + Cycle_a_00350_A6 a6_0; + Cycle_a_00350_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00350_A6 { + Cycle_a_00350_A1 a1_0; + Cycle_a_00350_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00350_A7 { + Cycle_a_00350_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00350_A8 { + Cycle_a_00350_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00350_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + +class ThreadRc_Cycle_am_00360B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00360_A1 a1_main = new Cycle_a_00360_A1("a1_main"); + Cycle_a_00360_A4 a4_main = new Cycle_a_00360_A4("a4_main"); + Cycle_a_00360_A6 a6_main = new Cycle_a_00360_A6("a6_main"); + Cycle_a_00360_A9 a9_main = new Cycle_a_00360_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_00360_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00360_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00360_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00360_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00360_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a5_0.a9_0 = a9_main; + a9_main.a2_0 = a1_main.a2_0; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2399) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00360_A1 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00360_A2 { + Cycle_a_00360_A3 a3_0; + Cycle_a_00360_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00360_A3 { + Cycle_a_00360_A1 a1_0; + Cycle_a_00360_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00360_A4 { + Cycle_a_00360_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00360_A5 { + Cycle_a_00360_A6 a6_0; + Cycle_a_00360_A8 a8_0; + Cycle_a_00360_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a9_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a + a9_0.a; + } + } + + class Cycle_a_00360_A6 { + Cycle_a_00360_A1 a1_0; + Cycle_a_00360_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00360_A7 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00360_A8 { + Cycle_a_00360_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00360_A9 { + Cycle_a_00360_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00360_A9(String strObjectName) { + a2_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_am_00370B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00370_A1 a1_main = new Cycle_a_00370_A1("a1_main"); + Cycle_a_00370_A4 a4_main = new Cycle_a_00370_A4("a4_main"); + Cycle_a_00370_A6 a6_main = new Cycle_a_00370_A6("a6_main"); + Cycle_a_00370_A9 a9_main = new Cycle_a_00370_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_00370_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00370_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00370_A5("a5_0"); + a1_main.a2_0.a3_0.a10_0 = new Cycle_a_00370_A10("a10_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_00370_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_00370_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; + a9_main.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a10_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2623) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00370_A1 { + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00370_A2 { + Cycle_a_00370_A3 a3_0; + Cycle_a_00370_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00370_A3 { + Cycle_a_00370_A1 a1_0; + Cycle_a_00370_A5 a5_0; + Cycle_a_00370_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a10_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a10_0.a; + } + } + + class Cycle_a_00370_A4 { + Cycle_a_00370_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00370_A5 { + Cycle_a_00370_A6 a6_0; + Cycle_a_00370_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00370_A6 { + Cycle_a_00370_A1 a1_0; + Cycle_a_00370_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00370_A7 { + Cycle_a_00370_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00370_A8 { + Cycle_a_00370_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00370_A9 { + Cycle_a_00370_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A9(String strObjectName) { + a6_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00370_A10 { + Cycle_a_00370_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00370_A10(String strObjectName) { + a9_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } +} + +class ThreadRc_Cycle_am_00380B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00380_A1 a1_main = new Cycle_a_00380_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00380_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00380_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a2_0 = a1_main.a2_0; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 815) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00380_A1 { + Cycle_a_00380_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00380_A2 { + Cycle_a_00380_A1 a1_0; + Cycle_a_00380_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00380_A3 { + Cycle_a_00380_A1 a1_0; + Cycle_a_00380_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00380_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_am_00390B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00390_A1 a1_main = new Cycle_a_00390_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00390_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new Cycle_a_00390_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 918) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00390_A1 { + Cycle_a_00390_A2 a2_0; + Cycle_a_00390_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00390_A2 { + Cycle_a_00390_A1 a1_0; + Cycle_a_00390_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00390_A3 { + Cycle_a_00390_A1 a1_0; + Cycle_a_00390_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00390_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_am_00400B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00400_A1 a1_main = new Cycle_a_00400_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00400_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00400_A3("a3_0"); + a1_main.a4_0 = new Cycle_a_00400_A4("a4_0"); + a1_main.a4_0.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 923) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00400_A1 { + Cycle_a_00400_A2 a2_0; + Cycle_a_00400_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } + } + + class Cycle_a_00400_A2 { + Cycle_a_00400_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00400_A3 { + Cycle_a_00400_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00400_A4 { + Cycle_a_00400_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00400_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_am_00410B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00410_A1 a1_main = new Cycle_a_00410_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00410_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00410_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00410_A4("a4_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 921) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00410_A1 { + Cycle_a_00410_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00410_A2 { + Cycle_a_00410_A3 a3_0; + Cycle_a_00410_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00410_A3 { + Cycle_a_00410_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00410_A4 { + Cycle_a_00410_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00410_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_am_00420B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00420_A1 a1_main = new Cycle_a_00420_A1("a1_main"); +// Cycle_a_00420_A4 a4_main = new Cycle_a_00420_A4("a4_main"); + a1_main.a2_0 = new Cycle_a_00420_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00420_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00420_A4("a4_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 923) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00420_A1 { + Cycle_a_00420_A2 a2_0; + Cycle_a_00420_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_a_00420_A2 { + Cycle_a_00420_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00420_A3 { + Cycle_a_00420_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00420_A4 { + Cycle_a_00420_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00420_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_am_00430B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00430_A1 a1_main = new Cycle_a_00430_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00430_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00430_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00430_A4("a4_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a4_0.a1_0 = a1_main; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1124) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00430_A1 { + Cycle_a_00430_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00430_A2 { + Cycle_a_00430_A1 a1_0; + Cycle_a_00430_A3 a3_0; + Cycle_a_00430_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00430_A3 { + Cycle_a_00430_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00430_A4 { + Cycle_a_00430_A1 a1_0; + Cycle_a_00430_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00430_A4(String strObjectName) { + a2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_am_00440B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00440_A1 a1_main = new Cycle_a_00440_A1("a1_main"); + a1_main.a2_0 = new Cycle_a_00440_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00440_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_a_00440_A4("a4_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1023) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00440_A1 { + Cycle_a_00440_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00440_A2 { + Cycle_a_00440_A1 a1_0; + Cycle_a_00440_A3 a3_0; + Cycle_a_00440_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00440_A3 { + Cycle_a_00440_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00440_A4 { + Cycle_a_00440_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00440_A4(String strObjectName) { + a2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_am_00450B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00450_A1 a1_main = new Cycle_a_00450_A1("a1_main"); + Cycle_a_00450_A6 a6_main = new Cycle_a_00450_A6("a6_main"); + Cycle_a_00450_A7 a7_main = new Cycle_a_00450_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00450_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00450_A3("a3_0"); + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_00450_A5("a5_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = a7_main; + a7_main.a2_0 = a1_main.a2_0; + + a1_main.add(); + a6_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + + + int result = a1_main.sum + a6_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1453) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00450_A1 { + Cycle_a_00450_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00450_A2 { + Cycle_a_00450_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00450_A3 { + Cycle_a_00450_A1 a1_0; + Cycle_a_00450_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00450_A5 { + Cycle_a_00450_A6 a6_0; + Cycle_a_00450_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A5(String strObjectName) { + a6_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a7_0.a; + } + } + + class Cycle_a_00450_A6 { + Cycle_a_00450_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A6(String strObjectName) { + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00450_A7 { + Cycle_a_00450_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00450_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_am_00460B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00460_A1 a1_main = new Cycle_a_00460_A1("a1_main"); + Cycle_a_00460_A5 a5_main = new Cycle_a_00460_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00460_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00460_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00460_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00460_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; + + a5_main.a3_0 = a1_main.a2_0.a3_0; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1550) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00460_A1 { + Cycle_a_00460_A2 a2_0; + Cycle_a_00460_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A1(String strObjectName) { + a2_0 = null; + a4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a4_0.a; + } + } + + class Cycle_a_00460_A2 { + Cycle_a_00460_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00460_A3 { + Cycle_a_00460_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00460_A4 { + Cycle_a_00460_A1 a1_0; + Cycle_a_00460_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + class Cycle_a_00460_A5 { + Cycle_a_00460_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00460_A6 { + Cycle_a_00460_A1 a1_0; + Cycle_a_00460_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00460_A6(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } +} + +class ThreadRc_Cycle_am_00470B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00470_A1 a1_main = new Cycle_a_00470_A1("a1_main"); + Cycle_a_00470_A5 a5_main = new Cycle_a_00470_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00470_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00470_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00470_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00470_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a1_0 = a1_main; + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1446) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00470_A1 { + Cycle_a_00470_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00470_A2 { + Cycle_a_00470_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00470_A3 { + Cycle_a_00470_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00470_A4 { + Cycle_a_00470_A1 a1_0; + Cycle_a_00470_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + class Cycle_a_00470_A5 { + Cycle_a_00470_A1 a1_0; + Cycle_a_00470_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A5(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_00470_A6 { + Cycle_a_00470_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00470_A6(String strObjectName) { + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } +} + +class ThreadRc_Cycle_am_00480B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00480_A1 a1_main = new Cycle_a_00480_A1("a1_main"); + Cycle_a_00480_A5 a5_main = new Cycle_a_00480_A5("a5_main"); + a1_main.a2_0 = new Cycle_a_00480_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00480_A3("a3_0"); + a1_main.a2_0.a3_0.a4_0 = new Cycle_a_00480_A4("a4_0"); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a4_0.a6_0 = new Cycle_a_00480_A6("a6_0"); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a1_main.a2_0.a3_0.a4_0.a6_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + a1_main.a2_0.a3_0.a4_0.a6_0.a1_0 = a1_main; + + a5_main.a3_0 = a1_main.a2_0.a3_0; + a5_main.a3_0.a4_0 = a1_main.a2_0.a3_0.a4_0; + + + a1_main.add(); + a5_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a4_0.add(); + a1_main.a2_0.a3_0.a4_0.a1_0.add(); + a1_main.a2_0.a3_0.a4_0.a6_0.add(); +// a1_main.a2_0.a3_0.a4_0.a6_0.a5_0.add(); +// a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.add(); +// a1_main.a2_0.a3_0.a4_0.a6_0.a1_0.add(); + + a5_main.a3_0.add(); + a5_main.a3_0.a4_0.add(); + +// System.out.println("a1_main.sum:"+a1_main.sum); +// System.out.println("a4_main.sum:"+a5_main.sum); +// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); +// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); +// System.out.println("a1_main.a2_0.a3_0.a4_0.sum:"+a1_main.a2_0.a3_0.a4_0.sum); +// System.out.println("a1_main.a2_0.a3_0.a4_0.a6_0.sum:"+a1_main.a2_0.a3_0.a4_0.a6_0.sum); +// System.out.println("a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.sum:"+a1_main.a2_0.a3_0.a4_0.a6_0.a4_0.sum); + + +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a5_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a1_main.a2_0.a3_0.a4_0.sum+a1_main.a2_0.a3_0.a4_0.a6_0.sum); + + int result = a1_main.sum + a5_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a4_0.sum + a1_main.a2_0.a3_0.a4_0.a6_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1550) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00480_A1 { + Cycle_a_00480_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00480_A2 { + Cycle_a_00480_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00480_A3 { + Cycle_a_00480_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A3(String strObjectName) { + a4_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00480_A4 { + Cycle_a_00480_A1 a1_0; + Cycle_a_00480_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A4(String strObjectName) { + a1_0 = null; + a6_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + class Cycle_a_00480_A5 { + Cycle_a_00480_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A5(String strObjectName) { + a3_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00480_A6 { + Cycle_a_00480_A1 a1_0; + Cycle_a_00480_A4 a4_0; + Cycle_a_00480_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00480_A6(String strObjectName) { + a1_0 = null; + a4_0 = null; + a5_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a4_0.a + a5_0.a; + } + } +} + +class ThreadRc_Cycle_am_00490B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00490_A1 a1_main = new Cycle_a_00490_A1("a1_main"); + Cycle_a_00490_A4 a4_main = new Cycle_a_00490_A4("a4_main"); + Cycle_a_00490_A7 a7_main = new Cycle_a_00490_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00490_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00490_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a4_main.a5_0 = new Cycle_a_00490_A5("a5_0"); + a4_main.a5_0.a6_0 = new Cycle_a_00490_A6("a6_0"); + a4_main.a5_0.a6_0.a4_0 = a4_main; +// a4_main.a5_0.a6_0.a3_0 = new Cycle_a_00490_A3("a3_0"); + a4_main.a5_0.a6_0.a3_0 = a1_main.a2_0.a3_0; + a4_main.a5_0.a6_0.a3_0.a1_0 = a1_main; + + a7_main.a9_0 = new Cycle_a_00490_A9("a9_0"); + a7_main.a9_0.a8_0 = new Cycle_a_00490_A8("a8_0"); + a7_main.a9_0.a8_0.a7_0 = a7_main; + a7_main.a9_0.a8_0.a5_0 = a4_main.a5_0; + + a1_main.add(); + a4_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a1_0.add(); + a4_main.a5_0.add(); + a4_main.a5_0.a6_0.add(); + a4_main.a5_0.a6_0.a4_0.add(); + a4_main.a5_0.a6_0.a3_0.add(); + a4_main.a5_0.a6_0.a3_0.a1_0.add(); + + a7_main.a9_0.add(); + a7_main.a9_0.a8_0.add(); + a7_main.a9_0.a8_0.a7_0.add(); + a7_main.a9_0.a8_0.a5_0.add(); +// +// System.out.println("a1_main.sum:"+a1_main.sum); +// System.out.println("a4_main.sum:"+a4_main.sum); +// System.out.println("a7_main.sum:"+a7_main.sum); +// System.out.println("a1_main.a2_0.sum:"+a1_main.a2_0.sum); +// System.out.println("a1_main.a2_0.a3_0.sum:"+a1_main.a2_0.a3_0.sum); +// System.out.println("a4_main.a5_0.sum:"+a4_main.a5_0.sum); +// System.out.println("a4_main.a5_0.a6_0.sum:"+a4_main.a5_0.a6_0.sum); +// System.out.println("a7_main.a9_0.sum:"+a7_main.a9_0.sum); +// System.out.println("a7_main.a9_0.a8_0.sum:"+a7_main.a9_0.a8_0.sum); + + +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a4_main.sum+a7_main.sum+a1_main.a2_0.sum+a1_main.a2_0.a3_0.sum+a4_main.a5_0.sum+a4_main.a5_0.a6_0.sum+a7_main.a9_0.sum+a7_main.a9_0.a8_0.sum); + + int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2098) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00490_A1 { + Cycle_a_00490_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00490_A2 { + Cycle_a_00490_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00490_A3 { + Cycle_a_00490_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00490_A4 { + Cycle_a_00490_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_a_00490_A5 { + Cycle_a_00490_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_00490_A6 { + Cycle_a_00490_A3 a3_0; + Cycle_a_00490_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A6(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_00490_A7 { + Cycle_a_00490_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A7(String strObjectName) { + a9_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_00490_A8 { + Cycle_a_00490_A5 a5_0; + Cycle_a_00490_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A8(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a + a5_0.a; + } + } + + class Cycle_a_00490_A9 { + Cycle_a_00490_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00490_A9(String strObjectName) { + a8_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } + } +} + +class ThreadRc_Cycle_am_00500B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_00500_A1 a1_main = new Cycle_a_00500_A1("a1_main"); + Cycle_a_00500_A4 a4_main = new Cycle_a_00500_A4("a4_main"); + Cycle_a_00500_A7 a7_main = new Cycle_a_00500_A7("a7_main"); + a1_main.a2_0 = new Cycle_a_00500_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_00500_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + + a4_main.a1_0 = a1_main; + a4_main.a5_0 = new Cycle_a_00500_A5("a5_0"); + a4_main.a5_0.a6_0 = new Cycle_a_00500_A6("a6_0"); + a4_main.a5_0.a6_0.a4_0 = a4_main; + + a4_main.a5_0.a8_0 = new Cycle_a_00500_A8("a8_0"); + a4_main.a5_0.a8_0.a7_0 = a7_main; + + a7_main.a9_0 = new Cycle_a_00500_A9("a9_0"); + a7_main.a9_0.a8_0 = new Cycle_a_00500_A8("a8_0"); + a7_main.a9_0.a8_0.a7_0 = a7_main; + + a1_main.add(); + a4_main.add(); + a7_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a1_0.add(); + a4_main.a1_0.add(); + a4_main.a5_0.add(); + a4_main.a5_0.a6_0.add(); + a4_main.a5_0.a6_0.a4_0.add(); + a4_main.a5_0.a8_0.add(); + a4_main.a5_0.a8_0.a7_0.add(); + a7_main.a9_0.add(); + a7_main.a9_0.a8_0.add(); + a7_main.a9_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a7_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a4_main.a5_0.sum + a4_main.a5_0.a6_0.sum + a7_main.a9_0.sum + a7_main.a9_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2099) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_00500_A1 { + Cycle_a_00500_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_00500_A2 { + Cycle_a_00500_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_00500_A3 { + Cycle_a_00500_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_00500_A4 { + Cycle_a_00500_A1 a1_0; + Cycle_a_00500_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A4(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_00500_A5 { + Cycle_a_00500_A6 a6_0; + Cycle_a_00500_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_00500_A6 { + Cycle_a_00500_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A6(String strObjectName) { + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_a_00500_A7 { + Cycle_a_00500_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A7(String strObjectName) { + a9_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_00500_A8 { + Cycle_a_00500_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_00500_A9 { + Cycle_a_00500_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_00500_A9(String strObjectName) { + a8_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a8_0.a; + } + } +} + +public class Cycle_am_00510 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_00180B A1_Cycle_am_00180 = new ThreadRc_Cycle_am_00180B(); + ThreadRc_Cycle_am_00180B A2_Cycle_am_00180 = new ThreadRc_Cycle_am_00180B(); + ThreadRc_Cycle_am_00190B A1_Cycle_am_00190 = new ThreadRc_Cycle_am_00190B(); + ThreadRc_Cycle_am_00190B A2_Cycle_am_00190 = new ThreadRc_Cycle_am_00190B(); + ThreadRc_Cycle_am_00200B A1_Cycle_am_00200 = new ThreadRc_Cycle_am_00200B(); + ThreadRc_Cycle_am_00200B A2_Cycle_am_00200 = new ThreadRc_Cycle_am_00200B(); + ThreadRc_Cycle_am_00210B A1_Cycle_am_00210 = new ThreadRc_Cycle_am_00210B(); + ThreadRc_Cycle_am_00210B A2_Cycle_am_00210 = new ThreadRc_Cycle_am_00210B(); + ThreadRc_Cycle_am_00220B A1_Cycle_am_00220 = new ThreadRc_Cycle_am_00220B(); + ThreadRc_Cycle_am_00220B A2_Cycle_am_00220 = new ThreadRc_Cycle_am_00220B(); + ThreadRc_Cycle_am_00230B A1_Cycle_am_00230 = new ThreadRc_Cycle_am_00230B(); + ThreadRc_Cycle_am_00230B A2_Cycle_am_00230 = new ThreadRc_Cycle_am_00230B(); + ThreadRc_Cycle_am_00240B A1_Cycle_am_00240 = new ThreadRc_Cycle_am_00240B(); + ThreadRc_Cycle_am_00240B A2_Cycle_am_00240 = new ThreadRc_Cycle_am_00240B(); + ThreadRc_Cycle_am_00250B A1_Cycle_am_00250 = new ThreadRc_Cycle_am_00250B(); + ThreadRc_Cycle_am_00250B A2_Cycle_am_00250 = new ThreadRc_Cycle_am_00250B(); + ThreadRc_Cycle_am_00260B A1_Cycle_am_00260 = new ThreadRc_Cycle_am_00260B(); + ThreadRc_Cycle_am_00260B A2_Cycle_am_00260 = new ThreadRc_Cycle_am_00260B(); + ThreadRc_Cycle_am_00270B A1_Cycle_am_00270 = new ThreadRc_Cycle_am_00270B(); + ThreadRc_Cycle_am_00270B A2_Cycle_am_00270 = new ThreadRc_Cycle_am_00270B(); + ThreadRc_Cycle_am_00280B A1_Cycle_am_00280 = new ThreadRc_Cycle_am_00280B(); + ThreadRc_Cycle_am_00280B A2_Cycle_am_00280 = new ThreadRc_Cycle_am_00280B(); + ThreadRc_Cycle_am_00290B A1_Cycle_am_00290 = new ThreadRc_Cycle_am_00290B(); + ThreadRc_Cycle_am_00290B A2_Cycle_am_00290 = new ThreadRc_Cycle_am_00290B(); + ThreadRc_Cycle_am_00300B A1_Cycle_am_00300 = new ThreadRc_Cycle_am_00300B(); + ThreadRc_Cycle_am_00300B A2_Cycle_am_00300 = new ThreadRc_Cycle_am_00300B(); + ThreadRc_Cycle_am_00310B A1_Cycle_am_00310 = new ThreadRc_Cycle_am_00310B(); + ThreadRc_Cycle_am_00310B A2_Cycle_am_00310 = new ThreadRc_Cycle_am_00310B(); + ThreadRc_Cycle_am_00320B A1_Cycle_am_00320 = new ThreadRc_Cycle_am_00320B(); + ThreadRc_Cycle_am_00320B A2_Cycle_am_00320 = new ThreadRc_Cycle_am_00320B(); + ThreadRc_Cycle_am_00330B A1_Cycle_am_00330 = new ThreadRc_Cycle_am_00330B(); + ThreadRc_Cycle_am_00330B A2_Cycle_am_00330 = new ThreadRc_Cycle_am_00330B(); + ThreadRc_Cycle_am_00340B A1_Cycle_am_00340 = new ThreadRc_Cycle_am_00340B(); + ThreadRc_Cycle_am_00340B A2_Cycle_am_00340 = new ThreadRc_Cycle_am_00340B(); + ThreadRc_Cycle_am_00350B A1_Cycle_am_00350 = new ThreadRc_Cycle_am_00350B(); + ThreadRc_Cycle_am_00350B A2_Cycle_am_00350 = new ThreadRc_Cycle_am_00350B(); + ThreadRc_Cycle_am_00360B A1_Cycle_am_00360 = new ThreadRc_Cycle_am_00360B(); + ThreadRc_Cycle_am_00360B A2_Cycle_am_00360 = new ThreadRc_Cycle_am_00360B(); + ThreadRc_Cycle_am_00370B A1_Cycle_am_00370 = new ThreadRc_Cycle_am_00370B(); + ThreadRc_Cycle_am_00370B A2_Cycle_am_00370 = new ThreadRc_Cycle_am_00370B(); + ThreadRc_Cycle_am_00380B A1_Cycle_am_00380 = new ThreadRc_Cycle_am_00380B(); + ThreadRc_Cycle_am_00380B A2_Cycle_am_00380 = new ThreadRc_Cycle_am_00380B(); + ThreadRc_Cycle_am_00390B A1_Cycle_am_00390 = new ThreadRc_Cycle_am_00390B(); + ThreadRc_Cycle_am_00390B A2_Cycle_am_00390 = new ThreadRc_Cycle_am_00390B(); + ThreadRc_Cycle_am_00400B A1_Cycle_am_00400 = new ThreadRc_Cycle_am_00400B(); + ThreadRc_Cycle_am_00400B A2_Cycle_am_00400 = new ThreadRc_Cycle_am_00400B(); + ThreadRc_Cycle_am_00410B A1_Cycle_am_00410 = new ThreadRc_Cycle_am_00410B(); + ThreadRc_Cycle_am_00410B A2_Cycle_am_00410 = new ThreadRc_Cycle_am_00410B(); + ThreadRc_Cycle_am_00420B A1_Cycle_am_00420 = new ThreadRc_Cycle_am_00420B(); + ThreadRc_Cycle_am_00420B A2_Cycle_am_00420 = new ThreadRc_Cycle_am_00420B(); + ThreadRc_Cycle_am_00430B A1_Cycle_am_00430 = new ThreadRc_Cycle_am_00430B(); + ThreadRc_Cycle_am_00430B A2_Cycle_am_00430 = new ThreadRc_Cycle_am_00430B(); + ThreadRc_Cycle_am_00440B A1_Cycle_am_00440 = new ThreadRc_Cycle_am_00440B(); + ThreadRc_Cycle_am_00440B A2_Cycle_am_00440 = new ThreadRc_Cycle_am_00440B(); + ThreadRc_Cycle_am_00450B A1_Cycle_am_00450 = new ThreadRc_Cycle_am_00450B(); + ThreadRc_Cycle_am_00450B A2_Cycle_am_00450 = new ThreadRc_Cycle_am_00450B(); + ThreadRc_Cycle_am_00460B A1_Cycle_am_00460 = new ThreadRc_Cycle_am_00460B(); + ThreadRc_Cycle_am_00460B A2_Cycle_am_00460 = new ThreadRc_Cycle_am_00460B(); + ThreadRc_Cycle_am_00470B A1_Cycle_am_00470 = new ThreadRc_Cycle_am_00470B(); + ThreadRc_Cycle_am_00470B A2_Cycle_am_00470 = new ThreadRc_Cycle_am_00470B(); + ThreadRc_Cycle_am_00480B A1_Cycle_am_00480 = new ThreadRc_Cycle_am_00480B(); + ThreadRc_Cycle_am_00480B A2_Cycle_am_00480 = new ThreadRc_Cycle_am_00480B(); + ThreadRc_Cycle_am_00490B A1_Cycle_am_00490 = new ThreadRc_Cycle_am_00490B(); + ThreadRc_Cycle_am_00490B A2_Cycle_am_00490 = new ThreadRc_Cycle_am_00490B(); + ThreadRc_Cycle_am_00500B A1_Cycle_am_00500 = new ThreadRc_Cycle_am_00500B(); + ThreadRc_Cycle_am_00500B A2_Cycle_am_00500 = new ThreadRc_Cycle_am_00500B(); + A1_Cycle_am_00180.start(); + A2_Cycle_am_00180.start(); + A1_Cycle_am_00190.start(); + A2_Cycle_am_00190.start(); + A1_Cycle_am_00200.start(); + A2_Cycle_am_00200.start(); + A1_Cycle_am_00210.start(); + A2_Cycle_am_00210.start(); + A1_Cycle_am_00220.start(); + A2_Cycle_am_00220.start(); + A1_Cycle_am_00230.start(); + A2_Cycle_am_00230.start(); + A1_Cycle_am_00240.start(); + A2_Cycle_am_00240.start(); + A1_Cycle_am_00250.start(); + A2_Cycle_am_00250.start(); + A1_Cycle_am_00260.start(); + A2_Cycle_am_00260.start(); + A1_Cycle_am_00270.start(); + A2_Cycle_am_00270.start(); + A1_Cycle_am_00280.start(); + A2_Cycle_am_00280.start(); + A1_Cycle_am_00290.start(); + A2_Cycle_am_00290.start(); + A1_Cycle_am_00300.start(); + A2_Cycle_am_00300.start(); + A1_Cycle_am_00310.start(); + A2_Cycle_am_00310.start(); + A1_Cycle_am_00320.start(); + A2_Cycle_am_00320.start(); + A1_Cycle_am_00330.start(); + A2_Cycle_am_00330.start(); + A1_Cycle_am_00340.start(); + A2_Cycle_am_00340.start(); + A1_Cycle_am_00350.start(); + A2_Cycle_am_00350.start(); + A1_Cycle_am_00360.start(); + A2_Cycle_am_00360.start(); + A1_Cycle_am_00370.start(); + A2_Cycle_am_00370.start(); + A1_Cycle_am_00380.start(); + A2_Cycle_am_00380.start(); + A1_Cycle_am_00390.start(); + A2_Cycle_am_00390.start(); + A1_Cycle_am_00400.start(); + A2_Cycle_am_00400.start(); + A1_Cycle_am_00410.start(); + A2_Cycle_am_00410.start(); + A1_Cycle_am_00420.start(); + A2_Cycle_am_00420.start(); + A1_Cycle_am_00430.start(); + A2_Cycle_am_00430.start(); + A1_Cycle_am_00440.start(); + A2_Cycle_am_00440.start(); + A1_Cycle_am_00450.start(); + A2_Cycle_am_00450.start(); + A1_Cycle_am_00460.start(); + A2_Cycle_am_00460.start(); + A1_Cycle_am_00470.start(); + A2_Cycle_am_00470.start(); + A1_Cycle_am_00480.start(); + A2_Cycle_am_00480.start(); + A1_Cycle_am_00490.start(); + A2_Cycle_am_00490.start(); + A1_Cycle_am_00500.start(); + A2_Cycle_am_00500.start(); + try { + A1_Cycle_am_00180.join(); + A2_Cycle_am_00180.join(); + A1_Cycle_am_00190.join(); + A2_Cycle_am_00190.join(); + A1_Cycle_am_00200.join(); + A2_Cycle_am_00200.join(); + A1_Cycle_am_00210.join(); + A2_Cycle_am_00210.join(); + A1_Cycle_am_00220.join(); + A2_Cycle_am_00220.join(); + A1_Cycle_am_00230.join(); + A2_Cycle_am_00230.join(); + A1_Cycle_am_00240.join(); + A2_Cycle_am_00240.join(); + A1_Cycle_am_00250.join(); + A2_Cycle_am_00250.join(); + A1_Cycle_am_00260.join(); + A2_Cycle_am_00260.join(); + A1_Cycle_am_00270.join(); + A2_Cycle_am_00270.join(); + A1_Cycle_am_00280.join(); + A2_Cycle_am_00280.join(); + A1_Cycle_am_00290.join(); + A2_Cycle_am_00290.join(); + A1_Cycle_am_00300.join(); + A2_Cycle_am_00300.join(); + A1_Cycle_am_00310.join(); + A2_Cycle_am_00310.join(); + A1_Cycle_am_00320.join(); + A2_Cycle_am_00320.join(); + A1_Cycle_am_00330.join(); + A2_Cycle_am_00330.join(); + A1_Cycle_am_00340.join(); + A2_Cycle_am_00340.join(); + A1_Cycle_am_00350.join(); + A2_Cycle_am_00350.join(); + A1_Cycle_am_00360.join(); + A2_Cycle_am_00360.join(); + A1_Cycle_am_00370.join(); + A2_Cycle_am_00370.join(); + A1_Cycle_am_00380.join(); + A2_Cycle_am_00380.join(); + A1_Cycle_am_00390.join(); + A2_Cycle_am_00390.join(); + A1_Cycle_am_00400.join(); + A2_Cycle_am_00400.join(); + A1_Cycle_am_00410.join(); + A2_Cycle_am_00410.join(); + A1_Cycle_am_00420.join(); + A2_Cycle_am_00420.join(); + A1_Cycle_am_00430.join(); + A2_Cycle_am_00430.join(); + A1_Cycle_am_00440.join(); + A2_Cycle_am_00440.join(); + A1_Cycle_am_00450.join(); + A2_Cycle_am_00450.join(); + A1_Cycle_am_00460.join(); + A2_Cycle_am_00460.join(); + A1_Cycle_am_00470.join(); + A2_Cycle_am_00470.join(); + A1_Cycle_am_00480.join(); + A2_Cycle_am_00480.join(); + A1_Cycle_am_00490.join(); + A2_Cycle_am_00490.join(); + A1_Cycle_am_00500.join(); + A2_Cycle_am_00500.join(); + } catch (InterruptedException e) { + } + if (A1_Cycle_am_00180.check() && A2_Cycle_am_00180.check() && A1_Cycle_am_00190.check() && A2_Cycle_am_00190.check() && A1_Cycle_am_00200.check() && A2_Cycle_am_00200.check() && A1_Cycle_am_00210.check() && A2_Cycle_am_00210.check() && A1_Cycle_am_00220.check() && A2_Cycle_am_00220.check() && A1_Cycle_am_00230.check() && A2_Cycle_am_00230.check() && A1_Cycle_am_00240.check() && A2_Cycle_am_00240.check() && A1_Cycle_am_00250.check() && A2_Cycle_am_00250.check() && A1_Cycle_am_00260.check() && A2_Cycle_am_00260.check() && A1_Cycle_am_00270.check() && A2_Cycle_am_00270.check() && A1_Cycle_am_00280.check() && A2_Cycle_am_00280.check() && A1_Cycle_am_00290.check() && A2_Cycle_am_00290.check() && A1_Cycle_am_00300.check() && A2_Cycle_am_00300.check() && A1_Cycle_am_00310.check() && A2_Cycle_am_00310.check() && A1_Cycle_am_00320.check() && A2_Cycle_am_00320.check() && A1_Cycle_am_00330.check() && A2_Cycle_am_00330.check() && A1_Cycle_am_00340.check() && A2_Cycle_am_00340.check() && A1_Cycle_am_00350.check() && A2_Cycle_am_00350.check() && A1_Cycle_am_00360.check() && A2_Cycle_am_00360.check() && A1_Cycle_am_00370.check() && A2_Cycle_am_00370.check() && A1_Cycle_am_00380.check() && A2_Cycle_am_00380.check() && A1_Cycle_am_00390.check() && A2_Cycle_am_00390.check() && A1_Cycle_am_00400.check() && A2_Cycle_am_00400.check() && A1_Cycle_am_00410.check() && A2_Cycle_am_00410.check() && A1_Cycle_am_00420.check() && A2_Cycle_am_00420.check() && A1_Cycle_am_00430.check() && A2_Cycle_am_00430.check() && A1_Cycle_am_00440.check() && A2_Cycle_am_00440.check() && A1_Cycle_am_00450.check() && A2_Cycle_am_00450.check() && A1_Cycle_am_00460.check() && A2_Cycle_am_00460.check() && A1_Cycle_am_00470.check() && A2_Cycle_am_00470.check() && A1_Cycle_am_00480.check() && A2_Cycle_am_00480.check() && A1_Cycle_am_00490.check() && A2_Cycle_am_00490.check() && A1_Cycle_am_00500.check() && A2_Cycle_am_00500.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\nExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0154-rc-function-RC_Thread01-Cycle_am_10010/Cycle_am_10010.java b/test/testsuite/ouroboros/memory_management/Function/RC0154-rc-function-RC_Thread01-Cycle_am_10010/Cycle_am_10010.java index bebc87549b141261faa038fd5f30c37f7abcf470..90f305b9ce77d2e88bed84f78abeb0f01c8199e9 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0154-rc-function-RC_Thread01-Cycle_am_10010/Cycle_am_10010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0154-rc-function-RC_Thread01-Cycle_am_10010/Cycle_am_10010.java @@ -1,431 +1,431 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_10010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_10010 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_10010.java - *- @ExecuteClass: Cycle_am_10010 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_am_10010 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_10010_A1 a1_main = new Cycle_a_10010_A1("a1_main"); - Cycle_a_10010_A4 a4_main = new Cycle_a_10010_A4("a4_main"); - Cycle_a_10010_A6 a6_main = new Cycle_a_10010_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_10010_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_10010_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10010_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_10010_A7("a7_0"); - a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; - a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - Cycle_a_10010_2A1 a1_2main = new Cycle_a_10010_2A1("a1_2main"); - Cycle_a_10010_2A4 a4_2main = new Cycle_a_10010_2A4("a4_2main"); - Cycle_a_10010_2A6 a6_2main = new Cycle_a_10010_2A6("a6_2main"); - a1_2main.a2_0 = new Cycle_a_10010_2A2("a2_0"); - a1_2main.a2_0.a3_0 = new Cycle_a_10010_2A3("a3_0"); - a1_2main.a2_0.a4_0 = a4_2main; - a4_2main.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a5_0 = new Cycle_a_10010_2A5("a5_0"); - a1_2main.a2_0.a3_0.a5_0.a6_0 = a6_2main; - a1_2main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10010_2A8("a8_0"); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10010_2A7("a7_0"); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_2main.a2_0.a3_0; - a6_2main.a1_0 = a1_2main; - a6_2main.a3_0 = a1_2main.a2_0.a3_0; - - - a1_2main.add(); - a4_2main.add(); - a6_2main.add(); - a1_2main.a2_0.add(); - a1_2main.a2_0.a3_0.add(); - a1_2main.a2_0.a3_0.a5_0.add(); - a1_2main.a2_0.a3_0.a5_0.a8_0.add(); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result2 = a1_2main.sum + a4_2main.sum + a6_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum + a1_2main.a2_0.a3_0.a5_0.sum + a6_2main.a3_0.a5_0.a8_0.a7_0.sum + a6_2main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - result += result2; - - if (result == 3852) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_10010_A1 { - Cycle_a_10010_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10010_A2 { - Cycle_a_10010_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_10010_A3 { - Cycle_a_10010_A1 a1_0; - Cycle_a_10010_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_10010_A4 { - Cycle_a_10010_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_10010_A5 { - Cycle_a_10010_A4 a4_0; - Cycle_a_10010_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A5(String strObjectName) { - a4_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a + a7_0.a; - } - } - - class Cycle_a_10010_A6 { - Cycle_a_10010_A5 a5_0; - Cycle_a_10010_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A6(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a7_0.a; - } - } - - class Cycle_a_10010_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Cycle_a_10010_2A1 { - Cycle_a_10010_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10010_2A2 { - Cycle_a_10010_2A3 a3_0; - Cycle_a_10010_2A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_10010_2A3 { - Cycle_a_10010_2A1 a1_0; - Cycle_a_10010_2A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_10010_2A4 { - Cycle_a_10010_2A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_10010_2A5 { - Cycle_a_10010_2A6 a6_0; - Cycle_a_10010_2A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_10010_2A6 { - Cycle_a_10010_2A1 a1_0; - Cycle_a_10010_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_10010_2A7 { - Cycle_a_10010_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_10010_2A8 { - Cycle_a_10010_2A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - - -public class Cycle_am_10010 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_10010 A1_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); - ThreadRc_Cycle_am_10010 A2_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); - ThreadRc_Cycle_am_10010 A3_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); - ThreadRc_Cycle_am_10010 A4_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); - ThreadRc_Cycle_am_10010 A5_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); - ThreadRc_Cycle_am_10010 A6_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); - - A1_Cycle_am_10010.start(); - A2_Cycle_am_10010.start(); - A3_Cycle_am_10010.start(); - A4_Cycle_am_10010.start(); - A5_Cycle_am_10010.start(); - A6_Cycle_am_10010.start(); - - try { - A1_Cycle_am_10010.join(); - A2_Cycle_am_10010.join(); - A3_Cycle_am_10010.join(); - A4_Cycle_am_10010.join(); - A5_Cycle_am_10010.join(); - A6_Cycle_am_10010.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_10010.check() && A2_Cycle_am_10010.check() && A3_Cycle_am_10010.check() && A4_Cycle_am_10010.check() && A5_Cycle_am_10010.check() && A6_Cycle_am_10010.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_10010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_10010 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_10010.java + *- @ExecuteClass: Cycle_am_10010 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_am_10010 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_10010_A1 a1_main = new Cycle_a_10010_A1("a1_main"); + Cycle_a_10010_A4 a4_main = new Cycle_a_10010_A4("a4_main"); + Cycle_a_10010_A6 a6_main = new Cycle_a_10010_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_10010_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_10010_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10010_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_10010_A7("a7_0"); + a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; + a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + Cycle_a_10010_2A1 a1_2main = new Cycle_a_10010_2A1("a1_2main"); + Cycle_a_10010_2A4 a4_2main = new Cycle_a_10010_2A4("a4_2main"); + Cycle_a_10010_2A6 a6_2main = new Cycle_a_10010_2A6("a6_2main"); + a1_2main.a2_0 = new Cycle_a_10010_2A2("a2_0"); + a1_2main.a2_0.a3_0 = new Cycle_a_10010_2A3("a3_0"); + a1_2main.a2_0.a4_0 = a4_2main; + a4_2main.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a5_0 = new Cycle_a_10010_2A5("a5_0"); + a1_2main.a2_0.a3_0.a5_0.a6_0 = a6_2main; + a1_2main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10010_2A8("a8_0"); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10010_2A7("a7_0"); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_2main.a2_0.a3_0; + a6_2main.a1_0 = a1_2main; + a6_2main.a3_0 = a1_2main.a2_0.a3_0; + + + a1_2main.add(); + a4_2main.add(); + a6_2main.add(); + a1_2main.a2_0.add(); + a1_2main.a2_0.a3_0.add(); + a1_2main.a2_0.a3_0.a5_0.add(); + a1_2main.a2_0.a3_0.a5_0.a8_0.add(); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result2 = a1_2main.sum + a4_2main.sum + a6_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum + a1_2main.a2_0.a3_0.a5_0.sum + a6_2main.a3_0.a5_0.a8_0.a7_0.sum + a6_2main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + result += result2; + + if (result == 3852) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_10010_A1 { + Cycle_a_10010_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10010_A2 { + Cycle_a_10010_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_10010_A3 { + Cycle_a_10010_A1 a1_0; + Cycle_a_10010_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_10010_A4 { + Cycle_a_10010_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_10010_A5 { + Cycle_a_10010_A4 a4_0; + Cycle_a_10010_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A5(String strObjectName) { + a4_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a + a7_0.a; + } + } + + class Cycle_a_10010_A6 { + Cycle_a_10010_A5 a5_0; + Cycle_a_10010_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A6(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a7_0.a; + } + } + + class Cycle_a_10010_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Cycle_a_10010_2A1 { + Cycle_a_10010_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10010_2A2 { + Cycle_a_10010_2A3 a3_0; + Cycle_a_10010_2A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_10010_2A3 { + Cycle_a_10010_2A1 a1_0; + Cycle_a_10010_2A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_10010_2A4 { + Cycle_a_10010_2A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_10010_2A5 { + Cycle_a_10010_2A6 a6_0; + Cycle_a_10010_2A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_10010_2A6 { + Cycle_a_10010_2A1 a1_0; + Cycle_a_10010_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_10010_2A7 { + Cycle_a_10010_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_10010_2A8 { + Cycle_a_10010_2A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + + +public class Cycle_am_10010 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_10010 A1_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); + ThreadRc_Cycle_am_10010 A2_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); + ThreadRc_Cycle_am_10010 A3_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); + ThreadRc_Cycle_am_10010 A4_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); + ThreadRc_Cycle_am_10010 A5_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); + ThreadRc_Cycle_am_10010 A6_Cycle_am_10010 = new ThreadRc_Cycle_am_10010(); + + A1_Cycle_am_10010.start(); + A2_Cycle_am_10010.start(); + A3_Cycle_am_10010.start(); + A4_Cycle_am_10010.start(); + A5_Cycle_am_10010.start(); + A6_Cycle_am_10010.start(); + + try { + A1_Cycle_am_10010.join(); + A2_Cycle_am_10010.join(); + A3_Cycle_am_10010.join(); + A4_Cycle_am_10010.join(); + A5_Cycle_am_10010.join(); + A6_Cycle_am_10010.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_10010.check() && A2_Cycle_am_10010.check() && A3_Cycle_am_10010.check() && A4_Cycle_am_10010.check() && A5_Cycle_am_10010.check() && A6_Cycle_am_10010.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0155-rc-function-RC_Thread01-Cycle_am_10020/Cycle_am_10020.java b/test/testsuite/ouroboros/memory_management/Function/RC0155-rc-function-RC_Thread01-Cycle_am_10020/Cycle_am_10020.java index 88ea33cbeba7a55e9bf2699ba7186da434d5711d..762019dd79b29e41ff46d864001d0c9aa5b89689 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0155-rc-function-RC_Thread01-Cycle_am_10020/Cycle_am_10020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0155-rc-function-RC_Thread01-Cycle_am_10020/Cycle_am_10020.java @@ -1,391 +1,391 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_10020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_10020 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_10020.java - *- @ExecuteClass: Cycle_am_10020 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_am_10020 extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_10020_A1 a1_main = new Cycle_a_10020_A1("a1_main"); - Cycle_a_10020_A4 a4_main = new Cycle_a_10020_A4("a4_main"); - Cycle_a_10020_A6 a6_main = new Cycle_a_10020_A6("a6_main"); - Cycle_a_10020_A9 a9_main = new Cycle_a_10020_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_10020_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_10020_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10020_A5("a5_0"); - a1_main.a2_0.a3_0.a10_0 = new Cycle_a_10020_A10("a10_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10020_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10020_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; - a9_main.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a10_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; - //System.out.println("RC-Testing_Result="+result); - Cycle_a_10020_2A1 a1_2main = new Cycle_a_10020_2A1("a1_2main"); - a1_2main.a2_0 = new Cycle_a_10020_2A2("a2_0"); - a1_2main.a2_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0 = new Cycle_a_10020_2A3("a3_0"); - a1_2main.a2_0.a3_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a2_0 = a1_2main.a2_0; - - - a1_2main.add(); - a1_2main.a2_0.add(); - a1_2main.a2_0.a3_0.add(); - - int result2 = a1_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - result += result2; - - if (result == 3438) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_10020_A1 { - Cycle_a_10020_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10020_A2 { - Cycle_a_10020_A3 a3_0; - Cycle_a_10020_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_10020_A3 { - Cycle_a_10020_A1 a1_0; - Cycle_a_10020_A5 a5_0; - Cycle_a_10020_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a10_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a10_0.a; - } - } - - class Cycle_a_10020_A4 { - Cycle_a_10020_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_10020_A5 { - Cycle_a_10020_A6 a6_0; - Cycle_a_10020_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_10020_A6 { - Cycle_a_10020_A1 a1_0; - Cycle_a_10020_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_10020_A7 { - Cycle_a_10020_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10020_A8 { - Cycle_a_10020_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_10020_A9 { - Cycle_a_10020_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A9(String strObjectName) { - a6_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_10020_A10 { - Cycle_a_10020_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A10(String strObjectName) { - a9_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_10020_2A1 { - Cycle_a_10020_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10020_2A2 { - Cycle_a_10020_2A1 a1_0; - Cycle_a_10020_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_10020_2A3 { - Cycle_a_10020_2A1 a1_0; - Cycle_a_10020_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - - -public class Cycle_am_10020 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_10020 A1_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); - ThreadRc_Cycle_am_10020 A2_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); - ThreadRc_Cycle_am_10020 A3_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); - ThreadRc_Cycle_am_10020 A4_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); - ThreadRc_Cycle_am_10020 A5_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); - ThreadRc_Cycle_am_10020 A6_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); - - A1_Cycle_am_10020.start(); - A2_Cycle_am_10020.start(); - A3_Cycle_am_10020.start(); - A4_Cycle_am_10020.start(); - A5_Cycle_am_10020.start(); - A6_Cycle_am_10020.start(); - - try { - A1_Cycle_am_10020.join(); - A2_Cycle_am_10020.join(); - A3_Cycle_am_10020.join(); - A4_Cycle_am_10020.join(); - A5_Cycle_am_10020.join(); - A6_Cycle_am_10020.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_10020.check() && A2_Cycle_am_10020.check() && A3_Cycle_am_10020.check() && A4_Cycle_am_10020.check() && A5_Cycle_am_10020.check() && A6_Cycle_am_10020.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_10020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_10020 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_10020.java + *- @ExecuteClass: Cycle_am_10020 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_am_10020 extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_10020_A1 a1_main = new Cycle_a_10020_A1("a1_main"); + Cycle_a_10020_A4 a4_main = new Cycle_a_10020_A4("a4_main"); + Cycle_a_10020_A6 a6_main = new Cycle_a_10020_A6("a6_main"); + Cycle_a_10020_A9 a9_main = new Cycle_a_10020_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_10020_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_10020_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10020_A5("a5_0"); + a1_main.a2_0.a3_0.a10_0 = new Cycle_a_10020_A10("a10_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10020_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10020_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; + a9_main.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a10_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; + //System.out.println("RC-Testing_Result="+result); + Cycle_a_10020_2A1 a1_2main = new Cycle_a_10020_2A1("a1_2main"); + a1_2main.a2_0 = new Cycle_a_10020_2A2("a2_0"); + a1_2main.a2_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0 = new Cycle_a_10020_2A3("a3_0"); + a1_2main.a2_0.a3_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a2_0 = a1_2main.a2_0; + + + a1_2main.add(); + a1_2main.a2_0.add(); + a1_2main.a2_0.a3_0.add(); + + int result2 = a1_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + result += result2; + + if (result == 3438) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_10020_A1 { + Cycle_a_10020_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10020_A2 { + Cycle_a_10020_A3 a3_0; + Cycle_a_10020_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_10020_A3 { + Cycle_a_10020_A1 a1_0; + Cycle_a_10020_A5 a5_0; + Cycle_a_10020_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a10_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a10_0.a; + } + } + + class Cycle_a_10020_A4 { + Cycle_a_10020_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_10020_A5 { + Cycle_a_10020_A6 a6_0; + Cycle_a_10020_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_10020_A6 { + Cycle_a_10020_A1 a1_0; + Cycle_a_10020_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_10020_A7 { + Cycle_a_10020_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10020_A8 { + Cycle_a_10020_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_10020_A9 { + Cycle_a_10020_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A9(String strObjectName) { + a6_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_10020_A10 { + Cycle_a_10020_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A10(String strObjectName) { + a9_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_10020_2A1 { + Cycle_a_10020_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10020_2A2 { + Cycle_a_10020_2A1 a1_0; + Cycle_a_10020_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_10020_2A3 { + Cycle_a_10020_2A1 a1_0; + Cycle_a_10020_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + + +public class Cycle_am_10020 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_10020 A1_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); + ThreadRc_Cycle_am_10020 A2_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); + ThreadRc_Cycle_am_10020 A3_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); + ThreadRc_Cycle_am_10020 A4_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); + ThreadRc_Cycle_am_10020 A5_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); + ThreadRc_Cycle_am_10020 A6_Cycle_am_10020 = new ThreadRc_Cycle_am_10020(); + + A1_Cycle_am_10020.start(); + A2_Cycle_am_10020.start(); + A3_Cycle_am_10020.start(); + A4_Cycle_am_10020.start(); + A5_Cycle_am_10020.start(); + A6_Cycle_am_10020.start(); + + try { + A1_Cycle_am_10020.join(); + A2_Cycle_am_10020.join(); + A3_Cycle_am_10020.join(); + A4_Cycle_am_10020.join(); + A5_Cycle_am_10020.join(); + A6_Cycle_am_10020.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_10020.check() && A2_Cycle_am_10020.check() && A3_Cycle_am_10020.check() && A4_Cycle_am_10020.check() && A5_Cycle_am_10020.check() && A6_Cycle_am_10020.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0156-rc-function-RC_Thread01-Cycle_am_10030/Cycle_am_10030.java b/test/testsuite/ouroboros/memory_management/Function/RC0156-rc-function-RC_Thread01-Cycle_am_10030/Cycle_am_10030.java index ad01fcc76b4630e47083e384ae68f6a9d3926e7f..8f6c3b3c5ea56d899962d5d9d253be232b49970e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0156-rc-function-RC_Thread01-Cycle_am_10030/Cycle_am_10030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0156-rc-function-RC_Thread01-Cycle_am_10030/Cycle_am_10030.java @@ -1,772 +1,772 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_10030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_a_10030 in RC测试-Cycle-01 to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_am_10030.java - *- @ExecuteClass: Cycle_am_10030 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_am_10020B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_10020_A1 a1_main = new Cycle_a_10020_A1("a1_main"); - Cycle_a_10020_A4 a4_main = new Cycle_a_10020_A4("a4_main"); - Cycle_a_10020_A6 a6_main = new Cycle_a_10020_A6("a6_main"); - Cycle_a_10020_A9 a9_main = new Cycle_a_10020_A9("a9_main"); - a1_main.a2_0 = new Cycle_a_10020_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_10020_A3("a3_0"); - a1_main.a2_0.a4_0 = a4_main; - a4_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10020_A5("a5_0"); - a1_main.a2_0.a3_0.a10_0 = new Cycle_a_10020_A10("a10_0"); - a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; - a6_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10020_A8("a8_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10020_A7("a7_0"); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; - a9_main.a6_0 = a6_main; - a6_main.a3_0 = a1_main.a2_0.a3_0; - - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a9_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a10_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.add(); - a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; - //System.out.println("RC-Testing_Result="+result); - Cycle_a_10020_2A1 a1_2main = new Cycle_a_10020_2A1("a1_2main"); - a1_2main.a2_0 = new Cycle_a_10020_2A2("a2_0"); - a1_2main.a2_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0 = new Cycle_a_10020_2A3("a3_0"); - a1_2main.a2_0.a3_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a2_0 = a1_2main.a2_0; - - - a1_2main.add(); - a1_2main.a2_0.add(); - a1_2main.a2_0.a3_0.add(); - - int result2 = a1_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum; - //System.out.println("RC-Testing_Result="+result); - result += result2; - - if (result == 3438) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_10020_A1 { - Cycle_a_10020_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10020_A2 { - Cycle_a_10020_A3 a3_0; - Cycle_a_10020_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_10020_A3 { - Cycle_a_10020_A1 a1_0; - Cycle_a_10020_A5 a5_0; - Cycle_a_10020_A10 a10_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a10_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a + a10_0.a; - } - } - - class Cycle_a_10020_A4 { - Cycle_a_10020_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_10020_A5 { - Cycle_a_10020_A6 a6_0; - Cycle_a_10020_A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_10020_A6 { - Cycle_a_10020_A1 a1_0; - Cycle_a_10020_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_10020_A7 { - Cycle_a_10020_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A7(String strObjectName) { - a2_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10020_A8 { - Cycle_a_10020_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_a_10020_A9 { - Cycle_a_10020_A6 a6_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A9(String strObjectName) { - a6_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_a_10020_A10 { - Cycle_a_10020_A9 a9_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_A10(String strObjectName) { - a9_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_a_10020_2A1 { - Cycle_a_10020_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10020_2A2 { - Cycle_a_10020_2A1 a1_0; - Cycle_a_10020_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_10020_2A3 { - Cycle_a_10020_2A1 a1_0; - Cycle_a_10020_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10020_2A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_am_10010B extends Thread { - private boolean checkout; - - public void run() { - Cycle_a_10010_A1 a1_main = new Cycle_a_10010_A1("a1_main"); - Cycle_a_10010_A4 a4_main = new Cycle_a_10010_A4("a4_main"); - Cycle_a_10010_A6 a6_main = new Cycle_a_10010_A6("a6_main"); - a1_main.a2_0 = new Cycle_a_10010_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_a_10010_A3("a3_0"); - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10010_A5("a5_0"); - a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; - a4_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_10010_A7("a7_0"); - a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; - a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; - - a1_main.add(); - a4_main.add(); - a6_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a3_0.a5_0.add(); - a1_main.a2_0.a3_0.a5_0.a7_0.add(); - - int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; - //System.out.println("RC-Testing_Result="+result); - - Cycle_a_10010_2A1 a1_2main = new Cycle_a_10010_2A1("a1_2main"); - Cycle_a_10010_2A4 a4_2main = new Cycle_a_10010_2A4("a4_2main"); - Cycle_a_10010_2A6 a6_2main = new Cycle_a_10010_2A6("a6_2main"); - a1_2main.a2_0 = new Cycle_a_10010_2A2("a2_0"); - a1_2main.a2_0.a3_0 = new Cycle_a_10010_2A3("a3_0"); - a1_2main.a2_0.a4_0 = a4_2main; - a4_2main.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a1_0 = a1_2main; - a1_2main.a2_0.a3_0.a5_0 = new Cycle_a_10010_2A5("a5_0"); - a1_2main.a2_0.a3_0.a5_0.a6_0 = a6_2main; - a1_2main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10010_2A8("a8_0"); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10010_2A7("a7_0"); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_2main.a2_0.a3_0; - a6_2main.a1_0 = a1_2main; - a6_2main.a3_0 = a1_2main.a2_0.a3_0; - - - a1_2main.add(); - a4_2main.add(); - a6_2main.add(); - a1_2main.a2_0.add(); - a1_2main.a2_0.a3_0.add(); - a1_2main.a2_0.a3_0.a5_0.add(); - a1_2main.a2_0.a3_0.a5_0.a8_0.add(); - a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); - - int result2 = a1_2main.sum + a4_2main.sum + a6_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum + a1_2main.a2_0.a3_0.a5_0.sum + a6_2main.a3_0.a5_0.a8_0.a7_0.sum + a6_2main.a3_0.a5_0.a8_0.sum; - //System.out.println("RC-Testing_Result="+result); - result += result2; - - if (result == 3852) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_a_10010_A1 { - Cycle_a_10010_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10010_A2 { - Cycle_a_10010_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_10010_A3 { - Cycle_a_10010_A1 a1_0; - Cycle_a_10010_A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_10010_A4 { - Cycle_a_10010_A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A4(String strObjectName) { - a3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_10010_A5 { - Cycle_a_10010_A4 a4_0; - Cycle_a_10010_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A5(String strObjectName) { - a4_0 = null; - a7_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a4_0.a + a7_0.a; - } - } - - class Cycle_a_10010_A6 { - Cycle_a_10010_A5 a5_0; - Cycle_a_10010_A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A6(String strObjectName) { - a5_0 = null; - a7_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a5_0.a + a7_0.a; - } - } - - class Cycle_a_10010_A7 { - int a; - int sum; - String strObjectName; - - Cycle_a_10010_A7(String strObjectName) { - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Cycle_a_10010_2A1 { - Cycle_a_10010_2A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_a_10010_2A2 { - Cycle_a_10010_2A3 a3_0; - Cycle_a_10010_2A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A2(String strObjectName) { - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_a_10010_2A3 { - Cycle_a_10010_2A1 a1_0; - Cycle_a_10010_2A5 a5_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - class Cycle_a_10010_2A4 { - Cycle_a_10010_2A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A4(String strObjectName) { - a1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_a_10010_2A5 { - Cycle_a_10010_2A6 a6_0; - Cycle_a_10010_2A8 a8_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A5(String strObjectName) { - a6_0 = null; - a8_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a + a8_0.a; - } - } - - class Cycle_a_10010_2A6 { - Cycle_a_10010_2A1 a1_0; - Cycle_a_10010_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a; - } - } - - class Cycle_a_10010_2A7 { - Cycle_a_10010_2A3 a3_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A7(String strObjectName) { - a3_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_a_10010_2A8 { - Cycle_a_10010_2A7 a7_0; - int a; - int sum; - String strObjectName; - - Cycle_a_10010_2A8(String strObjectName) { - a7_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + a7_0.a; - } - } -} - -public class Cycle_am_10030 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_am_10010B A1_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); - ThreadRc_Cycle_am_10010B A2_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); - ThreadRc_Cycle_am_10010B A3_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); - ThreadRc_Cycle_am_10010B A4_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); - ThreadRc_Cycle_am_10010B A5_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); - ThreadRc_Cycle_am_10010B A6_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); - ThreadRc_Cycle_am_10020B A1_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); - ThreadRc_Cycle_am_10020B A2_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); - ThreadRc_Cycle_am_10020B A3_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); - ThreadRc_Cycle_am_10020B A4_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); - ThreadRc_Cycle_am_10020B A5_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); - ThreadRc_Cycle_am_10020B A6_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); - A1_Cycle_am_10010.start(); - A2_Cycle_am_10010.start(); - A3_Cycle_am_10010.start(); - A4_Cycle_am_10010.start(); - A5_Cycle_am_10010.start(); - A6_Cycle_am_10010.start(); - A1_Cycle_am_10020.start(); - A2_Cycle_am_10020.start(); - A3_Cycle_am_10020.start(); - A4_Cycle_am_10020.start(); - A5_Cycle_am_10020.start(); - A6_Cycle_am_10020.start(); - - try { - A1_Cycle_am_10010.join(); - A2_Cycle_am_10010.join(); - A3_Cycle_am_10010.join(); - A4_Cycle_am_10010.join(); - A5_Cycle_am_10010.join(); - A6_Cycle_am_10010.join(); - A1_Cycle_am_10020.join(); - A2_Cycle_am_10020.join(); - A3_Cycle_am_10020.join(); - A4_Cycle_am_10020.join(); - A5_Cycle_am_10020.join(); - A6_Cycle_am_10020.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_am_10010.check() && A2_Cycle_am_10010.check() && A3_Cycle_am_10010.check() && A4_Cycle_am_10010.check() && A5_Cycle_am_10010.check() && A6_Cycle_am_10010.check() && A1_Cycle_am_10020.check() && A2_Cycle_am_10020.check() && A3_Cycle_am_10020.check() && A4_Cycle_am_10020.check() && A5_Cycle_am_10020.check() && A6_Cycle_am_10020.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_am_10030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_a_10030 in RC测试-Cycle-01 to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_am_10030.java + *- @ExecuteClass: Cycle_am_10030 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_am_10020B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_10020_A1 a1_main = new Cycle_a_10020_A1("a1_main"); + Cycle_a_10020_A4 a4_main = new Cycle_a_10020_A4("a4_main"); + Cycle_a_10020_A6 a6_main = new Cycle_a_10020_A6("a6_main"); + Cycle_a_10020_A9 a9_main = new Cycle_a_10020_A9("a9_main"); + a1_main.a2_0 = new Cycle_a_10020_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_10020_A3("a3_0"); + a1_main.a2_0.a4_0 = a4_main; + a4_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10020_A5("a5_0"); + a1_main.a2_0.a3_0.a10_0 = new Cycle_a_10020_A10("a10_0"); + a1_main.a2_0.a3_0.a5_0.a6_0 = a6_main; + a6_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10020_A8("a8_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10020_A7("a7_0"); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a3_0.a10_0.a9_0 = a9_main; + a9_main.a6_0 = a6_main; + a6_main.a3_0 = a1_main.a2_0.a3_0; + + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a9_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a10_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.add(); + a1_main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a9_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a3_0.a5_0.a8_0.a7_0.sum + a6_main.a3_0.a5_0.a8_0.sum + a6_main.a3_0.a10_0.sum; + //System.out.println("RC-Testing_Result="+result); + Cycle_a_10020_2A1 a1_2main = new Cycle_a_10020_2A1("a1_2main"); + a1_2main.a2_0 = new Cycle_a_10020_2A2("a2_0"); + a1_2main.a2_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0 = new Cycle_a_10020_2A3("a3_0"); + a1_2main.a2_0.a3_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a2_0 = a1_2main.a2_0; + + + a1_2main.add(); + a1_2main.a2_0.add(); + a1_2main.a2_0.a3_0.add(); + + int result2 = a1_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum; + //System.out.println("RC-Testing_Result="+result); + result += result2; + + if (result == 3438) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_10020_A1 { + Cycle_a_10020_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10020_A2 { + Cycle_a_10020_A3 a3_0; + Cycle_a_10020_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_10020_A3 { + Cycle_a_10020_A1 a1_0; + Cycle_a_10020_A5 a5_0; + Cycle_a_10020_A10 a10_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a10_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a + a10_0.a; + } + } + + class Cycle_a_10020_A4 { + Cycle_a_10020_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_10020_A5 { + Cycle_a_10020_A6 a6_0; + Cycle_a_10020_A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_10020_A6 { + Cycle_a_10020_A1 a1_0; + Cycle_a_10020_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_10020_A7 { + Cycle_a_10020_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A7(String strObjectName) { + a2_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10020_A8 { + Cycle_a_10020_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_a_10020_A9 { + Cycle_a_10020_A6 a6_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A9(String strObjectName) { + a6_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_a_10020_A10 { + Cycle_a_10020_A9 a9_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_A10(String strObjectName) { + a9_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_a_10020_2A1 { + Cycle_a_10020_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10020_2A2 { + Cycle_a_10020_2A1 a1_0; + Cycle_a_10020_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_10020_2A3 { + Cycle_a_10020_2A1 a1_0; + Cycle_a_10020_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10020_2A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_am_10010B extends Thread { + private boolean checkout; + + public void run() { + Cycle_a_10010_A1 a1_main = new Cycle_a_10010_A1("a1_main"); + Cycle_a_10010_A4 a4_main = new Cycle_a_10010_A4("a4_main"); + Cycle_a_10010_A6 a6_main = new Cycle_a_10010_A6("a6_main"); + a1_main.a2_0 = new Cycle_a_10010_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_a_10010_A3("a3_0"); + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a5_0 = new Cycle_a_10010_A5("a5_0"); + a1_main.a2_0.a3_0.a5_0.a4_0 = a4_main; + a4_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0.a5_0.a7_0 = new Cycle_a_10010_A7("a7_0"); + a6_main.a7_0 = a1_main.a2_0.a3_0.a5_0.a7_0; + a6_main.a5_0 = a1_main.a2_0.a3_0.a5_0; + + a1_main.add(); + a4_main.add(); + a6_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a3_0.a5_0.add(); + a1_main.a2_0.a3_0.a5_0.a7_0.add(); + + int result = a1_main.sum + a4_main.sum + a6_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a3_0.a5_0.sum + a6_main.a7_0.sum; + //System.out.println("RC-Testing_Result="+result); + + Cycle_a_10010_2A1 a1_2main = new Cycle_a_10010_2A1("a1_2main"); + Cycle_a_10010_2A4 a4_2main = new Cycle_a_10010_2A4("a4_2main"); + Cycle_a_10010_2A6 a6_2main = new Cycle_a_10010_2A6("a6_2main"); + a1_2main.a2_0 = new Cycle_a_10010_2A2("a2_0"); + a1_2main.a2_0.a3_0 = new Cycle_a_10010_2A3("a3_0"); + a1_2main.a2_0.a4_0 = a4_2main; + a4_2main.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a1_0 = a1_2main; + a1_2main.a2_0.a3_0.a5_0 = new Cycle_a_10010_2A5("a5_0"); + a1_2main.a2_0.a3_0.a5_0.a6_0 = a6_2main; + a1_2main.a2_0.a3_0.a5_0.a8_0 = new Cycle_a_10010_2A8("a8_0"); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0 = new Cycle_a_10010_2A7("a7_0"); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.a3_0 = a1_2main.a2_0.a3_0; + a6_2main.a1_0 = a1_2main; + a6_2main.a3_0 = a1_2main.a2_0.a3_0; + + + a1_2main.add(); + a4_2main.add(); + a6_2main.add(); + a1_2main.a2_0.add(); + a1_2main.a2_0.a3_0.add(); + a1_2main.a2_0.a3_0.a5_0.add(); + a1_2main.a2_0.a3_0.a5_0.a8_0.add(); + a1_2main.a2_0.a3_0.a5_0.a8_0.a7_0.add(); + + int result2 = a1_2main.sum + a4_2main.sum + a6_2main.sum + a1_2main.a2_0.sum + a1_2main.a2_0.a3_0.sum + a1_2main.a2_0.a3_0.a5_0.sum + a6_2main.a3_0.a5_0.a8_0.a7_0.sum + a6_2main.a3_0.a5_0.a8_0.sum; + //System.out.println("RC-Testing_Result="+result); + result += result2; + + if (result == 3852) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_a_10010_A1 { + Cycle_a_10010_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10010_A2 { + Cycle_a_10010_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_10010_A3 { + Cycle_a_10010_A1 a1_0; + Cycle_a_10010_A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_10010_A4 { + Cycle_a_10010_A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A4(String strObjectName) { + a3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_10010_A5 { + Cycle_a_10010_A4 a4_0; + Cycle_a_10010_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A5(String strObjectName) { + a4_0 = null; + a7_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a4_0.a + a7_0.a; + } + } + + class Cycle_a_10010_A6 { + Cycle_a_10010_A5 a5_0; + Cycle_a_10010_A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A6(String strObjectName) { + a5_0 = null; + a7_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a5_0.a + a7_0.a; + } + } + + class Cycle_a_10010_A7 { + int a; + int sum; + String strObjectName; + + Cycle_a_10010_A7(String strObjectName) { + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Cycle_a_10010_2A1 { + Cycle_a_10010_2A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_a_10010_2A2 { + Cycle_a_10010_2A3 a3_0; + Cycle_a_10010_2A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A2(String strObjectName) { + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_a_10010_2A3 { + Cycle_a_10010_2A1 a1_0; + Cycle_a_10010_2A5 a5_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + class Cycle_a_10010_2A4 { + Cycle_a_10010_2A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A4(String strObjectName) { + a1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_a_10010_2A5 { + Cycle_a_10010_2A6 a6_0; + Cycle_a_10010_2A8 a8_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A5(String strObjectName) { + a6_0 = null; + a8_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a + a8_0.a; + } + } + + class Cycle_a_10010_2A6 { + Cycle_a_10010_2A1 a1_0; + Cycle_a_10010_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a; + } + } + + class Cycle_a_10010_2A7 { + Cycle_a_10010_2A3 a3_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A7(String strObjectName) { + a3_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_a_10010_2A8 { + Cycle_a_10010_2A7 a7_0; + int a; + int sum; + String strObjectName; + + Cycle_a_10010_2A8(String strObjectName) { + a7_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + a7_0.a; + } + } +} + +public class Cycle_am_10030 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_am_10010B A1_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); + ThreadRc_Cycle_am_10010B A2_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); + ThreadRc_Cycle_am_10010B A3_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); + ThreadRc_Cycle_am_10010B A4_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); + ThreadRc_Cycle_am_10010B A5_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); + ThreadRc_Cycle_am_10010B A6_Cycle_am_10010 = new ThreadRc_Cycle_am_10010B(); + ThreadRc_Cycle_am_10020B A1_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); + ThreadRc_Cycle_am_10020B A2_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); + ThreadRc_Cycle_am_10020B A3_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); + ThreadRc_Cycle_am_10020B A4_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); + ThreadRc_Cycle_am_10020B A5_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); + ThreadRc_Cycle_am_10020B A6_Cycle_am_10020 = new ThreadRc_Cycle_am_10020B(); + A1_Cycle_am_10010.start(); + A2_Cycle_am_10010.start(); + A3_Cycle_am_10010.start(); + A4_Cycle_am_10010.start(); + A5_Cycle_am_10010.start(); + A6_Cycle_am_10010.start(); + A1_Cycle_am_10020.start(); + A2_Cycle_am_10020.start(); + A3_Cycle_am_10020.start(); + A4_Cycle_am_10020.start(); + A5_Cycle_am_10020.start(); + A6_Cycle_am_10020.start(); + + try { + A1_Cycle_am_10010.join(); + A2_Cycle_am_10010.join(); + A3_Cycle_am_10010.join(); + A4_Cycle_am_10010.join(); + A5_Cycle_am_10010.join(); + A6_Cycle_am_10010.join(); + A1_Cycle_am_10020.join(); + A2_Cycle_am_10020.join(); + A3_Cycle_am_10020.join(); + A4_Cycle_am_10020.join(); + A5_Cycle_am_10020.join(); + A6_Cycle_am_10020.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_am_10010.check() && A2_Cycle_am_10010.check() && A3_Cycle_am_10010.check() && A4_Cycle_am_10010.check() && A5_Cycle_am_10010.check() && A6_Cycle_am_10010.check() && A1_Cycle_am_10020.check() && A2_Cycle_am_10020.check() && A3_Cycle_am_10020.check() && A4_Cycle_am_10020.check() && A5_Cycle_am_10020.check() && A6_Cycle_am_10020.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0157-rc-function-RC_Thread01-Cycle_Bm_1_00010/Cycle_Bm_1_00010.java b/test/testsuite/ouroboros/memory_management/Function/RC0157-rc-function-RC_Thread01-Cycle_Bm_1_00010/Cycle_Bm_1_00010.java index a2af4edc9f0ba82dc15abba6b8acc58b9c86bf83..e508c2ba692d35163a15f8d925e339e828b1c0a8 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0157-rc-function-RC_Thread01-Cycle_Bm_1_00010/Cycle_Bm_1_00010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0157-rc-function-RC_Thread01-Cycle_Bm_1_00010/Cycle_Bm_1_00010.java @@ -1,103 +1,103 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00010 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00010.java - *- @ExecuteClass: Cycle_Bm_1_00010 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00010 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00010_A1 a1_0 = new Cycle_B_1_00010_A1(); - a1_0.a1_0 = a1_0; - a1_0.add(); - int nsum = a1_0.sum; - //System.out.println(nsum); - - if (nsum == 246) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00010_A1 { - Cycle_B_1_00010_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00010_A1() { - a1_0 = null; - a = 123; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_1_00010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00010 A1_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A2_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A3_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A4_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A5_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - ThreadRc_Cycle_Bm_1_00010 A6_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); - - A1_Cycle_Bm_1_00010.start(); - A2_Cycle_Bm_1_00010.start(); - A3_Cycle_Bm_1_00010.start(); - A4_Cycle_Bm_1_00010.start(); - A5_Cycle_Bm_1_00010.start(); - A6_Cycle_Bm_1_00010.start(); - - try { - A1_Cycle_Bm_1_00010.join(); - A2_Cycle_Bm_1_00010.join(); - A3_Cycle_Bm_1_00010.join(); - A4_Cycle_Bm_1_00010.join(); - A5_Cycle_Bm_1_00010.join(); - A6_Cycle_Bm_1_00010.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00010.check() && A2_Cycle_Bm_1_00010.check() && A3_Cycle_Bm_1_00010.check() && A4_Cycle_Bm_1_00010.check() && A5_Cycle_Bm_1_00010.check() && A6_Cycle_Bm_1_00010.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00010 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00010.java + *- @ExecuteClass: Cycle_Bm_1_00010 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00010 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00010_A1 a1_0 = new Cycle_B_1_00010_A1(); + a1_0.a1_0 = a1_0; + a1_0.add(); + int nsum = a1_0.sum; + //System.out.println(nsum); + + if (nsum == 246) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00010_A1 { + Cycle_B_1_00010_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00010_A1() { + a1_0 = null; + a = 123; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_1_00010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00010 A1_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A2_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A3_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A4_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A5_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + ThreadRc_Cycle_Bm_1_00010 A6_Cycle_Bm_1_00010 = new ThreadRc_Cycle_Bm_1_00010(); + + A1_Cycle_Bm_1_00010.start(); + A2_Cycle_Bm_1_00010.start(); + A3_Cycle_Bm_1_00010.start(); + A4_Cycle_Bm_1_00010.start(); + A5_Cycle_Bm_1_00010.start(); + A6_Cycle_Bm_1_00010.start(); + + try { + A1_Cycle_Bm_1_00010.join(); + A2_Cycle_Bm_1_00010.join(); + A3_Cycle_Bm_1_00010.join(); + A4_Cycle_Bm_1_00010.join(); + A5_Cycle_Bm_1_00010.join(); + A6_Cycle_Bm_1_00010.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00010.check() && A2_Cycle_Bm_1_00010.check() && A3_Cycle_Bm_1_00010.check() && A4_Cycle_Bm_1_00010.check() && A5_Cycle_Bm_1_00010.check() && A6_Cycle_Bm_1_00010.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0158-rc-function-RC_Thread01-Cycle_Bm_1_00020/Cycle_Bm_1_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0158-rc-function-RC_Thread01-Cycle_Bm_1_00020/Cycle_Bm_1_00020.java index 0b1c69f442e2da8a1c2b64a9c3481608b343e983..81639ab53143fce6393a3692376af3b3a50f02b2 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0158-rc-function-RC_Thread01-Cycle_Bm_1_00020/Cycle_Bm_1_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0158-rc-function-RC_Thread01-Cycle_Bm_1_00020/Cycle_Bm_1_00020.java @@ -1,123 +1,123 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00020 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00020.java - *- @ExecuteClass: Cycle_Bm_1_00020 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_Bm_1_00020 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00020_A1 a1_0 = new Cycle_B_1_00020_A1(); - a1_0.a2_0 = new Cycle_B_1_00020_A2(); - a1_0.a2_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - - int nsum = (a1_0.sum + a1_0.a2_0.sum); - //System.out.println(nsum); - - if (nsum == 6) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00020_A1 { - Cycle_B_1_00020_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00020_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00020_A2 { - Cycle_B_1_00020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00020_A2() { - a1_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_1_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00020 A1_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); - ThreadRc_Cycle_Bm_1_00020 A2_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); - ThreadRc_Cycle_Bm_1_00020 A3_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); - ThreadRc_Cycle_Bm_1_00020 A4_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); - ThreadRc_Cycle_Bm_1_00020 A5_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); - ThreadRc_Cycle_Bm_1_00020 A6_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); - - A1_Cycle_Bm_1_00020.start(); - A2_Cycle_Bm_1_00020.start(); - A3_Cycle_Bm_1_00020.start(); - A4_Cycle_Bm_1_00020.start(); - A5_Cycle_Bm_1_00020.start(); - A6_Cycle_Bm_1_00020.start(); - - try { - A1_Cycle_Bm_1_00020.join(); - A2_Cycle_Bm_1_00020.join(); - A3_Cycle_Bm_1_00020.join(); - A4_Cycle_Bm_1_00020.join(); - A5_Cycle_Bm_1_00020.join(); - A6_Cycle_Bm_1_00020.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00020.check() && A2_Cycle_Bm_1_00020.check() && A3_Cycle_Bm_1_00020.check() && A4_Cycle_Bm_1_00020.check() && A5_Cycle_Bm_1_00020.check() && A6_Cycle_Bm_1_00020.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00020 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00020.java + *- @ExecuteClass: Cycle_Bm_1_00020 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_Bm_1_00020 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00020_A1 a1_0 = new Cycle_B_1_00020_A1(); + a1_0.a2_0 = new Cycle_B_1_00020_A2(); + a1_0.a2_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + + int nsum = (a1_0.sum + a1_0.a2_0.sum); + //System.out.println(nsum); + + if (nsum == 6) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00020_A1 { + Cycle_B_1_00020_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00020_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00020_A2 { + Cycle_B_1_00020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00020_A2() { + a1_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_1_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00020 A1_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); + ThreadRc_Cycle_Bm_1_00020 A2_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); + ThreadRc_Cycle_Bm_1_00020 A3_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); + ThreadRc_Cycle_Bm_1_00020 A4_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); + ThreadRc_Cycle_Bm_1_00020 A5_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); + ThreadRc_Cycle_Bm_1_00020 A6_Cycle_Bm_1_00020 = new ThreadRc_Cycle_Bm_1_00020(); + + A1_Cycle_Bm_1_00020.start(); + A2_Cycle_Bm_1_00020.start(); + A3_Cycle_Bm_1_00020.start(); + A4_Cycle_Bm_1_00020.start(); + A5_Cycle_Bm_1_00020.start(); + A6_Cycle_Bm_1_00020.start(); + + try { + A1_Cycle_Bm_1_00020.join(); + A2_Cycle_Bm_1_00020.join(); + A3_Cycle_Bm_1_00020.join(); + A4_Cycle_Bm_1_00020.join(); + A5_Cycle_Bm_1_00020.join(); + A6_Cycle_Bm_1_00020.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00020.check() && A2_Cycle_Bm_1_00020.check() && A3_Cycle_Bm_1_00020.check() && A4_Cycle_Bm_1_00020.check() && A5_Cycle_Bm_1_00020.check() && A6_Cycle_Bm_1_00020.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0159-rc-function-RC_Thread01-Cycle_Bm_1_00030/Cycle_Bm_1_00030.java b/test/testsuite/ouroboros/memory_management/Function/RC0159-rc-function-RC_Thread01-Cycle_Bm_1_00030/Cycle_Bm_1_00030.java index 481f32b5a45a3d0ba933dc9a4dcd52e1c7522235..2344f0f7b3536db36c422d3de862f2bedbb22f84 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0159-rc-function-RC_Thread01-Cycle_Bm_1_00030/Cycle_Bm_1_00030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0159-rc-function-RC_Thread01-Cycle_Bm_1_00030/Cycle_Bm_1_00030.java @@ -1,140 +1,140 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00030 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00030.java - *- @ExecuteClass: Cycle_Bm_1_00030 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_Bm_1_00030 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00030_A1 a1_0 = new Cycle_B_1_00030_A1(); - a1_0.a2_0 = new Cycle_B_1_00030_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00030_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 12) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00030_A1 { - Cycle_B_1_00030_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00030_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00030_A2 { - Cycle_B_1_00030_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00030_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00030_A3 { - Cycle_B_1_00030_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00030_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_1_00030 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00030 A1_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); - ThreadRc_Cycle_Bm_1_00030 A2_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); - ThreadRc_Cycle_Bm_1_00030 A3_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); - ThreadRc_Cycle_Bm_1_00030 A4_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); - ThreadRc_Cycle_Bm_1_00030 A5_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); - ThreadRc_Cycle_Bm_1_00030 A6_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); - - A1_Cycle_Bm_1_00030.start(); - A2_Cycle_Bm_1_00030.start(); - A3_Cycle_Bm_1_00030.start(); - A4_Cycle_Bm_1_00030.start(); - A5_Cycle_Bm_1_00030.start(); - A6_Cycle_Bm_1_00030.start(); - - try { - A1_Cycle_Bm_1_00030.join(); - A2_Cycle_Bm_1_00030.join(); - A3_Cycle_Bm_1_00030.join(); - A4_Cycle_Bm_1_00030.join(); - A5_Cycle_Bm_1_00030.join(); - A6_Cycle_Bm_1_00030.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00030.check() && A2_Cycle_Bm_1_00030.check() && A3_Cycle_Bm_1_00030.check() && A4_Cycle_Bm_1_00030.check() && A5_Cycle_Bm_1_00030.check() && A6_Cycle_Bm_1_00030.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00030 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00030.java + *- @ExecuteClass: Cycle_Bm_1_00030 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_Bm_1_00030 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00030_A1 a1_0 = new Cycle_B_1_00030_A1(); + a1_0.a2_0 = new Cycle_B_1_00030_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00030_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 12) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00030_A1 { + Cycle_B_1_00030_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00030_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00030_A2 { + Cycle_B_1_00030_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00030_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00030_A3 { + Cycle_B_1_00030_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00030_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_1_00030 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00030 A1_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); + ThreadRc_Cycle_Bm_1_00030 A2_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); + ThreadRc_Cycle_Bm_1_00030 A3_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); + ThreadRc_Cycle_Bm_1_00030 A4_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); + ThreadRc_Cycle_Bm_1_00030 A5_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); + ThreadRc_Cycle_Bm_1_00030 A6_Cycle_Bm_1_00030 = new ThreadRc_Cycle_Bm_1_00030(); + + A1_Cycle_Bm_1_00030.start(); + A2_Cycle_Bm_1_00030.start(); + A3_Cycle_Bm_1_00030.start(); + A4_Cycle_Bm_1_00030.start(); + A5_Cycle_Bm_1_00030.start(); + A6_Cycle_Bm_1_00030.start(); + + try { + A1_Cycle_Bm_1_00030.join(); + A2_Cycle_Bm_1_00030.join(); + A3_Cycle_Bm_1_00030.join(); + A4_Cycle_Bm_1_00030.join(); + A5_Cycle_Bm_1_00030.join(); + A6_Cycle_Bm_1_00030.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00030.check() && A2_Cycle_Bm_1_00030.check() && A3_Cycle_Bm_1_00030.check() && A4_Cycle_Bm_1_00030.check() && A5_Cycle_Bm_1_00030.check() && A6_Cycle_Bm_1_00030.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0160-rc-function-RC_Thread01-Cycle_Bm_1_00040/Cycle_Bm_1_00040.java b/test/testsuite/ouroboros/memory_management/Function/RC0160-rc-function-RC_Thread01-Cycle_Bm_1_00040/Cycle_Bm_1_00040.java index 0b3aab3c959aab18c4e10e0c1ee912e13f61bd46..5b65c649fde368930bce8da07bdb57a3c1107693 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0160-rc-function-RC_Thread01-Cycle_Bm_1_00040/Cycle_Bm_1_00040.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0160-rc-function-RC_Thread01-Cycle_Bm_1_00040/Cycle_Bm_1_00040.java @@ -1,160 +1,160 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00040.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00040 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00040.java - *- @ExecuteClass: Cycle_Bm_1_00040 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_Bm_1_00040 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00040_A1 a1_0 = new Cycle_B_1_00040_A1(); - a1_0.a2_0 = new Cycle_B_1_00040_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00040_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00040_A4(); - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum; - //System.out.println(nsum); - - if (nsum == 21) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00040_A1 { - Cycle_B_1_00040_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00040_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00040_A2 { - Cycle_B_1_00040_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00040_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00040_A3 { - Cycle_B_1_00040_A1 a1_0; - Cycle_B_1_00040_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00040_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00040_A4 { - - int a; - int sum; - - Cycle_B_1_00040_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } -} - - -public class Cycle_Bm_1_00040 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00040 A1_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); - ThreadRc_Cycle_Bm_1_00040 A2_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); - ThreadRc_Cycle_Bm_1_00040 A3_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); - ThreadRc_Cycle_Bm_1_00040 A4_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); - ThreadRc_Cycle_Bm_1_00040 A5_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); - ThreadRc_Cycle_Bm_1_00040 A6_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); - - A1_Cycle_Bm_1_00040.start(); - A2_Cycle_Bm_1_00040.start(); - A3_Cycle_Bm_1_00040.start(); - A4_Cycle_Bm_1_00040.start(); - A5_Cycle_Bm_1_00040.start(); - A6_Cycle_Bm_1_00040.start(); - - try { - A1_Cycle_Bm_1_00040.join(); - A2_Cycle_Bm_1_00040.join(); - A3_Cycle_Bm_1_00040.join(); - A4_Cycle_Bm_1_00040.join(); - A5_Cycle_Bm_1_00040.join(); - A6_Cycle_Bm_1_00040.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00040.check() && A2_Cycle_Bm_1_00040.check() && A3_Cycle_Bm_1_00040.check() && A4_Cycle_Bm_1_00040.check() && A5_Cycle_Bm_1_00040.check() && A6_Cycle_Bm_1_00040.check()) - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00040.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00040 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00040.java + *- @ExecuteClass: Cycle_Bm_1_00040 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_Bm_1_00040 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00040_A1 a1_0 = new Cycle_B_1_00040_A1(); + a1_0.a2_0 = new Cycle_B_1_00040_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00040_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00040_A4(); + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum; + //System.out.println(nsum); + + if (nsum == 21) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00040_A1 { + Cycle_B_1_00040_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00040_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00040_A2 { + Cycle_B_1_00040_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00040_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00040_A3 { + Cycle_B_1_00040_A1 a1_0; + Cycle_B_1_00040_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00040_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00040_A4 { + + int a; + int sum; + + Cycle_B_1_00040_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } +} + + +public class Cycle_Bm_1_00040 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00040 A1_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); + ThreadRc_Cycle_Bm_1_00040 A2_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); + ThreadRc_Cycle_Bm_1_00040 A3_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); + ThreadRc_Cycle_Bm_1_00040 A4_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); + ThreadRc_Cycle_Bm_1_00040 A5_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); + ThreadRc_Cycle_Bm_1_00040 A6_Cycle_Bm_1_00040 = new ThreadRc_Cycle_Bm_1_00040(); + + A1_Cycle_Bm_1_00040.start(); + A2_Cycle_Bm_1_00040.start(); + A3_Cycle_Bm_1_00040.start(); + A4_Cycle_Bm_1_00040.start(); + A5_Cycle_Bm_1_00040.start(); + A6_Cycle_Bm_1_00040.start(); + + try { + A1_Cycle_Bm_1_00040.join(); + A2_Cycle_Bm_1_00040.join(); + A3_Cycle_Bm_1_00040.join(); + A4_Cycle_Bm_1_00040.join(); + A5_Cycle_Bm_1_00040.join(); + A6_Cycle_Bm_1_00040.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00040.check() && A2_Cycle_Bm_1_00040.check() && A3_Cycle_Bm_1_00040.check() && A4_Cycle_Bm_1_00040.check() && A5_Cycle_Bm_1_00040.check() && A6_Cycle_Bm_1_00040.check()) + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0161-rc-function-RC_Thread01-Cycle_Bm_1_00050/Cycle_Bm_1_00050.java b/test/testsuite/ouroboros/memory_management/Function/RC0161-rc-function-RC_Thread01-Cycle_Bm_1_00050/Cycle_Bm_1_00050.java index 993ec9afa153f3f10c2aa9c0191e9caa60135770..0cbde23c293ee873efdc05b3391357d31f68a87e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0161-rc-function-RC_Thread01-Cycle_Bm_1_00050/Cycle_Bm_1_00050.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0161-rc-function-RC_Thread01-Cycle_Bm_1_00050/Cycle_Bm_1_00050.java @@ -1,178 +1,178 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00050.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00050 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00050.java - *- @ExecuteClass: Cycle_Bm_1_00050 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_Bm_1_00050 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00050_A1 a1_0 = new Cycle_B_1_00050_A1(); - a1_0.a2_0 = new Cycle_B_1_00050_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00050_A3(); - a1_0.a2_0.a4_0 = new Cycle_B_1_00050_A4(); - a1_0.a2_0.a5_0 = new Cycle_B_1_00050_A5(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - a1_0.a2_0.a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a5_0.sum; - //System.out.println(nsum); - - if (nsum == 34) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00050_A1 { - Cycle_B_1_00050_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00050_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00050_A2 { - Cycle_B_1_00050_A3 a3_0; - Cycle_B_1_00050_A4 a4_0; - Cycle_B_1_00050_A5 a5_0; - int a; - int sum; - - Cycle_B_1_00050_A2() { - a3_0 = null; - a4_0 = null; - a5_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00050_A3 { - Cycle_B_1_00050_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00050_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00050_A4 { - - int a; - int sum; - - Cycle_B_1_00050_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } - - class Cycle_B_1_00050_A5 { - - int a; - int sum; - - Cycle_B_1_00050_A5() { - a = 6; - sum = 0; - } - - void add() { - sum = a + 7; - } - } -} - - -public class Cycle_Bm_1_00050 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00050 A1_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); - ThreadRc_Cycle_Bm_1_00050 A2_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); - ThreadRc_Cycle_Bm_1_00050 A3_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); - ThreadRc_Cycle_Bm_1_00050 A4_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); - ThreadRc_Cycle_Bm_1_00050 A5_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); - ThreadRc_Cycle_Bm_1_00050 A6_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); - - A1_Cycle_Bm_1_00050.start(); - A2_Cycle_Bm_1_00050.start(); - A3_Cycle_Bm_1_00050.start(); - A4_Cycle_Bm_1_00050.start(); - A5_Cycle_Bm_1_00050.start(); - A6_Cycle_Bm_1_00050.start(); - - try { - A1_Cycle_Bm_1_00050.join(); - A2_Cycle_Bm_1_00050.join(); - A3_Cycle_Bm_1_00050.join(); - A4_Cycle_Bm_1_00050.join(); - A5_Cycle_Bm_1_00050.join(); - A6_Cycle_Bm_1_00050.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00050.check() && A2_Cycle_Bm_1_00050.check() && A3_Cycle_Bm_1_00050.check() && A4_Cycle_Bm_1_00050.check() && A5_Cycle_Bm_1_00050.check() && A6_Cycle_Bm_1_00050.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00050.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00050 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00050.java + *- @ExecuteClass: Cycle_Bm_1_00050 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_Bm_1_00050 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00050_A1 a1_0 = new Cycle_B_1_00050_A1(); + a1_0.a2_0 = new Cycle_B_1_00050_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00050_A3(); + a1_0.a2_0.a4_0 = new Cycle_B_1_00050_A4(); + a1_0.a2_0.a5_0 = new Cycle_B_1_00050_A5(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + a1_0.a2_0.a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a5_0.sum; + //System.out.println(nsum); + + if (nsum == 34) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00050_A1 { + Cycle_B_1_00050_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00050_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00050_A2 { + Cycle_B_1_00050_A3 a3_0; + Cycle_B_1_00050_A4 a4_0; + Cycle_B_1_00050_A5 a5_0; + int a; + int sum; + + Cycle_B_1_00050_A2() { + a3_0 = null; + a4_0 = null; + a5_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00050_A3 { + Cycle_B_1_00050_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00050_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00050_A4 { + + int a; + int sum; + + Cycle_B_1_00050_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } + + class Cycle_B_1_00050_A5 { + + int a; + int sum; + + Cycle_B_1_00050_A5() { + a = 6; + sum = 0; + } + + void add() { + sum = a + 7; + } + } +} + + +public class Cycle_Bm_1_00050 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00050 A1_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); + ThreadRc_Cycle_Bm_1_00050 A2_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); + ThreadRc_Cycle_Bm_1_00050 A3_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); + ThreadRc_Cycle_Bm_1_00050 A4_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); + ThreadRc_Cycle_Bm_1_00050 A5_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); + ThreadRc_Cycle_Bm_1_00050 A6_Cycle_Bm_1_00050 = new ThreadRc_Cycle_Bm_1_00050(); + + A1_Cycle_Bm_1_00050.start(); + A2_Cycle_Bm_1_00050.start(); + A3_Cycle_Bm_1_00050.start(); + A4_Cycle_Bm_1_00050.start(); + A5_Cycle_Bm_1_00050.start(); + A6_Cycle_Bm_1_00050.start(); + + try { + A1_Cycle_Bm_1_00050.join(); + A2_Cycle_Bm_1_00050.join(); + A3_Cycle_Bm_1_00050.join(); + A4_Cycle_Bm_1_00050.join(); + A5_Cycle_Bm_1_00050.join(); + A6_Cycle_Bm_1_00050.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00050.check() && A2_Cycle_Bm_1_00050.check() && A3_Cycle_Bm_1_00050.check() && A4_Cycle_Bm_1_00050.check() && A5_Cycle_Bm_1_00050.check() && A6_Cycle_Bm_1_00050.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0162-rc-function-RC_Thread01-Cycle_Bm_1_00060/Cycle_Bm_1_00060.java b/test/testsuite/ouroboros/memory_management/Function/RC0162-rc-function-RC_Thread01-Cycle_Bm_1_00060/Cycle_Bm_1_00060.java index 0508cafebd5a22459eb051e5fc871952c0d2af82..f3d7d95f28a07c5fdaf6d9be359f3ed958589f3e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0162-rc-function-RC_Thread01-Cycle_Bm_1_00060/Cycle_Bm_1_00060.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0162-rc-function-RC_Thread01-Cycle_Bm_1_00060/Cycle_Bm_1_00060.java @@ -1,159 +1,159 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00060.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00060 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00060.java - *- @ExecuteClass: Cycle_Bm_1_00060 - *- @ExecuteArgs: - */ - -class ThreadRc_Cycle_Bm_1_00060 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00060_A1 a1_0 = new Cycle_B_1_00060_A1(); - a1_0.a2_0 = new Cycle_B_1_00060_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00060_A3(); - Cycle_B_1_00060_A4 a4_0 = new Cycle_B_1_00060_A4(); - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum; - //System.out.println(nsum); - - if (nsum == 19) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00060_A1 { - Cycle_B_1_00060_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00060_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00060_A2 { - Cycle_B_1_00060_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00060_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00060_A3 { - Cycle_B_1_00060_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00060_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00060_A4 { - Cycle_B_1_00060_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00060_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_Bm_1_00060 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00060 A1_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); - ThreadRc_Cycle_Bm_1_00060 A2_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); - ThreadRc_Cycle_Bm_1_00060 A3_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); - ThreadRc_Cycle_Bm_1_00060 A4_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); - ThreadRc_Cycle_Bm_1_00060 A5_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); - ThreadRc_Cycle_Bm_1_00060 A6_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); - - A1_Cycle_Bm_1_00060.start(); - A2_Cycle_Bm_1_00060.start(); - A3_Cycle_Bm_1_00060.start(); - A4_Cycle_Bm_1_00060.start(); - A5_Cycle_Bm_1_00060.start(); - A6_Cycle_Bm_1_00060.start(); - - try { - A1_Cycle_Bm_1_00060.join(); - A2_Cycle_Bm_1_00060.join(); - A3_Cycle_Bm_1_00060.join(); - A4_Cycle_Bm_1_00060.join(); - A5_Cycle_Bm_1_00060.join(); - A6_Cycle_Bm_1_00060.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00060.check() && A2_Cycle_Bm_1_00060.check() && A3_Cycle_Bm_1_00060.check() && A4_Cycle_Bm_1_00060.check() && A5_Cycle_Bm_1_00060.check() && A6_Cycle_Bm_1_00060.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00060.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00060 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00060.java + *- @ExecuteClass: Cycle_Bm_1_00060 + *- @ExecuteArgs: + */ + +class ThreadRc_Cycle_Bm_1_00060 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00060_A1 a1_0 = new Cycle_B_1_00060_A1(); + a1_0.a2_0 = new Cycle_B_1_00060_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00060_A3(); + Cycle_B_1_00060_A4 a4_0 = new Cycle_B_1_00060_A4(); + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum; + //System.out.println(nsum); + + if (nsum == 19) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00060_A1 { + Cycle_B_1_00060_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00060_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00060_A2 { + Cycle_B_1_00060_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00060_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00060_A3 { + Cycle_B_1_00060_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00060_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00060_A4 { + Cycle_B_1_00060_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00060_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_Bm_1_00060 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00060 A1_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); + ThreadRc_Cycle_Bm_1_00060 A2_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); + ThreadRc_Cycle_Bm_1_00060 A3_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); + ThreadRc_Cycle_Bm_1_00060 A4_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); + ThreadRc_Cycle_Bm_1_00060 A5_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); + ThreadRc_Cycle_Bm_1_00060 A6_Cycle_Bm_1_00060 = new ThreadRc_Cycle_Bm_1_00060(); + + A1_Cycle_Bm_1_00060.start(); + A2_Cycle_Bm_1_00060.start(); + A3_Cycle_Bm_1_00060.start(); + A4_Cycle_Bm_1_00060.start(); + A5_Cycle_Bm_1_00060.start(); + A6_Cycle_Bm_1_00060.start(); + + try { + A1_Cycle_Bm_1_00060.join(); + A2_Cycle_Bm_1_00060.join(); + A3_Cycle_Bm_1_00060.join(); + A4_Cycle_Bm_1_00060.join(); + A5_Cycle_Bm_1_00060.join(); + A6_Cycle_Bm_1_00060.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00060.check() && A2_Cycle_Bm_1_00060.check() && A3_Cycle_Bm_1_00060.check() && A4_Cycle_Bm_1_00060.check() && A5_Cycle_Bm_1_00060.check() && A6_Cycle_Bm_1_00060.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0163-rc-function-RC_Thread01-Cycle_Bm_1_00070/Cycle_Bm_1_00070.java b/test/testsuite/ouroboros/memory_management/Function/RC0163-rc-function-RC_Thread01-Cycle_Bm_1_00070/Cycle_Bm_1_00070.java index 30d84fed836ec6c4bb5e9ffade0b90890eac406a..14ef5d48869eae5a6caf11c6e60b3d1d2712f8c8 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0163-rc-function-RC_Thread01-Cycle_Bm_1_00070/Cycle_Bm_1_00070.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0163-rc-function-RC_Thread01-Cycle_Bm_1_00070/Cycle_Bm_1_00070.java @@ -1,158 +1,158 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00070.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00070 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00070.java - *- @ExecuteClass: Cycle_Bm_1_00070 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00070 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00070_A1 a1_0 = new Cycle_B_1_00070_A1(); - a1_0.a2_0 = new Cycle_B_1_00070_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00070_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00070_A4(); - - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum; - //System.out.println(nsum); - - if (nsum == 21) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00070_A1 { - Cycle_B_1_00070_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00070_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00070_A2 { - Cycle_B_1_00070_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00070_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00070_A3 { - Cycle_B_1_00070_A1 a1_0; - Cycle_B_1_00070_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00070_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00070_A4 { - int a; - int sum; - - Cycle_B_1_00070_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } -} - - -public class Cycle_Bm_1_00070 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00070 A1_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); - ThreadRc_Cycle_Bm_1_00070 A2_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); - ThreadRc_Cycle_Bm_1_00070 A3_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); - ThreadRc_Cycle_Bm_1_00070 A4_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); - ThreadRc_Cycle_Bm_1_00070 A5_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); - ThreadRc_Cycle_Bm_1_00070 A6_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); - - A1_Cycle_Bm_1_00070.start(); - A2_Cycle_Bm_1_00070.start(); - A3_Cycle_Bm_1_00070.start(); - A4_Cycle_Bm_1_00070.start(); - A5_Cycle_Bm_1_00070.start(); - A6_Cycle_Bm_1_00070.start(); - - try { - A1_Cycle_Bm_1_00070.join(); - A2_Cycle_Bm_1_00070.join(); - A3_Cycle_Bm_1_00070.join(); - A4_Cycle_Bm_1_00070.join(); - A5_Cycle_Bm_1_00070.join(); - A6_Cycle_Bm_1_00070.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00070.check() && A2_Cycle_Bm_1_00070.check() && A3_Cycle_Bm_1_00070.check() && A4_Cycle_Bm_1_00070.check() && A5_Cycle_Bm_1_00070.check() && A6_Cycle_Bm_1_00070.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00070.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00070 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00070.java + *- @ExecuteClass: Cycle_Bm_1_00070 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00070 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00070_A1 a1_0 = new Cycle_B_1_00070_A1(); + a1_0.a2_0 = new Cycle_B_1_00070_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00070_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00070_A4(); + + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum; + //System.out.println(nsum); + + if (nsum == 21) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00070_A1 { + Cycle_B_1_00070_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00070_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00070_A2 { + Cycle_B_1_00070_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00070_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00070_A3 { + Cycle_B_1_00070_A1 a1_0; + Cycle_B_1_00070_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00070_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00070_A4 { + int a; + int sum; + + Cycle_B_1_00070_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } +} + + +public class Cycle_Bm_1_00070 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00070 A1_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); + ThreadRc_Cycle_Bm_1_00070 A2_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); + ThreadRc_Cycle_Bm_1_00070 A3_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); + ThreadRc_Cycle_Bm_1_00070 A4_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); + ThreadRc_Cycle_Bm_1_00070 A5_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); + ThreadRc_Cycle_Bm_1_00070 A6_Cycle_Bm_1_00070 = new ThreadRc_Cycle_Bm_1_00070(); + + A1_Cycle_Bm_1_00070.start(); + A2_Cycle_Bm_1_00070.start(); + A3_Cycle_Bm_1_00070.start(); + A4_Cycle_Bm_1_00070.start(); + A5_Cycle_Bm_1_00070.start(); + A6_Cycle_Bm_1_00070.start(); + + try { + A1_Cycle_Bm_1_00070.join(); + A2_Cycle_Bm_1_00070.join(); + A3_Cycle_Bm_1_00070.join(); + A4_Cycle_Bm_1_00070.join(); + A5_Cycle_Bm_1_00070.join(); + A6_Cycle_Bm_1_00070.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00070.check() && A2_Cycle_Bm_1_00070.check() && A3_Cycle_Bm_1_00070.check() && A4_Cycle_Bm_1_00070.check() && A5_Cycle_Bm_1_00070.check() && A6_Cycle_Bm_1_00070.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0164-rc-function-RC_Thread01-Cycle_Bm_1_00080/Cycle_Bm_1_00080.java b/test/testsuite/ouroboros/memory_management/Function/RC0164-rc-function-RC_Thread01-Cycle_Bm_1_00080/Cycle_Bm_1_00080.java index f74c9b7c889fde910bdb9ade3711f9e0fe80129a..d3a9c995dab0653cc84f32537d167f23a3eea54e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0164-rc-function-RC_Thread01-Cycle_Bm_1_00080/Cycle_Bm_1_00080.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0164-rc-function-RC_Thread01-Cycle_Bm_1_00080/Cycle_Bm_1_00080.java @@ -1,175 +1,175 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00080.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00080 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00080.java - *- @ExecuteClass: Cycle_Bm_1_00080 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00080 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00080_A1 a1_0 = new Cycle_B_1_00080_A1(); - a1_0.a2_0 = new Cycle_B_1_00080_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00080_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00080_A4(); - a1_0.a2_0.a3_0.a5_0 = new Cycle_B_1_00080_A5(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a5_0.sum; - //System.out.println(nsum); - - if (nsum == 56) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00080_A1 { - Cycle_B_1_00080_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00080_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00080_A2 { - Cycle_B_1_00080_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00080_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00080_A3 { - Cycle_B_1_00080_A1 a1_0; - Cycle_B_1_00080_A4 a4_0; - Cycle_B_1_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_1_00080_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - a4_0.add(); - a5_0.add(); - sum = a + a1_0.a + a4_0.sum + a5_0.sum; - } - } - - class Cycle_B_1_00080_A4 { - int a; - int sum; - - Cycle_B_1_00080_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } - - class Cycle_B_1_00080_A5 { - int a; - int sum; - - Cycle_B_1_00080_A5() { - a = 6; - sum = 0; - } - - void add() { - sum = a + 7; - } - } -} - - -public class Cycle_Bm_1_00080 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00080 A1_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); - ThreadRc_Cycle_Bm_1_00080 A2_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); - ThreadRc_Cycle_Bm_1_00080 A3_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); - ThreadRc_Cycle_Bm_1_00080 A4_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); - ThreadRc_Cycle_Bm_1_00080 A5_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); - ThreadRc_Cycle_Bm_1_00080 A6_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); - - A1_Cycle_Bm_1_00080.start(); - A2_Cycle_Bm_1_00080.start(); - A3_Cycle_Bm_1_00080.start(); - A4_Cycle_Bm_1_00080.start(); - A5_Cycle_Bm_1_00080.start(); - A6_Cycle_Bm_1_00080.start(); - - try { - A1_Cycle_Bm_1_00080.join(); - A2_Cycle_Bm_1_00080.join(); - A3_Cycle_Bm_1_00080.join(); - A4_Cycle_Bm_1_00080.join(); - A5_Cycle_Bm_1_00080.join(); - A6_Cycle_Bm_1_00080.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00080.check() && A2_Cycle_Bm_1_00080.check() && A3_Cycle_Bm_1_00080.check() && A4_Cycle_Bm_1_00080.check() && A5_Cycle_Bm_1_00080.check() && A6_Cycle_Bm_1_00080.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00080.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00080 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00080.java + *- @ExecuteClass: Cycle_Bm_1_00080 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00080 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00080_A1 a1_0 = new Cycle_B_1_00080_A1(); + a1_0.a2_0 = new Cycle_B_1_00080_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00080_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00080_A4(); + a1_0.a2_0.a3_0.a5_0 = new Cycle_B_1_00080_A5(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a5_0.sum; + //System.out.println(nsum); + + if (nsum == 56) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00080_A1 { + Cycle_B_1_00080_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00080_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00080_A2 { + Cycle_B_1_00080_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00080_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00080_A3 { + Cycle_B_1_00080_A1 a1_0; + Cycle_B_1_00080_A4 a4_0; + Cycle_B_1_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_1_00080_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + a4_0.add(); + a5_0.add(); + sum = a + a1_0.a + a4_0.sum + a5_0.sum; + } + } + + class Cycle_B_1_00080_A4 { + int a; + int sum; + + Cycle_B_1_00080_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } + + class Cycle_B_1_00080_A5 { + int a; + int sum; + + Cycle_B_1_00080_A5() { + a = 6; + sum = 0; + } + + void add() { + sum = a + 7; + } + } +} + + +public class Cycle_Bm_1_00080 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00080 A1_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); + ThreadRc_Cycle_Bm_1_00080 A2_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); + ThreadRc_Cycle_Bm_1_00080 A3_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); + ThreadRc_Cycle_Bm_1_00080 A4_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); + ThreadRc_Cycle_Bm_1_00080 A5_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); + ThreadRc_Cycle_Bm_1_00080 A6_Cycle_Bm_1_00080 = new ThreadRc_Cycle_Bm_1_00080(); + + A1_Cycle_Bm_1_00080.start(); + A2_Cycle_Bm_1_00080.start(); + A3_Cycle_Bm_1_00080.start(); + A4_Cycle_Bm_1_00080.start(); + A5_Cycle_Bm_1_00080.start(); + A6_Cycle_Bm_1_00080.start(); + + try { + A1_Cycle_Bm_1_00080.join(); + A2_Cycle_Bm_1_00080.join(); + A3_Cycle_Bm_1_00080.join(); + A4_Cycle_Bm_1_00080.join(); + A5_Cycle_Bm_1_00080.join(); + A6_Cycle_Bm_1_00080.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00080.check() && A2_Cycle_Bm_1_00080.check() && A3_Cycle_Bm_1_00080.check() && A4_Cycle_Bm_1_00080.check() && A5_Cycle_Bm_1_00080.check() && A6_Cycle_Bm_1_00080.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0165-rc-function-RC_Thread01-Cycle_Bm_1_00090/Cycle_Bm_1_00090.java b/test/testsuite/ouroboros/memory_management/Function/RC0165-rc-function-RC_Thread01-Cycle_Bm_1_00090/Cycle_Bm_1_00090.java index bdc2a5f68b3e3a6423685a5df95f003389c9e505..c5557ed1f2f6640d86054b7c8c34c49e99751b1f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0165-rc-function-RC_Thread01-Cycle_Bm_1_00090/Cycle_Bm_1_00090.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0165-rc-function-RC_Thread01-Cycle_Bm_1_00090/Cycle_Bm_1_00090.java @@ -1,177 +1,177 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00090.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00090 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00090.java - *- @ExecuteClass: Cycle_Bm_1_00090 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00090 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00090_A1 a1_0 = new Cycle_B_1_00090_A1(); - a1_0.a2_0 = new Cycle_B_1_00090_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00090_A3(); - Cycle_B_1_00090_A4 a4_0 = new Cycle_B_1_00090_A4(); - Cycle_B_1_00090_A5 a5_0 = new Cycle_B_1_00090_A5(); - a4_0.a2_0 = a1_0.a2_0; - a5_0.a2_0 = a1_0.a2_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum; - //System.out.println(nsum); - - if (nsum == 25) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00090_A1 { - Cycle_B_1_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00090_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00090_A2 { - Cycle_B_1_00090_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00090_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00090_A3 { - Cycle_B_1_00090_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00090_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00090_A4 { - Cycle_B_1_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00090_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00090_A5 { - Cycle_B_1_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00090_A5() { - a2_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_Bm_1_00090 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00090 A1_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); - ThreadRc_Cycle_Bm_1_00090 A2_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); - ThreadRc_Cycle_Bm_1_00090 A3_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); - ThreadRc_Cycle_Bm_1_00090 A4_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); - ThreadRc_Cycle_Bm_1_00090 A5_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); - ThreadRc_Cycle_Bm_1_00090 A6_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); - - A1_Cycle_Bm_1_00090.start(); - A2_Cycle_Bm_1_00090.start(); - A3_Cycle_Bm_1_00090.start(); - A4_Cycle_Bm_1_00090.start(); - A5_Cycle_Bm_1_00090.start(); - A6_Cycle_Bm_1_00090.start(); - - try { - A1_Cycle_Bm_1_00090.join(); - A2_Cycle_Bm_1_00090.join(); - A3_Cycle_Bm_1_00090.join(); - A4_Cycle_Bm_1_00090.join(); - A5_Cycle_Bm_1_00090.join(); - A6_Cycle_Bm_1_00090.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00090.check() && A2_Cycle_Bm_1_00090.check() && A3_Cycle_Bm_1_00090.check() && A4_Cycle_Bm_1_00090.check() && A5_Cycle_Bm_1_00090.check() && A6_Cycle_Bm_1_00090.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00090.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00090 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00090.java + *- @ExecuteClass: Cycle_Bm_1_00090 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00090 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00090_A1 a1_0 = new Cycle_B_1_00090_A1(); + a1_0.a2_0 = new Cycle_B_1_00090_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00090_A3(); + Cycle_B_1_00090_A4 a4_0 = new Cycle_B_1_00090_A4(); + Cycle_B_1_00090_A5 a5_0 = new Cycle_B_1_00090_A5(); + a4_0.a2_0 = a1_0.a2_0; + a5_0.a2_0 = a1_0.a2_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum; + //System.out.println(nsum); + + if (nsum == 25) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00090_A1 { + Cycle_B_1_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00090_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00090_A2 { + Cycle_B_1_00090_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00090_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00090_A3 { + Cycle_B_1_00090_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00090_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00090_A4 { + Cycle_B_1_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00090_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00090_A5 { + Cycle_B_1_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00090_A5() { + a2_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_Bm_1_00090 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00090 A1_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); + ThreadRc_Cycle_Bm_1_00090 A2_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); + ThreadRc_Cycle_Bm_1_00090 A3_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); + ThreadRc_Cycle_Bm_1_00090 A4_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); + ThreadRc_Cycle_Bm_1_00090 A5_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); + ThreadRc_Cycle_Bm_1_00090 A6_Cycle_Bm_1_00090 = new ThreadRc_Cycle_Bm_1_00090(); + + A1_Cycle_Bm_1_00090.start(); + A2_Cycle_Bm_1_00090.start(); + A3_Cycle_Bm_1_00090.start(); + A4_Cycle_Bm_1_00090.start(); + A5_Cycle_Bm_1_00090.start(); + A6_Cycle_Bm_1_00090.start(); + + try { + A1_Cycle_Bm_1_00090.join(); + A2_Cycle_Bm_1_00090.join(); + A3_Cycle_Bm_1_00090.join(); + A4_Cycle_Bm_1_00090.join(); + A5_Cycle_Bm_1_00090.join(); + A6_Cycle_Bm_1_00090.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00090.check() && A2_Cycle_Bm_1_00090.check() && A3_Cycle_Bm_1_00090.check() && A4_Cycle_Bm_1_00090.check() && A5_Cycle_Bm_1_00090.check() && A6_Cycle_Bm_1_00090.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0166-rc-function-RC_Thread01-Cycle_Bm_1_00100/Cycle_Bm_1_00100.java b/test/testsuite/ouroboros/memory_management/Function/RC0166-rc-function-RC_Thread01-Cycle_Bm_1_00100/Cycle_Bm_1_00100.java index acdcdd104e2ad32719021f9987ad8e15463051e5..e6dd14d25e15a8442d7d7b5929eaf461ca0407ee 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0166-rc-function-RC_Thread01-Cycle_Bm_1_00100/Cycle_Bm_1_00100.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0166-rc-function-RC_Thread01-Cycle_Bm_1_00100/Cycle_Bm_1_00100.java @@ -1,179 +1,179 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00100.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00100 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00100.java - *- @ExecuteClass: Cycle_Bm_1_00100 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00100 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00100_A1 a1_0 = new Cycle_B_1_00100_A1(); - a1_0.a2_0 = new Cycle_B_1_00100_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00100_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a4_0 = new Cycle_B_1_00100_A4(); - a1_0.a2_0.a4_0.a5_0 = new Cycle_B_1_00100_A5(); - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - a1_0.a2_0.a4_0.a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a4_0.a5_0.sum; - ; - //System.out.println(nsum); - - if (nsum == 38) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00100_A1 { - Cycle_B_1_00100_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00100_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00100_A2 { - Cycle_B_1_00100_A3 a3_0; - Cycle_B_1_00100_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00100_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00100_A3 { - Cycle_B_1_00100_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00100_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00100_A4 { - - int a; - int sum; - Cycle_B_1_00100_A5 a5_0; - - Cycle_B_1_00100_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - a5_0.add(); - sum = a + a5_0.sum; - } - } - - class Cycle_B_1_00100_A5 { - - int a; - int sum; - - Cycle_B_1_00100_A5() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } - } -} - - -public class Cycle_Bm_1_00100 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00100 A1_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); - ThreadRc_Cycle_Bm_1_00100 A2_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); - ThreadRc_Cycle_Bm_1_00100 A3_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); - ThreadRc_Cycle_Bm_1_00100 A4_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); - ThreadRc_Cycle_Bm_1_00100 A5_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); - ThreadRc_Cycle_Bm_1_00100 A6_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); - - A1_Cycle_Bm_1_00100.start(); - A2_Cycle_Bm_1_00100.start(); - A3_Cycle_Bm_1_00100.start(); - A4_Cycle_Bm_1_00100.start(); - A5_Cycle_Bm_1_00100.start(); - A6_Cycle_Bm_1_00100.start(); - - try { - A1_Cycle_Bm_1_00100.join(); - A2_Cycle_Bm_1_00100.join(); - A3_Cycle_Bm_1_00100.join(); - A4_Cycle_Bm_1_00100.join(); - A5_Cycle_Bm_1_00100.join(); - A6_Cycle_Bm_1_00100.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00100.check() && A2_Cycle_Bm_1_00100.check() && A3_Cycle_Bm_1_00100.check() && A4_Cycle_Bm_1_00100.check() && A5_Cycle_Bm_1_00100.check() && A6_Cycle_Bm_1_00100.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00100.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00100 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00100.java + *- @ExecuteClass: Cycle_Bm_1_00100 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00100 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00100_A1 a1_0 = new Cycle_B_1_00100_A1(); + a1_0.a2_0 = new Cycle_B_1_00100_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00100_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a4_0 = new Cycle_B_1_00100_A4(); + a1_0.a2_0.a4_0.a5_0 = new Cycle_B_1_00100_A5(); + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + a1_0.a2_0.a4_0.a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a4_0.a5_0.sum; + ; + //System.out.println(nsum); + + if (nsum == 38) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00100_A1 { + Cycle_B_1_00100_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00100_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00100_A2 { + Cycle_B_1_00100_A3 a3_0; + Cycle_B_1_00100_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00100_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00100_A3 { + Cycle_B_1_00100_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00100_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00100_A4 { + + int a; + int sum; + Cycle_B_1_00100_A5 a5_0; + + Cycle_B_1_00100_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + a5_0.add(); + sum = a + a5_0.sum; + } + } + + class Cycle_B_1_00100_A5 { + + int a; + int sum; + + Cycle_B_1_00100_A5() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } + } +} + + +public class Cycle_Bm_1_00100 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00100 A1_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); + ThreadRc_Cycle_Bm_1_00100 A2_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); + ThreadRc_Cycle_Bm_1_00100 A3_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); + ThreadRc_Cycle_Bm_1_00100 A4_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); + ThreadRc_Cycle_Bm_1_00100 A5_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); + ThreadRc_Cycle_Bm_1_00100 A6_Cycle_Bm_1_00100 = new ThreadRc_Cycle_Bm_1_00100(); + + A1_Cycle_Bm_1_00100.start(); + A2_Cycle_Bm_1_00100.start(); + A3_Cycle_Bm_1_00100.start(); + A4_Cycle_Bm_1_00100.start(); + A5_Cycle_Bm_1_00100.start(); + A6_Cycle_Bm_1_00100.start(); + + try { + A1_Cycle_Bm_1_00100.join(); + A2_Cycle_Bm_1_00100.join(); + A3_Cycle_Bm_1_00100.join(); + A4_Cycle_Bm_1_00100.join(); + A5_Cycle_Bm_1_00100.join(); + A6_Cycle_Bm_1_00100.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00100.check() && A2_Cycle_Bm_1_00100.check() && A3_Cycle_Bm_1_00100.check() && A4_Cycle_Bm_1_00100.check() && A5_Cycle_Bm_1_00100.check() && A6_Cycle_Bm_1_00100.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0167-rc-function-RC_Thread01-Cycle_Bm_1_00110/Cycle_Bm_1_00110.java b/test/testsuite/ouroboros/memory_management/Function/RC0167-rc-function-RC_Thread01-Cycle_Bm_1_00110/Cycle_Bm_1_00110.java index 441b4bf07f9973edd43ee13f7267dbb1d0a1eac4..4b43009e73afd42a8463f1dd35bda7411581a53a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0167-rc-function-RC_Thread01-Cycle_Bm_1_00110/Cycle_Bm_1_00110.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0167-rc-function-RC_Thread01-Cycle_Bm_1_00110/Cycle_Bm_1_00110.java @@ -1,176 +1,176 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00110.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00110 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00110.java - *- @ExecuteClass: Cycle_Bm_1_00110 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00110 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00110_A1 a1_0 = new Cycle_B_1_00110_A1(); - a1_0.a2_0 = new Cycle_B_1_00110_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00110_A3(); - Cycle_B_1_00110_A5 a5_0 = new Cycle_B_1_00110_A5(); - a5_0.a4_0 = new Cycle_B_1_00110_A4(); - a5_0.a4_0.a2_0 = a1_0.a2_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a5_0.a4_0.add(); - a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a5_0.a4_0.sum + a5_0.sum; - //System.out.println(nsum); - - if (nsum == 27) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00110_A1 { - Cycle_B_1_00110_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00110_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00110_A2 { - Cycle_B_1_00110_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00110_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00110_A3 { - Cycle_B_1_00110_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00110_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00110_A4 { - Cycle_B_1_00110_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00110_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00110_A5 { - Cycle_B_1_00110_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00110_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class Cycle_Bm_1_00110 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00110 A1_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); - ThreadRc_Cycle_Bm_1_00110 A2_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); - ThreadRc_Cycle_Bm_1_00110 A3_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); - ThreadRc_Cycle_Bm_1_00110 A4_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); - ThreadRc_Cycle_Bm_1_00110 A5_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); - ThreadRc_Cycle_Bm_1_00110 A6_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); - - A1_Cycle_Bm_1_00110.start(); - A2_Cycle_Bm_1_00110.start(); - A3_Cycle_Bm_1_00110.start(); - A4_Cycle_Bm_1_00110.start(); - A5_Cycle_Bm_1_00110.start(); - A6_Cycle_Bm_1_00110.start(); - - try { - A1_Cycle_Bm_1_00110.join(); - A2_Cycle_Bm_1_00110.join(); - A3_Cycle_Bm_1_00110.join(); - A4_Cycle_Bm_1_00110.join(); - A5_Cycle_Bm_1_00110.join(); - A6_Cycle_Bm_1_00110.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00110.check() && A2_Cycle_Bm_1_00110.check() && A3_Cycle_Bm_1_00110.check() && A4_Cycle_Bm_1_00110.check() && A5_Cycle_Bm_1_00110.check() && A6_Cycle_Bm_1_00110.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00110.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00110 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00110.java + *- @ExecuteClass: Cycle_Bm_1_00110 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00110 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00110_A1 a1_0 = new Cycle_B_1_00110_A1(); + a1_0.a2_0 = new Cycle_B_1_00110_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00110_A3(); + Cycle_B_1_00110_A5 a5_0 = new Cycle_B_1_00110_A5(); + a5_0.a4_0 = new Cycle_B_1_00110_A4(); + a5_0.a4_0.a2_0 = a1_0.a2_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a5_0.a4_0.add(); + a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a5_0.a4_0.sum + a5_0.sum; + //System.out.println(nsum); + + if (nsum == 27) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00110_A1 { + Cycle_B_1_00110_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00110_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00110_A2 { + Cycle_B_1_00110_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00110_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00110_A3 { + Cycle_B_1_00110_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00110_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00110_A4 { + Cycle_B_1_00110_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00110_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00110_A5 { + Cycle_B_1_00110_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00110_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class Cycle_Bm_1_00110 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00110 A1_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); + ThreadRc_Cycle_Bm_1_00110 A2_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); + ThreadRc_Cycle_Bm_1_00110 A3_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); + ThreadRc_Cycle_Bm_1_00110 A4_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); + ThreadRc_Cycle_Bm_1_00110 A5_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); + ThreadRc_Cycle_Bm_1_00110 A6_Cycle_Bm_1_00110 = new ThreadRc_Cycle_Bm_1_00110(); + + A1_Cycle_Bm_1_00110.start(); + A2_Cycle_Bm_1_00110.start(); + A3_Cycle_Bm_1_00110.start(); + A4_Cycle_Bm_1_00110.start(); + A5_Cycle_Bm_1_00110.start(); + A6_Cycle_Bm_1_00110.start(); + + try { + A1_Cycle_Bm_1_00110.join(); + A2_Cycle_Bm_1_00110.join(); + A3_Cycle_Bm_1_00110.join(); + A4_Cycle_Bm_1_00110.join(); + A5_Cycle_Bm_1_00110.join(); + A6_Cycle_Bm_1_00110.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00110.check() && A2_Cycle_Bm_1_00110.check() && A3_Cycle_Bm_1_00110.check() && A4_Cycle_Bm_1_00110.check() && A5_Cycle_Bm_1_00110.check() && A6_Cycle_Bm_1_00110.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0168-rc-function-RC_Thread01-Cycle_Bm_1_00120/Cycle_Bm_1_00120.java b/test/testsuite/ouroboros/memory_management/Function/RC0168-rc-function-RC_Thread01-Cycle_Bm_1_00120/Cycle_Bm_1_00120.java index fbb95c2104fb3f85f4f2b8a6ccd26bfaa9ce6fc3..f1bff8fef12abe5cb83271dfb6ace00d484f4f32 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0168-rc-function-RC_Thread01-Cycle_Bm_1_00120/Cycle_Bm_1_00120.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0168-rc-function-RC_Thread01-Cycle_Bm_1_00120/Cycle_Bm_1_00120.java @@ -1,176 +1,176 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00120.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00120 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00120.java - *- @ExecuteClass: Cycle_Bm_1_00120 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00120 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00120_A1 a1_0 = new Cycle_B_1_00120_A1(); - a1_0.a2_0 = new Cycle_B_1_00120_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00120_A3(); - Cycle_B_1_00120_A5 a5_0 = new Cycle_B_1_00120_A5(); - a5_0.a4_0 = new Cycle_B_1_00120_A4(); - a5_0.a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a5_0.a4_0.add(); - a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a5_0.a4_0.sum + a5_0.sum; - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00120_A1 { - Cycle_B_1_00120_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00120_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00120_A2 { - Cycle_B_1_00120_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00120_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00120_A3 { - Cycle_B_1_00120_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00120_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00120_A4 { - Cycle_B_1_00120_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00120_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00120_A5 { - Cycle_B_1_00120_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00120_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class Cycle_Bm_1_00120 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00120 A1_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); - ThreadRc_Cycle_Bm_1_00120 A2_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); - ThreadRc_Cycle_Bm_1_00120 A3_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); - ThreadRc_Cycle_Bm_1_00120 A4_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); - ThreadRc_Cycle_Bm_1_00120 A5_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); - ThreadRc_Cycle_Bm_1_00120 A6_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); - - A1_Cycle_Bm_1_00120.start(); - A2_Cycle_Bm_1_00120.start(); - A3_Cycle_Bm_1_00120.start(); - A4_Cycle_Bm_1_00120.start(); - A5_Cycle_Bm_1_00120.start(); - A6_Cycle_Bm_1_00120.start(); - - try { - A1_Cycle_Bm_1_00120.join(); - A2_Cycle_Bm_1_00120.join(); - A3_Cycle_Bm_1_00120.join(); - A4_Cycle_Bm_1_00120.join(); - A5_Cycle_Bm_1_00120.join(); - A6_Cycle_Bm_1_00120.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00120.check() && A2_Cycle_Bm_1_00120.check() && A3_Cycle_Bm_1_00120.check() && A4_Cycle_Bm_1_00120.check() && A5_Cycle_Bm_1_00120.check() && A6_Cycle_Bm_1_00120.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00120.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00120 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00120.java + *- @ExecuteClass: Cycle_Bm_1_00120 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00120 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00120_A1 a1_0 = new Cycle_B_1_00120_A1(); + a1_0.a2_0 = new Cycle_B_1_00120_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00120_A3(); + Cycle_B_1_00120_A5 a5_0 = new Cycle_B_1_00120_A5(); + a5_0.a4_0 = new Cycle_B_1_00120_A4(); + a5_0.a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a5_0.a4_0.add(); + a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a5_0.a4_0.sum + a5_0.sum; + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00120_A1 { + Cycle_B_1_00120_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00120_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00120_A2 { + Cycle_B_1_00120_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00120_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00120_A3 { + Cycle_B_1_00120_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00120_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00120_A4 { + Cycle_B_1_00120_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00120_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00120_A5 { + Cycle_B_1_00120_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00120_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class Cycle_Bm_1_00120 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00120 A1_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); + ThreadRc_Cycle_Bm_1_00120 A2_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); + ThreadRc_Cycle_Bm_1_00120 A3_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); + ThreadRc_Cycle_Bm_1_00120 A4_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); + ThreadRc_Cycle_Bm_1_00120 A5_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); + ThreadRc_Cycle_Bm_1_00120 A6_Cycle_Bm_1_00120 = new ThreadRc_Cycle_Bm_1_00120(); + + A1_Cycle_Bm_1_00120.start(); + A2_Cycle_Bm_1_00120.start(); + A3_Cycle_Bm_1_00120.start(); + A4_Cycle_Bm_1_00120.start(); + A5_Cycle_Bm_1_00120.start(); + A6_Cycle_Bm_1_00120.start(); + + try { + A1_Cycle_Bm_1_00120.join(); + A2_Cycle_Bm_1_00120.join(); + A3_Cycle_Bm_1_00120.join(); + A4_Cycle_Bm_1_00120.join(); + A5_Cycle_Bm_1_00120.join(); + A6_Cycle_Bm_1_00120.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00120.check() && A2_Cycle_Bm_1_00120.check() && A3_Cycle_Bm_1_00120.check() && A4_Cycle_Bm_1_00120.check() && A5_Cycle_Bm_1_00120.check() && A6_Cycle_Bm_1_00120.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0169-rc-function-RC_Thread01-Cycle_Bm_1_00130/Cycle_Bm_1_00130.java b/test/testsuite/ouroboros/memory_management/Function/RC0169-rc-function-RC_Thread01-Cycle_Bm_1_00130/Cycle_Bm_1_00130.java index a204b56ac66e635ffd51b0509b9612d8d9a9022b..3a29395a125a792e7b99208e7e29ff48d1dbdd1f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0169-rc-function-RC_Thread01-Cycle_Bm_1_00130/Cycle_Bm_1_00130.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0169-rc-function-RC_Thread01-Cycle_Bm_1_00130/Cycle_Bm_1_00130.java @@ -1,141 +1,141 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00130.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00130 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00130.java - *- @ExecuteClass: Cycle_Bm_1_00130 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00130 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00130_A1 a1_0 = new Cycle_B_1_00130_A1(); - Cycle_B_1_00130_A2 a2_0 = new Cycle_B_1_00130_A2(); - Cycle_B_1_00130_A3 a3_0 = new Cycle_B_1_00130_A3(); - a1_0.a3_0 = a3_0; - a2_0.a3_0 = a3_0; - a3_0.a1_0 = a1_0; - a1_0.add(); - a2_0.add(); - a3_0.add(); - int nsum = (a1_0.sum + a2_0.sum + a3_0.sum); - //System.out.println(nsum); - - if (nsum == 13) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00130_A1 { - Cycle_B_1_00130_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00130_A1() { - a3_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00130_A2 { - Cycle_B_1_00130_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00130_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00130_A3 { - Cycle_B_1_00130_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00130_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_1_00130 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00130 A1_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); - ThreadRc_Cycle_Bm_1_00130 A2_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); - ThreadRc_Cycle_Bm_1_00130 A3_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); - ThreadRc_Cycle_Bm_1_00130 A4_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); - ThreadRc_Cycle_Bm_1_00130 A5_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); - ThreadRc_Cycle_Bm_1_00130 A6_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); - - A1_Cycle_Bm_1_00130.start(); - A2_Cycle_Bm_1_00130.start(); - A3_Cycle_Bm_1_00130.start(); - A4_Cycle_Bm_1_00130.start(); - A5_Cycle_Bm_1_00130.start(); - A6_Cycle_Bm_1_00130.start(); - - try { - A1_Cycle_Bm_1_00130.join(); - A2_Cycle_Bm_1_00130.join(); - A3_Cycle_Bm_1_00130.join(); - A4_Cycle_Bm_1_00130.join(); - A5_Cycle_Bm_1_00130.join(); - A6_Cycle_Bm_1_00130.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00130.check() && A2_Cycle_Bm_1_00130.check() && A3_Cycle_Bm_1_00130.check() && A4_Cycle_Bm_1_00130.check() && A5_Cycle_Bm_1_00130.check() && A6_Cycle_Bm_1_00130.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00130.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00130 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00130.java + *- @ExecuteClass: Cycle_Bm_1_00130 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00130 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00130_A1 a1_0 = new Cycle_B_1_00130_A1(); + Cycle_B_1_00130_A2 a2_0 = new Cycle_B_1_00130_A2(); + Cycle_B_1_00130_A3 a3_0 = new Cycle_B_1_00130_A3(); + a1_0.a3_0 = a3_0; + a2_0.a3_0 = a3_0; + a3_0.a1_0 = a1_0; + a1_0.add(); + a2_0.add(); + a3_0.add(); + int nsum = (a1_0.sum + a2_0.sum + a3_0.sum); + //System.out.println(nsum); + + if (nsum == 13) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00130_A1 { + Cycle_B_1_00130_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00130_A1() { + a3_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00130_A2 { + Cycle_B_1_00130_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00130_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00130_A3 { + Cycle_B_1_00130_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00130_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_1_00130 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00130 A1_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); + ThreadRc_Cycle_Bm_1_00130 A2_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); + ThreadRc_Cycle_Bm_1_00130 A3_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); + ThreadRc_Cycle_Bm_1_00130 A4_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); + ThreadRc_Cycle_Bm_1_00130 A5_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); + ThreadRc_Cycle_Bm_1_00130 A6_Cycle_Bm_1_00130 = new ThreadRc_Cycle_Bm_1_00130(); + + A1_Cycle_Bm_1_00130.start(); + A2_Cycle_Bm_1_00130.start(); + A3_Cycle_Bm_1_00130.start(); + A4_Cycle_Bm_1_00130.start(); + A5_Cycle_Bm_1_00130.start(); + A6_Cycle_Bm_1_00130.start(); + + try { + A1_Cycle_Bm_1_00130.join(); + A2_Cycle_Bm_1_00130.join(); + A3_Cycle_Bm_1_00130.join(); + A4_Cycle_Bm_1_00130.join(); + A5_Cycle_Bm_1_00130.join(); + A6_Cycle_Bm_1_00130.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00130.check() && A2_Cycle_Bm_1_00130.check() && A3_Cycle_Bm_1_00130.check() && A4_Cycle_Bm_1_00130.check() && A5_Cycle_Bm_1_00130.check() && A6_Cycle_Bm_1_00130.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0170-rc-function-RC_Thread01-Cycle_Bm_1_00140/Cycle_Bm_1_00140.java b/test/testsuite/ouroboros/memory_management/Function/RC0170-rc-function-RC_Thread01-Cycle_Bm_1_00140/Cycle_Bm_1_00140.java index bab1be26e4b56bf12b65f2d0106c1cf1af79fc35..0f159af3466c3a34e762f65c0e2f3bd251f45765 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0170-rc-function-RC_Thread01-Cycle_Bm_1_00140/Cycle_Bm_1_00140.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0170-rc-function-RC_Thread01-Cycle_Bm_1_00140/Cycle_Bm_1_00140.java @@ -1,158 +1,158 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00140.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00140 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00140.java - *- @ExecuteClass: Cycle_Bm_1_00140 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00140 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00140_A1 a1_0 = new Cycle_B_1_00140_A1(); - a1_0.a2_0 = new Cycle_B_1_00140_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00140_A3(); - Cycle_B_1_00140_A4 a4_0 = new Cycle_B_1_00140_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 12) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00140_A1 { - Cycle_B_1_00140_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00140_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00140_A2 { - Cycle_B_1_00140_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00140_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00140_A3 { - Cycle_B_1_00140_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00140_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00140_A4 { - Cycle_B_1_00140_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00140_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_Bm_1_00140 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00140 A1_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); - ThreadRc_Cycle_Bm_1_00140 A2_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); - ThreadRc_Cycle_Bm_1_00140 A3_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); - ThreadRc_Cycle_Bm_1_00140 A4_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); - ThreadRc_Cycle_Bm_1_00140 A5_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); - ThreadRc_Cycle_Bm_1_00140 A6_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); - - A1_Cycle_Bm_1_00140.start(); - A2_Cycle_Bm_1_00140.start(); - A3_Cycle_Bm_1_00140.start(); - A4_Cycle_Bm_1_00140.start(); - A5_Cycle_Bm_1_00140.start(); - A6_Cycle_Bm_1_00140.start(); - - try { - A1_Cycle_Bm_1_00140.join(); - A2_Cycle_Bm_1_00140.join(); - A3_Cycle_Bm_1_00140.join(); - A4_Cycle_Bm_1_00140.join(); - A5_Cycle_Bm_1_00140.join(); - A6_Cycle_Bm_1_00140.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00140.check() && A2_Cycle_Bm_1_00140.check() && A3_Cycle_Bm_1_00140.check() && A4_Cycle_Bm_1_00140.check() && A5_Cycle_Bm_1_00140.check() && A6_Cycle_Bm_1_00140.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00140.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00140 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00140.java + *- @ExecuteClass: Cycle_Bm_1_00140 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00140 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00140_A1 a1_0 = new Cycle_B_1_00140_A1(); + a1_0.a2_0 = new Cycle_B_1_00140_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00140_A3(); + Cycle_B_1_00140_A4 a4_0 = new Cycle_B_1_00140_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 12) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00140_A1 { + Cycle_B_1_00140_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00140_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00140_A2 { + Cycle_B_1_00140_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00140_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00140_A3 { + Cycle_B_1_00140_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00140_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00140_A4 { + Cycle_B_1_00140_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00140_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_Bm_1_00140 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00140 A1_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); + ThreadRc_Cycle_Bm_1_00140 A2_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); + ThreadRc_Cycle_Bm_1_00140 A3_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); + ThreadRc_Cycle_Bm_1_00140 A4_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); + ThreadRc_Cycle_Bm_1_00140 A5_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); + ThreadRc_Cycle_Bm_1_00140 A6_Cycle_Bm_1_00140 = new ThreadRc_Cycle_Bm_1_00140(); + + A1_Cycle_Bm_1_00140.start(); + A2_Cycle_Bm_1_00140.start(); + A3_Cycle_Bm_1_00140.start(); + A4_Cycle_Bm_1_00140.start(); + A5_Cycle_Bm_1_00140.start(); + A6_Cycle_Bm_1_00140.start(); + + try { + A1_Cycle_Bm_1_00140.join(); + A2_Cycle_Bm_1_00140.join(); + A3_Cycle_Bm_1_00140.join(); + A4_Cycle_Bm_1_00140.join(); + A5_Cycle_Bm_1_00140.join(); + A6_Cycle_Bm_1_00140.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00140.check() && A2_Cycle_Bm_1_00140.check() && A3_Cycle_Bm_1_00140.check() && A4_Cycle_Bm_1_00140.check() && A5_Cycle_Bm_1_00140.check() && A6_Cycle_Bm_1_00140.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0171-rc-function-RC_Thread01-Cycle_Bm_1_00150/Cycle_Bm_1_00150.java b/test/testsuite/ouroboros/memory_management/Function/RC0171-rc-function-RC_Thread01-Cycle_Bm_1_00150/Cycle_Bm_1_00150.java index a0279111fd7a44ad08ac7e29dca0c2c4eda232f8..2f467c84863848b0fb781bb8498833604373171b 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0171-rc-function-RC_Thread01-Cycle_Bm_1_00150/Cycle_Bm_1_00150.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0171-rc-function-RC_Thread01-Cycle_Bm_1_00150/Cycle_Bm_1_00150.java @@ -1,179 +1,179 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00150.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00150 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00150.java - *- @ExecuteClass: Cycle_Bm_1_00150 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00150 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00150_A1 a1_0 = new Cycle_B_1_00150_A1(); - a1_0.a2_0 = new Cycle_B_1_00150_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00150_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00150_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_1_00150_A5(); - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum; - ; - //System.out.println(nsum); - - if (nsum == 38) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00150_A1 { - Cycle_B_1_00150_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00150_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00150_A2 { - Cycle_B_1_00150_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00150_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00150_A3 { - Cycle_B_1_00150_A1 a1_0; - Cycle_B_1_00150_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00150_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00150_A4 { - - int a; - int sum; - Cycle_B_1_00150_A5 a5_0; - - Cycle_B_1_00150_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - a5_0.add(); - sum = a + a5_0.sum; - } - } - - class Cycle_B_1_00150_A5 { - - int a; - int sum; - - Cycle_B_1_00150_A5() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } - } -} - - -public class Cycle_Bm_1_00150 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00150 A1_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); - ThreadRc_Cycle_Bm_1_00150 A2_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); - ThreadRc_Cycle_Bm_1_00150 A3_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); - ThreadRc_Cycle_Bm_1_00150 A4_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); - ThreadRc_Cycle_Bm_1_00150 A5_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); - ThreadRc_Cycle_Bm_1_00150 A6_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); - - A1_Cycle_Bm_1_00150.start(); - A2_Cycle_Bm_1_00150.start(); - A3_Cycle_Bm_1_00150.start(); - A4_Cycle_Bm_1_00150.start(); - A5_Cycle_Bm_1_00150.start(); - A6_Cycle_Bm_1_00150.start(); - - try { - A1_Cycle_Bm_1_00150.join(); - A2_Cycle_Bm_1_00150.join(); - A3_Cycle_Bm_1_00150.join(); - A4_Cycle_Bm_1_00150.join(); - A5_Cycle_Bm_1_00150.join(); - A6_Cycle_Bm_1_00150.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00150.check() && A2_Cycle_Bm_1_00150.check() && A3_Cycle_Bm_1_00150.check() && A4_Cycle_Bm_1_00150.check() && A5_Cycle_Bm_1_00150.check() && A6_Cycle_Bm_1_00150.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00150.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00150 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00150.java + *- @ExecuteClass: Cycle_Bm_1_00150 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00150 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00150_A1 a1_0 = new Cycle_B_1_00150_A1(); + a1_0.a2_0 = new Cycle_B_1_00150_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00150_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00150_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_1_00150_A5(); + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum; + ; + //System.out.println(nsum); + + if (nsum == 38) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00150_A1 { + Cycle_B_1_00150_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00150_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00150_A2 { + Cycle_B_1_00150_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00150_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00150_A3 { + Cycle_B_1_00150_A1 a1_0; + Cycle_B_1_00150_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00150_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00150_A4 { + + int a; + int sum; + Cycle_B_1_00150_A5 a5_0; + + Cycle_B_1_00150_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + a5_0.add(); + sum = a + a5_0.sum; + } + } + + class Cycle_B_1_00150_A5 { + + int a; + int sum; + + Cycle_B_1_00150_A5() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } + } +} + + +public class Cycle_Bm_1_00150 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00150 A1_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); + ThreadRc_Cycle_Bm_1_00150 A2_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); + ThreadRc_Cycle_Bm_1_00150 A3_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); + ThreadRc_Cycle_Bm_1_00150 A4_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); + ThreadRc_Cycle_Bm_1_00150 A5_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); + ThreadRc_Cycle_Bm_1_00150 A6_Cycle_Bm_1_00150 = new ThreadRc_Cycle_Bm_1_00150(); + + A1_Cycle_Bm_1_00150.start(); + A2_Cycle_Bm_1_00150.start(); + A3_Cycle_Bm_1_00150.start(); + A4_Cycle_Bm_1_00150.start(); + A5_Cycle_Bm_1_00150.start(); + A6_Cycle_Bm_1_00150.start(); + + try { + A1_Cycle_Bm_1_00150.join(); + A2_Cycle_Bm_1_00150.join(); + A3_Cycle_Bm_1_00150.join(); + A4_Cycle_Bm_1_00150.join(); + A5_Cycle_Bm_1_00150.join(); + A6_Cycle_Bm_1_00150.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00150.check() && A2_Cycle_Bm_1_00150.check() && A3_Cycle_Bm_1_00150.check() && A4_Cycle_Bm_1_00150.check() && A5_Cycle_Bm_1_00150.check() && A6_Cycle_Bm_1_00150.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0172-rc-function-RC_Thread01-Cycle_Bm_1_00160/Cycle_Bm_1_00160.java b/test/testsuite/ouroboros/memory_management/Function/RC0172-rc-function-RC_Thread01-Cycle_Bm_1_00160/Cycle_Bm_1_00160.java index d248f5034ce68fd30202be3c2326904bbcc7209a..992d057867b805c42920c6461601b862edc6741d 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0172-rc-function-RC_Thread01-Cycle_Bm_1_00160/Cycle_Bm_1_00160.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0172-rc-function-RC_Thread01-Cycle_Bm_1_00160/Cycle_Bm_1_00160.java @@ -1,158 +1,158 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00160.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00160 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00160.java - *- @ExecuteClass: Cycle_Bm_1_00160 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00160 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00160_A1 a1_0 = new Cycle_B_1_00160_A1(); - a1_0.a2_0 = new Cycle_B_1_00160_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00160_A3(); - Cycle_B_1_00160_A4 a4_0 = new Cycle_B_1_00160_A4(); - a4_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 17) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00160_A1 { - Cycle_B_1_00160_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00160_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00160_A2 { - Cycle_B_1_00160_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00160_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00160_A3 { - Cycle_B_1_00160_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00160_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00160_A4 { - Cycle_B_1_00160_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00160_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_1_00160 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00160 A1_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); - ThreadRc_Cycle_Bm_1_00160 A2_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); - ThreadRc_Cycle_Bm_1_00160 A3_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); - ThreadRc_Cycle_Bm_1_00160 A4_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); - ThreadRc_Cycle_Bm_1_00160 A5_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); - ThreadRc_Cycle_Bm_1_00160 A6_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); - - A1_Cycle_Bm_1_00160.start(); - A2_Cycle_Bm_1_00160.start(); - A3_Cycle_Bm_1_00160.start(); - A4_Cycle_Bm_1_00160.start(); - A5_Cycle_Bm_1_00160.start(); - A6_Cycle_Bm_1_00160.start(); - - try { - A1_Cycle_Bm_1_00160.join(); - A2_Cycle_Bm_1_00160.join(); - A3_Cycle_Bm_1_00160.join(); - A4_Cycle_Bm_1_00160.join(); - A5_Cycle_Bm_1_00160.join(); - A6_Cycle_Bm_1_00160.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00160.check() && A2_Cycle_Bm_1_00160.check() && A3_Cycle_Bm_1_00160.check() && A4_Cycle_Bm_1_00160.check() && A5_Cycle_Bm_1_00160.check() && A6_Cycle_Bm_1_00160.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00160.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00160 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00160.java + *- @ExecuteClass: Cycle_Bm_1_00160 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00160 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00160_A1 a1_0 = new Cycle_B_1_00160_A1(); + a1_0.a2_0 = new Cycle_B_1_00160_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00160_A3(); + Cycle_B_1_00160_A4 a4_0 = new Cycle_B_1_00160_A4(); + a4_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 17) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00160_A1 { + Cycle_B_1_00160_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00160_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00160_A2 { + Cycle_B_1_00160_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00160_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00160_A3 { + Cycle_B_1_00160_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00160_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00160_A4 { + Cycle_B_1_00160_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00160_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_1_00160 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00160 A1_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); + ThreadRc_Cycle_Bm_1_00160 A2_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); + ThreadRc_Cycle_Bm_1_00160 A3_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); + ThreadRc_Cycle_Bm_1_00160 A4_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); + ThreadRc_Cycle_Bm_1_00160 A5_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); + ThreadRc_Cycle_Bm_1_00160 A6_Cycle_Bm_1_00160 = new ThreadRc_Cycle_Bm_1_00160(); + + A1_Cycle_Bm_1_00160.start(); + A2_Cycle_Bm_1_00160.start(); + A3_Cycle_Bm_1_00160.start(); + A4_Cycle_Bm_1_00160.start(); + A5_Cycle_Bm_1_00160.start(); + A6_Cycle_Bm_1_00160.start(); + + try { + A1_Cycle_Bm_1_00160.join(); + A2_Cycle_Bm_1_00160.join(); + A3_Cycle_Bm_1_00160.join(); + A4_Cycle_Bm_1_00160.join(); + A5_Cycle_Bm_1_00160.join(); + A6_Cycle_Bm_1_00160.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00160.check() && A2_Cycle_Bm_1_00160.check() && A3_Cycle_Bm_1_00160.check() && A4_Cycle_Bm_1_00160.check() && A5_Cycle_Bm_1_00160.check() && A6_Cycle_Bm_1_00160.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0173-rc-function-RC_Thread01-Cycle_Bm_1_00170/Cycle_Bm_1_00170.java b/test/testsuite/ouroboros/memory_management/Function/RC0173-rc-function-RC_Thread01-Cycle_Bm_1_00170/Cycle_Bm_1_00170.java index bb28224e5f411ff8c7f3821c70a779788eb362d9..7caa0596f5e1db607f2bccdbd198bdfbee225891 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0173-rc-function-RC_Thread01-Cycle_Bm_1_00170/Cycle_Bm_1_00170.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0173-rc-function-RC_Thread01-Cycle_Bm_1_00170/Cycle_Bm_1_00170.java @@ -1,177 +1,177 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00170.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00170 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00170.java - *- @ExecuteClass: Cycle_Bm_1_00170 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00170 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00170_A1 a1_0 = new Cycle_B_1_00170_A1(); - a1_0.a2_0 = new Cycle_B_1_00170_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00170_A3(); - Cycle_B_1_00170_A4 a4_0 = new Cycle_B_1_00170_A4(); - Cycle_B_1_00170_A5 a5_0 = new Cycle_B_1_00170_A5(); - a5_0.a4_0 = a4_0; - a4_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - //System.out.println(nsum); - - if (nsum == 26) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00170_A1 { - Cycle_B_1_00170_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00170_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00170_A2 { - Cycle_B_1_00170_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00170_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00170_A3 { - Cycle_B_1_00170_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00170_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00170_A4 { - Cycle_B_1_00170_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00170_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00170_A5 { - Cycle_B_1_00170_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00170_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class Cycle_Bm_1_00170 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00170 A1_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); - ThreadRc_Cycle_Bm_1_00170 A2_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); - ThreadRc_Cycle_Bm_1_00170 A3_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); - ThreadRc_Cycle_Bm_1_00170 A4_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); - ThreadRc_Cycle_Bm_1_00170 A5_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); - ThreadRc_Cycle_Bm_1_00170 A6_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); - - A1_Cycle_Bm_1_00170.start(); - A2_Cycle_Bm_1_00170.start(); - A3_Cycle_Bm_1_00170.start(); - A4_Cycle_Bm_1_00170.start(); - A5_Cycle_Bm_1_00170.start(); - A6_Cycle_Bm_1_00170.start(); - - try { - A1_Cycle_Bm_1_00170.join(); - A2_Cycle_Bm_1_00170.join(); - A3_Cycle_Bm_1_00170.join(); - A4_Cycle_Bm_1_00170.join(); - A5_Cycle_Bm_1_00170.join(); - A6_Cycle_Bm_1_00170.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00170.check() && A2_Cycle_Bm_1_00170.check() && A3_Cycle_Bm_1_00170.check() && A4_Cycle_Bm_1_00170.check() && A5_Cycle_Bm_1_00170.check() && A6_Cycle_Bm_1_00170.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00170.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00170 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00170.java + *- @ExecuteClass: Cycle_Bm_1_00170 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00170 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00170_A1 a1_0 = new Cycle_B_1_00170_A1(); + a1_0.a2_0 = new Cycle_B_1_00170_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00170_A3(); + Cycle_B_1_00170_A4 a4_0 = new Cycle_B_1_00170_A4(); + Cycle_B_1_00170_A5 a5_0 = new Cycle_B_1_00170_A5(); + a5_0.a4_0 = a4_0; + a4_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + //System.out.println(nsum); + + if (nsum == 26) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00170_A1 { + Cycle_B_1_00170_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00170_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00170_A2 { + Cycle_B_1_00170_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00170_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00170_A3 { + Cycle_B_1_00170_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00170_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00170_A4 { + Cycle_B_1_00170_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00170_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00170_A5 { + Cycle_B_1_00170_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00170_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class Cycle_Bm_1_00170 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00170 A1_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); + ThreadRc_Cycle_Bm_1_00170 A2_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); + ThreadRc_Cycle_Bm_1_00170 A3_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); + ThreadRc_Cycle_Bm_1_00170 A4_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); + ThreadRc_Cycle_Bm_1_00170 A5_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); + ThreadRc_Cycle_Bm_1_00170 A6_Cycle_Bm_1_00170 = new ThreadRc_Cycle_Bm_1_00170(); + + A1_Cycle_Bm_1_00170.start(); + A2_Cycle_Bm_1_00170.start(); + A3_Cycle_Bm_1_00170.start(); + A4_Cycle_Bm_1_00170.start(); + A5_Cycle_Bm_1_00170.start(); + A6_Cycle_Bm_1_00170.start(); + + try { + A1_Cycle_Bm_1_00170.join(); + A2_Cycle_Bm_1_00170.join(); + A3_Cycle_Bm_1_00170.join(); + A4_Cycle_Bm_1_00170.join(); + A5_Cycle_Bm_1_00170.join(); + A6_Cycle_Bm_1_00170.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00170.check() && A2_Cycle_Bm_1_00170.check() && A3_Cycle_Bm_1_00170.check() && A4_Cycle_Bm_1_00170.check() && A5_Cycle_Bm_1_00170.check() && A6_Cycle_Bm_1_00170.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0174-rc-function-RC_Thread01-Cycle_Bm_1_00180/Cycle_Bm_1_00180.java b/test/testsuite/ouroboros/memory_management/Function/RC0174-rc-function-RC_Thread01-Cycle_Bm_1_00180/Cycle_Bm_1_00180.java index 954924cd07b28c60c2b3179116630fa2c7438da5..55563326b85437e98e1e2c469dcf1a0aac9de1f5 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0174-rc-function-RC_Thread01-Cycle_Bm_1_00180/Cycle_Bm_1_00180.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0174-rc-function-RC_Thread01-Cycle_Bm_1_00180/Cycle_Bm_1_00180.java @@ -1,177 +1,177 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00180.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00180 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00180.java - *- @ExecuteClass: Cycle_Bm_1_00180 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00180 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00180_A1 a1_0 = new Cycle_B_1_00180_A1(); - a1_0.a2_0 = new Cycle_B_1_00180_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00180_A3(); - Cycle_B_1_00180_A4 a4_0 = new Cycle_B_1_00180_A4(); - Cycle_B_1_00180_A5 a5_0 = new Cycle_B_1_00180_A5(); - a4_0.a1_0 = a1_0; - a5_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - //System.out.println(nsum); - - if (nsum == 23) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00180_A1 { - Cycle_B_1_00180_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00180_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00180_A2 { - Cycle_B_1_00180_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00180_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00180_A3 { - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00180_A4 { - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00180_A5 { - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_1_00180 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00180 A1_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A2_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A3_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A4_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A5_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - ThreadRc_Cycle_Bm_1_00180 A6_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); - - A1_Cycle_Bm_1_00180.start(); - A2_Cycle_Bm_1_00180.start(); - A3_Cycle_Bm_1_00180.start(); - A4_Cycle_Bm_1_00180.start(); - A5_Cycle_Bm_1_00180.start(); - A6_Cycle_Bm_1_00180.start(); - - try { - A1_Cycle_Bm_1_00180.join(); - A2_Cycle_Bm_1_00180.join(); - A3_Cycle_Bm_1_00180.join(); - A4_Cycle_Bm_1_00180.join(); - A5_Cycle_Bm_1_00180.join(); - A6_Cycle_Bm_1_00180.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00180.check() && A2_Cycle_Bm_1_00180.check() && A3_Cycle_Bm_1_00180.check() && A4_Cycle_Bm_1_00180.check() && A5_Cycle_Bm_1_00180.check() && A6_Cycle_Bm_1_00180.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00180.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00180 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00180.java + *- @ExecuteClass: Cycle_Bm_1_00180 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00180 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00180_A1 a1_0 = new Cycle_B_1_00180_A1(); + a1_0.a2_0 = new Cycle_B_1_00180_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00180_A3(); + Cycle_B_1_00180_A4 a4_0 = new Cycle_B_1_00180_A4(); + Cycle_B_1_00180_A5 a5_0 = new Cycle_B_1_00180_A5(); + a4_0.a1_0 = a1_0; + a5_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + //System.out.println(nsum); + + if (nsum == 23) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00180_A1 { + Cycle_B_1_00180_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00180_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00180_A2 { + Cycle_B_1_00180_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00180_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00180_A3 { + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00180_A4 { + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00180_A5 { + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_1_00180 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00180 A1_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A2_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A3_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A4_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A5_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + ThreadRc_Cycle_Bm_1_00180 A6_Cycle_Bm_1_00180 = new ThreadRc_Cycle_Bm_1_00180(); + + A1_Cycle_Bm_1_00180.start(); + A2_Cycle_Bm_1_00180.start(); + A3_Cycle_Bm_1_00180.start(); + A4_Cycle_Bm_1_00180.start(); + A5_Cycle_Bm_1_00180.start(); + A6_Cycle_Bm_1_00180.start(); + + try { + A1_Cycle_Bm_1_00180.join(); + A2_Cycle_Bm_1_00180.join(); + A3_Cycle_Bm_1_00180.join(); + A4_Cycle_Bm_1_00180.join(); + A5_Cycle_Bm_1_00180.join(); + A6_Cycle_Bm_1_00180.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00180.check() && A2_Cycle_Bm_1_00180.check() && A3_Cycle_Bm_1_00180.check() && A4_Cycle_Bm_1_00180.check() && A5_Cycle_Bm_1_00180.check() && A6_Cycle_Bm_1_00180.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0175-rc-function-RC_Thread01-Cycle_Bm_1_00190/Cycle_Bm_1_00190.java b/test/testsuite/ouroboros/memory_management/Function/RC0175-rc-function-RC_Thread01-Cycle_Bm_1_00190/Cycle_Bm_1_00190.java index 3e5570abd475e412b7df01fc0c121bfe4074b1ad..0d297b607378546861265d55e8f5750db2412a9f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0175-rc-function-RC_Thread01-Cycle_Bm_1_00190/Cycle_Bm_1_00190.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0175-rc-function-RC_Thread01-Cycle_Bm_1_00190/Cycle_Bm_1_00190.java @@ -1,158 +1,158 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00190.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00190 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00190.java - *- @ExecuteClass: Cycle_Bm_1_00190 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00190 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00190_A1 a1_0 = new Cycle_B_1_00190_A1(); - a1_0.a2_0 = new Cycle_B_1_00190_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00190_A3(); - Cycle_B_1_00190_A4 a4_0 = new Cycle_B_1_00190_A4(); - a1_0.a4_0 = a4_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 21) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00190_A1 { - Cycle_B_1_00190_A2 a2_0; - Cycle_B_1_00190_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00190_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00190_A2 { - Cycle_B_1_00190_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00190_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00190_A3 { - Cycle_B_1_00190_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00190_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00190_A4 { - int a; - int sum; - - Cycle_B_1_00190_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } -} - - -public class Cycle_Bm_1_00190 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00190 A1_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); - ThreadRc_Cycle_Bm_1_00190 A2_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); - ThreadRc_Cycle_Bm_1_00190 A3_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); - ThreadRc_Cycle_Bm_1_00190 A4_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); - ThreadRc_Cycle_Bm_1_00190 A5_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); - ThreadRc_Cycle_Bm_1_00190 A6_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); - - A1_Cycle_Bm_1_00190.start(); - A2_Cycle_Bm_1_00190.start(); - A3_Cycle_Bm_1_00190.start(); - A4_Cycle_Bm_1_00190.start(); - A5_Cycle_Bm_1_00190.start(); - A6_Cycle_Bm_1_00190.start(); - - try { - A1_Cycle_Bm_1_00190.join(); - A2_Cycle_Bm_1_00190.join(); - A3_Cycle_Bm_1_00190.join(); - A4_Cycle_Bm_1_00190.join(); - A5_Cycle_Bm_1_00190.join(); - A6_Cycle_Bm_1_00190.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00190.check() && A2_Cycle_Bm_1_00190.check() && A3_Cycle_Bm_1_00190.check() && A4_Cycle_Bm_1_00190.check() && A5_Cycle_Bm_1_00190.check() && A6_Cycle_Bm_1_00190.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00190.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00190 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00190.java + *- @ExecuteClass: Cycle_Bm_1_00190 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00190 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00190_A1 a1_0 = new Cycle_B_1_00190_A1(); + a1_0.a2_0 = new Cycle_B_1_00190_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00190_A3(); + Cycle_B_1_00190_A4 a4_0 = new Cycle_B_1_00190_A4(); + a1_0.a4_0 = a4_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 21) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00190_A1 { + Cycle_B_1_00190_A2 a2_0; + Cycle_B_1_00190_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00190_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00190_A2 { + Cycle_B_1_00190_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00190_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00190_A3 { + Cycle_B_1_00190_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00190_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00190_A4 { + int a; + int sum; + + Cycle_B_1_00190_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } +} + + +public class Cycle_Bm_1_00190 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00190 A1_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); + ThreadRc_Cycle_Bm_1_00190 A2_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); + ThreadRc_Cycle_Bm_1_00190 A3_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); + ThreadRc_Cycle_Bm_1_00190 A4_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); + ThreadRc_Cycle_Bm_1_00190 A5_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); + ThreadRc_Cycle_Bm_1_00190 A6_Cycle_Bm_1_00190 = new ThreadRc_Cycle_Bm_1_00190(); + + A1_Cycle_Bm_1_00190.start(); + A2_Cycle_Bm_1_00190.start(); + A3_Cycle_Bm_1_00190.start(); + A4_Cycle_Bm_1_00190.start(); + A5_Cycle_Bm_1_00190.start(); + A6_Cycle_Bm_1_00190.start(); + + try { + A1_Cycle_Bm_1_00190.join(); + A2_Cycle_Bm_1_00190.join(); + A3_Cycle_Bm_1_00190.join(); + A4_Cycle_Bm_1_00190.join(); + A5_Cycle_Bm_1_00190.join(); + A6_Cycle_Bm_1_00190.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00190.check() && A2_Cycle_Bm_1_00190.check() && A3_Cycle_Bm_1_00190.check() && A4_Cycle_Bm_1_00190.check() && A5_Cycle_Bm_1_00190.check() && A6_Cycle_Bm_1_00190.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0176-rc-function-RC_Thread01-Cycle_Bm_1_00200/Cycle_Bm_1_00200.java b/test/testsuite/ouroboros/memory_management/Function/RC0176-rc-function-RC_Thread01-Cycle_Bm_1_00200/Cycle_Bm_1_00200.java index 53bf8b15ff1a579f13d94007397e92abebd6155b..f8b689c10954eeb04d1a31f3c7ece02fe842d2d2 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0176-rc-function-RC_Thread01-Cycle_Bm_1_00200/Cycle_Bm_1_00200.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0176-rc-function-RC_Thread01-Cycle_Bm_1_00200/Cycle_Bm_1_00200.java @@ -1,177 +1,177 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00200.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_00200 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00200.java - *- @ExecuteClass: Cycle_Bm_1_00200 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00200 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00200_A1 a1_0 = new Cycle_B_1_00200_A1(); - a1_0.a2_0 = new Cycle_B_1_00200_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00200_A3(); - Cycle_B_1_00200_A4 a4_0 = new Cycle_B_1_00200_A4(); - Cycle_B_1_00200_A5 a5_0 = new Cycle_B_1_00200_A5(); - a1_0.a4_0 = a4_0; - a1_0.a5_0 = a5_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - //System.out.println(nsum); - - if (nsum == 38) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00200_A1 { - Cycle_B_1_00200_A2 a2_0; - Cycle_B_1_00200_A4 a4_0; - Cycle_B_1_00200_A5 a5_0; - int a; - int sum; - - Cycle_B_1_00200_A1() { - a2_0 = null; - a4_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00200_A2 { - Cycle_B_1_00200_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00200_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00200_A3 { - Cycle_B_1_00200_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00200_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00200_A4 { - int a; - int sum; - - Cycle_B_1_00200_A4() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } - } - - class Cycle_B_1_00200_A5 { - int a; - int sum; - - Cycle_B_1_00200_A5() { - a = 7; - sum = 0; - } - - void add() { - sum = a + 8; - } - } -} - - -public class Cycle_Bm_1_00200 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00200 A1_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); - ThreadRc_Cycle_Bm_1_00200 A2_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); - ThreadRc_Cycle_Bm_1_00200 A3_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); - ThreadRc_Cycle_Bm_1_00200 A4_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); - ThreadRc_Cycle_Bm_1_00200 A5_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); - ThreadRc_Cycle_Bm_1_00200 A6_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); - - A1_Cycle_Bm_1_00200.start(); - A2_Cycle_Bm_1_00200.start(); - A3_Cycle_Bm_1_00200.start(); - A4_Cycle_Bm_1_00200.start(); - A5_Cycle_Bm_1_00200.start(); - A6_Cycle_Bm_1_00200.start(); - - try { - A1_Cycle_Bm_1_00200.join(); - A2_Cycle_Bm_1_00200.join(); - A3_Cycle_Bm_1_00200.join(); - A4_Cycle_Bm_1_00200.join(); - A5_Cycle_Bm_1_00200.join(); - A6_Cycle_Bm_1_00200.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_00200.check() && A2_Cycle_Bm_1_00200.check() && A3_Cycle_Bm_1_00200.check() && A4_Cycle_Bm_1_00200.check() && A5_Cycle_Bm_1_00200.check() && A6_Cycle_Bm_1_00200.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00200.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_00200 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00200.java + *- @ExecuteClass: Cycle_Bm_1_00200 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00200 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00200_A1 a1_0 = new Cycle_B_1_00200_A1(); + a1_0.a2_0 = new Cycle_B_1_00200_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00200_A3(); + Cycle_B_1_00200_A4 a4_0 = new Cycle_B_1_00200_A4(); + Cycle_B_1_00200_A5 a5_0 = new Cycle_B_1_00200_A5(); + a1_0.a4_0 = a4_0; + a1_0.a5_0 = a5_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + //System.out.println(nsum); + + if (nsum == 38) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00200_A1 { + Cycle_B_1_00200_A2 a2_0; + Cycle_B_1_00200_A4 a4_0; + Cycle_B_1_00200_A5 a5_0; + int a; + int sum; + + Cycle_B_1_00200_A1() { + a2_0 = null; + a4_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00200_A2 { + Cycle_B_1_00200_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00200_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00200_A3 { + Cycle_B_1_00200_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00200_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00200_A4 { + int a; + int sum; + + Cycle_B_1_00200_A4() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } + } + + class Cycle_B_1_00200_A5 { + int a; + int sum; + + Cycle_B_1_00200_A5() { + a = 7; + sum = 0; + } + + void add() { + sum = a + 8; + } + } +} + + +public class Cycle_Bm_1_00200 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00200 A1_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); + ThreadRc_Cycle_Bm_1_00200 A2_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); + ThreadRc_Cycle_Bm_1_00200 A3_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); + ThreadRc_Cycle_Bm_1_00200 A4_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); + ThreadRc_Cycle_Bm_1_00200 A5_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); + ThreadRc_Cycle_Bm_1_00200 A6_Cycle_Bm_1_00200 = new ThreadRc_Cycle_Bm_1_00200(); + + A1_Cycle_Bm_1_00200.start(); + A2_Cycle_Bm_1_00200.start(); + A3_Cycle_Bm_1_00200.start(); + A4_Cycle_Bm_1_00200.start(); + A5_Cycle_Bm_1_00200.start(); + A6_Cycle_Bm_1_00200.start(); + + try { + A1_Cycle_Bm_1_00200.join(); + A2_Cycle_Bm_1_00200.join(); + A3_Cycle_Bm_1_00200.join(); + A4_Cycle_Bm_1_00200.join(); + A5_Cycle_Bm_1_00200.join(); + A6_Cycle_Bm_1_00200.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_00200.check() && A2_Cycle_Bm_1_00200.check() && A3_Cycle_Bm_1_00200.check() && A4_Cycle_Bm_1_00200.check() && A5_Cycle_Bm_1_00200.check() && A6_Cycle_Bm_1_00200.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0177-rc-function-RC_Thread01-Cycle_Bm_1_00210/Cycle_Bm_1_00210.java b/test/testsuite/ouroboros/memory_management/Function/RC0177-rc-function-RC_Thread01-Cycle_Bm_1_00210/Cycle_Bm_1_00210.java index d0401140ad8024e9244d9bb17ce8dec765a5063a..616d75f77d71446b2dec90ea41ee95c7431ee7b1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0177-rc-function-RC_Thread01-Cycle_Bm_1_00210/Cycle_Bm_1_00210.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0177-rc-function-RC_Thread01-Cycle_Bm_1_00210/Cycle_Bm_1_00210.java @@ -1,2046 +1,2046 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00210.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:make Cycle_B_1_xx together to this Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_00210.java - *- @ExecuteClass: Cycle_Bm_1_00210 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_00010B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00010_A1 a1_0 = new Cycle_B_1_00010_A1(); - a1_0.a1_0 = a1_0; - a1_0.add(); - int nsum = a1_0.sum; - //System.out.println(nsum); - - if (nsum == 246) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00010_A1 { - Cycle_B_1_00010_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00010_A1() { - a1_0 = null; - a = 123; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00020B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00020_A1 a1_0 = new Cycle_B_1_00020_A1(); - a1_0.a2_0 = new Cycle_B_1_00020_A2(); - a1_0.a2_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - - int nsum = (a1_0.sum + a1_0.a2_0.sum); - //System.out.println(nsum); - - if (nsum == 6) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00020_A1 { - Cycle_B_1_00020_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00020_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00020_A2 { - Cycle_B_1_00020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00020_A2() { - a1_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00030B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00030_A1 a1_0 = new Cycle_B_1_00030_A1(); - a1_0.a2_0 = new Cycle_B_1_00030_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00030_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 12) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00030_A1 { - Cycle_B_1_00030_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00030_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00030_A2 { - Cycle_B_1_00030_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00030_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00030_A3 { - Cycle_B_1_00030_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00030_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00040B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00040_A1 a1_0 = new Cycle_B_1_00040_A1(); - a1_0.a2_0 = new Cycle_B_1_00040_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00040_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00040_A4(); - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum; - //System.out.println(nsum); - - if (nsum == 21) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00040_A1 { - Cycle_B_1_00040_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00040_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00040_A2 { - Cycle_B_1_00040_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00040_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00040_A3 { - Cycle_B_1_00040_A1 a1_0; - Cycle_B_1_00040_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00040_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00040_A4 { - - int a; - int sum; - - Cycle_B_1_00040_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } -} - -class ThreadRc_Cycle_Bm_1_00050B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00050_A1 a1_0 = new Cycle_B_1_00050_A1(); - a1_0.a2_0 = new Cycle_B_1_00050_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00050_A3(); - a1_0.a2_0.a4_0 = new Cycle_B_1_00050_A4(); - a1_0.a2_0.a5_0 = new Cycle_B_1_00050_A5(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - a1_0.a2_0.a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a5_0.sum; - //System.out.println(nsum); - - if (nsum == 34) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00050_A1 { - Cycle_B_1_00050_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00050_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00050_A2 { - Cycle_B_1_00050_A3 a3_0; - Cycle_B_1_00050_A4 a4_0; - Cycle_B_1_00050_A5 a5_0; - int a; - int sum; - - Cycle_B_1_00050_A2() { - a3_0 = null; - a4_0 = null; - a5_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00050_A3 { - Cycle_B_1_00050_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00050_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00050_A4 { - - int a; - int sum; - - Cycle_B_1_00050_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } - - class Cycle_B_1_00050_A5 { - - int a; - int sum; - - Cycle_B_1_00050_A5() { - a = 6; - sum = 0; - } - - void add() { - sum = a + 7; - } - } -} - -class ThreadRc_Cycle_Bm_1_00060B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00060_A1 a1_0 = new Cycle_B_1_00060_A1(); - a1_0.a2_0 = new Cycle_B_1_00060_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00060_A3(); - Cycle_B_1_00060_A4 a4_0 = new Cycle_B_1_00060_A4(); - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum; - //System.out.println(nsum); - - if (nsum == 19) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00060_A1 { - Cycle_B_1_00060_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00060_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00060_A2 { - Cycle_B_1_00060_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00060_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00060_A3 { - Cycle_B_1_00060_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00060_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00060_A4 { - Cycle_B_1_00060_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00060_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00070B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00070_A1 a1_0 = new Cycle_B_1_00070_A1(); - a1_0.a2_0 = new Cycle_B_1_00070_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00070_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00070_A4(); - - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum; - //System.out.println(nsum); - - if (nsum == 21) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00070_A1 { - Cycle_B_1_00070_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00070_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00070_A2 { - Cycle_B_1_00070_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00070_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00070_A3 { - Cycle_B_1_00070_A1 a1_0; - Cycle_B_1_00070_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00070_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00070_A4 { - int a; - int sum; - - Cycle_B_1_00070_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } -} - -class ThreadRc_Cycle_Bm_1_00080B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00080_A1 a1_0 = new Cycle_B_1_00080_A1(); - a1_0.a2_0 = new Cycle_B_1_00080_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00080_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00080_A4(); - a1_0.a2_0.a3_0.a5_0 = new Cycle_B_1_00080_A5(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a5_0.sum; - //System.out.println(nsum); - - if (nsum == 56) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00080_A1 { - Cycle_B_1_00080_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00080_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00080_A2 { - Cycle_B_1_00080_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00080_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00080_A3 { - Cycle_B_1_00080_A1 a1_0; - Cycle_B_1_00080_A4 a4_0; - Cycle_B_1_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_1_00080_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - a4_0.add(); - a5_0.add(); - sum = a + a1_0.a + a4_0.sum + a5_0.sum; - } - } - - class Cycle_B_1_00080_A4 { - int a; - int sum; - - Cycle_B_1_00080_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } - - class Cycle_B_1_00080_A5 { - int a; - int sum; - - Cycle_B_1_00080_A5() { - a = 6; - sum = 0; - } - - void add() { - sum = a + 7; - } - } -} - -class ThreadRc_Cycle_Bm_1_00090B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00090_A1 a1_0 = new Cycle_B_1_00090_A1(); - a1_0.a2_0 = new Cycle_B_1_00090_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00090_A3(); - Cycle_B_1_00090_A4 a4_0 = new Cycle_B_1_00090_A4(); - Cycle_B_1_00090_A5 a5_0 = new Cycle_B_1_00090_A5(); - a4_0.a2_0 = a1_0.a2_0; - a5_0.a2_0 = a1_0.a2_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum; - //System.out.println(nsum); - - if (nsum == 25) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00090_A1 { - Cycle_B_1_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00090_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00090_A2 { - Cycle_B_1_00090_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00090_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00090_A3 { - Cycle_B_1_00090_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00090_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00090_A4 { - Cycle_B_1_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00090_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00090_A5 { - Cycle_B_1_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00090_A5() { - a2_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00100B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00100_A1 a1_0 = new Cycle_B_1_00100_A1(); - a1_0.a2_0 = new Cycle_B_1_00100_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00100_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a4_0 = new Cycle_B_1_00100_A4(); - a1_0.a2_0.a4_0.a5_0 = new Cycle_B_1_00100_A5(); - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - a1_0.a2_0.a4_0.a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a4_0.a5_0.sum; - //System.out.println(nsum); - - if (nsum == 38) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00100_A1 { - Cycle_B_1_00100_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00100_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00100_A2 { - Cycle_B_1_00100_A3 a3_0; - Cycle_B_1_00100_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00100_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00100_A3 { - Cycle_B_1_00100_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00100_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00100_A4 { - - int a; - int sum; - Cycle_B_1_00100_A5 a5_0; - - Cycle_B_1_00100_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - a5_0.add(); - sum = a + a5_0.sum; - } - } - - class Cycle_B_1_00100_A5 { - - int a; - int sum; - - Cycle_B_1_00100_A5() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } - } -} - -class ThreadRc_Cycle_Bm_1_00110B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00110_A1 a1_0 = new Cycle_B_1_00110_A1(); - a1_0.a2_0 = new Cycle_B_1_00110_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00110_A3(); - Cycle_B_1_00110_A5 a5_0 = new Cycle_B_1_00110_A5(); - a5_0.a4_0 = new Cycle_B_1_00110_A4(); - a5_0.a4_0.a2_0 = a1_0.a2_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a5_0.a4_0.add(); - a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a5_0.a4_0.sum + a5_0.sum; - //System.out.println(nsum); - - if (nsum == 27) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00110_A1 { - Cycle_B_1_00110_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00110_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00110_A2 { - Cycle_B_1_00110_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00110_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00110_A3 { - Cycle_B_1_00110_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00110_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00110_A4 { - Cycle_B_1_00110_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00110_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00110_A5 { - Cycle_B_1_00110_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00110_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00120B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00120_A1 a1_0 = new Cycle_B_1_00120_A1(); - a1_0.a2_0 = new Cycle_B_1_00120_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00120_A3(); - Cycle_B_1_00120_A5 a5_0 = new Cycle_B_1_00120_A5(); - a5_0.a4_0 = new Cycle_B_1_00120_A4(); - a5_0.a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a5_0.a4_0.add(); - a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a5_0.a4_0.sum + a5_0.sum; - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00120_A1 { - Cycle_B_1_00120_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00120_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00120_A2 { - Cycle_B_1_00120_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00120_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00120_A3 { - Cycle_B_1_00120_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00120_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00120_A4 { - Cycle_B_1_00120_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00120_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00120_A5 { - Cycle_B_1_00120_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00120_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00130B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00130_A1 a1_0 = new Cycle_B_1_00130_A1(); - Cycle_B_1_00130_A2 a2_0 = new Cycle_B_1_00130_A2(); - Cycle_B_1_00130_A3 a3_0 = new Cycle_B_1_00130_A3(); - a1_0.a3_0 = a3_0; - a2_0.a3_0 = a3_0; - a3_0.a1_0 = a1_0; - a1_0.add(); - a2_0.add(); - a3_0.add(); - int nsum = (a1_0.sum + a2_0.sum + a3_0.sum); - //System.out.println(nsum); - - if (nsum == 13) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00130_A1 { - Cycle_B_1_00130_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00130_A1() { - a3_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00130_A2 { - Cycle_B_1_00130_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00130_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00130_A3 { - Cycle_B_1_00130_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00130_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00140B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00140_A1 a1_0 = new Cycle_B_1_00140_A1(); - a1_0.a2_0 = new Cycle_B_1_00140_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00140_A3(); - Cycle_B_1_00140_A4 a4_0 = new Cycle_B_1_00140_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 12) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00140_A1 { - Cycle_B_1_00140_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00140_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00140_A2 { - Cycle_B_1_00140_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00140_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00140_A3 { - Cycle_B_1_00140_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00140_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00140_A4 { - Cycle_B_1_00140_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00140_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00150B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00150_A1 a1_0 = new Cycle_B_1_00150_A1(); - a1_0.a2_0 = new Cycle_B_1_00150_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00150_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00150_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_1_00150_A5(); - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum; - //System.out.println(nsum); - - if (nsum == 38) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00150_A1 { - Cycle_B_1_00150_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00150_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00150_A2 { - Cycle_B_1_00150_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00150_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00150_A3 { - Cycle_B_1_00150_A1 a1_0; - Cycle_B_1_00150_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00150_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00150_A4 { - - int a; - int sum; - Cycle_B_1_00150_A5 a5_0; - - Cycle_B_1_00150_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - a5_0.add(); - sum = a + a5_0.sum; - } - } - - class Cycle_B_1_00150_A5 { - - int a; - int sum; - - Cycle_B_1_00150_A5() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } - } -} - -class ThreadRc_Cycle_Bm_1_00160B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00160_A1 a1_0 = new Cycle_B_1_00160_A1(); - a1_0.a2_0 = new Cycle_B_1_00160_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00160_A3(); - Cycle_B_1_00160_A4 a4_0 = new Cycle_B_1_00160_A4(); - a4_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 17) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00160_A1 { - Cycle_B_1_00160_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00160_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00160_A2 { - Cycle_B_1_00160_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00160_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00160_A3 { - Cycle_B_1_00160_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00160_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00160_A4 { - Cycle_B_1_00160_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00160_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00170B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00170_A1 a1_0 = new Cycle_B_1_00170_A1(); - a1_0.a2_0 = new Cycle_B_1_00170_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00170_A3(); - Cycle_B_1_00170_A4 a4_0 = new Cycle_B_1_00170_A4(); - Cycle_B_1_00170_A5 a5_0 = new Cycle_B_1_00170_A5(); - a5_0.a4_0 = a4_0; - a4_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - //System.out.println(nsum); - - if (nsum == 26) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00170_A1 { - Cycle_B_1_00170_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00170_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00170_A2 { - Cycle_B_1_00170_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00170_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00170_A3 { - Cycle_B_1_00170_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00170_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00170_A4 { - Cycle_B_1_00170_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00170_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00170_A5 { - Cycle_B_1_00170_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00170_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00180B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00180_A1 a1_0 = new Cycle_B_1_00180_A1(); - a1_0.a2_0 = new Cycle_B_1_00180_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00180_A3(); - Cycle_B_1_00180_A4 a4_0 = new Cycle_B_1_00180_A4(); - Cycle_B_1_00180_A5 a5_0 = new Cycle_B_1_00180_A5(); - a4_0.a1_0 = a1_0; - a5_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - //System.out.println(nsum); - - if (nsum == 23) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00180_A1 { - Cycle_B_1_00180_A2 a2_0; - int a; - int sum; - - Cycle_B_1_00180_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00180_A2 { - Cycle_B_1_00180_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00180_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00180_A3 { - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00180_A4 { - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00180_A5 { - Cycle_B_1_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00180_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_00190B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00190_A1 a1_0 = new Cycle_B_1_00190_A1(); - a1_0.a2_0 = new Cycle_B_1_00190_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00190_A3(); - Cycle_B_1_00190_A4 a4_0 = new Cycle_B_1_00190_A4(); - a1_0.a4_0 = a4_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 21) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00190_A1 { - Cycle_B_1_00190_A2 a2_0; - Cycle_B_1_00190_A4 a4_0; - int a; - int sum; - - Cycle_B_1_00190_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00190_A2 { - Cycle_B_1_00190_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00190_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00190_A3 { - Cycle_B_1_00190_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00190_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00190_A4 { - int a; - int sum; - - Cycle_B_1_00190_A4() { - a = 4; - sum = 0; - } - - void add() { - sum = a + 5; - } - } -} - -class ThreadRc_Cycle_Bm_1_00200B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_00200_A1 a1_0 = new Cycle_B_1_00200_A1(); - a1_0.a2_0 = new Cycle_B_1_00200_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_00200_A3(); - Cycle_B_1_00200_A4 a4_0 = new Cycle_B_1_00200_A4(); - Cycle_B_1_00200_A5 a5_0 = new Cycle_B_1_00200_A5(); - a1_0.a4_0 = a4_0; - a1_0.a5_0 = a5_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - //System.out.println(nsum); - - if (nsum == 38) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_00200_A1 { - Cycle_B_1_00200_A2 a2_0; - Cycle_B_1_00200_A4 a4_0; - Cycle_B_1_00200_A5 a5_0; - int a; - int sum; - - Cycle_B_1_00200_A1() { - a2_0 = null; - a4_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_00200_A2 { - Cycle_B_1_00200_A3 a3_0; - int a; - int sum; - - Cycle_B_1_00200_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_00200_A3 { - Cycle_B_1_00200_A1 a1_0; - int a; - int sum; - - Cycle_B_1_00200_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_00200_A4 { - int a; - int sum; - - Cycle_B_1_00200_A4() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } - } - - class Cycle_B_1_00200_A5 { - int a; - int sum; - - Cycle_B_1_00200_A5() { - a = 7; - sum = 0; - } - - void add() { - sum = a + 8; - } - } -} - -public class Cycle_Bm_1_00210 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_00010B A1_00010 = new ThreadRc_Cycle_Bm_1_00010B(); - ThreadRc_Cycle_Bm_1_00010B A2_00010 = new ThreadRc_Cycle_Bm_1_00010B(); - ThreadRc_Cycle_Bm_1_00020B A1_00020 = new ThreadRc_Cycle_Bm_1_00020B(); - ThreadRc_Cycle_Bm_1_00020B A2_00020 = new ThreadRc_Cycle_Bm_1_00020B(); - ThreadRc_Cycle_Bm_1_00030B A1_00030 = new ThreadRc_Cycle_Bm_1_00030B(); - ThreadRc_Cycle_Bm_1_00030B A2_00030 = new ThreadRc_Cycle_Bm_1_00030B(); - ThreadRc_Cycle_Bm_1_00040B A1_00040 = new ThreadRc_Cycle_Bm_1_00040B(); - ThreadRc_Cycle_Bm_1_00040B A2_00040 = new ThreadRc_Cycle_Bm_1_00040B(); - ThreadRc_Cycle_Bm_1_00050B A1_00050 = new ThreadRc_Cycle_Bm_1_00050B(); - ThreadRc_Cycle_Bm_1_00050B A2_00050 = new ThreadRc_Cycle_Bm_1_00050B(); - ThreadRc_Cycle_Bm_1_00060B A1_00060 = new ThreadRc_Cycle_Bm_1_00060B(); - ThreadRc_Cycle_Bm_1_00060B A2_00060 = new ThreadRc_Cycle_Bm_1_00060B(); - ThreadRc_Cycle_Bm_1_00070B A1_00070 = new ThreadRc_Cycle_Bm_1_00070B(); - ThreadRc_Cycle_Bm_1_00070B A2_00070 = new ThreadRc_Cycle_Bm_1_00070B(); - ThreadRc_Cycle_Bm_1_00080B A1_00080 = new ThreadRc_Cycle_Bm_1_00080B(); - ThreadRc_Cycle_Bm_1_00080B A2_00080 = new ThreadRc_Cycle_Bm_1_00080B(); - ThreadRc_Cycle_Bm_1_00090B A1_00090 = new ThreadRc_Cycle_Bm_1_00090B(); - ThreadRc_Cycle_Bm_1_00090B A2_00090 = new ThreadRc_Cycle_Bm_1_00090B(); - ThreadRc_Cycle_Bm_1_00100B A1_00100 = new ThreadRc_Cycle_Bm_1_00100B(); - ThreadRc_Cycle_Bm_1_00100B A2_00100 = new ThreadRc_Cycle_Bm_1_00100B(); - ThreadRc_Cycle_Bm_1_00110B A1_00110 = new ThreadRc_Cycle_Bm_1_00110B(); - ThreadRc_Cycle_Bm_1_00110B A2_00110 = new ThreadRc_Cycle_Bm_1_00110B(); - ThreadRc_Cycle_Bm_1_00120B A1_00120 = new ThreadRc_Cycle_Bm_1_00120B(); - ThreadRc_Cycle_Bm_1_00120B A2_00120 = new ThreadRc_Cycle_Bm_1_00120B(); - ThreadRc_Cycle_Bm_1_00130B A1_00130 = new ThreadRc_Cycle_Bm_1_00130B(); - ThreadRc_Cycle_Bm_1_00130B A2_00130 = new ThreadRc_Cycle_Bm_1_00130B(); - ThreadRc_Cycle_Bm_1_00140B A1_00140 = new ThreadRc_Cycle_Bm_1_00140B(); - ThreadRc_Cycle_Bm_1_00140B A2_00140 = new ThreadRc_Cycle_Bm_1_00140B(); - ThreadRc_Cycle_Bm_1_00150B A1_00150 = new ThreadRc_Cycle_Bm_1_00150B(); - ThreadRc_Cycle_Bm_1_00150B A2_00150 = new ThreadRc_Cycle_Bm_1_00150B(); - ThreadRc_Cycle_Bm_1_00160B A1_00160 = new ThreadRc_Cycle_Bm_1_00160B(); - ThreadRc_Cycle_Bm_1_00160B A2_00160 = new ThreadRc_Cycle_Bm_1_00160B(); - ThreadRc_Cycle_Bm_1_00170B A1_00170 = new ThreadRc_Cycle_Bm_1_00170B(); - ThreadRc_Cycle_Bm_1_00170B A2_00170 = new ThreadRc_Cycle_Bm_1_00170B(); - ThreadRc_Cycle_Bm_1_00180B A1_00180 = new ThreadRc_Cycle_Bm_1_00180B(); - ThreadRc_Cycle_Bm_1_00180B A2_00180 = new ThreadRc_Cycle_Bm_1_00180B(); - ThreadRc_Cycle_Bm_1_00190B A1_00190 = new ThreadRc_Cycle_Bm_1_00190B(); - ThreadRc_Cycle_Bm_1_00190B A2_00190 = new ThreadRc_Cycle_Bm_1_00190B(); - ThreadRc_Cycle_Bm_1_00200B A1_00200 = new ThreadRc_Cycle_Bm_1_00200B(); - ThreadRc_Cycle_Bm_1_00200B A2_00200 = new ThreadRc_Cycle_Bm_1_00200B(); - A1_00010.start(); - A2_00010.start(); - A1_00020.start(); - A2_00020.start(); - A1_00030.start(); - A2_00030.start(); - A1_00040.start(); - A2_00040.start(); - A1_00050.start(); - A2_00050.start(); - A1_00060.start(); - A2_00060.start(); - A1_00070.start(); - A2_00070.start(); - A1_00080.start(); - A2_00080.start(); - A1_00090.start(); - A2_00090.start(); - A1_00100.start(); - A2_00100.start(); - A1_00110.start(); - A2_00110.start(); - A1_00120.start(); - A2_00120.start(); - A1_00130.start(); - A2_00130.start(); - A1_00140.start(); - A2_00140.start(); - A1_00150.start(); - A2_00150.start(); - A1_00160.start(); - A2_00160.start(); - A1_00170.start(); - A2_00170.start(); - A1_00180.start(); - A2_00180.start(); - A1_00190.start(); - A2_00190.start(); - A1_00200.start(); - A2_00200.start(); - try { - A1_00010.join(); - A2_00010.join(); - A1_00020.join(); - A2_00020.join(); - A1_00030.join(); - A2_00030.join(); - A1_00040.join(); - A2_00040.join(); - A1_00050.join(); - A2_00050.join(); - A1_00060.join(); - A2_00060.join(); - A1_00070.join(); - A2_00070.join(); - A1_00080.join(); - A2_00080.join(); - A1_00090.join(); - A2_00090.join(); - A1_00100.join(); - A2_00100.join(); - A1_00110.join(); - A2_00110.join(); - A1_00120.join(); - A2_00120.join(); - A1_00130.join(); - A2_00130.join(); - A1_00140.join(); - A2_00140.join(); - A1_00150.join(); - A2_00150.join(); - A1_00160.join(); - A2_00160.join(); - A1_00170.join(); - A2_00170.join(); - A1_00180.join(); - A2_00180.join(); - A1_00190.join(); - A2_00190.join(); - A1_00200.join(); - A2_00200.join(); - } catch (InterruptedException e) { - } - if (A1_00010.check() && A2_00010.check() && A1_00020.check() && A2_00020.check() && A1_00030.check() && A2_00030.check() && A1_00040.check() && A2_00040.check() && A1_00050.check() && A2_00050.check() && A1_00060.check() && A2_00060.check() && A1_00070.check() && A2_00070.check() && A1_00080.check() && A2_00080.check() && A1_00090.check() && A2_00090.check() && A1_00100.check() && A2_00100.check() && A1_00110.check() && A2_00110.check() && A1_00120.check() && A2_00120.check() && A1_00130.check() && A2_00130.check() && A1_00140.check() && A2_00140.check() && A1_00150.check() && A2_00150.check() && A1_00160.check() && A2_00160.check() && A1_00170.check() && A2_00170.check() && A1_00180.check() && A2_00180.check() && A1_00190.check() && A2_00190.check() && A1_00200.check() && A2_00200.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_00210.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:make Cycle_B_1_xx together to this Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_00210.java + *- @ExecuteClass: Cycle_Bm_1_00210 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_00010B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00010_A1 a1_0 = new Cycle_B_1_00010_A1(); + a1_0.a1_0 = a1_0; + a1_0.add(); + int nsum = a1_0.sum; + //System.out.println(nsum); + + if (nsum == 246) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00010_A1 { + Cycle_B_1_00010_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00010_A1() { + a1_0 = null; + a = 123; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00020B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00020_A1 a1_0 = new Cycle_B_1_00020_A1(); + a1_0.a2_0 = new Cycle_B_1_00020_A2(); + a1_0.a2_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + + int nsum = (a1_0.sum + a1_0.a2_0.sum); + //System.out.println(nsum); + + if (nsum == 6) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00020_A1 { + Cycle_B_1_00020_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00020_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00020_A2 { + Cycle_B_1_00020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00020_A2() { + a1_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00030B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00030_A1 a1_0 = new Cycle_B_1_00030_A1(); + a1_0.a2_0 = new Cycle_B_1_00030_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00030_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 12) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00030_A1 { + Cycle_B_1_00030_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00030_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00030_A2 { + Cycle_B_1_00030_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00030_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00030_A3 { + Cycle_B_1_00030_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00030_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00040B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00040_A1 a1_0 = new Cycle_B_1_00040_A1(); + a1_0.a2_0 = new Cycle_B_1_00040_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00040_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00040_A4(); + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum; + //System.out.println(nsum); + + if (nsum == 21) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00040_A1 { + Cycle_B_1_00040_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00040_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00040_A2 { + Cycle_B_1_00040_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00040_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00040_A3 { + Cycle_B_1_00040_A1 a1_0; + Cycle_B_1_00040_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00040_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00040_A4 { + + int a; + int sum; + + Cycle_B_1_00040_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } +} + +class ThreadRc_Cycle_Bm_1_00050B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00050_A1 a1_0 = new Cycle_B_1_00050_A1(); + a1_0.a2_0 = new Cycle_B_1_00050_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00050_A3(); + a1_0.a2_0.a4_0 = new Cycle_B_1_00050_A4(); + a1_0.a2_0.a5_0 = new Cycle_B_1_00050_A5(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + a1_0.a2_0.a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a5_0.sum; + //System.out.println(nsum); + + if (nsum == 34) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00050_A1 { + Cycle_B_1_00050_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00050_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00050_A2 { + Cycle_B_1_00050_A3 a3_0; + Cycle_B_1_00050_A4 a4_0; + Cycle_B_1_00050_A5 a5_0; + int a; + int sum; + + Cycle_B_1_00050_A2() { + a3_0 = null; + a4_0 = null; + a5_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00050_A3 { + Cycle_B_1_00050_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00050_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00050_A4 { + + int a; + int sum; + + Cycle_B_1_00050_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } + + class Cycle_B_1_00050_A5 { + + int a; + int sum; + + Cycle_B_1_00050_A5() { + a = 6; + sum = 0; + } + + void add() { + sum = a + 7; + } + } +} + +class ThreadRc_Cycle_Bm_1_00060B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00060_A1 a1_0 = new Cycle_B_1_00060_A1(); + a1_0.a2_0 = new Cycle_B_1_00060_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00060_A3(); + Cycle_B_1_00060_A4 a4_0 = new Cycle_B_1_00060_A4(); + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum; + //System.out.println(nsum); + + if (nsum == 19) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00060_A1 { + Cycle_B_1_00060_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00060_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00060_A2 { + Cycle_B_1_00060_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00060_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00060_A3 { + Cycle_B_1_00060_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00060_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00060_A4 { + Cycle_B_1_00060_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00060_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00070B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00070_A1 a1_0 = new Cycle_B_1_00070_A1(); + a1_0.a2_0 = new Cycle_B_1_00070_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00070_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00070_A4(); + + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum; + //System.out.println(nsum); + + if (nsum == 21) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00070_A1 { + Cycle_B_1_00070_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00070_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00070_A2 { + Cycle_B_1_00070_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00070_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00070_A3 { + Cycle_B_1_00070_A1 a1_0; + Cycle_B_1_00070_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00070_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00070_A4 { + int a; + int sum; + + Cycle_B_1_00070_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } +} + +class ThreadRc_Cycle_Bm_1_00080B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00080_A1 a1_0 = new Cycle_B_1_00080_A1(); + a1_0.a2_0 = new Cycle_B_1_00080_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00080_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00080_A4(); + a1_0.a2_0.a3_0.a5_0 = new Cycle_B_1_00080_A5(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a5_0.sum; + //System.out.println(nsum); + + if (nsum == 56) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00080_A1 { + Cycle_B_1_00080_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00080_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00080_A2 { + Cycle_B_1_00080_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00080_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00080_A3 { + Cycle_B_1_00080_A1 a1_0; + Cycle_B_1_00080_A4 a4_0; + Cycle_B_1_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_1_00080_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + a4_0.add(); + a5_0.add(); + sum = a + a1_0.a + a4_0.sum + a5_0.sum; + } + } + + class Cycle_B_1_00080_A4 { + int a; + int sum; + + Cycle_B_1_00080_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } + + class Cycle_B_1_00080_A5 { + int a; + int sum; + + Cycle_B_1_00080_A5() { + a = 6; + sum = 0; + } + + void add() { + sum = a + 7; + } + } +} + +class ThreadRc_Cycle_Bm_1_00090B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00090_A1 a1_0 = new Cycle_B_1_00090_A1(); + a1_0.a2_0 = new Cycle_B_1_00090_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00090_A3(); + Cycle_B_1_00090_A4 a4_0 = new Cycle_B_1_00090_A4(); + Cycle_B_1_00090_A5 a5_0 = new Cycle_B_1_00090_A5(); + a4_0.a2_0 = a1_0.a2_0; + a5_0.a2_0 = a1_0.a2_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum; + //System.out.println(nsum); + + if (nsum == 25) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00090_A1 { + Cycle_B_1_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00090_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00090_A2 { + Cycle_B_1_00090_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00090_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00090_A3 { + Cycle_B_1_00090_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00090_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00090_A4 { + Cycle_B_1_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00090_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00090_A5 { + Cycle_B_1_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00090_A5() { + a2_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00100B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00100_A1 a1_0 = new Cycle_B_1_00100_A1(); + a1_0.a2_0 = new Cycle_B_1_00100_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00100_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a4_0 = new Cycle_B_1_00100_A4(); + a1_0.a2_0.a4_0.a5_0 = new Cycle_B_1_00100_A5(); + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + a1_0.a2_0.a4_0.a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a4_0.a5_0.sum; + //System.out.println(nsum); + + if (nsum == 38) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00100_A1 { + Cycle_B_1_00100_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00100_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00100_A2 { + Cycle_B_1_00100_A3 a3_0; + Cycle_B_1_00100_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00100_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00100_A3 { + Cycle_B_1_00100_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00100_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00100_A4 { + + int a; + int sum; + Cycle_B_1_00100_A5 a5_0; + + Cycle_B_1_00100_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + a5_0.add(); + sum = a + a5_0.sum; + } + } + + class Cycle_B_1_00100_A5 { + + int a; + int sum; + + Cycle_B_1_00100_A5() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } + } +} + +class ThreadRc_Cycle_Bm_1_00110B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00110_A1 a1_0 = new Cycle_B_1_00110_A1(); + a1_0.a2_0 = new Cycle_B_1_00110_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00110_A3(); + Cycle_B_1_00110_A5 a5_0 = new Cycle_B_1_00110_A5(); + a5_0.a4_0 = new Cycle_B_1_00110_A4(); + a5_0.a4_0.a2_0 = a1_0.a2_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a5_0.a4_0.add(); + a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a5_0.a4_0.sum + a5_0.sum; + //System.out.println(nsum); + + if (nsum == 27) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00110_A1 { + Cycle_B_1_00110_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00110_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00110_A2 { + Cycle_B_1_00110_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00110_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00110_A3 { + Cycle_B_1_00110_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00110_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00110_A4 { + Cycle_B_1_00110_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00110_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00110_A5 { + Cycle_B_1_00110_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00110_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00120B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00120_A1 a1_0 = new Cycle_B_1_00120_A1(); + a1_0.a2_0 = new Cycle_B_1_00120_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00120_A3(); + Cycle_B_1_00120_A5 a5_0 = new Cycle_B_1_00120_A5(); + a5_0.a4_0 = new Cycle_B_1_00120_A4(); + a5_0.a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a5_0.a4_0.add(); + a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a5_0.a4_0.sum + a5_0.sum; + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00120_A1 { + Cycle_B_1_00120_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00120_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00120_A2 { + Cycle_B_1_00120_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00120_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00120_A3 { + Cycle_B_1_00120_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00120_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00120_A4 { + Cycle_B_1_00120_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00120_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00120_A5 { + Cycle_B_1_00120_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00120_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00130B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00130_A1 a1_0 = new Cycle_B_1_00130_A1(); + Cycle_B_1_00130_A2 a2_0 = new Cycle_B_1_00130_A2(); + Cycle_B_1_00130_A3 a3_0 = new Cycle_B_1_00130_A3(); + a1_0.a3_0 = a3_0; + a2_0.a3_0 = a3_0; + a3_0.a1_0 = a1_0; + a1_0.add(); + a2_0.add(); + a3_0.add(); + int nsum = (a1_0.sum + a2_0.sum + a3_0.sum); + //System.out.println(nsum); + + if (nsum == 13) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00130_A1 { + Cycle_B_1_00130_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00130_A1() { + a3_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00130_A2 { + Cycle_B_1_00130_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00130_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00130_A3 { + Cycle_B_1_00130_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00130_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00140B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00140_A1 a1_0 = new Cycle_B_1_00140_A1(); + a1_0.a2_0 = new Cycle_B_1_00140_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00140_A3(); + Cycle_B_1_00140_A4 a4_0 = new Cycle_B_1_00140_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 12) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00140_A1 { + Cycle_B_1_00140_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00140_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00140_A2 { + Cycle_B_1_00140_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00140_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00140_A3 { + Cycle_B_1_00140_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00140_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00140_A4 { + Cycle_B_1_00140_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00140_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00150B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00150_A1 a1_0 = new Cycle_B_1_00150_A1(); + a1_0.a2_0 = new Cycle_B_1_00150_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00150_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_1_00150_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_1_00150_A5(); + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + int nsum = a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum; + //System.out.println(nsum); + + if (nsum == 38) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00150_A1 { + Cycle_B_1_00150_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00150_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00150_A2 { + Cycle_B_1_00150_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00150_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00150_A3 { + Cycle_B_1_00150_A1 a1_0; + Cycle_B_1_00150_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00150_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00150_A4 { + + int a; + int sum; + Cycle_B_1_00150_A5 a5_0; + + Cycle_B_1_00150_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + a5_0.add(); + sum = a + a5_0.sum; + } + } + + class Cycle_B_1_00150_A5 { + + int a; + int sum; + + Cycle_B_1_00150_A5() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } + } +} + +class ThreadRc_Cycle_Bm_1_00160B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00160_A1 a1_0 = new Cycle_B_1_00160_A1(); + a1_0.a2_0 = new Cycle_B_1_00160_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00160_A3(); + Cycle_B_1_00160_A4 a4_0 = new Cycle_B_1_00160_A4(); + a4_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 17) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00160_A1 { + Cycle_B_1_00160_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00160_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00160_A2 { + Cycle_B_1_00160_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00160_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00160_A3 { + Cycle_B_1_00160_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00160_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00160_A4 { + Cycle_B_1_00160_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00160_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00170B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00170_A1 a1_0 = new Cycle_B_1_00170_A1(); + a1_0.a2_0 = new Cycle_B_1_00170_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00170_A3(); + Cycle_B_1_00170_A4 a4_0 = new Cycle_B_1_00170_A4(); + Cycle_B_1_00170_A5 a5_0 = new Cycle_B_1_00170_A5(); + a5_0.a4_0 = a4_0; + a4_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + //System.out.println(nsum); + + if (nsum == 26) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00170_A1 { + Cycle_B_1_00170_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00170_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00170_A2 { + Cycle_B_1_00170_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00170_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00170_A3 { + Cycle_B_1_00170_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00170_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00170_A4 { + Cycle_B_1_00170_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00170_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00170_A5 { + Cycle_B_1_00170_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00170_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00180B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00180_A1 a1_0 = new Cycle_B_1_00180_A1(); + a1_0.a2_0 = new Cycle_B_1_00180_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00180_A3(); + Cycle_B_1_00180_A4 a4_0 = new Cycle_B_1_00180_A4(); + Cycle_B_1_00180_A5 a5_0 = new Cycle_B_1_00180_A5(); + a4_0.a1_0 = a1_0; + a5_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + //System.out.println(nsum); + + if (nsum == 23) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00180_A1 { + Cycle_B_1_00180_A2 a2_0; + int a; + int sum; + + Cycle_B_1_00180_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00180_A2 { + Cycle_B_1_00180_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00180_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00180_A3 { + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00180_A4 { + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00180_A5 { + Cycle_B_1_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00180_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_00190B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00190_A1 a1_0 = new Cycle_B_1_00190_A1(); + a1_0.a2_0 = new Cycle_B_1_00190_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00190_A3(); + Cycle_B_1_00190_A4 a4_0 = new Cycle_B_1_00190_A4(); + a1_0.a4_0 = a4_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 21) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00190_A1 { + Cycle_B_1_00190_A2 a2_0; + Cycle_B_1_00190_A4 a4_0; + int a; + int sum; + + Cycle_B_1_00190_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00190_A2 { + Cycle_B_1_00190_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00190_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00190_A3 { + Cycle_B_1_00190_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00190_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00190_A4 { + int a; + int sum; + + Cycle_B_1_00190_A4() { + a = 4; + sum = 0; + } + + void add() { + sum = a + 5; + } + } +} + +class ThreadRc_Cycle_Bm_1_00200B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_00200_A1 a1_0 = new Cycle_B_1_00200_A1(); + a1_0.a2_0 = new Cycle_B_1_00200_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_00200_A3(); + Cycle_B_1_00200_A4 a4_0 = new Cycle_B_1_00200_A4(); + Cycle_B_1_00200_A5 a5_0 = new Cycle_B_1_00200_A5(); + a1_0.a4_0 = a4_0; + a1_0.a5_0 = a5_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + //System.out.println(nsum); + + if (nsum == 38) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_00200_A1 { + Cycle_B_1_00200_A2 a2_0; + Cycle_B_1_00200_A4 a4_0; + Cycle_B_1_00200_A5 a5_0; + int a; + int sum; + + Cycle_B_1_00200_A1() { + a2_0 = null; + a4_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_00200_A2 { + Cycle_B_1_00200_A3 a3_0; + int a; + int sum; + + Cycle_B_1_00200_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_00200_A3 { + Cycle_B_1_00200_A1 a1_0; + int a; + int sum; + + Cycle_B_1_00200_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_00200_A4 { + int a; + int sum; + + Cycle_B_1_00200_A4() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } + } + + class Cycle_B_1_00200_A5 { + int a; + int sum; + + Cycle_B_1_00200_A5() { + a = 7; + sum = 0; + } + + void add() { + sum = a + 8; + } + } +} + +public class Cycle_Bm_1_00210 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_00010B A1_00010 = new ThreadRc_Cycle_Bm_1_00010B(); + ThreadRc_Cycle_Bm_1_00010B A2_00010 = new ThreadRc_Cycle_Bm_1_00010B(); + ThreadRc_Cycle_Bm_1_00020B A1_00020 = new ThreadRc_Cycle_Bm_1_00020B(); + ThreadRc_Cycle_Bm_1_00020B A2_00020 = new ThreadRc_Cycle_Bm_1_00020B(); + ThreadRc_Cycle_Bm_1_00030B A1_00030 = new ThreadRc_Cycle_Bm_1_00030B(); + ThreadRc_Cycle_Bm_1_00030B A2_00030 = new ThreadRc_Cycle_Bm_1_00030B(); + ThreadRc_Cycle_Bm_1_00040B A1_00040 = new ThreadRc_Cycle_Bm_1_00040B(); + ThreadRc_Cycle_Bm_1_00040B A2_00040 = new ThreadRc_Cycle_Bm_1_00040B(); + ThreadRc_Cycle_Bm_1_00050B A1_00050 = new ThreadRc_Cycle_Bm_1_00050B(); + ThreadRc_Cycle_Bm_1_00050B A2_00050 = new ThreadRc_Cycle_Bm_1_00050B(); + ThreadRc_Cycle_Bm_1_00060B A1_00060 = new ThreadRc_Cycle_Bm_1_00060B(); + ThreadRc_Cycle_Bm_1_00060B A2_00060 = new ThreadRc_Cycle_Bm_1_00060B(); + ThreadRc_Cycle_Bm_1_00070B A1_00070 = new ThreadRc_Cycle_Bm_1_00070B(); + ThreadRc_Cycle_Bm_1_00070B A2_00070 = new ThreadRc_Cycle_Bm_1_00070B(); + ThreadRc_Cycle_Bm_1_00080B A1_00080 = new ThreadRc_Cycle_Bm_1_00080B(); + ThreadRc_Cycle_Bm_1_00080B A2_00080 = new ThreadRc_Cycle_Bm_1_00080B(); + ThreadRc_Cycle_Bm_1_00090B A1_00090 = new ThreadRc_Cycle_Bm_1_00090B(); + ThreadRc_Cycle_Bm_1_00090B A2_00090 = new ThreadRc_Cycle_Bm_1_00090B(); + ThreadRc_Cycle_Bm_1_00100B A1_00100 = new ThreadRc_Cycle_Bm_1_00100B(); + ThreadRc_Cycle_Bm_1_00100B A2_00100 = new ThreadRc_Cycle_Bm_1_00100B(); + ThreadRc_Cycle_Bm_1_00110B A1_00110 = new ThreadRc_Cycle_Bm_1_00110B(); + ThreadRc_Cycle_Bm_1_00110B A2_00110 = new ThreadRc_Cycle_Bm_1_00110B(); + ThreadRc_Cycle_Bm_1_00120B A1_00120 = new ThreadRc_Cycle_Bm_1_00120B(); + ThreadRc_Cycle_Bm_1_00120B A2_00120 = new ThreadRc_Cycle_Bm_1_00120B(); + ThreadRc_Cycle_Bm_1_00130B A1_00130 = new ThreadRc_Cycle_Bm_1_00130B(); + ThreadRc_Cycle_Bm_1_00130B A2_00130 = new ThreadRc_Cycle_Bm_1_00130B(); + ThreadRc_Cycle_Bm_1_00140B A1_00140 = new ThreadRc_Cycle_Bm_1_00140B(); + ThreadRc_Cycle_Bm_1_00140B A2_00140 = new ThreadRc_Cycle_Bm_1_00140B(); + ThreadRc_Cycle_Bm_1_00150B A1_00150 = new ThreadRc_Cycle_Bm_1_00150B(); + ThreadRc_Cycle_Bm_1_00150B A2_00150 = new ThreadRc_Cycle_Bm_1_00150B(); + ThreadRc_Cycle_Bm_1_00160B A1_00160 = new ThreadRc_Cycle_Bm_1_00160B(); + ThreadRc_Cycle_Bm_1_00160B A2_00160 = new ThreadRc_Cycle_Bm_1_00160B(); + ThreadRc_Cycle_Bm_1_00170B A1_00170 = new ThreadRc_Cycle_Bm_1_00170B(); + ThreadRc_Cycle_Bm_1_00170B A2_00170 = new ThreadRc_Cycle_Bm_1_00170B(); + ThreadRc_Cycle_Bm_1_00180B A1_00180 = new ThreadRc_Cycle_Bm_1_00180B(); + ThreadRc_Cycle_Bm_1_00180B A2_00180 = new ThreadRc_Cycle_Bm_1_00180B(); + ThreadRc_Cycle_Bm_1_00190B A1_00190 = new ThreadRc_Cycle_Bm_1_00190B(); + ThreadRc_Cycle_Bm_1_00190B A2_00190 = new ThreadRc_Cycle_Bm_1_00190B(); + ThreadRc_Cycle_Bm_1_00200B A1_00200 = new ThreadRc_Cycle_Bm_1_00200B(); + ThreadRc_Cycle_Bm_1_00200B A2_00200 = new ThreadRc_Cycle_Bm_1_00200B(); + A1_00010.start(); + A2_00010.start(); + A1_00020.start(); + A2_00020.start(); + A1_00030.start(); + A2_00030.start(); + A1_00040.start(); + A2_00040.start(); + A1_00050.start(); + A2_00050.start(); + A1_00060.start(); + A2_00060.start(); + A1_00070.start(); + A2_00070.start(); + A1_00080.start(); + A2_00080.start(); + A1_00090.start(); + A2_00090.start(); + A1_00100.start(); + A2_00100.start(); + A1_00110.start(); + A2_00110.start(); + A1_00120.start(); + A2_00120.start(); + A1_00130.start(); + A2_00130.start(); + A1_00140.start(); + A2_00140.start(); + A1_00150.start(); + A2_00150.start(); + A1_00160.start(); + A2_00160.start(); + A1_00170.start(); + A2_00170.start(); + A1_00180.start(); + A2_00180.start(); + A1_00190.start(); + A2_00190.start(); + A1_00200.start(); + A2_00200.start(); + try { + A1_00010.join(); + A2_00010.join(); + A1_00020.join(); + A2_00020.join(); + A1_00030.join(); + A2_00030.join(); + A1_00040.join(); + A2_00040.join(); + A1_00050.join(); + A2_00050.join(); + A1_00060.join(); + A2_00060.join(); + A1_00070.join(); + A2_00070.join(); + A1_00080.join(); + A2_00080.join(); + A1_00090.join(); + A2_00090.join(); + A1_00100.join(); + A2_00100.join(); + A1_00110.join(); + A2_00110.join(); + A1_00120.join(); + A2_00120.join(); + A1_00130.join(); + A2_00130.join(); + A1_00140.join(); + A2_00140.join(); + A1_00150.join(); + A2_00150.join(); + A1_00160.join(); + A2_00160.join(); + A1_00170.join(); + A2_00170.join(); + A1_00180.join(); + A2_00180.join(); + A1_00190.join(); + A2_00190.join(); + A1_00200.join(); + A2_00200.join(); + } catch (InterruptedException e) { + } + if (A1_00010.check() && A2_00010.check() && A1_00020.check() && A2_00020.check() && A1_00030.check() && A2_00030.check() && A1_00040.check() && A2_00040.check() && A1_00050.check() && A2_00050.check() && A1_00060.check() && A2_00060.check() && A1_00070.check() && A2_00070.check() && A1_00080.check() && A2_00080.check() && A1_00090.check() && A2_00090.check() && A1_00100.check() && A2_00100.check() && A1_00110.check() && A2_00110.check() && A1_00120.check() && A2_00120.check() && A1_00130.check() && A2_00130.check() && A1_00140.check() && A2_00140.check() && A1_00150.check() && A2_00150.check() && A1_00160.check() && A2_00160.check() && A1_00170.check() && A2_00170.check() && A1_00180.check() && A2_00180.check() && A1_00190.check() && A2_00190.check() && A1_00200.check() && A2_00200.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0178-rc-function-RC_Thread01-Cycle_Bm_1_10010/Cycle_Bm_1_10010.java b/test/testsuite/ouroboros/memory_management/Function/RC0178-rc-function-RC_Thread01-Cycle_Bm_1_10010/Cycle_Bm_1_10010.java index ddafae7df02db95f7318a55c04a80a3624aed9b4..696a2273c3c2b00d8d43317365530357ea4cf2a7 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0178-rc-function-RC_Thread01-Cycle_Bm_1_10010/Cycle_Bm_1_10010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0178-rc-function-RC_Thread01-Cycle_Bm_1_10010/Cycle_Bm_1_10010.java @@ -1,196 +1,196 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_10010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_10010 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_10010.java - *- @ExecuteClass: Cycle_Bm_1_10010 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_10010 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_10010_A1 a1_0 = new Cycle_B_1_10010_A1(); - a1_0.a2_0 = new Cycle_B_1_10010_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_10010_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - Cycle_B_1_10010_2A1 a1_10 = new Cycle_B_1_10010_2A1(); - a1_10.a2_0 = new Cycle_B_1_10010_2A2(); - a1_10.a2_0.a3_0 = new Cycle_B_1_10010_2A3(); - a1_10.a2_0.a3_0.a1_0 = a1_10; - a1_10.add(); - a1_10.a2_0.add(); - a1_10.a2_0.a3_0.add(); - int nsum2 = (a1_10.sum + a1_10.a2_0.sum + a1_10.a2_0.a3_0.sum); - //System.out.println(nsum); - nsum += nsum2; - - if (nsum == 24) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_10010_A1 { - Cycle_B_1_10010_A2 a2_0; - int a; - int sum; - - Cycle_B_1_10010_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_10010_A2 { - Cycle_B_1_10010_A3 a3_0; - int a; - int sum; - - Cycle_B_1_10010_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_10010_A3 { - Cycle_B_1_10010_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10010_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10010_2A1 { - Cycle_B_1_10010_2A2 a2_0; - int a; - int sum; - - Cycle_B_1_10010_2A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_10010_2A2 { - Cycle_B_1_10010_2A3 a3_0; - int a; - int sum; - - Cycle_B_1_10010_2A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_10010_2A3 { - Cycle_B_1_10010_2A1 a1_0; - int a; - int sum; - - Cycle_B_1_10010_2A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_1_10010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_10010 A1_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); - ThreadRc_Cycle_Bm_1_10010 A2_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); - ThreadRc_Cycle_Bm_1_10010 A3_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); - ThreadRc_Cycle_Bm_1_10010 A4_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); - ThreadRc_Cycle_Bm_1_10010 A5_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); - ThreadRc_Cycle_Bm_1_10010 A6_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); - - A1_Cycle_Bm_1_10010.start(); - A2_Cycle_Bm_1_10010.start(); - A3_Cycle_Bm_1_10010.start(); - A4_Cycle_Bm_1_10010.start(); - A5_Cycle_Bm_1_10010.start(); - A6_Cycle_Bm_1_10010.start(); - - try { - A1_Cycle_Bm_1_10010.join(); - A2_Cycle_Bm_1_10010.join(); - A3_Cycle_Bm_1_10010.join(); - A4_Cycle_Bm_1_10010.join(); - A5_Cycle_Bm_1_10010.join(); - A6_Cycle_Bm_1_10010.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_10010.check() && A2_Cycle_Bm_1_10010.check() && A3_Cycle_Bm_1_10010.check() && A4_Cycle_Bm_1_10010.check() && A5_Cycle_Bm_1_10010.check() && A6_Cycle_Bm_1_10010.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_10010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_10010 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_10010.java + *- @ExecuteClass: Cycle_Bm_1_10010 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_10010 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_10010_A1 a1_0 = new Cycle_B_1_10010_A1(); + a1_0.a2_0 = new Cycle_B_1_10010_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_10010_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + Cycle_B_1_10010_2A1 a1_10 = new Cycle_B_1_10010_2A1(); + a1_10.a2_0 = new Cycle_B_1_10010_2A2(); + a1_10.a2_0.a3_0 = new Cycle_B_1_10010_2A3(); + a1_10.a2_0.a3_0.a1_0 = a1_10; + a1_10.add(); + a1_10.a2_0.add(); + a1_10.a2_0.a3_0.add(); + int nsum2 = (a1_10.sum + a1_10.a2_0.sum + a1_10.a2_0.a3_0.sum); + //System.out.println(nsum); + nsum += nsum2; + + if (nsum == 24) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_10010_A1 { + Cycle_B_1_10010_A2 a2_0; + int a; + int sum; + + Cycle_B_1_10010_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_10010_A2 { + Cycle_B_1_10010_A3 a3_0; + int a; + int sum; + + Cycle_B_1_10010_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_10010_A3 { + Cycle_B_1_10010_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10010_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10010_2A1 { + Cycle_B_1_10010_2A2 a2_0; + int a; + int sum; + + Cycle_B_1_10010_2A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_10010_2A2 { + Cycle_B_1_10010_2A3 a3_0; + int a; + int sum; + + Cycle_B_1_10010_2A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_10010_2A3 { + Cycle_B_1_10010_2A1 a1_0; + int a; + int sum; + + Cycle_B_1_10010_2A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_1_10010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_10010 A1_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); + ThreadRc_Cycle_Bm_1_10010 A2_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); + ThreadRc_Cycle_Bm_1_10010 A3_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); + ThreadRc_Cycle_Bm_1_10010 A4_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); + ThreadRc_Cycle_Bm_1_10010 A5_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); + ThreadRc_Cycle_Bm_1_10010 A6_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010(); + + A1_Cycle_Bm_1_10010.start(); + A2_Cycle_Bm_1_10010.start(); + A3_Cycle_Bm_1_10010.start(); + A4_Cycle_Bm_1_10010.start(); + A5_Cycle_Bm_1_10010.start(); + A6_Cycle_Bm_1_10010.start(); + + try { + A1_Cycle_Bm_1_10010.join(); + A2_Cycle_Bm_1_10010.join(); + A3_Cycle_Bm_1_10010.join(); + A4_Cycle_Bm_1_10010.join(); + A5_Cycle_Bm_1_10010.join(); + A6_Cycle_Bm_1_10010.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_10010.check() && A2_Cycle_Bm_1_10010.check() && A3_Cycle_Bm_1_10010.check() && A4_Cycle_Bm_1_10010.check() && A5_Cycle_Bm_1_10010.check() && A6_Cycle_Bm_1_10010.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0179-rc-function-RC_Thread01-Cycle_Bm_1_10020/Cycle_Bm_1_10020.java b/test/testsuite/ouroboros/memory_management/Function/RC0179-rc-function-RC_Thread01-Cycle_Bm_1_10020/Cycle_Bm_1_10020.java index 356b8d7ef672c3bc6860026c3a69bffdecc5e314..0da71f81003d3c425bb754ef35fb899156c01cf3 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0179-rc-function-RC_Thread01-Cycle_Bm_1_10020/Cycle_Bm_1_10020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0179-rc-function-RC_Thread01-Cycle_Bm_1_10020/Cycle_Bm_1_10020.java @@ -1,271 +1,271 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_10020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_10020 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_10020.java - *- @ExecuteClass: Cycle_Bm_1_10020 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_10020 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_10020_A1 a1_0 = new Cycle_B_1_10020_A1(); - a1_0.a2_0 = new Cycle_B_1_10020_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_10020_A3(); - Cycle_B_1_10020_A4 a4_0 = new Cycle_B_1_10020_A4(); - Cycle_B_1_10020_A5 a5_0 = new Cycle_B_1_10020_A5(); - a4_0.a1_0 = a1_0; - a5_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - Cycle_B_1_10020_2A1 a1_20 = new Cycle_B_1_10020_2A1(); - a1_20.a2_0 = new Cycle_B_1_10020_2A2(); - a1_20.a2_0.a3_0 = new Cycle_B_1_10020_2A3(); - Cycle_B_1_10020_2A4 a4_20 = new Cycle_B_1_10020_2A4(); - Cycle_B_1_10020_2A5 a5_20 = new Cycle_B_1_10020_2A5(); - a1_20.a4_0 = a4_20; - a1_20.a5_0 = a5_20; - a1_20.a2_0.a3_0.a1_0 = a1_20; - a1_20.add(); - a1_20.a2_0.add(); - a1_20.a2_0.a3_0.add(); - a4_20.add(); - a5_20.add(); - int nsum1 = (a1_20.sum + a1_20.a2_0.sum + a1_20.a2_0.a3_0.sum + a4_20.sum + a5_20.sum); - nsum += nsum1; - - if (nsum == 61) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_10020_A1 { - Cycle_B_1_10020_A2 a2_0; - int a; - int sum; - - Cycle_B_1_10020_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_10020_A2 { - Cycle_B_1_10020_A3 a3_0; - int a; - int sum; - - Cycle_B_1_10020_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_10020_A3 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10020_A4 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10020_A5 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10020_2A1 { - Cycle_B_1_10020_2A2 a2_0; - Cycle_B_1_10020_2A4 a4_0; - Cycle_B_1_10020_2A5 a5_0; - int a; - int sum; - - Cycle_B_1_10020_2A1() { - a2_0 = null; - a4_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_10020_2A2 { - Cycle_B_1_10020_2A3 a3_0; - int a; - int sum; - - Cycle_B_1_10020_2A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_10020_2A3 { - Cycle_B_1_10020_2A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_2A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10020_2A4 { - int a; - int sum; - - Cycle_B_1_10020_2A4() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } - } - - class Cycle_B_1_10020_2A5 { - int a; - int sum; - - Cycle_B_1_10020_2A5() { - a = 7; - sum = 0; - } - - void add() { - sum = a + 8; - } - } -} - - -public class Cycle_Bm_1_10020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_10020 A1_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); - ThreadRc_Cycle_Bm_1_10020 A2_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); - ThreadRc_Cycle_Bm_1_10020 A3_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); - ThreadRc_Cycle_Bm_1_10020 A4_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); - ThreadRc_Cycle_Bm_1_10020 A5_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); - ThreadRc_Cycle_Bm_1_10020 A6_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); - - A1_Cycle_Bm_1_10020.start(); - A2_Cycle_Bm_1_10020.start(); - A3_Cycle_Bm_1_10020.start(); - A4_Cycle_Bm_1_10020.start(); - A5_Cycle_Bm_1_10020.start(); - A6_Cycle_Bm_1_10020.start(); - - try { - A1_Cycle_Bm_1_10020.join(); - A2_Cycle_Bm_1_10020.join(); - A3_Cycle_Bm_1_10020.join(); - A4_Cycle_Bm_1_10020.join(); - A5_Cycle_Bm_1_10020.join(); - A6_Cycle_Bm_1_10020.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_1_10020.check() && A2_Cycle_Bm_1_10020.check() && A3_Cycle_Bm_1_10020.check() && A4_Cycle_Bm_1_10020.check() && A5_Cycle_Bm_1_10020.check() && A6_Cycle_Bm_1_10020.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_10020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_10020 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_10020.java + *- @ExecuteClass: Cycle_Bm_1_10020 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_10020 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_10020_A1 a1_0 = new Cycle_B_1_10020_A1(); + a1_0.a2_0 = new Cycle_B_1_10020_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_10020_A3(); + Cycle_B_1_10020_A4 a4_0 = new Cycle_B_1_10020_A4(); + Cycle_B_1_10020_A5 a5_0 = new Cycle_B_1_10020_A5(); + a4_0.a1_0 = a1_0; + a5_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + Cycle_B_1_10020_2A1 a1_20 = new Cycle_B_1_10020_2A1(); + a1_20.a2_0 = new Cycle_B_1_10020_2A2(); + a1_20.a2_0.a3_0 = new Cycle_B_1_10020_2A3(); + Cycle_B_1_10020_2A4 a4_20 = new Cycle_B_1_10020_2A4(); + Cycle_B_1_10020_2A5 a5_20 = new Cycle_B_1_10020_2A5(); + a1_20.a4_0 = a4_20; + a1_20.a5_0 = a5_20; + a1_20.a2_0.a3_0.a1_0 = a1_20; + a1_20.add(); + a1_20.a2_0.add(); + a1_20.a2_0.a3_0.add(); + a4_20.add(); + a5_20.add(); + int nsum1 = (a1_20.sum + a1_20.a2_0.sum + a1_20.a2_0.a3_0.sum + a4_20.sum + a5_20.sum); + nsum += nsum1; + + if (nsum == 61) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_10020_A1 { + Cycle_B_1_10020_A2 a2_0; + int a; + int sum; + + Cycle_B_1_10020_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_10020_A2 { + Cycle_B_1_10020_A3 a3_0; + int a; + int sum; + + Cycle_B_1_10020_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_10020_A3 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10020_A4 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10020_A5 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10020_2A1 { + Cycle_B_1_10020_2A2 a2_0; + Cycle_B_1_10020_2A4 a4_0; + Cycle_B_1_10020_2A5 a5_0; + int a; + int sum; + + Cycle_B_1_10020_2A1() { + a2_0 = null; + a4_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_10020_2A2 { + Cycle_B_1_10020_2A3 a3_0; + int a; + int sum; + + Cycle_B_1_10020_2A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_10020_2A3 { + Cycle_B_1_10020_2A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_2A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10020_2A4 { + int a; + int sum; + + Cycle_B_1_10020_2A4() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } + } + + class Cycle_B_1_10020_2A5 { + int a; + int sum; + + Cycle_B_1_10020_2A5() { + a = 7; + sum = 0; + } + + void add() { + sum = a + 8; + } + } +} + + +public class Cycle_Bm_1_10020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_10020 A1_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); + ThreadRc_Cycle_Bm_1_10020 A2_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); + ThreadRc_Cycle_Bm_1_10020 A3_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); + ThreadRc_Cycle_Bm_1_10020 A4_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); + ThreadRc_Cycle_Bm_1_10020 A5_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); + ThreadRc_Cycle_Bm_1_10020 A6_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020(); + + A1_Cycle_Bm_1_10020.start(); + A2_Cycle_Bm_1_10020.start(); + A3_Cycle_Bm_1_10020.start(); + A4_Cycle_Bm_1_10020.start(); + A5_Cycle_Bm_1_10020.start(); + A6_Cycle_Bm_1_10020.start(); + + try { + A1_Cycle_Bm_1_10020.join(); + A2_Cycle_Bm_1_10020.join(); + A3_Cycle_Bm_1_10020.join(); + A4_Cycle_Bm_1_10020.join(); + A5_Cycle_Bm_1_10020.join(); + A6_Cycle_Bm_1_10020.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_1_10020.check() && A2_Cycle_Bm_1_10020.check() && A3_Cycle_Bm_1_10020.check() && A4_Cycle_Bm_1_10020.check() && A5_Cycle_Bm_1_10020.check() && A6_Cycle_Bm_1_10020.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0180-rc-function-RC_Thread01-Cycle_Bm_1_10030/Cycle_Bm_1_10030.java b/test/testsuite/ouroboros/memory_management/Function/RC0180-rc-function-RC_Thread01-Cycle_Bm_1_10030/Cycle_Bm_1_10030.java index 97a874d2cd87f8a7b1ea32e02940d52252d78a7e..e16701fec7ee51406fad6d836ccf255e6123bd09 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0180-rc-function-RC_Thread01-Cycle_Bm_1_10030/Cycle_Bm_1_10030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0180-rc-function-RC_Thread01-Cycle_Bm_1_10030/Cycle_Bm_1_10030.java @@ -1,418 +1,418 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_10030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_1_10030 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_1_10030.java - *- @ExecuteClass: Cycle_Bm_1_10030 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_1_10010B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_10010_A1 a1_0 = new Cycle_B_1_10010_A1(); - a1_0.a2_0 = new Cycle_B_1_10010_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_10010_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - Cycle_B_1_10010_2A1 a1_10 = new Cycle_B_1_10010_2A1(); - a1_10.a2_0 = new Cycle_B_1_10010_2A2(); - a1_10.a2_0.a3_0 = new Cycle_B_1_10010_2A3(); - a1_10.a2_0.a3_0.a1_0 = a1_10; - a1_10.add(); - a1_10.a2_0.add(); - a1_10.a2_0.a3_0.add(); - int nsum2 = (a1_10.sum + a1_10.a2_0.sum + a1_10.a2_0.a3_0.sum); - //System.out.println(nsum); - nsum += nsum2; - - if (nsum == 24) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_10010_A1 { - Cycle_B_1_10010_A2 a2_0; - int a; - int sum; - - Cycle_B_1_10010_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_10010_A2 { - Cycle_B_1_10010_A3 a3_0; - int a; - int sum; - - Cycle_B_1_10010_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_10010_A3 { - Cycle_B_1_10010_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10010_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10010_2A1 { - Cycle_B_1_10010_2A2 a2_0; - int a; - int sum; - - Cycle_B_1_10010_2A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_10010_2A2 { - Cycle_B_1_10010_2A3 a3_0; - int a; - int sum; - - Cycle_B_1_10010_2A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_10010_2A3 { - Cycle_B_1_10010_2A1 a1_0; - int a; - int sum; - - Cycle_B_1_10010_2A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_1_10020B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_1_10020_A1 a1_0 = new Cycle_B_1_10020_A1(); - a1_0.a2_0 = new Cycle_B_1_10020_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_1_10020_A3(); - Cycle_B_1_10020_A4 a4_0 = new Cycle_B_1_10020_A4(); - Cycle_B_1_10020_A5 a5_0 = new Cycle_B_1_10020_A5(); - a4_0.a1_0 = a1_0; - a5_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); - Cycle_B_1_10020_2A1 a1_20 = new Cycle_B_1_10020_2A1(); - a1_20.a2_0 = new Cycle_B_1_10020_2A2(); - a1_20.a2_0.a3_0 = new Cycle_B_1_10020_2A3(); - Cycle_B_1_10020_2A4 a4_20 = new Cycle_B_1_10020_2A4(); - Cycle_B_1_10020_2A5 a5_20 = new Cycle_B_1_10020_2A5(); - a1_20.a4_0 = a4_20; - a1_20.a5_0 = a5_20; - a1_20.a2_0.a3_0.a1_0 = a1_20; - a1_20.add(); - a1_20.a2_0.add(); - a1_20.a2_0.a3_0.add(); - a4_20.add(); - a5_20.add(); - int nsum1 = (a1_20.sum + a1_20.a2_0.sum + a1_20.a2_0.a3_0.sum + a4_20.sum + a5_20.sum); - nsum += nsum1; - - if (nsum == 61) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_1_10020_A1 { - Cycle_B_1_10020_A2 a2_0; - int a; - int sum; - - Cycle_B_1_10020_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_10020_A2 { - Cycle_B_1_10020_A3 a3_0; - int a; - int sum; - - Cycle_B_1_10020_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_10020_A3 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10020_A4 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10020_A5 { - Cycle_B_1_10020_A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10020_2A1 { - Cycle_B_1_10020_2A2 a2_0; - Cycle_B_1_10020_2A4 a4_0; - Cycle_B_1_10020_2A5 a5_0; - int a; - int sum; - - Cycle_B_1_10020_2A1() { - a2_0 = null; - a4_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_1_10020_2A2 { - Cycle_B_1_10020_2A3 a3_0; - int a; - int sum; - - Cycle_B_1_10020_2A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_1_10020_2A3 { - Cycle_B_1_10020_2A1 a1_0; - int a; - int sum; - - Cycle_B_1_10020_2A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_1_10020_2A4 { - int a; - int sum; - - Cycle_B_1_10020_2A4() { - a = 5; - sum = 0; - } - - void add() { - sum = a + 6; - } - } - - class Cycle_B_1_10020_2A5 { - int a; - int sum; - - Cycle_B_1_10020_2A5() { - a = 7; - sum = 0; - } - - void add() { - sum = a + 8; - } - } -} - -public class Cycle_Bm_1_10030 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_1_10010B A1_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); - ThreadRc_Cycle_Bm_1_10010B A2_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); - ThreadRc_Cycle_Bm_1_10010B A3_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); - ThreadRc_Cycle_Bm_1_10010B A4_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); - ThreadRc_Cycle_Bm_1_10010B A5_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); - ThreadRc_Cycle_Bm_1_10010B A6_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); - ThreadRc_Cycle_Bm_1_10020B A1_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); - ThreadRc_Cycle_Bm_1_10020B A2_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); - ThreadRc_Cycle_Bm_1_10020B A3_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); - ThreadRc_Cycle_Bm_1_10020B A4_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); - ThreadRc_Cycle_Bm_1_10020B A5_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); - ThreadRc_Cycle_Bm_1_10020B A6_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); - A1_Cycle_Bm_1_10010.start(); - A2_Cycle_Bm_1_10010.start(); - A3_Cycle_Bm_1_10010.start(); - A4_Cycle_Bm_1_10010.start(); - A5_Cycle_Bm_1_10010.start(); - A6_Cycle_Bm_1_10010.start(); - A1_Cycle_Bm_1_10020.start(); - A2_Cycle_Bm_1_10020.start(); - A3_Cycle_Bm_1_10020.start(); - A4_Cycle_Bm_1_10020.start(); - A5_Cycle_Bm_1_10020.start(); - A6_Cycle_Bm_1_10020.start(); - - try { - A1_Cycle_Bm_1_10010.join(); - A2_Cycle_Bm_1_10010.join(); - A3_Cycle_Bm_1_10010.join(); - A4_Cycle_Bm_1_10010.join(); - A5_Cycle_Bm_1_10010.join(); - A6_Cycle_Bm_1_10010.join(); - A1_Cycle_Bm_1_10020.join(); - A2_Cycle_Bm_1_10020.join(); - A3_Cycle_Bm_1_10020.join(); - A4_Cycle_Bm_1_10020.join(); - A5_Cycle_Bm_1_10020.join(); - A6_Cycle_Bm_1_10020.join(); - } catch (InterruptedException e) { - e.getStackTrace(); - } - if (A1_Cycle_Bm_1_10010.check() && A2_Cycle_Bm_1_10010.check() && A3_Cycle_Bm_1_10010.check() && A4_Cycle_Bm_1_10010.check() && A5_Cycle_Bm_1_10010.check() && A6_Cycle_Bm_1_10010.check() && A1_Cycle_Bm_1_10020.check() && A2_Cycle_Bm_1_10020.check() && A3_Cycle_Bm_1_10020.check() && A4_Cycle_Bm_1_10020.check() && A5_Cycle_Bm_1_10020.check() && A6_Cycle_Bm_1_10020.check()) - System.out.println("ExpectResult"); - } - - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_1_10030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_1_10030 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_1_10030.java + *- @ExecuteClass: Cycle_Bm_1_10030 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_1_10010B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_10010_A1 a1_0 = new Cycle_B_1_10010_A1(); + a1_0.a2_0 = new Cycle_B_1_10010_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_10010_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + Cycle_B_1_10010_2A1 a1_10 = new Cycle_B_1_10010_2A1(); + a1_10.a2_0 = new Cycle_B_1_10010_2A2(); + a1_10.a2_0.a3_0 = new Cycle_B_1_10010_2A3(); + a1_10.a2_0.a3_0.a1_0 = a1_10; + a1_10.add(); + a1_10.a2_0.add(); + a1_10.a2_0.a3_0.add(); + int nsum2 = (a1_10.sum + a1_10.a2_0.sum + a1_10.a2_0.a3_0.sum); + //System.out.println(nsum); + nsum += nsum2; + + if (nsum == 24) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_10010_A1 { + Cycle_B_1_10010_A2 a2_0; + int a; + int sum; + + Cycle_B_1_10010_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_10010_A2 { + Cycle_B_1_10010_A3 a3_0; + int a; + int sum; + + Cycle_B_1_10010_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_10010_A3 { + Cycle_B_1_10010_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10010_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10010_2A1 { + Cycle_B_1_10010_2A2 a2_0; + int a; + int sum; + + Cycle_B_1_10010_2A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_10010_2A2 { + Cycle_B_1_10010_2A3 a3_0; + int a; + int sum; + + Cycle_B_1_10010_2A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_10010_2A3 { + Cycle_B_1_10010_2A1 a1_0; + int a; + int sum; + + Cycle_B_1_10010_2A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_1_10020B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_1_10020_A1 a1_0 = new Cycle_B_1_10020_A1(); + a1_0.a2_0 = new Cycle_B_1_10020_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_1_10020_A3(); + Cycle_B_1_10020_A4 a4_0 = new Cycle_B_1_10020_A4(); + Cycle_B_1_10020_A5 a5_0 = new Cycle_B_1_10020_A5(); + a4_0.a1_0 = a1_0; + a5_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a5_0.sum); + Cycle_B_1_10020_2A1 a1_20 = new Cycle_B_1_10020_2A1(); + a1_20.a2_0 = new Cycle_B_1_10020_2A2(); + a1_20.a2_0.a3_0 = new Cycle_B_1_10020_2A3(); + Cycle_B_1_10020_2A4 a4_20 = new Cycle_B_1_10020_2A4(); + Cycle_B_1_10020_2A5 a5_20 = new Cycle_B_1_10020_2A5(); + a1_20.a4_0 = a4_20; + a1_20.a5_0 = a5_20; + a1_20.a2_0.a3_0.a1_0 = a1_20; + a1_20.add(); + a1_20.a2_0.add(); + a1_20.a2_0.a3_0.add(); + a4_20.add(); + a5_20.add(); + int nsum1 = (a1_20.sum + a1_20.a2_0.sum + a1_20.a2_0.a3_0.sum + a4_20.sum + a5_20.sum); + nsum += nsum1; + + if (nsum == 61) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_1_10020_A1 { + Cycle_B_1_10020_A2 a2_0; + int a; + int sum; + + Cycle_B_1_10020_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_10020_A2 { + Cycle_B_1_10020_A3 a3_0; + int a; + int sum; + + Cycle_B_1_10020_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_10020_A3 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10020_A4 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10020_A5 { + Cycle_B_1_10020_A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10020_2A1 { + Cycle_B_1_10020_2A2 a2_0; + Cycle_B_1_10020_2A4 a4_0; + Cycle_B_1_10020_2A5 a5_0; + int a; + int sum; + + Cycle_B_1_10020_2A1() { + a2_0 = null; + a4_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_1_10020_2A2 { + Cycle_B_1_10020_2A3 a3_0; + int a; + int sum; + + Cycle_B_1_10020_2A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_1_10020_2A3 { + Cycle_B_1_10020_2A1 a1_0; + int a; + int sum; + + Cycle_B_1_10020_2A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_1_10020_2A4 { + int a; + int sum; + + Cycle_B_1_10020_2A4() { + a = 5; + sum = 0; + } + + void add() { + sum = a + 6; + } + } + + class Cycle_B_1_10020_2A5 { + int a; + int sum; + + Cycle_B_1_10020_2A5() { + a = 7; + sum = 0; + } + + void add() { + sum = a + 8; + } + } +} + +public class Cycle_Bm_1_10030 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_1_10010B A1_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); + ThreadRc_Cycle_Bm_1_10010B A2_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); + ThreadRc_Cycle_Bm_1_10010B A3_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); + ThreadRc_Cycle_Bm_1_10010B A4_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); + ThreadRc_Cycle_Bm_1_10010B A5_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); + ThreadRc_Cycle_Bm_1_10010B A6_Cycle_Bm_1_10010 = new ThreadRc_Cycle_Bm_1_10010B(); + ThreadRc_Cycle_Bm_1_10020B A1_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); + ThreadRc_Cycle_Bm_1_10020B A2_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); + ThreadRc_Cycle_Bm_1_10020B A3_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); + ThreadRc_Cycle_Bm_1_10020B A4_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); + ThreadRc_Cycle_Bm_1_10020B A5_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); + ThreadRc_Cycle_Bm_1_10020B A6_Cycle_Bm_1_10020 = new ThreadRc_Cycle_Bm_1_10020B(); + A1_Cycle_Bm_1_10010.start(); + A2_Cycle_Bm_1_10010.start(); + A3_Cycle_Bm_1_10010.start(); + A4_Cycle_Bm_1_10010.start(); + A5_Cycle_Bm_1_10010.start(); + A6_Cycle_Bm_1_10010.start(); + A1_Cycle_Bm_1_10020.start(); + A2_Cycle_Bm_1_10020.start(); + A3_Cycle_Bm_1_10020.start(); + A4_Cycle_Bm_1_10020.start(); + A5_Cycle_Bm_1_10020.start(); + A6_Cycle_Bm_1_10020.start(); + + try { + A1_Cycle_Bm_1_10010.join(); + A2_Cycle_Bm_1_10010.join(); + A3_Cycle_Bm_1_10010.join(); + A4_Cycle_Bm_1_10010.join(); + A5_Cycle_Bm_1_10010.join(); + A6_Cycle_Bm_1_10010.join(); + A1_Cycle_Bm_1_10020.join(); + A2_Cycle_Bm_1_10020.join(); + A3_Cycle_Bm_1_10020.join(); + A4_Cycle_Bm_1_10020.join(); + A5_Cycle_Bm_1_10020.join(); + A6_Cycle_Bm_1_10020.join(); + } catch (InterruptedException e) { + e.getStackTrace(); + } + if (A1_Cycle_Bm_1_10010.check() && A2_Cycle_Bm_1_10010.check() && A3_Cycle_Bm_1_10010.check() && A4_Cycle_Bm_1_10010.check() && A5_Cycle_Bm_1_10010.check() && A6_Cycle_Bm_1_10010.check() && A1_Cycle_Bm_1_10020.check() && A2_Cycle_Bm_1_10020.check() && A3_Cycle_Bm_1_10020.check() && A4_Cycle_Bm_1_10020.check() && A5_Cycle_Bm_1_10020.check() && A6_Cycle_Bm_1_10020.check()) + System.out.println("ExpectResult"); + } + + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0181-rc-function-RC_Thread01-Cycle_Bm_2_00010/Cycle_Bm_2_00010.java b/test/testsuite/ouroboros/memory_management/Function/RC0181-rc-function-RC_Thread01-Cycle_Bm_2_00010/Cycle_Bm_2_00010.java index d0fdf1519690b34629be549f449801987a86cbac..93c3a8594fba8222ab9ede5f78e2844ec1ccee45 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0181-rc-function-RC_Thread01-Cycle_Bm_2_00010/Cycle_Bm_2_00010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0181-rc-function-RC_Thread01-Cycle_Bm_2_00010/Cycle_Bm_2_00010.java @@ -1,160 +1,160 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00010 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00010.java - *- @ExecuteClass: Cycle_Bm_2_00010 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00010 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00010_A1 a1_0 = new Cycle_B_2_00010_A1(); - a1_0.a2_0 = new Cycle_B_2_00010_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00010_A3(); - a1_0.a2_0.a4_0 = new Cycle_B_2_00010_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a4_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 18) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00010_A1 { - Cycle_B_2_00010_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00010_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00010_A2 { - Cycle_B_2_00010_A3 a3_0; - Cycle_B_2_00010_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00010_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00010_A3 { - Cycle_B_2_00010_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00010_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00010_A4 { - Cycle_B_2_00010_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00010_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_Bm_2_00010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00010 A1_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); - ThreadRc_Cycle_Bm_2_00010 A2_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); - ThreadRc_Cycle_Bm_2_00010 A3_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); - ThreadRc_Cycle_Bm_2_00010 A4_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); - ThreadRc_Cycle_Bm_2_00010 A5_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); - ThreadRc_Cycle_Bm_2_00010 A6_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); - - A1_Cycle_Bm_2_00010.start(); - A2_Cycle_Bm_2_00010.start(); - A3_Cycle_Bm_2_00010.start(); - A4_Cycle_Bm_2_00010.start(); - A5_Cycle_Bm_2_00010.start(); - A6_Cycle_Bm_2_00010.start(); - - try { - A1_Cycle_Bm_2_00010.join(); - A2_Cycle_Bm_2_00010.join(); - A3_Cycle_Bm_2_00010.join(); - A4_Cycle_Bm_2_00010.join(); - A5_Cycle_Bm_2_00010.join(); - A6_Cycle_Bm_2_00010.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00010.check() && A2_Cycle_Bm_2_00010.check() && A3_Cycle_Bm_2_00010.check() && A4_Cycle_Bm_2_00010.check() && A5_Cycle_Bm_2_00010.check() && A6_Cycle_Bm_2_00010.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00010 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00010.java + *- @ExecuteClass: Cycle_Bm_2_00010 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00010 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00010_A1 a1_0 = new Cycle_B_2_00010_A1(); + a1_0.a2_0 = new Cycle_B_2_00010_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00010_A3(); + a1_0.a2_0.a4_0 = new Cycle_B_2_00010_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a4_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 18) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00010_A1 { + Cycle_B_2_00010_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00010_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00010_A2 { + Cycle_B_2_00010_A3 a3_0; + Cycle_B_2_00010_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00010_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00010_A3 { + Cycle_B_2_00010_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00010_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00010_A4 { + Cycle_B_2_00010_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00010_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_Bm_2_00010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00010 A1_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); + ThreadRc_Cycle_Bm_2_00010 A2_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); + ThreadRc_Cycle_Bm_2_00010 A3_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); + ThreadRc_Cycle_Bm_2_00010 A4_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); + ThreadRc_Cycle_Bm_2_00010 A5_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); + ThreadRc_Cycle_Bm_2_00010 A6_Cycle_Bm_2_00010 = new ThreadRc_Cycle_Bm_2_00010(); + + A1_Cycle_Bm_2_00010.start(); + A2_Cycle_Bm_2_00010.start(); + A3_Cycle_Bm_2_00010.start(); + A4_Cycle_Bm_2_00010.start(); + A5_Cycle_Bm_2_00010.start(); + A6_Cycle_Bm_2_00010.start(); + + try { + A1_Cycle_Bm_2_00010.join(); + A2_Cycle_Bm_2_00010.join(); + A3_Cycle_Bm_2_00010.join(); + A4_Cycle_Bm_2_00010.join(); + A5_Cycle_Bm_2_00010.join(); + A6_Cycle_Bm_2_00010.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00010.check() && A2_Cycle_Bm_2_00010.check() && A3_Cycle_Bm_2_00010.check() && A4_Cycle_Bm_2_00010.check() && A5_Cycle_Bm_2_00010.check() && A6_Cycle_Bm_2_00010.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0182-rc-function-RC_Thread01-Cycle_Bm_2_00020/Cycle_Bm_2_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0182-rc-function-RC_Thread01-Cycle_Bm_2_00020/Cycle_Bm_2_00020.java index 8ff41beaa8a9c69485076509a6decf3874d0f35d..655487ca0e58bcd6396f942a55e2cbf05f4e730a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0182-rc-function-RC_Thread01-Cycle_Bm_2_00020/Cycle_Bm_2_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0182-rc-function-RC_Thread01-Cycle_Bm_2_00020/Cycle_Bm_2_00020.java @@ -1,163 +1,163 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00020 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00020.java - *- @ExecuteClass: Cycle_Bm_2_00020 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00020 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00020_A1 a1_0 = new Cycle_B_2_00020_A1(); - a1_0.a2_0 = new Cycle_B_2_00020_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00020_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00020_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 19) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00020_A1 { - Cycle_B_2_00020_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00020_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00020_A2 { - Cycle_B_2_00020_A3 a3_0; - Cycle_B_2_00020_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00020_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00020_A3 { - Cycle_B_2_00020_A1 a1_0; - Cycle_B_2_00020_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00020_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00020_A4 { - Cycle_B_2_00020_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00020_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_Bm_2_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00020 A1_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); - ThreadRc_Cycle_Bm_2_00020 A2_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); - ThreadRc_Cycle_Bm_2_00020 A3_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); - ThreadRc_Cycle_Bm_2_00020 A4_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); - ThreadRc_Cycle_Bm_2_00020 A5_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); - ThreadRc_Cycle_Bm_2_00020 A6_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); - - A1_Cycle_Bm_2_00020.start(); - A2_Cycle_Bm_2_00020.start(); - A3_Cycle_Bm_2_00020.start(); - A4_Cycle_Bm_2_00020.start(); - A5_Cycle_Bm_2_00020.start(); - A6_Cycle_Bm_2_00020.start(); - - try { - A1_Cycle_Bm_2_00020.join(); - A2_Cycle_Bm_2_00020.join(); - A3_Cycle_Bm_2_00020.join(); - A4_Cycle_Bm_2_00020.join(); - A5_Cycle_Bm_2_00020.join(); - A6_Cycle_Bm_2_00020.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00020.check() && A2_Cycle_Bm_2_00020.check() && A3_Cycle_Bm_2_00020.check() && A4_Cycle_Bm_2_00020.check() && A5_Cycle_Bm_2_00020.check() && A6_Cycle_Bm_2_00020.check()) - System.out.println("ExpectResult"); - - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00020 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00020.java + *- @ExecuteClass: Cycle_Bm_2_00020 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00020 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00020_A1 a1_0 = new Cycle_B_2_00020_A1(); + a1_0.a2_0 = new Cycle_B_2_00020_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00020_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00020_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 19) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00020_A1 { + Cycle_B_2_00020_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00020_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00020_A2 { + Cycle_B_2_00020_A3 a3_0; + Cycle_B_2_00020_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00020_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00020_A3 { + Cycle_B_2_00020_A1 a1_0; + Cycle_B_2_00020_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00020_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00020_A4 { + Cycle_B_2_00020_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00020_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_Bm_2_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00020 A1_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); + ThreadRc_Cycle_Bm_2_00020 A2_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); + ThreadRc_Cycle_Bm_2_00020 A3_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); + ThreadRc_Cycle_Bm_2_00020 A4_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); + ThreadRc_Cycle_Bm_2_00020 A5_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); + ThreadRc_Cycle_Bm_2_00020 A6_Cycle_Bm_2_00020 = new ThreadRc_Cycle_Bm_2_00020(); + + A1_Cycle_Bm_2_00020.start(); + A2_Cycle_Bm_2_00020.start(); + A3_Cycle_Bm_2_00020.start(); + A4_Cycle_Bm_2_00020.start(); + A5_Cycle_Bm_2_00020.start(); + A6_Cycle_Bm_2_00020.start(); + + try { + A1_Cycle_Bm_2_00020.join(); + A2_Cycle_Bm_2_00020.join(); + A3_Cycle_Bm_2_00020.join(); + A4_Cycle_Bm_2_00020.join(); + A5_Cycle_Bm_2_00020.join(); + A6_Cycle_Bm_2_00020.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00020.check() && A2_Cycle_Bm_2_00020.check() && A3_Cycle_Bm_2_00020.check() && A4_Cycle_Bm_2_00020.check() && A5_Cycle_Bm_2_00020.check() && A6_Cycle_Bm_2_00020.check()) + System.out.println("ExpectResult"); + + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0183-rc-function-RC_Thread01-Cycle_Bm_2_00030/Cycle_Bm_2_00030.java b/test/testsuite/ouroboros/memory_management/Function/RC0183-rc-function-RC_Thread01-Cycle_Bm_2_00030/Cycle_Bm_2_00030.java index 3c4ea4b51e68ed1cf0547d78ed02f65f1b06caa9..4f68483598ac7264b4008c246b7e672d6d54934f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0183-rc-function-RC_Thread01-Cycle_Bm_2_00030/Cycle_Bm_2_00030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0183-rc-function-RC_Thread01-Cycle_Bm_2_00030/Cycle_Bm_2_00030.java @@ -1,161 +1,161 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00030 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00030.java - *- @ExecuteClass: Cycle_Bm_2_00030 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00030 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00030_A1 a1_0 = new Cycle_B_2_00030_A1(); - a1_0.a2_0 = new Cycle_B_2_00030_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00030_A3(); - Cycle_B_2_00030_A4 a4_0 = new Cycle_B_2_00030_A4(); - a4_0.a1_0 = a1_0; - a1_0.a4_0 = a4_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 16) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00030_A1 { - Cycle_B_2_00030_A2 a2_0; - Cycle_B_2_00030_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00030_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00030_A2 { - Cycle_B_2_00030_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00030_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00030_A3 { - Cycle_B_2_00030_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00030_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00030_A4 { - Cycle_B_2_00030_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00030_A4() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_2_00030 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00030 A1_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); - ThreadRc_Cycle_Bm_2_00030 A2_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); - ThreadRc_Cycle_Bm_2_00030 A3_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); - ThreadRc_Cycle_Bm_2_00030 A4_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); - ThreadRc_Cycle_Bm_2_00030 A5_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); - ThreadRc_Cycle_Bm_2_00030 A6_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); - - A1_Cycle_Bm_2_00030.start(); - A2_Cycle_Bm_2_00030.start(); - A3_Cycle_Bm_2_00030.start(); - A4_Cycle_Bm_2_00030.start(); - A5_Cycle_Bm_2_00030.start(); - A6_Cycle_Bm_2_00030.start(); - - try { - A1_Cycle_Bm_2_00030.join(); - A2_Cycle_Bm_2_00030.join(); - A3_Cycle_Bm_2_00030.join(); - A4_Cycle_Bm_2_00030.join(); - A5_Cycle_Bm_2_00030.join(); - A6_Cycle_Bm_2_00030.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00030.check() && A2_Cycle_Bm_2_00030.check() && A3_Cycle_Bm_2_00030.check() && A4_Cycle_Bm_2_00030.check() && A5_Cycle_Bm_2_00030.check() && A6_Cycle_Bm_2_00030.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00030 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00030.java + *- @ExecuteClass: Cycle_Bm_2_00030 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00030 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00030_A1 a1_0 = new Cycle_B_2_00030_A1(); + a1_0.a2_0 = new Cycle_B_2_00030_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00030_A3(); + Cycle_B_2_00030_A4 a4_0 = new Cycle_B_2_00030_A4(); + a4_0.a1_0 = a1_0; + a1_0.a4_0 = a4_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 16) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00030_A1 { + Cycle_B_2_00030_A2 a2_0; + Cycle_B_2_00030_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00030_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00030_A2 { + Cycle_B_2_00030_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00030_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00030_A3 { + Cycle_B_2_00030_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00030_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00030_A4 { + Cycle_B_2_00030_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00030_A4() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_2_00030 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00030 A1_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); + ThreadRc_Cycle_Bm_2_00030 A2_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); + ThreadRc_Cycle_Bm_2_00030 A3_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); + ThreadRc_Cycle_Bm_2_00030 A4_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); + ThreadRc_Cycle_Bm_2_00030 A5_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); + ThreadRc_Cycle_Bm_2_00030 A6_Cycle_Bm_2_00030 = new ThreadRc_Cycle_Bm_2_00030(); + + A1_Cycle_Bm_2_00030.start(); + A2_Cycle_Bm_2_00030.start(); + A3_Cycle_Bm_2_00030.start(); + A4_Cycle_Bm_2_00030.start(); + A5_Cycle_Bm_2_00030.start(); + A6_Cycle_Bm_2_00030.start(); + + try { + A1_Cycle_Bm_2_00030.join(); + A2_Cycle_Bm_2_00030.join(); + A3_Cycle_Bm_2_00030.join(); + A4_Cycle_Bm_2_00030.join(); + A5_Cycle_Bm_2_00030.join(); + A6_Cycle_Bm_2_00030.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00030.check() && A2_Cycle_Bm_2_00030.check() && A3_Cycle_Bm_2_00030.check() && A4_Cycle_Bm_2_00030.check() && A5_Cycle_Bm_2_00030.check() && A6_Cycle_Bm_2_00030.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0184-rc-function-RC_Thread01-Cycle_Bm_2_00040/Cycle_Bm_2_00040.java b/test/testsuite/ouroboros/memory_management/Function/RC0184-rc-function-RC_Thread01-Cycle_Bm_2_00040/Cycle_Bm_2_00040.java index 68fc8cfcf5f64d4bb53df9655fba2a744e7dc35b..8e99c792f81211e2872df1f9c91dacc2459cde95 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0184-rc-function-RC_Thread01-Cycle_Bm_2_00040/Cycle_Bm_2_00040.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0184-rc-function-RC_Thread01-Cycle_Bm_2_00040/Cycle_Bm_2_00040.java @@ -1,163 +1,163 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00040.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00040 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00040.java - *- @ExecuteClass: Cycle_Bm_2_00040 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00040 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00040_A1 a1_0 = new Cycle_B_2_00040_A1(); - a1_0.a2_0 = new Cycle_B_2_00040_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00040_A3(); - Cycle_B_2_00040_A4 a4_0 = new Cycle_B_2_00040_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a4_0 = a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 19) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00040_A1 { - Cycle_B_2_00040_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00040_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00040_A2 { - Cycle_B_2_00040_A3 a3_0; - Cycle_B_2_00040_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00040_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00040_A3 { - Cycle_B_2_00040_A1 a1_0; - Cycle_B_2_00040_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00040_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00040_A4 { - Cycle_B_2_00040_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00040_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_Bm_2_00040 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00040 A1_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); - ThreadRc_Cycle_Bm_2_00040 A2_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); - ThreadRc_Cycle_Bm_2_00040 A3_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); - ThreadRc_Cycle_Bm_2_00040 A4_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); - ThreadRc_Cycle_Bm_2_00040 A5_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); - ThreadRc_Cycle_Bm_2_00040 A6_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); - - A1_Cycle_Bm_2_00040.start(); - A2_Cycle_Bm_2_00040.start(); - A3_Cycle_Bm_2_00040.start(); - A4_Cycle_Bm_2_00040.start(); - A5_Cycle_Bm_2_00040.start(); - A6_Cycle_Bm_2_00040.start(); - - try { - A1_Cycle_Bm_2_00040.join(); - A2_Cycle_Bm_2_00040.join(); - A3_Cycle_Bm_2_00040.join(); - A4_Cycle_Bm_2_00040.join(); - A5_Cycle_Bm_2_00040.join(); - A6_Cycle_Bm_2_00040.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00040.check() && A2_Cycle_Bm_2_00040.check() && A3_Cycle_Bm_2_00040.check() && A4_Cycle_Bm_2_00040.check() && A5_Cycle_Bm_2_00040.check() && A6_Cycle_Bm_2_00040.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00040.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00040 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00040.java + *- @ExecuteClass: Cycle_Bm_2_00040 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00040 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00040_A1 a1_0 = new Cycle_B_2_00040_A1(); + a1_0.a2_0 = new Cycle_B_2_00040_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00040_A3(); + Cycle_B_2_00040_A4 a4_0 = new Cycle_B_2_00040_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a4_0 = a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 19) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00040_A1 { + Cycle_B_2_00040_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00040_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00040_A2 { + Cycle_B_2_00040_A3 a3_0; + Cycle_B_2_00040_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00040_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00040_A3 { + Cycle_B_2_00040_A1 a1_0; + Cycle_B_2_00040_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00040_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00040_A4 { + Cycle_B_2_00040_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00040_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_Bm_2_00040 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00040 A1_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); + ThreadRc_Cycle_Bm_2_00040 A2_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); + ThreadRc_Cycle_Bm_2_00040 A3_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); + ThreadRc_Cycle_Bm_2_00040 A4_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); + ThreadRc_Cycle_Bm_2_00040 A5_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); + ThreadRc_Cycle_Bm_2_00040 A6_Cycle_Bm_2_00040 = new ThreadRc_Cycle_Bm_2_00040(); + + A1_Cycle_Bm_2_00040.start(); + A2_Cycle_Bm_2_00040.start(); + A3_Cycle_Bm_2_00040.start(); + A4_Cycle_Bm_2_00040.start(); + A5_Cycle_Bm_2_00040.start(); + A6_Cycle_Bm_2_00040.start(); + + try { + A1_Cycle_Bm_2_00040.join(); + A2_Cycle_Bm_2_00040.join(); + A3_Cycle_Bm_2_00040.join(); + A4_Cycle_Bm_2_00040.join(); + A5_Cycle_Bm_2_00040.join(); + A6_Cycle_Bm_2_00040.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00040.check() && A2_Cycle_Bm_2_00040.check() && A3_Cycle_Bm_2_00040.check() && A4_Cycle_Bm_2_00040.check() && A5_Cycle_Bm_2_00040.check() && A6_Cycle_Bm_2_00040.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0185-rc-function-RC_Thread01-Cycle_Bm_2_00050/Cycle_Bm_2_00050.java b/test/testsuite/ouroboros/memory_management/Function/RC0185-rc-function-RC_Thread01-Cycle_Bm_2_00050/Cycle_Bm_2_00050.java index cf3b26c7a6c9d4c1a07a75f775b8334ec337861b..415083ad5bbc90bb84f4f2472546ac05caefcbff 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0185-rc-function-RC_Thread01-Cycle_Bm_2_00050/Cycle_Bm_2_00050.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0185-rc-function-RC_Thread01-Cycle_Bm_2_00050/Cycle_Bm_2_00050.java @@ -1,182 +1,182 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00050.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00050 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00050.java - *- @ExecuteClass: Cycle_Bm_2_00050 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00050 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00050_A1 a1_0 = new Cycle_B_2_00050_A1(); - a1_0.a2_0 = new Cycle_B_2_00050_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00050_A3(); - Cycle_B_2_00050_A4 a4_0 = new Cycle_B_2_00050_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a4_0.a3_0.a5_0 = new Cycle_B_2_00050_A5(); - a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a4_0.a3_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00050_A1 { - Cycle_B_2_00050_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00050_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00050_A2 { - Cycle_B_2_00050_A3 a3_0; - Cycle_B_2_00050_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00050_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00050_A3 { - Cycle_B_2_00050_A1 a1_0; - Cycle_B_2_00050_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00050_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00050_A4 { - Cycle_B_2_00050_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00050_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00050_A5 { - Cycle_B_2_00050_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00050_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class Cycle_Bm_2_00050 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00050 A1_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); - ThreadRc_Cycle_Bm_2_00050 A2_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); - ThreadRc_Cycle_Bm_2_00050 A3_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); - ThreadRc_Cycle_Bm_2_00050 A4_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); - ThreadRc_Cycle_Bm_2_00050 A5_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); - ThreadRc_Cycle_Bm_2_00050 A6_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); - - A1_Cycle_Bm_2_00050.start(); - A2_Cycle_Bm_2_00050.start(); - A3_Cycle_Bm_2_00050.start(); - A4_Cycle_Bm_2_00050.start(); - A5_Cycle_Bm_2_00050.start(); - A6_Cycle_Bm_2_00050.start(); - - try { - A1_Cycle_Bm_2_00050.join(); - A2_Cycle_Bm_2_00050.join(); - A3_Cycle_Bm_2_00050.join(); - A4_Cycle_Bm_2_00050.join(); - A5_Cycle_Bm_2_00050.join(); - A6_Cycle_Bm_2_00050.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00050.check() && A2_Cycle_Bm_2_00050.check() && A3_Cycle_Bm_2_00050.check() && A4_Cycle_Bm_2_00050.check() && A5_Cycle_Bm_2_00050.check() && A6_Cycle_Bm_2_00050.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00050.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00050 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00050.java + *- @ExecuteClass: Cycle_Bm_2_00050 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00050 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00050_A1 a1_0 = new Cycle_B_2_00050_A1(); + a1_0.a2_0 = new Cycle_B_2_00050_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00050_A3(); + Cycle_B_2_00050_A4 a4_0 = new Cycle_B_2_00050_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a4_0.a3_0.a5_0 = new Cycle_B_2_00050_A5(); + a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a4_0.a3_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00050_A1 { + Cycle_B_2_00050_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00050_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00050_A2 { + Cycle_B_2_00050_A3 a3_0; + Cycle_B_2_00050_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00050_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00050_A3 { + Cycle_B_2_00050_A1 a1_0; + Cycle_B_2_00050_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00050_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00050_A4 { + Cycle_B_2_00050_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00050_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00050_A5 { + Cycle_B_2_00050_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00050_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class Cycle_Bm_2_00050 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00050 A1_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); + ThreadRc_Cycle_Bm_2_00050 A2_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); + ThreadRc_Cycle_Bm_2_00050 A3_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); + ThreadRc_Cycle_Bm_2_00050 A4_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); + ThreadRc_Cycle_Bm_2_00050 A5_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); + ThreadRc_Cycle_Bm_2_00050 A6_Cycle_Bm_2_00050 = new ThreadRc_Cycle_Bm_2_00050(); + + A1_Cycle_Bm_2_00050.start(); + A2_Cycle_Bm_2_00050.start(); + A3_Cycle_Bm_2_00050.start(); + A4_Cycle_Bm_2_00050.start(); + A5_Cycle_Bm_2_00050.start(); + A6_Cycle_Bm_2_00050.start(); + + try { + A1_Cycle_Bm_2_00050.join(); + A2_Cycle_Bm_2_00050.join(); + A3_Cycle_Bm_2_00050.join(); + A4_Cycle_Bm_2_00050.join(); + A5_Cycle_Bm_2_00050.join(); + A6_Cycle_Bm_2_00050.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00050.check() && A2_Cycle_Bm_2_00050.check() && A3_Cycle_Bm_2_00050.check() && A4_Cycle_Bm_2_00050.check() && A5_Cycle_Bm_2_00050.check() && A6_Cycle_Bm_2_00050.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0186-rc-function-RC_Thread01-Cycle_Bm_2_00060/Cycle_Bm_2_00060.java b/test/testsuite/ouroboros/memory_management/Function/RC0186-rc-function-RC_Thread01-Cycle_Bm_2_00060/Cycle_Bm_2_00060.java index ee3321642b429f3d5817e0f0c485c5a30c24db91..aa172c7e56d615d12e4674613ce312e0833ded3c 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0186-rc-function-RC_Thread01-Cycle_Bm_2_00060/Cycle_Bm_2_00060.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0186-rc-function-RC_Thread01-Cycle_Bm_2_00060/Cycle_Bm_2_00060.java @@ -1,185 +1,185 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00060.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00060 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00060.java - *- @ExecuteClass: Cycle_Bm_2_00060 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00060 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00060_A1 a1_0 = new Cycle_B_2_00060_A1(); - a1_0.a2_0 = new Cycle_B_2_00060_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00060_A3(); - Cycle_B_2_00060_A4 a4_0 = new Cycle_B_2_00060_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a4_0.a3_0.a5_0 = new Cycle_B_2_00060_A5(); - a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.a5_0 = a4_0.a3_0.a5_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a4_0.a3_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00060_A1 { - Cycle_B_2_00060_A2 a2_0; - Cycle_B_2_00060_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00060_A1() { - a2_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00060_A2 { - Cycle_B_2_00060_A3 a3_0; - Cycle_B_2_00060_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00060_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00060_A3 { - Cycle_B_2_00060_A1 a1_0; - Cycle_B_2_00060_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00060_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00060_A4 { - Cycle_B_2_00060_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00060_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00060_A5 { - Cycle_B_2_00060_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00060_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class Cycle_Bm_2_00060 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00060 A1_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); - ThreadRc_Cycle_Bm_2_00060 A2_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); - ThreadRc_Cycle_Bm_2_00060 A3_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); - ThreadRc_Cycle_Bm_2_00060 A4_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); - ThreadRc_Cycle_Bm_2_00060 A5_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); - ThreadRc_Cycle_Bm_2_00060 A6_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); - - A1_Cycle_Bm_2_00060.start(); - A2_Cycle_Bm_2_00060.start(); - A3_Cycle_Bm_2_00060.start(); - A4_Cycle_Bm_2_00060.start(); - A5_Cycle_Bm_2_00060.start(); - A6_Cycle_Bm_2_00060.start(); - - try { - A1_Cycle_Bm_2_00060.join(); - A2_Cycle_Bm_2_00060.join(); - A3_Cycle_Bm_2_00060.join(); - A4_Cycle_Bm_2_00060.join(); - A5_Cycle_Bm_2_00060.join(); - A6_Cycle_Bm_2_00060.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00060.check() && A2_Cycle_Bm_2_00060.check() && A3_Cycle_Bm_2_00060.check() && A4_Cycle_Bm_2_00060.check() && A5_Cycle_Bm_2_00060.check() && A6_Cycle_Bm_2_00060.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00060.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00060 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00060.java + *- @ExecuteClass: Cycle_Bm_2_00060 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00060 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00060_A1 a1_0 = new Cycle_B_2_00060_A1(); + a1_0.a2_0 = new Cycle_B_2_00060_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00060_A3(); + Cycle_B_2_00060_A4 a4_0 = new Cycle_B_2_00060_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a4_0.a3_0.a5_0 = new Cycle_B_2_00060_A5(); + a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.a5_0 = a4_0.a3_0.a5_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a4_0.a3_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00060_A1 { + Cycle_B_2_00060_A2 a2_0; + Cycle_B_2_00060_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00060_A1() { + a2_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00060_A2 { + Cycle_B_2_00060_A3 a3_0; + Cycle_B_2_00060_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00060_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00060_A3 { + Cycle_B_2_00060_A1 a1_0; + Cycle_B_2_00060_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00060_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00060_A4 { + Cycle_B_2_00060_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00060_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00060_A5 { + Cycle_B_2_00060_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00060_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class Cycle_Bm_2_00060 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00060 A1_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); + ThreadRc_Cycle_Bm_2_00060 A2_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); + ThreadRc_Cycle_Bm_2_00060 A3_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); + ThreadRc_Cycle_Bm_2_00060 A4_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); + ThreadRc_Cycle_Bm_2_00060 A5_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); + ThreadRc_Cycle_Bm_2_00060 A6_Cycle_Bm_2_00060 = new ThreadRc_Cycle_Bm_2_00060(); + + A1_Cycle_Bm_2_00060.start(); + A2_Cycle_Bm_2_00060.start(); + A3_Cycle_Bm_2_00060.start(); + A4_Cycle_Bm_2_00060.start(); + A5_Cycle_Bm_2_00060.start(); + A6_Cycle_Bm_2_00060.start(); + + try { + A1_Cycle_Bm_2_00060.join(); + A2_Cycle_Bm_2_00060.join(); + A3_Cycle_Bm_2_00060.join(); + A4_Cycle_Bm_2_00060.join(); + A5_Cycle_Bm_2_00060.join(); + A6_Cycle_Bm_2_00060.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00060.check() && A2_Cycle_Bm_2_00060.check() && A3_Cycle_Bm_2_00060.check() && A4_Cycle_Bm_2_00060.check() && A5_Cycle_Bm_2_00060.check() && A6_Cycle_Bm_2_00060.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0187-rc-function-RC_Thread01-Cycle_Bm_2_00070/Cycle_Bm_2_00070.java b/test/testsuite/ouroboros/memory_management/Function/RC0187-rc-function-RC_Thread01-Cycle_Bm_2_00070/Cycle_Bm_2_00070.java index d222236b3dd536146284c1c3a7bc30ed2addb030..90dcc53c4401debffceb2ec8539b16d7420ecd45 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0187-rc-function-RC_Thread01-Cycle_Bm_2_00070/Cycle_Bm_2_00070.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0187-rc-function-RC_Thread01-Cycle_Bm_2_00070/Cycle_Bm_2_00070.java @@ -1,201 +1,201 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00070.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00070 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00070.java - *- @ExecuteClass: Cycle_Bm_2_00070 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00070 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00070_A1 a1_0 = new Cycle_B_2_00070_A1(); - a1_0.a2_0 = new Cycle_B_2_00070_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00070_A3(); - Cycle_B_2_00070_A4 a4_0 = new Cycle_B_2_00070_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a4_0.a3_0.a5_0 = new Cycle_B_2_00070_A5(); - Cycle_B_2_00070_A6 a6_0 = new Cycle_B_2_00070_A6(); - a6_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a6_0.add(); - a4_0.a3_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum + a6_0.sum); - //System.out.println(nsum); - - if (nsum == 37) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00070_A1 { - Cycle_B_2_00070_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00070_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00070_A2 { - Cycle_B_2_00070_A3 a3_0; - Cycle_B_2_00070_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00070_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00070_A3 { - Cycle_B_2_00070_A1 a1_0; - Cycle_B_2_00070_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00070_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00070_A4 { - Cycle_B_2_00070_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00070_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00070_A5 { - Cycle_B_2_00070_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00070_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00070_A6 { - Cycle_B_2_00070_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00070_A6() { - a3_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_Bm_2_00070 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00070 A1_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); - ThreadRc_Cycle_Bm_2_00070 A2_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); - ThreadRc_Cycle_Bm_2_00070 A3_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); - ThreadRc_Cycle_Bm_2_00070 A4_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); - ThreadRc_Cycle_Bm_2_00070 A5_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); - ThreadRc_Cycle_Bm_2_00070 A6_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); - - A1_Cycle_Bm_2_00070.start(); - A2_Cycle_Bm_2_00070.start(); - A3_Cycle_Bm_2_00070.start(); - A4_Cycle_Bm_2_00070.start(); - A5_Cycle_Bm_2_00070.start(); - A6_Cycle_Bm_2_00070.start(); - - try { - A1_Cycle_Bm_2_00070.join(); - A2_Cycle_Bm_2_00070.join(); - A3_Cycle_Bm_2_00070.join(); - A4_Cycle_Bm_2_00070.join(); - A5_Cycle_Bm_2_00070.join(); - A6_Cycle_Bm_2_00070.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00070.check() && A2_Cycle_Bm_2_00070.check() && A3_Cycle_Bm_2_00070.check() && A4_Cycle_Bm_2_00070.check() && A5_Cycle_Bm_2_00070.check() && A6_Cycle_Bm_2_00070.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00070.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00070 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00070.java + *- @ExecuteClass: Cycle_Bm_2_00070 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00070 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00070_A1 a1_0 = new Cycle_B_2_00070_A1(); + a1_0.a2_0 = new Cycle_B_2_00070_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00070_A3(); + Cycle_B_2_00070_A4 a4_0 = new Cycle_B_2_00070_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a4_0.a3_0.a5_0 = new Cycle_B_2_00070_A5(); + Cycle_B_2_00070_A6 a6_0 = new Cycle_B_2_00070_A6(); + a6_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a6_0.add(); + a4_0.a3_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum + a6_0.sum); + //System.out.println(nsum); + + if (nsum == 37) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00070_A1 { + Cycle_B_2_00070_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00070_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00070_A2 { + Cycle_B_2_00070_A3 a3_0; + Cycle_B_2_00070_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00070_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00070_A3 { + Cycle_B_2_00070_A1 a1_0; + Cycle_B_2_00070_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00070_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00070_A4 { + Cycle_B_2_00070_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00070_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00070_A5 { + Cycle_B_2_00070_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00070_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00070_A6 { + Cycle_B_2_00070_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00070_A6() { + a3_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_Bm_2_00070 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00070 A1_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); + ThreadRc_Cycle_Bm_2_00070 A2_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); + ThreadRc_Cycle_Bm_2_00070 A3_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); + ThreadRc_Cycle_Bm_2_00070 A4_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); + ThreadRc_Cycle_Bm_2_00070 A5_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); + ThreadRc_Cycle_Bm_2_00070 A6_Cycle_Bm_2_00070 = new ThreadRc_Cycle_Bm_2_00070(); + + A1_Cycle_Bm_2_00070.start(); + A2_Cycle_Bm_2_00070.start(); + A3_Cycle_Bm_2_00070.start(); + A4_Cycle_Bm_2_00070.start(); + A5_Cycle_Bm_2_00070.start(); + A6_Cycle_Bm_2_00070.start(); + + try { + A1_Cycle_Bm_2_00070.join(); + A2_Cycle_Bm_2_00070.join(); + A3_Cycle_Bm_2_00070.join(); + A4_Cycle_Bm_2_00070.join(); + A5_Cycle_Bm_2_00070.join(); + A6_Cycle_Bm_2_00070.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00070.check() && A2_Cycle_Bm_2_00070.check() && A3_Cycle_Bm_2_00070.check() && A4_Cycle_Bm_2_00070.check() && A5_Cycle_Bm_2_00070.check() && A6_Cycle_Bm_2_00070.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0188-rc-function-RC_Thread01-Cycle_Bm_2_00080/Cycle_Bm_2_00080.java b/test/testsuite/ouroboros/memory_management/Function/RC0188-rc-function-RC_Thread01-Cycle_Bm_2_00080/Cycle_Bm_2_00080.java index 9d9b9a5ba6e135894807996014ae95dcce41e7f9..9bbe8d9c044cb9edc06c4c6fa99cd1cc1c50e393 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0188-rc-function-RC_Thread01-Cycle_Bm_2_00080/Cycle_Bm_2_00080.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0188-rc-function-RC_Thread01-Cycle_Bm_2_00080/Cycle_Bm_2_00080.java @@ -1,189 +1,189 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00080.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00080 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00080.java - *- @ExecuteClass: Cycle_Bm_2_00080 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00080 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00080_A1 a1_0 = new Cycle_B_2_00080_A1(); - a1_0.a2_0 = new Cycle_B_2_00080_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00080_A3(); - Cycle_B_2_00080_A4 a4_0 = new Cycle_B_2_00080_A4(); - a4_0.a2_0 = a1_0.a2_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a4_0.a3_0.a5_0 = new Cycle_B_2_00080_A5(); - a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.a5_0 = a4_0.a3_0.a5_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a4_0.a3_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00080_A1 { - Cycle_B_2_00080_A2 a2_0; - Cycle_B_2_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00080_A1() { - a2_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00080_A2 { - Cycle_B_2_00080_A3 a3_0; - Cycle_B_2_00080_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00080_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00080_A3 { - Cycle_B_2_00080_A1 a1_0; - Cycle_B_2_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00080_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00080_A4 { - Cycle_B_2_00080_A3 a3_0; - Cycle_B_2_00080_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00080_A4() { - a3_0 = null; - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00080_A5 { - Cycle_B_2_00080_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00080_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class Cycle_Bm_2_00080 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00080 A1_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A2_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A3_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A4_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A5_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - ThreadRc_Cycle_Bm_2_00080 A6_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); - - A1_Cycle_Bm_2_00080.start(); - A2_Cycle_Bm_2_00080.start(); - A3_Cycle_Bm_2_00080.start(); - A4_Cycle_Bm_2_00080.start(); - A5_Cycle_Bm_2_00080.start(); - A6_Cycle_Bm_2_00080.start(); - - try { - A1_Cycle_Bm_2_00080.join(); - A2_Cycle_Bm_2_00080.join(); - A3_Cycle_Bm_2_00080.join(); - A4_Cycle_Bm_2_00080.join(); - A5_Cycle_Bm_2_00080.join(); - A6_Cycle_Bm_2_00080.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00080.check() && A2_Cycle_Bm_2_00080.check() && A3_Cycle_Bm_2_00080.check() && A4_Cycle_Bm_2_00080.check() && A5_Cycle_Bm_2_00080.check() && A6_Cycle_Bm_2_00080.check()) - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00080.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00080 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00080.java + *- @ExecuteClass: Cycle_Bm_2_00080 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00080 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00080_A1 a1_0 = new Cycle_B_2_00080_A1(); + a1_0.a2_0 = new Cycle_B_2_00080_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00080_A3(); + Cycle_B_2_00080_A4 a4_0 = new Cycle_B_2_00080_A4(); + a4_0.a2_0 = a1_0.a2_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a4_0.a3_0.a5_0 = new Cycle_B_2_00080_A5(); + a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.a5_0 = a4_0.a3_0.a5_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a4_0.a3_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00080_A1 { + Cycle_B_2_00080_A2 a2_0; + Cycle_B_2_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00080_A1() { + a2_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00080_A2 { + Cycle_B_2_00080_A3 a3_0; + Cycle_B_2_00080_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00080_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00080_A3 { + Cycle_B_2_00080_A1 a1_0; + Cycle_B_2_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00080_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00080_A4 { + Cycle_B_2_00080_A3 a3_0; + Cycle_B_2_00080_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00080_A4() { + a3_0 = null; + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00080_A5 { + Cycle_B_2_00080_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00080_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class Cycle_Bm_2_00080 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00080 A1_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A2_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A3_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A4_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A5_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + ThreadRc_Cycle_Bm_2_00080 A6_Cycle_Bm_2_00080 = new ThreadRc_Cycle_Bm_2_00080(); + + A1_Cycle_Bm_2_00080.start(); + A2_Cycle_Bm_2_00080.start(); + A3_Cycle_Bm_2_00080.start(); + A4_Cycle_Bm_2_00080.start(); + A5_Cycle_Bm_2_00080.start(); + A6_Cycle_Bm_2_00080.start(); + + try { + A1_Cycle_Bm_2_00080.join(); + A2_Cycle_Bm_2_00080.join(); + A3_Cycle_Bm_2_00080.join(); + A4_Cycle_Bm_2_00080.join(); + A5_Cycle_Bm_2_00080.join(); + A6_Cycle_Bm_2_00080.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00080.check() && A2_Cycle_Bm_2_00080.check() && A3_Cycle_Bm_2_00080.check() && A4_Cycle_Bm_2_00080.check() && A5_Cycle_Bm_2_00080.check() && A6_Cycle_Bm_2_00080.check()) + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0189-rc-function-RC_Thread01-Cycle_Bm_2_00090/Cycle_Bm_2_00090.java b/test/testsuite/ouroboros/memory_management/Function/RC0189-rc-function-RC_Thread01-Cycle_Bm_2_00090/Cycle_Bm_2_00090.java index 10ac7abaef3885bff82286ac4ce514ff91c314b9..9558896b414ba0ca9e07d79c75a5ad28d6753a74 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0189-rc-function-RC_Thread01-Cycle_Bm_2_00090/Cycle_Bm_2_00090.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0189-rc-function-RC_Thread01-Cycle_Bm_2_00090/Cycle_Bm_2_00090.java @@ -1,143 +1,143 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00090.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00090 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00090.java - *- @ExecuteClass: Cycle_Bm_2_00090 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00090 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00090_A1 a1_0 = new Cycle_B_2_00090_A1(); - Cycle_B_2_00090_A3 a3_0 = new Cycle_B_2_00090_A3(); - a1_0.a2_0 = new Cycle_B_2_00090_A2(); - a1_0.a2_0.a1_0 = a1_0; - a3_0.a2_0 = a1_0.a2_0; - a3_0.a2_0.a3_0 = a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a3_0.sum); - //System.out.println(nsum); - - if (nsum == 9) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00090_A1 { - Cycle_B_2_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00090_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00090_A2 { - Cycle_B_2_00090_A1 a1_0; - Cycle_B_2_00090_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00090_A2() { - a1_0 = null; - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00090_A3 { - Cycle_B_2_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00090_A3() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_Bm_2_00090 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00090 A1_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); - ThreadRc_Cycle_Bm_2_00090 A2_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); - ThreadRc_Cycle_Bm_2_00090 A3_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); - ThreadRc_Cycle_Bm_2_00090 A4_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); - ThreadRc_Cycle_Bm_2_00090 A5_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); - ThreadRc_Cycle_Bm_2_00090 A6_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); - - A1_Cycle_Bm_2_00090.start(); - A2_Cycle_Bm_2_00090.start(); - A3_Cycle_Bm_2_00090.start(); - A4_Cycle_Bm_2_00090.start(); - A5_Cycle_Bm_2_00090.start(); - A6_Cycle_Bm_2_00090.start(); - - try { - A1_Cycle_Bm_2_00090.join(); - A2_Cycle_Bm_2_00090.join(); - A3_Cycle_Bm_2_00090.join(); - A4_Cycle_Bm_2_00090.join(); - A5_Cycle_Bm_2_00090.join(); - A6_Cycle_Bm_2_00090.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00090.check() && A2_Cycle_Bm_2_00090.check() && A3_Cycle_Bm_2_00090.check() && A4_Cycle_Bm_2_00090.check() && A5_Cycle_Bm_2_00090.check() && A6_Cycle_Bm_2_00090.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00090.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00090 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00090.java + *- @ExecuteClass: Cycle_Bm_2_00090 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00090 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00090_A1 a1_0 = new Cycle_B_2_00090_A1(); + Cycle_B_2_00090_A3 a3_0 = new Cycle_B_2_00090_A3(); + a1_0.a2_0 = new Cycle_B_2_00090_A2(); + a1_0.a2_0.a1_0 = a1_0; + a3_0.a2_0 = a1_0.a2_0; + a3_0.a2_0.a3_0 = a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a3_0.sum); + //System.out.println(nsum); + + if (nsum == 9) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00090_A1 { + Cycle_B_2_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00090_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00090_A2 { + Cycle_B_2_00090_A1 a1_0; + Cycle_B_2_00090_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00090_A2() { + a1_0 = null; + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00090_A3 { + Cycle_B_2_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00090_A3() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_Bm_2_00090 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00090 A1_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); + ThreadRc_Cycle_Bm_2_00090 A2_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); + ThreadRc_Cycle_Bm_2_00090 A3_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); + ThreadRc_Cycle_Bm_2_00090 A4_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); + ThreadRc_Cycle_Bm_2_00090 A5_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); + ThreadRc_Cycle_Bm_2_00090 A6_Cycle_Bm_2_00090 = new ThreadRc_Cycle_Bm_2_00090(); + + A1_Cycle_Bm_2_00090.start(); + A2_Cycle_Bm_2_00090.start(); + A3_Cycle_Bm_2_00090.start(); + A4_Cycle_Bm_2_00090.start(); + A5_Cycle_Bm_2_00090.start(); + A6_Cycle_Bm_2_00090.start(); + + try { + A1_Cycle_Bm_2_00090.join(); + A2_Cycle_Bm_2_00090.join(); + A3_Cycle_Bm_2_00090.join(); + A4_Cycle_Bm_2_00090.join(); + A5_Cycle_Bm_2_00090.join(); + A6_Cycle_Bm_2_00090.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00090.check() && A2_Cycle_Bm_2_00090.check() && A3_Cycle_Bm_2_00090.check() && A4_Cycle_Bm_2_00090.check() && A5_Cycle_Bm_2_00090.check() && A6_Cycle_Bm_2_00090.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0190-rc-function-RC_Thread01-Cycle_Bm_2_00100/Cycle_Bm_2_00100.java b/test/testsuite/ouroboros/memory_management/Function/RC0190-rc-function-RC_Thread01-Cycle_Bm_2_00100/Cycle_Bm_2_00100.java index c7c3ba8daa2521f72621fb3016d0be98dfa272e3..8ba2f4482bee27b6b8799cfcec5b84d88eed63de 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0190-rc-function-RC_Thread01-Cycle_Bm_2_00100/Cycle_Bm_2_00100.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0190-rc-function-RC_Thread01-Cycle_Bm_2_00100/Cycle_Bm_2_00100.java @@ -1,178 +1,178 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00100.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00100 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00100.java - *- @ExecuteClass: Cycle_Bm_2_00100 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00100 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00100_A1 a1_0 = new Cycle_B_2_00100_A1(); - a1_0.a2_0 = new Cycle_B_2_00100_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00100_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00100_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00100_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 29) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00100_A1 { - Cycle_B_2_00100_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00100_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00100_A2 { - Cycle_B_2_00100_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00100_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00100_A3 { - Cycle_B_2_00100_A1 a1_0; - Cycle_B_2_00100_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00100_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00100_A4 { - Cycle_B_2_00100_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00100_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00100_A5 { - Cycle_B_2_00100_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00100_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - - -public class Cycle_Bm_2_00100 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00100 A1_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); - ThreadRc_Cycle_Bm_2_00100 A2_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); - ThreadRc_Cycle_Bm_2_00100 A3_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); - ThreadRc_Cycle_Bm_2_00100 A4_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); - ThreadRc_Cycle_Bm_2_00100 A5_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); - ThreadRc_Cycle_Bm_2_00100 A6_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); - - A1_Cycle_Bm_2_00100.start(); - A2_Cycle_Bm_2_00100.start(); - A3_Cycle_Bm_2_00100.start(); - A4_Cycle_Bm_2_00100.start(); - A5_Cycle_Bm_2_00100.start(); - A6_Cycle_Bm_2_00100.start(); - - try { - A1_Cycle_Bm_2_00100.join(); - A2_Cycle_Bm_2_00100.join(); - A3_Cycle_Bm_2_00100.join(); - A4_Cycle_Bm_2_00100.join(); - A5_Cycle_Bm_2_00100.join(); - A6_Cycle_Bm_2_00100.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00100.check() && A2_Cycle_Bm_2_00100.check() && A3_Cycle_Bm_2_00100.check() && A4_Cycle_Bm_2_00100.check() && A5_Cycle_Bm_2_00100.check() && A6_Cycle_Bm_2_00100.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00100.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00100 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00100.java + *- @ExecuteClass: Cycle_Bm_2_00100 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00100 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00100_A1 a1_0 = new Cycle_B_2_00100_A1(); + a1_0.a2_0 = new Cycle_B_2_00100_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00100_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00100_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00100_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 29) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00100_A1 { + Cycle_B_2_00100_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00100_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00100_A2 { + Cycle_B_2_00100_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00100_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00100_A3 { + Cycle_B_2_00100_A1 a1_0; + Cycle_B_2_00100_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00100_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00100_A4 { + Cycle_B_2_00100_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00100_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00100_A5 { + Cycle_B_2_00100_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00100_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + + +public class Cycle_Bm_2_00100 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00100 A1_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); + ThreadRc_Cycle_Bm_2_00100 A2_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); + ThreadRc_Cycle_Bm_2_00100 A3_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); + ThreadRc_Cycle_Bm_2_00100 A4_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); + ThreadRc_Cycle_Bm_2_00100 A5_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); + ThreadRc_Cycle_Bm_2_00100 A6_Cycle_Bm_2_00100 = new ThreadRc_Cycle_Bm_2_00100(); + + A1_Cycle_Bm_2_00100.start(); + A2_Cycle_Bm_2_00100.start(); + A3_Cycle_Bm_2_00100.start(); + A4_Cycle_Bm_2_00100.start(); + A5_Cycle_Bm_2_00100.start(); + A6_Cycle_Bm_2_00100.start(); + + try { + A1_Cycle_Bm_2_00100.join(); + A2_Cycle_Bm_2_00100.join(); + A3_Cycle_Bm_2_00100.join(); + A4_Cycle_Bm_2_00100.join(); + A5_Cycle_Bm_2_00100.join(); + A6_Cycle_Bm_2_00100.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00100.check() && A2_Cycle_Bm_2_00100.check() && A3_Cycle_Bm_2_00100.check() && A4_Cycle_Bm_2_00100.check() && A5_Cycle_Bm_2_00100.check() && A6_Cycle_Bm_2_00100.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0191-rc-function-RC_Thread01-Cycle_Bm_2_00110/Cycle_Bm_2_00110.java b/test/testsuite/ouroboros/memory_management/Function/RC0191-rc-function-RC_Thread01-Cycle_Bm_2_00110/Cycle_Bm_2_00110.java index 151c806d8410cde4950df3417a52486c0c953d04..01a4357783eb2b4968a879632b10ad27dd76606d 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0191-rc-function-RC_Thread01-Cycle_Bm_2_00110/Cycle_Bm_2_00110.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0191-rc-function-RC_Thread01-Cycle_Bm_2_00110/Cycle_Bm_2_00110.java @@ -1,178 +1,178 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00110.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00110 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00110.java - *- @ExecuteClass: Cycle_Bm_2_00110 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00110 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00110_A1 a1_0 = new Cycle_B_2_00110_A1(); - a1_0.a2_0 = new Cycle_B_2_00110_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00110_A3(); - a1_0.a2_0.a4_0 = new Cycle_B_2_00110_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a4_0.a5_0 = new Cycle_B_2_00110_A5(); - a1_0.a2_0.a4_0.a5_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - a1_0.a2_0.a4_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a4_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00110_A1 { - Cycle_B_2_00110_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00110_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00110_A2 { - Cycle_B_2_00110_A3 a3_0; - Cycle_B_2_00110_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00110_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00110_A3 { - Cycle_B_2_00110_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00110_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00110_A4 { - Cycle_B_2_00110_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00110_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00110_A5 { - Cycle_B_2_00110_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00110_A5() { - a2_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_Bm_2_00110 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00110 A1_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); - ThreadRc_Cycle_Bm_2_00110 A2_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); - ThreadRc_Cycle_Bm_2_00110 A3_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); - ThreadRc_Cycle_Bm_2_00110 A4_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); - ThreadRc_Cycle_Bm_2_00110 A5_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); - ThreadRc_Cycle_Bm_2_00110 A6_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); - - A1_Cycle_Bm_2_00110.start(); - A2_Cycle_Bm_2_00110.start(); - A3_Cycle_Bm_2_00110.start(); - A4_Cycle_Bm_2_00110.start(); - A5_Cycle_Bm_2_00110.start(); - A6_Cycle_Bm_2_00110.start(); - - try { - A1_Cycle_Bm_2_00110.join(); - A2_Cycle_Bm_2_00110.join(); - A3_Cycle_Bm_2_00110.join(); - A4_Cycle_Bm_2_00110.join(); - A5_Cycle_Bm_2_00110.join(); - A6_Cycle_Bm_2_00110.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00110.check() && A2_Cycle_Bm_2_00110.check() && A3_Cycle_Bm_2_00110.check() && A4_Cycle_Bm_2_00110.check() && A5_Cycle_Bm_2_00110.check() && A6_Cycle_Bm_2_00110.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00110.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00110 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00110.java + *- @ExecuteClass: Cycle_Bm_2_00110 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00110 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00110_A1 a1_0 = new Cycle_B_2_00110_A1(); + a1_0.a2_0 = new Cycle_B_2_00110_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00110_A3(); + a1_0.a2_0.a4_0 = new Cycle_B_2_00110_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a4_0.a5_0 = new Cycle_B_2_00110_A5(); + a1_0.a2_0.a4_0.a5_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + a1_0.a2_0.a4_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a4_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00110_A1 { + Cycle_B_2_00110_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00110_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00110_A2 { + Cycle_B_2_00110_A3 a3_0; + Cycle_B_2_00110_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00110_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00110_A3 { + Cycle_B_2_00110_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00110_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00110_A4 { + Cycle_B_2_00110_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00110_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00110_A5 { + Cycle_B_2_00110_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00110_A5() { + a2_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_Bm_2_00110 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00110 A1_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); + ThreadRc_Cycle_Bm_2_00110 A2_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); + ThreadRc_Cycle_Bm_2_00110 A3_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); + ThreadRc_Cycle_Bm_2_00110 A4_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); + ThreadRc_Cycle_Bm_2_00110 A5_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); + ThreadRc_Cycle_Bm_2_00110 A6_Cycle_Bm_2_00110 = new ThreadRc_Cycle_Bm_2_00110(); + + A1_Cycle_Bm_2_00110.start(); + A2_Cycle_Bm_2_00110.start(); + A3_Cycle_Bm_2_00110.start(); + A4_Cycle_Bm_2_00110.start(); + A5_Cycle_Bm_2_00110.start(); + A6_Cycle_Bm_2_00110.start(); + + try { + A1_Cycle_Bm_2_00110.join(); + A2_Cycle_Bm_2_00110.join(); + A3_Cycle_Bm_2_00110.join(); + A4_Cycle_Bm_2_00110.join(); + A5_Cycle_Bm_2_00110.join(); + A6_Cycle_Bm_2_00110.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00110.check() && A2_Cycle_Bm_2_00110.check() && A3_Cycle_Bm_2_00110.check() && A4_Cycle_Bm_2_00110.check() && A5_Cycle_Bm_2_00110.check() && A6_Cycle_Bm_2_00110.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0192-rc-function-RC_Thread01-Cycle_Bm_2_00120/Cycle_Bm_2_00120.java b/test/testsuite/ouroboros/memory_management/Function/RC0192-rc-function-RC_Thread01-Cycle_Bm_2_00120/Cycle_Bm_2_00120.java index bfa148086118e21df04cb0e728b89a618fb265b8..2bfee9f0e47290f7e301b3c06e20f69850d2fabe 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0192-rc-function-RC_Thread01-Cycle_Bm_2_00120/Cycle_Bm_2_00120.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0192-rc-function-RC_Thread01-Cycle_Bm_2_00120/Cycle_Bm_2_00120.java @@ -1,178 +1,178 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00120.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00120 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00120.java - *- @ExecuteClass: Cycle_Bm_2_00120 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00120 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00120_A1 a1_0 = new Cycle_B_2_00120_A1(); - a1_0.a2_0 = new Cycle_B_2_00120_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00120_A3(); - a1_0.a4_0 = new Cycle_B_2_00120_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a4_0.a5_0 = new Cycle_B_2_00120_A5(); - a1_0.a4_0.a5_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a4_0.add(); - a1_0.a4_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a4_0.sum + a1_0.a4_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 27) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00120_A1 { - Cycle_B_2_00120_A2 a2_0; - Cycle_B_2_00120_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00120_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00120_A2 { - Cycle_B_2_00120_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00120_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00120_A3 { - Cycle_B_2_00120_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00120_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00120_A4 { - Cycle_B_2_00120_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00120_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00120_A5 { - Cycle_B_2_00120_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00120_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_2_00120 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00120 A1_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); - ThreadRc_Cycle_Bm_2_00120 A2_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); - ThreadRc_Cycle_Bm_2_00120 A3_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); - ThreadRc_Cycle_Bm_2_00120 A4_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); - ThreadRc_Cycle_Bm_2_00120 A5_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); - ThreadRc_Cycle_Bm_2_00120 A6_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); - - A1_Cycle_Bm_2_00120.start(); - A2_Cycle_Bm_2_00120.start(); - A3_Cycle_Bm_2_00120.start(); - A4_Cycle_Bm_2_00120.start(); - A5_Cycle_Bm_2_00120.start(); - A6_Cycle_Bm_2_00120.start(); - - try { - A1_Cycle_Bm_2_00120.join(); - A2_Cycle_Bm_2_00120.join(); - A3_Cycle_Bm_2_00120.join(); - A4_Cycle_Bm_2_00120.join(); - A5_Cycle_Bm_2_00120.join(); - A6_Cycle_Bm_2_00120.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00120.check() && A2_Cycle_Bm_2_00120.check() && A3_Cycle_Bm_2_00120.check() && A4_Cycle_Bm_2_00120.check() && A5_Cycle_Bm_2_00120.check() && A6_Cycle_Bm_2_00120.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00120.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00120 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00120.java + *- @ExecuteClass: Cycle_Bm_2_00120 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00120 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00120_A1 a1_0 = new Cycle_B_2_00120_A1(); + a1_0.a2_0 = new Cycle_B_2_00120_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00120_A3(); + a1_0.a4_0 = new Cycle_B_2_00120_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a4_0.a5_0 = new Cycle_B_2_00120_A5(); + a1_0.a4_0.a5_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a4_0.add(); + a1_0.a4_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a4_0.sum + a1_0.a4_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 27) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00120_A1 { + Cycle_B_2_00120_A2 a2_0; + Cycle_B_2_00120_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00120_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00120_A2 { + Cycle_B_2_00120_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00120_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00120_A3 { + Cycle_B_2_00120_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00120_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00120_A4 { + Cycle_B_2_00120_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00120_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00120_A5 { + Cycle_B_2_00120_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00120_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_2_00120 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00120 A1_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); + ThreadRc_Cycle_Bm_2_00120 A2_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); + ThreadRc_Cycle_Bm_2_00120 A3_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); + ThreadRc_Cycle_Bm_2_00120 A4_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); + ThreadRc_Cycle_Bm_2_00120 A5_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); + ThreadRc_Cycle_Bm_2_00120 A6_Cycle_Bm_2_00120 = new ThreadRc_Cycle_Bm_2_00120(); + + A1_Cycle_Bm_2_00120.start(); + A2_Cycle_Bm_2_00120.start(); + A3_Cycle_Bm_2_00120.start(); + A4_Cycle_Bm_2_00120.start(); + A5_Cycle_Bm_2_00120.start(); + A6_Cycle_Bm_2_00120.start(); + + try { + A1_Cycle_Bm_2_00120.join(); + A2_Cycle_Bm_2_00120.join(); + A3_Cycle_Bm_2_00120.join(); + A4_Cycle_Bm_2_00120.join(); + A5_Cycle_Bm_2_00120.join(); + A6_Cycle_Bm_2_00120.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00120.check() && A2_Cycle_Bm_2_00120.check() && A3_Cycle_Bm_2_00120.check() && A4_Cycle_Bm_2_00120.check() && A5_Cycle_Bm_2_00120.check() && A6_Cycle_Bm_2_00120.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0193-rc-function-RC_Thread01-Cycle_Bm_2_00130/Cycle_Bm_2_00130.java b/test/testsuite/ouroboros/memory_management/Function/RC0193-rc-function-RC_Thread01-Cycle_Bm_2_00130/Cycle_Bm_2_00130.java index 45afff073dc59e2e3f47b8774a0d750f9c35f1e8..ab8ac46644a4c1244b2bac8ebb964d9c820493d5 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0193-rc-function-RC_Thread01-Cycle_Bm_2_00130/Cycle_Bm_2_00130.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0193-rc-function-RC_Thread01-Cycle_Bm_2_00130/Cycle_Bm_2_00130.java @@ -1,199 +1,199 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00130.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00130 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00130.java - *- @ExecuteClass: Cycle_Bm_2_00130 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00130 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00130_A1 a1_0 = new Cycle_B_2_00130_A1(); - a1_0.a2_0 = new Cycle_B_2_00130_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00130_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00130_A4(); - a1_0.a2_0.a3_0.a4_0.a1_0 = a1_0; - Cycle_B_2_00130_A5 a5_0 = new Cycle_B_2_00130_A5(); - a1_0.a2_0.a3_0.a4_0.a6_0 = new Cycle_B_2_00130_A6(); - a1_0.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_0; - a5_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a6_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a5_0.sum + a1_0.a2_0.a3_0.a4_0.a6_0.sum); - //System.out.println(nsum); - - if (nsum == 45) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00130_A1 { - Cycle_B_2_00130_A2 a2_0; - Cycle_B_2_00130_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00130_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00130_A2 { - Cycle_B_2_00130_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00130_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00130_A3 { - Cycle_B_2_00130_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00130_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00130_A4 { - Cycle_B_2_00130_A1 a1_0; - Cycle_B_2_00130_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00130_A4() { - a1_0 = null; - a6_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - class Cycle_B_2_00130_A5 { - Cycle_B_2_00130_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00130_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00130_A6 { - Cycle_B_2_00130_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00130_A6() { - a5_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } -} - - -public class Cycle_Bm_2_00130 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00130 A1_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); - ThreadRc_Cycle_Bm_2_00130 A2_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); - ThreadRc_Cycle_Bm_2_00130 A3_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); - ThreadRc_Cycle_Bm_2_00130 A4_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); - ThreadRc_Cycle_Bm_2_00130 A5_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); - ThreadRc_Cycle_Bm_2_00130 A6_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); - - A1_Cycle_Bm_2_00130.start(); - A2_Cycle_Bm_2_00130.start(); - A3_Cycle_Bm_2_00130.start(); - A4_Cycle_Bm_2_00130.start(); - A5_Cycle_Bm_2_00130.start(); - A6_Cycle_Bm_2_00130.start(); - - try { - A1_Cycle_Bm_2_00130.join(); - A2_Cycle_Bm_2_00130.join(); - A3_Cycle_Bm_2_00130.join(); - A4_Cycle_Bm_2_00130.join(); - A5_Cycle_Bm_2_00130.join(); - A6_Cycle_Bm_2_00130.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00130.check() && A2_Cycle_Bm_2_00130.check() && A3_Cycle_Bm_2_00130.check() && A4_Cycle_Bm_2_00130.check() && A5_Cycle_Bm_2_00130.check() && A6_Cycle_Bm_2_00130.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00130.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00130 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00130.java + *- @ExecuteClass: Cycle_Bm_2_00130 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00130 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00130_A1 a1_0 = new Cycle_B_2_00130_A1(); + a1_0.a2_0 = new Cycle_B_2_00130_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00130_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00130_A4(); + a1_0.a2_0.a3_0.a4_0.a1_0 = a1_0; + Cycle_B_2_00130_A5 a5_0 = new Cycle_B_2_00130_A5(); + a1_0.a2_0.a3_0.a4_0.a6_0 = new Cycle_B_2_00130_A6(); + a1_0.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_0; + a5_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a6_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a5_0.sum + a1_0.a2_0.a3_0.a4_0.a6_0.sum); + //System.out.println(nsum); + + if (nsum == 45) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00130_A1 { + Cycle_B_2_00130_A2 a2_0; + Cycle_B_2_00130_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00130_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00130_A2 { + Cycle_B_2_00130_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00130_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00130_A3 { + Cycle_B_2_00130_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00130_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00130_A4 { + Cycle_B_2_00130_A1 a1_0; + Cycle_B_2_00130_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00130_A4() { + a1_0 = null; + a6_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + class Cycle_B_2_00130_A5 { + Cycle_B_2_00130_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00130_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00130_A6 { + Cycle_B_2_00130_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00130_A6() { + a5_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } +} + + +public class Cycle_Bm_2_00130 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00130 A1_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); + ThreadRc_Cycle_Bm_2_00130 A2_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); + ThreadRc_Cycle_Bm_2_00130 A3_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); + ThreadRc_Cycle_Bm_2_00130 A4_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); + ThreadRc_Cycle_Bm_2_00130 A5_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); + ThreadRc_Cycle_Bm_2_00130 A6_Cycle_Bm_2_00130 = new ThreadRc_Cycle_Bm_2_00130(); + + A1_Cycle_Bm_2_00130.start(); + A2_Cycle_Bm_2_00130.start(); + A3_Cycle_Bm_2_00130.start(); + A4_Cycle_Bm_2_00130.start(); + A5_Cycle_Bm_2_00130.start(); + A6_Cycle_Bm_2_00130.start(); + + try { + A1_Cycle_Bm_2_00130.join(); + A2_Cycle_Bm_2_00130.join(); + A3_Cycle_Bm_2_00130.join(); + A4_Cycle_Bm_2_00130.join(); + A5_Cycle_Bm_2_00130.join(); + A6_Cycle_Bm_2_00130.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00130.check() && A2_Cycle_Bm_2_00130.check() && A3_Cycle_Bm_2_00130.check() && A4_Cycle_Bm_2_00130.check() && A5_Cycle_Bm_2_00130.check() && A6_Cycle_Bm_2_00130.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0194-rc-function-RC_Thread01-Cycle_Bm_2_00140/Cycle_Bm_2_00140.java b/test/testsuite/ouroboros/memory_management/Function/RC0194-rc-function-RC_Thread01-Cycle_Bm_2_00140/Cycle_Bm_2_00140.java index ce506c9b368118de96c49e22878a42b3538c06ec..10005d195631ef401f1bb6f78f3ecb3efb06b6d6 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0194-rc-function-RC_Thread01-Cycle_Bm_2_00140/Cycle_Bm_2_00140.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0194-rc-function-RC_Thread01-Cycle_Bm_2_00140/Cycle_Bm_2_00140.java @@ -1,144 +1,144 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00140.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00140 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00140.java - *- @ExecuteClass: Cycle_Bm_2_00140 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00140 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00140_A1 a1_0 = new Cycle_B_2_00140_A1(); - a1_0.a2_0 = new Cycle_B_2_00140_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00140_A3(); - a1_0.a2_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 13) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00140_A1 { - Cycle_B_2_00140_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00140_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00140_A2 { - Cycle_B_2_00140_A3 a3_0; - Cycle_B_2_00140_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00140_A2() { - a3_0 = null; - a1_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a + a1_0.a; - } - } - - class Cycle_B_2_00140_A3 { - Cycle_B_2_00140_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00140_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_2_00140 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00140 A1_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); - ThreadRc_Cycle_Bm_2_00140 A2_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); - ThreadRc_Cycle_Bm_2_00140 A3_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); - ThreadRc_Cycle_Bm_2_00140 A4_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); - ThreadRc_Cycle_Bm_2_00140 A5_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); - ThreadRc_Cycle_Bm_2_00140 A6_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); - - A1_Cycle_Bm_2_00140.start(); - A2_Cycle_Bm_2_00140.start(); - A3_Cycle_Bm_2_00140.start(); - A4_Cycle_Bm_2_00140.start(); - A5_Cycle_Bm_2_00140.start(); - A6_Cycle_Bm_2_00140.start(); - - try { - A1_Cycle_Bm_2_00140.join(); - A2_Cycle_Bm_2_00140.join(); - A3_Cycle_Bm_2_00140.join(); - A4_Cycle_Bm_2_00140.join(); - A5_Cycle_Bm_2_00140.join(); - A6_Cycle_Bm_2_00140.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00140.check() && A2_Cycle_Bm_2_00140.check() && A3_Cycle_Bm_2_00140.check() && A4_Cycle_Bm_2_00140.check() && A5_Cycle_Bm_2_00140.check() && A6_Cycle_Bm_2_00140.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00140.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00140 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00140.java + *- @ExecuteClass: Cycle_Bm_2_00140 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00140 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00140_A1 a1_0 = new Cycle_B_2_00140_A1(); + a1_0.a2_0 = new Cycle_B_2_00140_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00140_A3(); + a1_0.a2_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 13) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00140_A1 { + Cycle_B_2_00140_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00140_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00140_A2 { + Cycle_B_2_00140_A3 a3_0; + Cycle_B_2_00140_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00140_A2() { + a3_0 = null; + a1_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a + a1_0.a; + } + } + + class Cycle_B_2_00140_A3 { + Cycle_B_2_00140_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00140_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_2_00140 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00140 A1_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); + ThreadRc_Cycle_Bm_2_00140 A2_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); + ThreadRc_Cycle_Bm_2_00140 A3_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); + ThreadRc_Cycle_Bm_2_00140 A4_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); + ThreadRc_Cycle_Bm_2_00140 A5_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); + ThreadRc_Cycle_Bm_2_00140 A6_Cycle_Bm_2_00140 = new ThreadRc_Cycle_Bm_2_00140(); + + A1_Cycle_Bm_2_00140.start(); + A2_Cycle_Bm_2_00140.start(); + A3_Cycle_Bm_2_00140.start(); + A4_Cycle_Bm_2_00140.start(); + A5_Cycle_Bm_2_00140.start(); + A6_Cycle_Bm_2_00140.start(); + + try { + A1_Cycle_Bm_2_00140.join(); + A2_Cycle_Bm_2_00140.join(); + A3_Cycle_Bm_2_00140.join(); + A4_Cycle_Bm_2_00140.join(); + A5_Cycle_Bm_2_00140.join(); + A6_Cycle_Bm_2_00140.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00140.check() && A2_Cycle_Bm_2_00140.check() && A3_Cycle_Bm_2_00140.check() && A4_Cycle_Bm_2_00140.check() && A5_Cycle_Bm_2_00140.check() && A6_Cycle_Bm_2_00140.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0195-rc-function-RC_Thread01-Cycle_Bm_2_00150/Cycle_Bm_2_00150.java b/test/testsuite/ouroboros/memory_management/Function/RC0195-rc-function-RC_Thread01-Cycle_Bm_2_00150/Cycle_Bm_2_00150.java index e335e116770c4c7546980543f3022d65cbaace18..e1266f6f8be9898f37b2a57f76b3299521e08404 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0195-rc-function-RC_Thread01-Cycle_Bm_2_00150/Cycle_Bm_2_00150.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0195-rc-function-RC_Thread01-Cycle_Bm_2_00150/Cycle_Bm_2_00150.java @@ -1,142 +1,142 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00150.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00150 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00150.java - *- @ExecuteClass: Cycle_Bm_2_00150 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00150 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00150_A1 a1_0 = new Cycle_B_2_00150_A1(); - a1_0.a2_0 = new Cycle_B_2_00150_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00150_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 14) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00150_A1 { - Cycle_B_2_00150_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00150_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00150_A2 { - Cycle_B_2_00150_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00150_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00150_A3 { - Cycle_B_2_00150_A1 a1_0; - Cycle_B_2_00150_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00150_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - - -public class Cycle_Bm_2_00150 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00150 A1_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); - ThreadRc_Cycle_Bm_2_00150 A2_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); - ThreadRc_Cycle_Bm_2_00150 A3_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); - ThreadRc_Cycle_Bm_2_00150 A4_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); - ThreadRc_Cycle_Bm_2_00150 A5_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); - ThreadRc_Cycle_Bm_2_00150 A6_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); - - A1_Cycle_Bm_2_00150.start(); - A2_Cycle_Bm_2_00150.start(); - A3_Cycle_Bm_2_00150.start(); - A4_Cycle_Bm_2_00150.start(); - A5_Cycle_Bm_2_00150.start(); - A6_Cycle_Bm_2_00150.start(); - - try { - A1_Cycle_Bm_2_00150.join(); - A2_Cycle_Bm_2_00150.join(); - A3_Cycle_Bm_2_00150.join(); - A4_Cycle_Bm_2_00150.join(); - A5_Cycle_Bm_2_00150.join(); - A6_Cycle_Bm_2_00150.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00150.check() && A2_Cycle_Bm_2_00150.check() && A3_Cycle_Bm_2_00150.check() && A4_Cycle_Bm_2_00150.check() && A5_Cycle_Bm_2_00150.check() && A6_Cycle_Bm_2_00150.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00150.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00150 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00150.java + *- @ExecuteClass: Cycle_Bm_2_00150 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00150 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00150_A1 a1_0 = new Cycle_B_2_00150_A1(); + a1_0.a2_0 = new Cycle_B_2_00150_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00150_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 14) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00150_A1 { + Cycle_B_2_00150_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00150_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00150_A2 { + Cycle_B_2_00150_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00150_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00150_A3 { + Cycle_B_2_00150_A1 a1_0; + Cycle_B_2_00150_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00150_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + + +public class Cycle_Bm_2_00150 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00150 A1_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); + ThreadRc_Cycle_Bm_2_00150 A2_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); + ThreadRc_Cycle_Bm_2_00150 A3_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); + ThreadRc_Cycle_Bm_2_00150 A4_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); + ThreadRc_Cycle_Bm_2_00150 A5_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); + ThreadRc_Cycle_Bm_2_00150 A6_Cycle_Bm_2_00150 = new ThreadRc_Cycle_Bm_2_00150(); + + A1_Cycle_Bm_2_00150.start(); + A2_Cycle_Bm_2_00150.start(); + A3_Cycle_Bm_2_00150.start(); + A4_Cycle_Bm_2_00150.start(); + A5_Cycle_Bm_2_00150.start(); + A6_Cycle_Bm_2_00150.start(); + + try { + A1_Cycle_Bm_2_00150.join(); + A2_Cycle_Bm_2_00150.join(); + A3_Cycle_Bm_2_00150.join(); + A4_Cycle_Bm_2_00150.join(); + A5_Cycle_Bm_2_00150.join(); + A6_Cycle_Bm_2_00150.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00150.check() && A2_Cycle_Bm_2_00150.check() && A3_Cycle_Bm_2_00150.check() && A4_Cycle_Bm_2_00150.check() && A5_Cycle_Bm_2_00150.check() && A6_Cycle_Bm_2_00150.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0196-rc-function-RC_Thread01-Cycle_Bm_2_00160/Cycle_Bm_2_00160.java b/test/testsuite/ouroboros/memory_management/Function/RC0196-rc-function-RC_Thread01-Cycle_Bm_2_00160/Cycle_Bm_2_00160.java index 06b087cd3b80c2abf17f6f20d3da10f9bc81e12c..42e71be0062216cbead612e6b50afd5f042e901a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0196-rc-function-RC_Thread01-Cycle_Bm_2_00160/Cycle_Bm_2_00160.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0196-rc-function-RC_Thread01-Cycle_Bm_2_00160/Cycle_Bm_2_00160.java @@ -1,142 +1,142 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00160.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00160 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00160.java - *- @ExecuteClass: Cycle_Bm_2_00160 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00160 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00160_A1 a1_0 = new Cycle_B_2_00160_A1(); - a1_0.a2_0 = new Cycle_B_2_00160_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00160_A3(); - a1_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 15) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00160_A1 { - Cycle_B_2_00160_A2 a2_0; - Cycle_B_2_00160_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00160_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_B_2_00160_A2 { - Cycle_B_2_00160_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00160_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00160_A3 { - Cycle_B_2_00160_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00160_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_2_00160 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00160 A1_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); - ThreadRc_Cycle_Bm_2_00160 A2_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); - ThreadRc_Cycle_Bm_2_00160 A3_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); - ThreadRc_Cycle_Bm_2_00160 A4_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); - ThreadRc_Cycle_Bm_2_00160 A5_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); - ThreadRc_Cycle_Bm_2_00160 A6_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); - - A1_Cycle_Bm_2_00160.start(); - A2_Cycle_Bm_2_00160.start(); - A3_Cycle_Bm_2_00160.start(); - A4_Cycle_Bm_2_00160.start(); - A5_Cycle_Bm_2_00160.start(); - A6_Cycle_Bm_2_00160.start(); - - try { - A1_Cycle_Bm_2_00160.join(); - A2_Cycle_Bm_2_00160.join(); - A3_Cycle_Bm_2_00160.join(); - A4_Cycle_Bm_2_00160.join(); - A5_Cycle_Bm_2_00160.join(); - A6_Cycle_Bm_2_00160.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00160.check() && A2_Cycle_Bm_2_00160.check() && A3_Cycle_Bm_2_00160.check() && A4_Cycle_Bm_2_00160.check() && A5_Cycle_Bm_2_00160.check() && A6_Cycle_Bm_2_00160.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00160.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00160 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00160.java + *- @ExecuteClass: Cycle_Bm_2_00160 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00160 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00160_A1 a1_0 = new Cycle_B_2_00160_A1(); + a1_0.a2_0 = new Cycle_B_2_00160_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00160_A3(); + a1_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 15) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00160_A1 { + Cycle_B_2_00160_A2 a2_0; + Cycle_B_2_00160_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00160_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_B_2_00160_A2 { + Cycle_B_2_00160_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00160_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00160_A3 { + Cycle_B_2_00160_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00160_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_2_00160 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00160 A1_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); + ThreadRc_Cycle_Bm_2_00160 A2_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); + ThreadRc_Cycle_Bm_2_00160 A3_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); + ThreadRc_Cycle_Bm_2_00160 A4_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); + ThreadRc_Cycle_Bm_2_00160 A5_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); + ThreadRc_Cycle_Bm_2_00160 A6_Cycle_Bm_2_00160 = new ThreadRc_Cycle_Bm_2_00160(); + + A1_Cycle_Bm_2_00160.start(); + A2_Cycle_Bm_2_00160.start(); + A3_Cycle_Bm_2_00160.start(); + A4_Cycle_Bm_2_00160.start(); + A5_Cycle_Bm_2_00160.start(); + A6_Cycle_Bm_2_00160.start(); + + try { + A1_Cycle_Bm_2_00160.join(); + A2_Cycle_Bm_2_00160.join(); + A3_Cycle_Bm_2_00160.join(); + A4_Cycle_Bm_2_00160.join(); + A5_Cycle_Bm_2_00160.join(); + A6_Cycle_Bm_2_00160.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00160.check() && A2_Cycle_Bm_2_00160.check() && A3_Cycle_Bm_2_00160.check() && A4_Cycle_Bm_2_00160.check() && A5_Cycle_Bm_2_00160.check() && A6_Cycle_Bm_2_00160.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0197-rc-function-RC_Thread01-Cycle_Bm_2_00170/Cycle_Bm_2_00170.java b/test/testsuite/ouroboros/memory_management/Function/RC0197-rc-function-RC_Thread01-Cycle_Bm_2_00170/Cycle_Bm_2_00170.java index 9cd7870bc894574e3c77ffad3b1cafba06481d49..f1c178379064d86d20d50b83abd6783bf750f34a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0197-rc-function-RC_Thread01-Cycle_Bm_2_00170/Cycle_Bm_2_00170.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0197-rc-function-RC_Thread01-Cycle_Bm_2_00170/Cycle_Bm_2_00170.java @@ -1,159 +1,159 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00170.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00170 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00170.java - *- @ExecuteClass: Cycle_Bm_2_00170 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00170 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00170_A1 a1_0 = new Cycle_B_2_00170_A1(); - a1_0.a2_0 = new Cycle_B_2_00170_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00170_A3(); - a1_0.a2_0.a4_0 = new Cycle_B_2_00170_A4(); - a1_0.a2_0.a4_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 21) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00170_A1 { - Cycle_B_2_00170_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00170_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00170_A2 { - Cycle_B_2_00170_A3 a3_0; - Cycle_B_2_00170_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00170_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_B_2_00170_A3 { - Cycle_B_2_00170_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00170_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00170_A4 { - Cycle_B_2_00170_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00170_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_2_00170 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00170 A1_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); - ThreadRc_Cycle_Bm_2_00170 A2_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); - ThreadRc_Cycle_Bm_2_00170 A3_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); - ThreadRc_Cycle_Bm_2_00170 A4_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); - ThreadRc_Cycle_Bm_2_00170 A5_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); - ThreadRc_Cycle_Bm_2_00170 A6_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); - - A1_Cycle_Bm_2_00170.start(); - A2_Cycle_Bm_2_00170.start(); - A3_Cycle_Bm_2_00170.start(); - A4_Cycle_Bm_2_00170.start(); - A5_Cycle_Bm_2_00170.start(); - A6_Cycle_Bm_2_00170.start(); - - try { - A1_Cycle_Bm_2_00170.join(); - A2_Cycle_Bm_2_00170.join(); - A3_Cycle_Bm_2_00170.join(); - A4_Cycle_Bm_2_00170.join(); - A5_Cycle_Bm_2_00170.join(); - A6_Cycle_Bm_2_00170.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00170.check() && A2_Cycle_Bm_2_00170.check() && A3_Cycle_Bm_2_00170.check() && A4_Cycle_Bm_2_00170.check() && A5_Cycle_Bm_2_00170.check() && A6_Cycle_Bm_2_00170.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00170.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00170 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00170.java + *- @ExecuteClass: Cycle_Bm_2_00170 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00170 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00170_A1 a1_0 = new Cycle_B_2_00170_A1(); + a1_0.a2_0 = new Cycle_B_2_00170_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00170_A3(); + a1_0.a2_0.a4_0 = new Cycle_B_2_00170_A4(); + a1_0.a2_0.a4_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 21) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00170_A1 { + Cycle_B_2_00170_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00170_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00170_A2 { + Cycle_B_2_00170_A3 a3_0; + Cycle_B_2_00170_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00170_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_B_2_00170_A3 { + Cycle_B_2_00170_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00170_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00170_A4 { + Cycle_B_2_00170_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00170_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_2_00170 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00170 A1_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); + ThreadRc_Cycle_Bm_2_00170 A2_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); + ThreadRc_Cycle_Bm_2_00170 A3_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); + ThreadRc_Cycle_Bm_2_00170 A4_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); + ThreadRc_Cycle_Bm_2_00170 A5_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); + ThreadRc_Cycle_Bm_2_00170 A6_Cycle_Bm_2_00170 = new ThreadRc_Cycle_Bm_2_00170(); + + A1_Cycle_Bm_2_00170.start(); + A2_Cycle_Bm_2_00170.start(); + A3_Cycle_Bm_2_00170.start(); + A4_Cycle_Bm_2_00170.start(); + A5_Cycle_Bm_2_00170.start(); + A6_Cycle_Bm_2_00170.start(); + + try { + A1_Cycle_Bm_2_00170.join(); + A2_Cycle_Bm_2_00170.join(); + A3_Cycle_Bm_2_00170.join(); + A4_Cycle_Bm_2_00170.join(); + A5_Cycle_Bm_2_00170.join(); + A6_Cycle_Bm_2_00170.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00170.check() && A2_Cycle_Bm_2_00170.check() && A3_Cycle_Bm_2_00170.check() && A4_Cycle_Bm_2_00170.check() && A5_Cycle_Bm_2_00170.check() && A6_Cycle_Bm_2_00170.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0198-rc-function-RC_Thread01-Cycle_Bm_2_00180/Cycle_Bm_2_00180.java b/test/testsuite/ouroboros/memory_management/Function/RC0198-rc-function-RC_Thread01-Cycle_Bm_2_00180/Cycle_Bm_2_00180.java index 97a3046a7651e4e7cde250d546eb25e360035190..5f3bb267c24ea88b2e859c9e583a427fc51962b7 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0198-rc-function-RC_Thread01-Cycle_Bm_2_00180/Cycle_Bm_2_00180.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0198-rc-function-RC_Thread01-Cycle_Bm_2_00180/Cycle_Bm_2_00180.java @@ -1,159 +1,159 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00180.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00180 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00180.java - *- @ExecuteClass: Cycle_Bm_2_00180 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00180 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00180_A1 a1_0 = new Cycle_B_2_00180_A1(); - a1_0.a2_0 = new Cycle_B_2_00180_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00180_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00180_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 15) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00180_A1 { - Cycle_B_2_00180_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00180_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00180_A2 { - Cycle_B_2_00180_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00180_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00180_A3 { - Cycle_B_2_00180_A1 a1_0; - Cycle_B_2_00180_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00180_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } - } - - class Cycle_B_2_00180_A4 { - Cycle_B_2_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00180_A4() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -public class Cycle_Bm_2_00180 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00180 A1_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); - ThreadRc_Cycle_Bm_2_00180 A2_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); - ThreadRc_Cycle_Bm_2_00180 A3_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); - ThreadRc_Cycle_Bm_2_00180 A4_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); - ThreadRc_Cycle_Bm_2_00180 A5_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); - ThreadRc_Cycle_Bm_2_00180 A6_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); - - A1_Cycle_Bm_2_00180.start(); - A2_Cycle_Bm_2_00180.start(); - A3_Cycle_Bm_2_00180.start(); - A4_Cycle_Bm_2_00180.start(); - A5_Cycle_Bm_2_00180.start(); - A6_Cycle_Bm_2_00180.start(); - - try { - A1_Cycle_Bm_2_00180.join(); - A2_Cycle_Bm_2_00180.join(); - A3_Cycle_Bm_2_00180.join(); - A4_Cycle_Bm_2_00180.join(); - A5_Cycle_Bm_2_00180.join(); - A6_Cycle_Bm_2_00180.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00180.check() && A2_Cycle_Bm_2_00180.check() && A3_Cycle_Bm_2_00180.check() && A4_Cycle_Bm_2_00180.check() && A5_Cycle_Bm_2_00180.check() && A6_Cycle_Bm_2_00180.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00180.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00180 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00180.java + *- @ExecuteClass: Cycle_Bm_2_00180 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00180 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00180_A1 a1_0 = new Cycle_B_2_00180_A1(); + a1_0.a2_0 = new Cycle_B_2_00180_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00180_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00180_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 15) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00180_A1 { + Cycle_B_2_00180_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00180_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00180_A2 { + Cycle_B_2_00180_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00180_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00180_A3 { + Cycle_B_2_00180_A1 a1_0; + Cycle_B_2_00180_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00180_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } + } + + class Cycle_B_2_00180_A4 { + Cycle_B_2_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00180_A4() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +public class Cycle_Bm_2_00180 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00180 A1_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); + ThreadRc_Cycle_Bm_2_00180 A2_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); + ThreadRc_Cycle_Bm_2_00180 A3_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); + ThreadRc_Cycle_Bm_2_00180 A4_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); + ThreadRc_Cycle_Bm_2_00180 A5_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); + ThreadRc_Cycle_Bm_2_00180 A6_Cycle_Bm_2_00180 = new ThreadRc_Cycle_Bm_2_00180(); + + A1_Cycle_Bm_2_00180.start(); + A2_Cycle_Bm_2_00180.start(); + A3_Cycle_Bm_2_00180.start(); + A4_Cycle_Bm_2_00180.start(); + A5_Cycle_Bm_2_00180.start(); + A6_Cycle_Bm_2_00180.start(); + + try { + A1_Cycle_Bm_2_00180.join(); + A2_Cycle_Bm_2_00180.join(); + A3_Cycle_Bm_2_00180.join(); + A4_Cycle_Bm_2_00180.join(); + A5_Cycle_Bm_2_00180.join(); + A6_Cycle_Bm_2_00180.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00180.check() && A2_Cycle_Bm_2_00180.check() && A3_Cycle_Bm_2_00180.check() && A4_Cycle_Bm_2_00180.check() && A5_Cycle_Bm_2_00180.check() && A6_Cycle_Bm_2_00180.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0199-rc-function-RC_Thread01-Cycle_Bm_2_00190/Cycle_Bm_2_00190.java b/test/testsuite/ouroboros/memory_management/Function/RC0199-rc-function-RC_Thread01-Cycle_Bm_2_00190/Cycle_Bm_2_00190.java index aa3997fc96eb67d146f3e20d8c335c3279f1f93d..3384c8829c58b7587442d991be475da8bb9769ba 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0199-rc-function-RC_Thread01-Cycle_Bm_2_00190/Cycle_Bm_2_00190.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0199-rc-function-RC_Thread01-Cycle_Bm_2_00190/Cycle_Bm_2_00190.java @@ -1,159 +1,159 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00190.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00190 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00190.java - *- @ExecuteClass: Cycle_Bm_2_00190 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00190 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00190_A1 a1_0 = new Cycle_B_2_00190_A1(); - a1_0.a2_0 = new Cycle_B_2_00190_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00190_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00190_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 15) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00190_A1 { - Cycle_B_2_00190_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00190_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00190_A2 { - Cycle_B_2_00190_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00190_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00190_A3 { - Cycle_B_2_00190_A1 a1_0; - Cycle_B_2_00190_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00190_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00190_A4 { - Cycle_B_2_00190_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00190_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_Bm_2_00190 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00190 A1_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); - ThreadRc_Cycle_Bm_2_00190 A2_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); - ThreadRc_Cycle_Bm_2_00190 A3_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); - ThreadRc_Cycle_Bm_2_00190 A4_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); - ThreadRc_Cycle_Bm_2_00190 A5_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); - ThreadRc_Cycle_Bm_2_00190 A6_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); - - A1_Cycle_Bm_2_00190.start(); - A2_Cycle_Bm_2_00190.start(); - A3_Cycle_Bm_2_00190.start(); - A4_Cycle_Bm_2_00190.start(); - A5_Cycle_Bm_2_00190.start(); - A6_Cycle_Bm_2_00190.start(); - - try { - A1_Cycle_Bm_2_00190.join(); - A2_Cycle_Bm_2_00190.join(); - A3_Cycle_Bm_2_00190.join(); - A4_Cycle_Bm_2_00190.join(); - A5_Cycle_Bm_2_00190.join(); - A6_Cycle_Bm_2_00190.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00190.check() && A2_Cycle_Bm_2_00190.check() && A3_Cycle_Bm_2_00190.check() && A4_Cycle_Bm_2_00190.check() && A5_Cycle_Bm_2_00190.check() && A6_Cycle_Bm_2_00190.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00190.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00190 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00190.java + *- @ExecuteClass: Cycle_Bm_2_00190 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00190 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00190_A1 a1_0 = new Cycle_B_2_00190_A1(); + a1_0.a2_0 = new Cycle_B_2_00190_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00190_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00190_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 15) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00190_A1 { + Cycle_B_2_00190_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00190_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00190_A2 { + Cycle_B_2_00190_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00190_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00190_A3 { + Cycle_B_2_00190_A1 a1_0; + Cycle_B_2_00190_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00190_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00190_A4 { + Cycle_B_2_00190_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00190_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_Bm_2_00190 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00190 A1_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); + ThreadRc_Cycle_Bm_2_00190 A2_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); + ThreadRc_Cycle_Bm_2_00190 A3_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); + ThreadRc_Cycle_Bm_2_00190 A4_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); + ThreadRc_Cycle_Bm_2_00190 A5_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); + ThreadRc_Cycle_Bm_2_00190 A6_Cycle_Bm_2_00190 = new ThreadRc_Cycle_Bm_2_00190(); + + A1_Cycle_Bm_2_00190.start(); + A2_Cycle_Bm_2_00190.start(); + A3_Cycle_Bm_2_00190.start(); + A4_Cycle_Bm_2_00190.start(); + A5_Cycle_Bm_2_00190.start(); + A6_Cycle_Bm_2_00190.start(); + + try { + A1_Cycle_Bm_2_00190.join(); + A2_Cycle_Bm_2_00190.join(); + A3_Cycle_Bm_2_00190.join(); + A4_Cycle_Bm_2_00190.join(); + A5_Cycle_Bm_2_00190.join(); + A6_Cycle_Bm_2_00190.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00190.check() && A2_Cycle_Bm_2_00190.check() && A3_Cycle_Bm_2_00190.check() && A4_Cycle_Bm_2_00190.check() && A5_Cycle_Bm_2_00190.check() && A6_Cycle_Bm_2_00190.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0200-rc-function-RC_Thread01-Cycle_Bm_2_00200/Cycle_Bm_2_00200.java b/test/testsuite/ouroboros/memory_management/Function/RC0200-rc-function-RC_Thread01-Cycle_Bm_2_00200/Cycle_Bm_2_00200.java index 5d3eccb08a3e28c6202d71a395d990ce1af7178a..c2bbb12cea9198fceeef068d3181f30d0bd05669 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0200-rc-function-RC_Thread01-Cycle_Bm_2_00200/Cycle_Bm_2_00200.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0200-rc-function-RC_Thread01-Cycle_Bm_2_00200/Cycle_Bm_2_00200.java @@ -1,160 +1,160 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00200.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00200 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00200.java - *- @ExecuteClass: Cycle_Bm_2_00200 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00200 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00200_A1 a1_0 = new Cycle_B_2_00200_A1(); - a1_0.a2_0 = new Cycle_B_2_00200_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00200_A3(); - Cycle_B_2_00200_A4 a4_0 = new Cycle_B_2_00200_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0 = a4_0; - a4_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 16) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00200_A1 { - Cycle_B_2_00200_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00200_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00200_A2 { - Cycle_B_2_00200_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00200_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00200_A3 { - Cycle_B_2_00200_A1 a1_0; - Cycle_B_2_00200_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00200_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a + a1_0.a; - } - } - - class Cycle_B_2_00200_A4 { - Cycle_B_2_00200_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00200_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -public class Cycle_Bm_2_00200 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00200 A1_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); - ThreadRc_Cycle_Bm_2_00200 A2_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); - ThreadRc_Cycle_Bm_2_00200 A3_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); - ThreadRc_Cycle_Bm_2_00200 A4_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); - ThreadRc_Cycle_Bm_2_00200 A5_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); - ThreadRc_Cycle_Bm_2_00200 A6_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); - - A1_Cycle_Bm_2_00200.start(); - A2_Cycle_Bm_2_00200.start(); - A3_Cycle_Bm_2_00200.start(); - A4_Cycle_Bm_2_00200.start(); - A5_Cycle_Bm_2_00200.start(); - A6_Cycle_Bm_2_00200.start(); - - try { - A1_Cycle_Bm_2_00200.join(); - A2_Cycle_Bm_2_00200.join(); - A3_Cycle_Bm_2_00200.join(); - A4_Cycle_Bm_2_00200.join(); - A5_Cycle_Bm_2_00200.join(); - A6_Cycle_Bm_2_00200.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00200.check() && A2_Cycle_Bm_2_00200.check() && A3_Cycle_Bm_2_00200.check() && A4_Cycle_Bm_2_00200.check() && A5_Cycle_Bm_2_00200.check() && A6_Cycle_Bm_2_00200.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00200.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00200 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00200.java + *- @ExecuteClass: Cycle_Bm_2_00200 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00200 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00200_A1 a1_0 = new Cycle_B_2_00200_A1(); + a1_0.a2_0 = new Cycle_B_2_00200_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00200_A3(); + Cycle_B_2_00200_A4 a4_0 = new Cycle_B_2_00200_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0 = a4_0; + a4_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 16) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00200_A1 { + Cycle_B_2_00200_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00200_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00200_A2 { + Cycle_B_2_00200_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00200_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00200_A3 { + Cycle_B_2_00200_A1 a1_0; + Cycle_B_2_00200_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00200_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a + a1_0.a; + } + } + + class Cycle_B_2_00200_A4 { + Cycle_B_2_00200_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00200_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +public class Cycle_Bm_2_00200 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00200 A1_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); + ThreadRc_Cycle_Bm_2_00200 A2_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); + ThreadRc_Cycle_Bm_2_00200 A3_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); + ThreadRc_Cycle_Bm_2_00200 A4_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); + ThreadRc_Cycle_Bm_2_00200 A5_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); + ThreadRc_Cycle_Bm_2_00200 A6_Cycle_Bm_2_00200 = new ThreadRc_Cycle_Bm_2_00200(); + + A1_Cycle_Bm_2_00200.start(); + A2_Cycle_Bm_2_00200.start(); + A3_Cycle_Bm_2_00200.start(); + A4_Cycle_Bm_2_00200.start(); + A5_Cycle_Bm_2_00200.start(); + A6_Cycle_Bm_2_00200.start(); + + try { + A1_Cycle_Bm_2_00200.join(); + A2_Cycle_Bm_2_00200.join(); + A3_Cycle_Bm_2_00200.join(); + A4_Cycle_Bm_2_00200.join(); + A5_Cycle_Bm_2_00200.join(); + A6_Cycle_Bm_2_00200.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00200.check() && A2_Cycle_Bm_2_00200.check() && A3_Cycle_Bm_2_00200.check() && A4_Cycle_Bm_2_00200.check() && A5_Cycle_Bm_2_00200.check() && A6_Cycle_Bm_2_00200.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0201-rc-function-RC_Thread01-Cycle_Bm_2_00210/Cycle_Bm_2_00210.java b/test/testsuite/ouroboros/memory_management/Function/RC0201-rc-function-RC_Thread01-Cycle_Bm_2_00210/Cycle_Bm_2_00210.java index d1c91f5768d6bb65cbdcec3c21a05d376dedaef8..3f3d3b88e50b63ebf0d5c3aa3e37015bb679945e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0201-rc-function-RC_Thread01-Cycle_Bm_2_00210/Cycle_Bm_2_00210.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0201-rc-function-RC_Thread01-Cycle_Bm_2_00210/Cycle_Bm_2_00210.java @@ -1,250 +1,250 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00210.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00210 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00210.java - *- @ExecuteClass: Cycle_Bm_2_00210 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00210 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00210_A1 a1_0 = new Cycle_B_2_00210_A1(); - a1_0.a2_0 = new Cycle_B_2_00210_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00210_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00210_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00210_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00210_A6(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0 = new Cycle_B_2_00210_A8(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0 = new Cycle_B_2_00210_A9(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00210_A7(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.sum); - //System.out.println(nsum); - - if (nsum == 94) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00210_A1 { - Cycle_B_2_00210_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00210_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00210_A2 { - Cycle_B_2_00210_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00210_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00210_A3 { - Cycle_B_2_00210_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00210_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00210_A4 { - Cycle_B_2_00210_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00210_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00210_A5 { - Cycle_B_2_00210_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00210_A5() { - a6_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_B_2_00210_A6 { - Cycle_B_2_00210_A1 a1_0; - Cycle_B_2_00210_A8 a8_0; - int a; - int sum; - - Cycle_B_2_00210_A6() { - a1_0 = null; - a8_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a8_0.a; - } - } - - class Cycle_B_2_00210_A8 { - Cycle_B_2_00210_A9 a9_0; - int a; - int sum; - - Cycle_B_2_00210_A8() { - a9_0 = null; - a = 7; - sum = 0; - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_B_2_00210_A9 { - Cycle_B_2_00210_A7 a7_0; - int a; - int sum; - - Cycle_B_2_00210_A9() { - a7_0 = null; - a = 8; - sum = 0; - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_B_2_00210_A7 { - Cycle_B_2_00210_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00210_A7() { - a4_0 = null; - a = 9; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class Cycle_Bm_2_00210 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00210 A1_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); - ThreadRc_Cycle_Bm_2_00210 A2_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); - ThreadRc_Cycle_Bm_2_00210 A3_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); - ThreadRc_Cycle_Bm_2_00210 A4_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); - ThreadRc_Cycle_Bm_2_00210 A5_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); - ThreadRc_Cycle_Bm_2_00210 A6_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); - - A1_Cycle_Bm_2_00210.start(); - A2_Cycle_Bm_2_00210.start(); - A3_Cycle_Bm_2_00210.start(); - A4_Cycle_Bm_2_00210.start(); - A5_Cycle_Bm_2_00210.start(); - A6_Cycle_Bm_2_00210.start(); - - try { - A1_Cycle_Bm_2_00210.join(); - A2_Cycle_Bm_2_00210.join(); - A3_Cycle_Bm_2_00210.join(); - A4_Cycle_Bm_2_00210.join(); - A5_Cycle_Bm_2_00210.join(); - A6_Cycle_Bm_2_00210.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00210.check() && A2_Cycle_Bm_2_00210.check() && A3_Cycle_Bm_2_00210.check() && A4_Cycle_Bm_2_00210.check() && A5_Cycle_Bm_2_00210.check() && A6_Cycle_Bm_2_00210.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00210.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00210 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00210.java + *- @ExecuteClass: Cycle_Bm_2_00210 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00210 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00210_A1 a1_0 = new Cycle_B_2_00210_A1(); + a1_0.a2_0 = new Cycle_B_2_00210_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00210_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00210_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00210_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00210_A6(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0 = new Cycle_B_2_00210_A8(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0 = new Cycle_B_2_00210_A9(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00210_A7(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.sum); + //System.out.println(nsum); + + if (nsum == 94) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00210_A1 { + Cycle_B_2_00210_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00210_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00210_A2 { + Cycle_B_2_00210_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00210_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00210_A3 { + Cycle_B_2_00210_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00210_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00210_A4 { + Cycle_B_2_00210_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00210_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00210_A5 { + Cycle_B_2_00210_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00210_A5() { + a6_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_B_2_00210_A6 { + Cycle_B_2_00210_A1 a1_0; + Cycle_B_2_00210_A8 a8_0; + int a; + int sum; + + Cycle_B_2_00210_A6() { + a1_0 = null; + a8_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a8_0.a; + } + } + + class Cycle_B_2_00210_A8 { + Cycle_B_2_00210_A9 a9_0; + int a; + int sum; + + Cycle_B_2_00210_A8() { + a9_0 = null; + a = 7; + sum = 0; + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_B_2_00210_A9 { + Cycle_B_2_00210_A7 a7_0; + int a; + int sum; + + Cycle_B_2_00210_A9() { + a7_0 = null; + a = 8; + sum = 0; + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_B_2_00210_A7 { + Cycle_B_2_00210_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00210_A7() { + a4_0 = null; + a = 9; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class Cycle_Bm_2_00210 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00210 A1_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); + ThreadRc_Cycle_Bm_2_00210 A2_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); + ThreadRc_Cycle_Bm_2_00210 A3_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); + ThreadRc_Cycle_Bm_2_00210 A4_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); + ThreadRc_Cycle_Bm_2_00210 A5_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); + ThreadRc_Cycle_Bm_2_00210 A6_Cycle_Bm_2_00210 = new ThreadRc_Cycle_Bm_2_00210(); + + A1_Cycle_Bm_2_00210.start(); + A2_Cycle_Bm_2_00210.start(); + A3_Cycle_Bm_2_00210.start(); + A4_Cycle_Bm_2_00210.start(); + A5_Cycle_Bm_2_00210.start(); + A6_Cycle_Bm_2_00210.start(); + + try { + A1_Cycle_Bm_2_00210.join(); + A2_Cycle_Bm_2_00210.join(); + A3_Cycle_Bm_2_00210.join(); + A4_Cycle_Bm_2_00210.join(); + A5_Cycle_Bm_2_00210.join(); + A6_Cycle_Bm_2_00210.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00210.check() && A2_Cycle_Bm_2_00210.check() && A3_Cycle_Bm_2_00210.check() && A4_Cycle_Bm_2_00210.check() && A5_Cycle_Bm_2_00210.check() && A6_Cycle_Bm_2_00210.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0202-rc-function-RC_Thread01-Cycle_Bm_2_00220/Cycle_Bm_2_00220.java b/test/testsuite/ouroboros/memory_management/Function/RC0202-rc-function-RC_Thread01-Cycle_Bm_2_00220/Cycle_Bm_2_00220.java index a798c1283124c7fc026174772b8c9ee6bf8e370d..2b626628d4dafeeb1e161949a54401fd7095a2bf 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0202-rc-function-RC_Thread01-Cycle_Bm_2_00220/Cycle_Bm_2_00220.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0202-rc-function-RC_Thread01-Cycle_Bm_2_00220/Cycle_Bm_2_00220.java @@ -1,250 +1,250 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00220.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00220 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00220.java - *- @ExecuteClass: Cycle_Bm_2_00220 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00220 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00220_A1 a1_0 = new Cycle_B_2_00220_A1(); - a1_0.a2_0 = new Cycle_B_2_00220_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00220_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00220_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00220_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00220_A6(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; - a1_0.a8_0 = new Cycle_B_2_00220_A8(); - a1_0.a8_0.a9_0 = new Cycle_B_2_00220_A9(); - a1_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00220_A7(); - a1_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a1_0.a8_0.add(); - a1_0.a8_0.a9_0.add(); - a1_0.a8_0.a9_0.a7_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_0.a8_0.sum + a1_0.a8_0.a9_0.sum + a1_0.a8_0.a9_0.a7_0.sum); - //System.out.println(nsum); - - if (nsum == 94) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00220_A1 { - Cycle_B_2_00220_A2 a2_0; - Cycle_B_2_00220_A8 a8_0; - int a; - int sum; - - Cycle_B_2_00220_A1() { - a2_0 = null; - a8_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a + a8_0.a; - } - } - - class Cycle_B_2_00220_A2 { - Cycle_B_2_00220_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00220_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00220_A3 { - Cycle_B_2_00220_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00220_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00220_A4 { - Cycle_B_2_00220_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00220_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00220_A5 { - Cycle_B_2_00220_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00220_A5() { - a6_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_B_2_00220_A6 { - Cycle_B_2_00220_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00220_A6() { - a1_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00220_A8 { - Cycle_B_2_00220_A9 a9_0; - int a; - int sum; - - Cycle_B_2_00220_A8() { - a9_0 = null; - a = 7; - sum = 0; - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_B_2_00220_A9 { - Cycle_B_2_00220_A7 a7_0; - int a; - int sum; - - Cycle_B_2_00220_A9() { - a7_0 = null; - a = 8; - sum = 0; - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_B_2_00220_A7 { - Cycle_B_2_00220_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00220_A7() { - a4_0 = null; - a = 9; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - - -public class Cycle_Bm_2_00220 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00220 A1_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); - ThreadRc_Cycle_Bm_2_00220 A2_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); - ThreadRc_Cycle_Bm_2_00220 A3_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); - ThreadRc_Cycle_Bm_2_00220 A4_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); - ThreadRc_Cycle_Bm_2_00220 A5_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); - ThreadRc_Cycle_Bm_2_00220 A6_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); - - A1_Cycle_Bm_2_00220.start(); - A2_Cycle_Bm_2_00220.start(); - A3_Cycle_Bm_2_00220.start(); - A4_Cycle_Bm_2_00220.start(); - A5_Cycle_Bm_2_00220.start(); - A6_Cycle_Bm_2_00220.start(); - - try { - A1_Cycle_Bm_2_00220.join(); - A2_Cycle_Bm_2_00220.join(); - A3_Cycle_Bm_2_00220.join(); - A4_Cycle_Bm_2_00220.join(); - A5_Cycle_Bm_2_00220.join(); - A6_Cycle_Bm_2_00220.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00220.check() && A2_Cycle_Bm_2_00220.check() && A3_Cycle_Bm_2_00220.check() && A4_Cycle_Bm_2_00220.check() && A5_Cycle_Bm_2_00220.check() && A6_Cycle_Bm_2_00220.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00220.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00220 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00220.java + *- @ExecuteClass: Cycle_Bm_2_00220 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00220 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00220_A1 a1_0 = new Cycle_B_2_00220_A1(); + a1_0.a2_0 = new Cycle_B_2_00220_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00220_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00220_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00220_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00220_A6(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; + a1_0.a8_0 = new Cycle_B_2_00220_A8(); + a1_0.a8_0.a9_0 = new Cycle_B_2_00220_A9(); + a1_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00220_A7(); + a1_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a1_0.a8_0.add(); + a1_0.a8_0.a9_0.add(); + a1_0.a8_0.a9_0.a7_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_0.a8_0.sum + a1_0.a8_0.a9_0.sum + a1_0.a8_0.a9_0.a7_0.sum); + //System.out.println(nsum); + + if (nsum == 94) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00220_A1 { + Cycle_B_2_00220_A2 a2_0; + Cycle_B_2_00220_A8 a8_0; + int a; + int sum; + + Cycle_B_2_00220_A1() { + a2_0 = null; + a8_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a + a8_0.a; + } + } + + class Cycle_B_2_00220_A2 { + Cycle_B_2_00220_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00220_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00220_A3 { + Cycle_B_2_00220_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00220_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00220_A4 { + Cycle_B_2_00220_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00220_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00220_A5 { + Cycle_B_2_00220_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00220_A5() { + a6_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_B_2_00220_A6 { + Cycle_B_2_00220_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00220_A6() { + a1_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00220_A8 { + Cycle_B_2_00220_A9 a9_0; + int a; + int sum; + + Cycle_B_2_00220_A8() { + a9_0 = null; + a = 7; + sum = 0; + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_B_2_00220_A9 { + Cycle_B_2_00220_A7 a7_0; + int a; + int sum; + + Cycle_B_2_00220_A9() { + a7_0 = null; + a = 8; + sum = 0; + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_B_2_00220_A7 { + Cycle_B_2_00220_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00220_A7() { + a4_0 = null; + a = 9; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + + +public class Cycle_Bm_2_00220 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00220 A1_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); + ThreadRc_Cycle_Bm_2_00220 A2_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); + ThreadRc_Cycle_Bm_2_00220 A3_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); + ThreadRc_Cycle_Bm_2_00220 A4_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); + ThreadRc_Cycle_Bm_2_00220 A5_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); + ThreadRc_Cycle_Bm_2_00220 A6_Cycle_Bm_2_00220 = new ThreadRc_Cycle_Bm_2_00220(); + + A1_Cycle_Bm_2_00220.start(); + A2_Cycle_Bm_2_00220.start(); + A3_Cycle_Bm_2_00220.start(); + A4_Cycle_Bm_2_00220.start(); + A5_Cycle_Bm_2_00220.start(); + A6_Cycle_Bm_2_00220.start(); + + try { + A1_Cycle_Bm_2_00220.join(); + A2_Cycle_Bm_2_00220.join(); + A3_Cycle_Bm_2_00220.join(); + A4_Cycle_Bm_2_00220.join(); + A5_Cycle_Bm_2_00220.join(); + A6_Cycle_Bm_2_00220.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00220.check() && A2_Cycle_Bm_2_00220.check() && A3_Cycle_Bm_2_00220.check() && A4_Cycle_Bm_2_00220.check() && A5_Cycle_Bm_2_00220.check() && A6_Cycle_Bm_2_00220.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0203-rc-function-RC_Thread01-Cycle_Bm_2_00230/Cycle_Bm_2_00230.java b/test/testsuite/ouroboros/memory_management/Function/RC0203-rc-function-RC_Thread01-Cycle_Bm_2_00230/Cycle_Bm_2_00230.java index 194a57ffee943f79c80a941705ca9c2d143459fc..1fbc06aed00ad5c6eb2e9d259a26e73df005edba 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0203-rc-function-RC_Thread01-Cycle_Bm_2_00230/Cycle_Bm_2_00230.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0203-rc-function-RC_Thread01-Cycle_Bm_2_00230/Cycle_Bm_2_00230.java @@ -1,270 +1,270 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00230.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Cycle_B_2_00230 in RC测试-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00230.java - *- @ExecuteClass: Cycle_Bm_2_00230 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00230 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00230_A1 a1_0 = new Cycle_B_2_00230_A1(); - a1_0.a2_0 = new Cycle_B_2_00230_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00230_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00230_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00230_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00230_A6(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; - - Cycle_B_2_00230_A10 a10_0 = new Cycle_B_2_00230_A10(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_0; - a10_0.a8_0 = new Cycle_B_2_00230_A8(); - a10_0.a8_0.a9_0 = new Cycle_B_2_00230_A9(); - a10_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00230_A7(); - a10_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a10_0.a8_0.add(); - a10_0.a8_0.a9_0.add(); - a10_0.a8_0.a9_0.a7_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_0.a8_0.sum + a10_0.a8_0.a9_0.sum + a10_0.a8_0.a9_0.a7_0.sum); - - //System.out.println(nsum); - - if (nsum == 97) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00230_A1 { - Cycle_B_2_00230_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00230_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00230_A2 { - Cycle_B_2_00230_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00230_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00230_A3 { - Cycle_B_2_00230_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00230_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00230_A4 { - Cycle_B_2_00230_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00230_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00230_A5 { - Cycle_B_2_00230_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00230_A5() { - a6_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_B_2_00230_A6 { - Cycle_B_2_00230_A1 a1_0; - Cycle_B_2_00230_A10 a10_0; - int a; - int sum; - - Cycle_B_2_00230_A6() { - a1_0 = null; - a10_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a10_0.a; - } - } - - class Cycle_B_2_00230_A8 { - Cycle_B_2_00230_A9 a9_0; - int a; - int sum; - - Cycle_B_2_00230_A8() { - a9_0 = null; - a = 7; - sum = 0; - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_B_2_00230_A9 { - Cycle_B_2_00230_A7 a7_0; - int a; - int sum; - - Cycle_B_2_00230_A9() { - a7_0 = null; - a = 8; - sum = 0; - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_B_2_00230_A7 { - Cycle_B_2_00230_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00230_A7() { - a4_0 = null; - a = 9; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00230_A10 { - Cycle_B_2_00230_A8 a8_0; - int a; - int sum; - - Cycle_B_2_00230_A10() { - a8_0 = null; - a = 10; - sum = 0; - } - - void add() { - sum = a + a8_0.a; - } - } -} - - -public class Cycle_Bm_2_00230 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00230 A1_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A2_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A3_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A4_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A5_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - ThreadRc_Cycle_Bm_2_00230 A6_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); - - A1_Cycle_Bm_2_00230.start(); - A2_Cycle_Bm_2_00230.start(); - A3_Cycle_Bm_2_00230.start(); - A4_Cycle_Bm_2_00230.start(); - A5_Cycle_Bm_2_00230.start(); - A6_Cycle_Bm_2_00230.start(); - - try { - A1_Cycle_Bm_2_00230.join(); - A2_Cycle_Bm_2_00230.join(); - A3_Cycle_Bm_2_00230.join(); - A4_Cycle_Bm_2_00230.join(); - A5_Cycle_Bm_2_00230.join(); - A6_Cycle_Bm_2_00230.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_00230.check() && A2_Cycle_Bm_2_00230.check() && A3_Cycle_Bm_2_00230.check() && A4_Cycle_Bm_2_00230.check() && A5_Cycle_Bm_2_00230.check() && A6_Cycle_Bm_2_00230.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00230.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Cycle_B_2_00230 in RC测试-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00230.java + *- @ExecuteClass: Cycle_Bm_2_00230 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00230 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00230_A1 a1_0 = new Cycle_B_2_00230_A1(); + a1_0.a2_0 = new Cycle_B_2_00230_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00230_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00230_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00230_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00230_A6(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; + + Cycle_B_2_00230_A10 a10_0 = new Cycle_B_2_00230_A10(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_0; + a10_0.a8_0 = new Cycle_B_2_00230_A8(); + a10_0.a8_0.a9_0 = new Cycle_B_2_00230_A9(); + a10_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00230_A7(); + a10_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a10_0.a8_0.add(); + a10_0.a8_0.a9_0.add(); + a10_0.a8_0.a9_0.a7_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_0.a8_0.sum + a10_0.a8_0.a9_0.sum + a10_0.a8_0.a9_0.a7_0.sum); + + //System.out.println(nsum); + + if (nsum == 97) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00230_A1 { + Cycle_B_2_00230_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00230_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00230_A2 { + Cycle_B_2_00230_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00230_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00230_A3 { + Cycle_B_2_00230_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00230_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00230_A4 { + Cycle_B_2_00230_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00230_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00230_A5 { + Cycle_B_2_00230_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00230_A5() { + a6_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_B_2_00230_A6 { + Cycle_B_2_00230_A1 a1_0; + Cycle_B_2_00230_A10 a10_0; + int a; + int sum; + + Cycle_B_2_00230_A6() { + a1_0 = null; + a10_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a10_0.a; + } + } + + class Cycle_B_2_00230_A8 { + Cycle_B_2_00230_A9 a9_0; + int a; + int sum; + + Cycle_B_2_00230_A8() { + a9_0 = null; + a = 7; + sum = 0; + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_B_2_00230_A9 { + Cycle_B_2_00230_A7 a7_0; + int a; + int sum; + + Cycle_B_2_00230_A9() { + a7_0 = null; + a = 8; + sum = 0; + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_B_2_00230_A7 { + Cycle_B_2_00230_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00230_A7() { + a4_0 = null; + a = 9; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00230_A10 { + Cycle_B_2_00230_A8 a8_0; + int a; + int sum; + + Cycle_B_2_00230_A10() { + a8_0 = null; + a = 10; + sum = 0; + } + + void add() { + sum = a + a8_0.a; + } + } +} + + +public class Cycle_Bm_2_00230 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00230 A1_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A2_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A3_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A4_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A5_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + ThreadRc_Cycle_Bm_2_00230 A6_Cycle_Bm_2_00230 = new ThreadRc_Cycle_Bm_2_00230(); + + A1_Cycle_Bm_2_00230.start(); + A2_Cycle_Bm_2_00230.start(); + A3_Cycle_Bm_2_00230.start(); + A4_Cycle_Bm_2_00230.start(); + A5_Cycle_Bm_2_00230.start(); + A6_Cycle_Bm_2_00230.start(); + + try { + A1_Cycle_Bm_2_00230.join(); + A2_Cycle_Bm_2_00230.join(); + A3_Cycle_Bm_2_00230.join(); + A4_Cycle_Bm_2_00230.join(); + A5_Cycle_Bm_2_00230.join(); + A6_Cycle_Bm_2_00230.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_00230.check() && A2_Cycle_Bm_2_00230.check() && A3_Cycle_Bm_2_00230.check() && A4_Cycle_Bm_2_00230.check() && A5_Cycle_Bm_2_00230.check() && A6_Cycle_Bm_2_00230.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0204-rc-function-RC_Thread01-Cycle_Bm_2_00240/Cycle_Bm_2_00240.java b/test/testsuite/ouroboros/memory_management/Function/RC0204-rc-function-RC_Thread01-Cycle_Bm_2_00240/Cycle_Bm_2_00240.java index 9709da6c4013edcf443f8c7d3dd8a48dbc8de3c5..f3636fc76bdf6b7d643f34a27faf2fe7f9fcfb26 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0204-rc-function-RC_Thread01-Cycle_Bm_2_00240/Cycle_Bm_2_00240.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0204-rc-function-RC_Thread01-Cycle_Bm_2_00240/Cycle_Bm_2_00240.java @@ -1,2763 +1,2763 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00240.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Make Cycle_B_2_00240 together to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_00240.java - *- @ExecuteClass: Cycle_Bm_2_00240 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_00010B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00010_A1 a1_0 = new Cycle_B_2_00010_A1(); - a1_0.a2_0 = new Cycle_B_2_00010_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00010_A3(); - a1_0.a2_0.a4_0 = new Cycle_B_2_00010_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a4_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 18) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00010_A1 { - Cycle_B_2_00010_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00010_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00010_A2 { - Cycle_B_2_00010_A3 a3_0; - Cycle_B_2_00010_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00010_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00010_A3 { - Cycle_B_2_00010_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00010_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00010_A4 { - Cycle_B_2_00010_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00010_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00020B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00020_A1 a1_0 = new Cycle_B_2_00020_A1(); - a1_0.a2_0 = new Cycle_B_2_00020_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00020_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00020_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 19) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00020_A1 { - Cycle_B_2_00020_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00020_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00020_A2 { - Cycle_B_2_00020_A3 a3_0; - Cycle_B_2_00020_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00020_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00020_A3 { - Cycle_B_2_00020_A1 a1_0; - Cycle_B_2_00020_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00020_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00020_A4 { - Cycle_B_2_00020_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00020_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00030B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00030_A1 a1_0 = new Cycle_B_2_00030_A1(); - a1_0.a2_0 = new Cycle_B_2_00030_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00030_A3(); - Cycle_B_2_00030_A4 a4_0 = new Cycle_B_2_00030_A4(); - a4_0.a1_0 = a1_0; - a1_0.a4_0 = a4_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 16) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00030_A1 { - Cycle_B_2_00030_A2 a2_0; - Cycle_B_2_00030_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00030_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00030_A2 { - Cycle_B_2_00030_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00030_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00030_A3 { - Cycle_B_2_00030_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00030_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00030_A4 { - Cycle_B_2_00030_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00030_A4() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00040B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00040_A1 a1_0 = new Cycle_B_2_00040_A1(); - a1_0.a2_0 = new Cycle_B_2_00040_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00040_A3(); - Cycle_B_2_00040_A4 a4_0 = new Cycle_B_2_00040_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a4_0 = a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 19) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00040_A1 { - Cycle_B_2_00040_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00040_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00040_A2 { - Cycle_B_2_00040_A3 a3_0; - Cycle_B_2_00040_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00040_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00040_A3 { - Cycle_B_2_00040_A1 a1_0; - Cycle_B_2_00040_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00040_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00040_A4 { - Cycle_B_2_00040_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00040_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00050B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00050_A1 a1_0 = new Cycle_B_2_00050_A1(); - a1_0.a2_0 = new Cycle_B_2_00050_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00050_A3(); - Cycle_B_2_00050_A4 a4_0 = new Cycle_B_2_00050_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a4_0.a3_0.a5_0 = new Cycle_B_2_00050_A5(); - a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a4_0.a3_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00050_A1 { - Cycle_B_2_00050_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00050_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00050_A2 { - Cycle_B_2_00050_A3 a3_0; - Cycle_B_2_00050_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00050_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00050_A3 { - Cycle_B_2_00050_A1 a1_0; - Cycle_B_2_00050_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00050_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00050_A4 { - Cycle_B_2_00050_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00050_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00050_A5 { - Cycle_B_2_00050_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00050_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00060B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00060_A1 a1_0 = new Cycle_B_2_00060_A1(); - a1_0.a2_0 = new Cycle_B_2_00060_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00060_A3(); - Cycle_B_2_00060_A4 a4_0 = new Cycle_B_2_00060_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a4_0.a3_0.a5_0 = new Cycle_B_2_00060_A5(); - a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.a5_0 = a4_0.a3_0.a5_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a4_0.a3_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00060_A1 { - Cycle_B_2_00060_A2 a2_0; - Cycle_B_2_00060_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00060_A1() { - a2_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00060_A2 { - Cycle_B_2_00060_A3 a3_0; - Cycle_B_2_00060_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00060_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00060_A3 { - Cycle_B_2_00060_A1 a1_0; - Cycle_B_2_00060_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00060_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00060_A4 { - Cycle_B_2_00060_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00060_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00060_A5 { - Cycle_B_2_00060_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00060_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00070B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00070_A1 a1_0 = new Cycle_B_2_00070_A1(); - a1_0.a2_0 = new Cycle_B_2_00070_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00070_A3(); - Cycle_B_2_00070_A4 a4_0 = new Cycle_B_2_00070_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a4_0.a3_0.a5_0 = new Cycle_B_2_00070_A5(); - Cycle_B_2_00070_A6 a6_0 = new Cycle_B_2_00070_A6(); - a6_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a6_0.add(); - a4_0.a3_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum + a6_0.sum); - //System.out.println(nsum); - - if (nsum == 37) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00070_A1 { - Cycle_B_2_00070_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00070_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00070_A2 { - Cycle_B_2_00070_A3 a3_0; - Cycle_B_2_00070_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00070_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00070_A3 { - Cycle_B_2_00070_A1 a1_0; - Cycle_B_2_00070_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00070_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00070_A4 { - Cycle_B_2_00070_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00070_A4() { - a3_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00070_A5 { - Cycle_B_2_00070_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00070_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00070_A6 { - Cycle_B_2_00070_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00070_A6() { - a3_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00080B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00080_A1 a1_0 = new Cycle_B_2_00080_A1(); - a1_0.a2_0 = new Cycle_B_2_00080_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00080_A3(); - Cycle_B_2_00080_A4 a4_0 = new Cycle_B_2_00080_A4(); - a4_0.a2_0 = a1_0.a2_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a4_0.a3_0 = a1_0.a2_0.a3_0; - a4_0.a3_0.a5_0 = new Cycle_B_2_00080_A5(); - a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; - a4_0.a3_0.a5_0.a4_0 = a4_0; - a1_0.a5_0 = a4_0.a3_0.a5_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a4_0.add(); - a4_0.a3_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00080_A1 { - Cycle_B_2_00080_A2 a2_0; - Cycle_B_2_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00080_A1() { - a2_0 = null; - a5_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00080_A2 { - Cycle_B_2_00080_A3 a3_0; - Cycle_B_2_00080_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00080_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00080_A3 { - Cycle_B_2_00080_A1 a1_0; - Cycle_B_2_00080_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00080_A3() { - a1_0 = null; - a5_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00080_A4 { - Cycle_B_2_00080_A3 a3_0; - Cycle_B_2_00080_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00080_A4() { - a3_0 = null; - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00080_A5 { - Cycle_B_2_00080_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00080_A5() { - a4_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00090B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00090_A1 a1_0 = new Cycle_B_2_00090_A1(); - Cycle_B_2_00090_A3 a3_0 = new Cycle_B_2_00090_A3(); - a1_0.a2_0 = new Cycle_B_2_00090_A2(); - a1_0.a2_0.a1_0 = a1_0; - a3_0.a2_0 = a1_0.a2_0; - a3_0.a2_0.a3_0 = a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a3_0.sum); - //System.out.println(nsum); - - if (nsum == 9) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00090_A1 { - Cycle_B_2_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00090_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00090_A2 { - Cycle_B_2_00090_A1 a1_0; - Cycle_B_2_00090_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00090_A2() { - a1_0 = null; - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00090_A3 { - Cycle_B_2_00090_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00090_A3() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00100B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00100_A1 a1_0 = new Cycle_B_2_00100_A1(); - a1_0.a2_0 = new Cycle_B_2_00100_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00100_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00100_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00100_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 29) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00100_A1 { - Cycle_B_2_00100_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00100_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00100_A2 { - Cycle_B_2_00100_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00100_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00100_A3 { - Cycle_B_2_00100_A1 a1_0; - Cycle_B_2_00100_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00100_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00100_A4 { - Cycle_B_2_00100_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00100_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00100_A5 { - Cycle_B_2_00100_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00100_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00110B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00110_A1 a1_0 = new Cycle_B_2_00110_A1(); - a1_0.a2_0 = new Cycle_B_2_00110_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00110_A3(); - a1_0.a2_0.a4_0 = new Cycle_B_2_00110_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a4_0.a5_0 = new Cycle_B_2_00110_A5(); - a1_0.a2_0.a4_0.a5_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - a1_0.a2_0.a4_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a4_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 28) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00110_A1 { - Cycle_B_2_00110_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00110_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00110_A2 { - Cycle_B_2_00110_A3 a3_0; - Cycle_B_2_00110_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00110_A2() { - a3_0 = null; - a4_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00110_A3 { - Cycle_B_2_00110_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00110_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00110_A4 { - Cycle_B_2_00110_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00110_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00110_A5 { - Cycle_B_2_00110_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00110_A5() { - a2_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00120B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00120_A1 a1_0 = new Cycle_B_2_00120_A1(); - a1_0.a2_0 = new Cycle_B_2_00120_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00120_A3(); - a1_0.a4_0 = new Cycle_B_2_00120_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a4_0.a5_0 = new Cycle_B_2_00120_A5(); - a1_0.a4_0.a5_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a4_0.add(); - a1_0.a4_0.a5_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a4_0.sum + a1_0.a4_0.a5_0.sum); - //System.out.println(nsum); - - if (nsum == 27) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00120_A1 { - Cycle_B_2_00120_A2 a2_0; - Cycle_B_2_00120_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00120_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00120_A2 { - Cycle_B_2_00120_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00120_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00120_A3 { - Cycle_B_2_00120_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00120_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00120_A4 { - Cycle_B_2_00120_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00120_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00120_A5 { - Cycle_B_2_00120_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00120_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00130B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00130_A1 a1_0 = new Cycle_B_2_00130_A1(); - a1_0.a2_0 = new Cycle_B_2_00130_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00130_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00130_A4(); - a1_0.a2_0.a3_0.a4_0.a1_0 = a1_0; - Cycle_B_2_00130_A5 a5_0 = new Cycle_B_2_00130_A5(); - a1_0.a2_0.a3_0.a4_0.a6_0 = new Cycle_B_2_00130_A6(); - a1_0.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_0; - a5_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a6_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a5_0.sum + a1_0.a2_0.a3_0.a4_0.a6_0.sum); - //System.out.println(nsum); - - if (nsum == 45) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00130_A1 { - Cycle_B_2_00130_A2 a2_0; - Cycle_B_2_00130_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00130_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00130_A2 { - Cycle_B_2_00130_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00130_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00130_A3 { - Cycle_B_2_00130_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00130_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00130_A4 { - Cycle_B_2_00130_A1 a1_0; - Cycle_B_2_00130_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00130_A4() { - a1_0 = null; - a6_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - class Cycle_B_2_00130_A5 { - Cycle_B_2_00130_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00130_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00130_A6 { - Cycle_B_2_00130_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00130_A6() { - a5_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00140B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00140_A1 a1_0 = new Cycle_B_2_00140_A1(); - a1_0.a2_0 = new Cycle_B_2_00140_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00140_A3(); - a1_0.a2_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 13) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00140_A1 { - Cycle_B_2_00140_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00140_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00140_A2 { - Cycle_B_2_00140_A3 a3_0; - Cycle_B_2_00140_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00140_A2() { - a3_0 = null; - a1_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a + a1_0.a; - } - } - - class Cycle_B_2_00140_A3 { - Cycle_B_2_00140_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00140_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00150B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00150_A1 a1_0 = new Cycle_B_2_00150_A1(); - a1_0.a2_0 = new Cycle_B_2_00150_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00150_A3(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 14) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00150_A1 { - Cycle_B_2_00150_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00150_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00150_A2 { - Cycle_B_2_00150_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00150_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00150_A3 { - Cycle_B_2_00150_A1 a1_0; - Cycle_B_2_00150_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00150_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00160B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00160_A1 a1_0 = new Cycle_B_2_00160_A1(); - a1_0.a2_0 = new Cycle_B_2_00160_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00160_A3(); - a1_0.a3_0 = a1_0.a2_0.a3_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); - //System.out.println(nsum); - - if (nsum == 15) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00160_A1 { - Cycle_B_2_00160_A2 a2_0; - Cycle_B_2_00160_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00160_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - } - - class Cycle_B_2_00160_A2 { - Cycle_B_2_00160_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00160_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00160_A3 { - Cycle_B_2_00160_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00160_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - - -class ThreadRc_Cycle_Bm_2_00170B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00170_A1 a1_0 = new Cycle_B_2_00170_A1(); - a1_0.a2_0 = new Cycle_B_2_00170_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00170_A3(); - a1_0.a2_0.a4_0 = new Cycle_B_2_00170_A4(); - a1_0.a2_0.a4_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a4_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 21) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00170_A1 { - Cycle_B_2_00170_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00170_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00170_A2 { - Cycle_B_2_00170_A3 a3_0; - Cycle_B_2_00170_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00170_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a + a4_0.a; - } - } - - class Cycle_B_2_00170_A3 { - Cycle_B_2_00170_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00170_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00170_A4 { - Cycle_B_2_00170_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00170_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00180B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00180_A1 a1_0 = new Cycle_B_2_00180_A1(); - a1_0.a2_0 = new Cycle_B_2_00180_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00180_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00180_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a1_0 = a1_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 15) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00180_A1 { - Cycle_B_2_00180_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00180_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00180_A2 { - Cycle_B_2_00180_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00180_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00180_A3 { - Cycle_B_2_00180_A1 a1_0; - Cycle_B_2_00180_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00180_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a4_0.a; - } - } - - class Cycle_B_2_00180_A4 { - Cycle_B_2_00180_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00180_A4() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00190B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00190_A1 a1_0 = new Cycle_B_2_00190_A1(); - a1_0.a2_0 = new Cycle_B_2_00190_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00190_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00190_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); - //System.out.println(nsum); - - if (nsum == 15) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00190_A1 { - Cycle_B_2_00190_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00190_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00190_A2 { - Cycle_B_2_00190_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00190_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00190_A3 { - Cycle_B_2_00190_A1 a1_0; - Cycle_B_2_00190_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00190_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00190_A4 { - Cycle_B_2_00190_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00190_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -class ThreadRc_Cycle_Bm_2_00200B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00200_A1 a1_0 = new Cycle_B_2_00200_A1(); - a1_0.a2_0 = new Cycle_B_2_00200_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00200_A3(); - Cycle_B_2_00200_A4 a4_0 = new Cycle_B_2_00200_A4(); - a1_0.a2_0.a3_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0 = a4_0; - a4_0.a2_0 = a1_0.a2_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); - //System.out.println(nsum); - - if (nsum == 16) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00200_A1 { - Cycle_B_2_00200_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00200_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00200_A2 { - Cycle_B_2_00200_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00200_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00200_A3 { - Cycle_B_2_00200_A1 a1_0; - Cycle_B_2_00200_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00200_A3() { - a1_0 = null; - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a + a1_0.a; - } - } - - class Cycle_B_2_00200_A4 { - Cycle_B_2_00200_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00200_A4() { - a2_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } -} - - -class ThreadRc_Cycle_Bm_2_00210B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00210_A1 a1_0 = new Cycle_B_2_00210_A1(); - a1_0.a2_0 = new Cycle_B_2_00210_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00210_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00210_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00210_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00210_A6(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0 = new Cycle_B_2_00210_A8(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0 = new Cycle_B_2_00210_A9(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00210_A7(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.sum); - //System.out.println(nsum); - - if (nsum == 94) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00210_A1 { - Cycle_B_2_00210_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00210_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00210_A2 { - Cycle_B_2_00210_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00210_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00210_A3 { - Cycle_B_2_00210_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00210_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00210_A4 { - Cycle_B_2_00210_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00210_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00210_A5 { - Cycle_B_2_00210_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00210_A5() { - a6_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_B_2_00210_A6 { - Cycle_B_2_00210_A1 a1_0; - Cycle_B_2_00210_A8 a8_0; - int a; - int sum; - - Cycle_B_2_00210_A6() { - a1_0 = null; - a8_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a8_0.a; - } - } - - class Cycle_B_2_00210_A8 { - Cycle_B_2_00210_A9 a9_0; - int a; - int sum; - - Cycle_B_2_00210_A8() { - a9_0 = null; - a = 7; - sum = 0; - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_B_2_00210_A9 { - Cycle_B_2_00210_A7 a7_0; - int a; - int sum; - - Cycle_B_2_00210_A9() { - a7_0 = null; - a = 8; - sum = 0; - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_B_2_00210_A7 { - Cycle_B_2_00210_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00210_A7() { - a4_0 = null; - a = 9; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00220B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00220_A1 a1_0 = new Cycle_B_2_00220_A1(); - a1_0.a2_0 = new Cycle_B_2_00220_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00220_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00220_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00220_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00220_A6(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; - a1_0.a8_0 = new Cycle_B_2_00220_A8(); - a1_0.a8_0.a9_0 = new Cycle_B_2_00220_A9(); - a1_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00220_A7(); - a1_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a1_0.a8_0.add(); - a1_0.a8_0.a9_0.add(); - a1_0.a8_0.a9_0.a7_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_0.a8_0.sum + a1_0.a8_0.a9_0.sum + a1_0.a8_0.a9_0.a7_0.sum); - //System.out.println(nsum); - - if (nsum == 94) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00220_A1 { - Cycle_B_2_00220_A2 a2_0; - Cycle_B_2_00220_A8 a8_0; - int a; - int sum; - - Cycle_B_2_00220_A1() { - a2_0 = null; - a8_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a + a8_0.a; - } - } - - class Cycle_B_2_00220_A2 { - Cycle_B_2_00220_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00220_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00220_A3 { - Cycle_B_2_00220_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00220_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00220_A4 { - Cycle_B_2_00220_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00220_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00220_A5 { - Cycle_B_2_00220_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00220_A5() { - a6_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_B_2_00220_A6 { - Cycle_B_2_00220_A1 a1_0; - int a; - int sum; - - Cycle_B_2_00220_A6() { - a1_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00220_A8 { - Cycle_B_2_00220_A9 a9_0; - int a; - int sum; - - Cycle_B_2_00220_A8() { - a9_0 = null; - a = 7; - sum = 0; - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_B_2_00220_A9 { - Cycle_B_2_00220_A7 a7_0; - int a; - int sum; - - Cycle_B_2_00220_A9() { - a7_0 = null; - a = 8; - sum = 0; - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_B_2_00220_A7 { - Cycle_B_2_00220_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00220_A7() { - a4_0 = null; - a = 9; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } -} - -class ThreadRc_Cycle_Bm_2_00230B extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00230_A1 a1_0 = new Cycle_B_2_00230_A1(); - a1_0.a2_0 = new Cycle_B_2_00230_A2(); - a1_0.a2_0.a3_0 = new Cycle_B_2_00230_A3(); - a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00230_A4(); - a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00230_A5(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00230_A6(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; - - Cycle_B_2_00230_A10 a10_0 = new Cycle_B_2_00230_A10(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_0; - a10_0.a8_0 = new Cycle_B_2_00230_A8(); - a10_0.a8_0.a9_0 = new Cycle_B_2_00230_A9(); - a10_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00230_A7(); - a10_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; - a1_0.add(); - a1_0.a2_0.add(); - a1_0.a2_0.a3_0.add(); - a1_0.a2_0.a3_0.a4_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.add(); - a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); - a10_0.a8_0.add(); - a10_0.a8_0.a9_0.add(); - a10_0.a8_0.a9_0.a7_0.add(); - int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_0.a8_0.sum + a10_0.a8_0.a9_0.sum + a10_0.a8_0.a9_0.a7_0.sum); - - //System.out.println(nsum); - - if (nsum == 97) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00230_A1 { - Cycle_B_2_00230_A2 a2_0; - int a; - int sum; - - Cycle_B_2_00230_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00230_A2 { - Cycle_B_2_00230_A3 a3_0; - int a; - int sum; - - Cycle_B_2_00230_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - class Cycle_B_2_00230_A3 { - Cycle_B_2_00230_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00230_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00230_A4 { - Cycle_B_2_00230_A5 a5_0; - int a; - int sum; - - Cycle_B_2_00230_A4() { - a5_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - - class Cycle_B_2_00230_A5 { - Cycle_B_2_00230_A6 a6_0; - int a; - int sum; - - Cycle_B_2_00230_A5() { - a6_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a6_0.a; - } - } - - class Cycle_B_2_00230_A6 { - Cycle_B_2_00230_A1 a1_0; - Cycle_B_2_00230_A10 a10_0; - int a; - int sum; - - Cycle_B_2_00230_A6() { - a1_0 = null; - a10_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a10_0.a; - } - } - - class Cycle_B_2_00230_A8 { - Cycle_B_2_00230_A9 a9_0; - int a; - int sum; - - Cycle_B_2_00230_A8() { - a9_0 = null; - a = 7; - sum = 0; - } - - void add() { - sum = a + a9_0.a; - } - } - - class Cycle_B_2_00230_A9 { - Cycle_B_2_00230_A7 a7_0; - int a; - int sum; - - Cycle_B_2_00230_A9() { - a7_0 = null; - a = 8; - sum = 0; - } - - void add() { - sum = a + a7_0.a; - } - } - - class Cycle_B_2_00230_A7 { - Cycle_B_2_00230_A4 a4_0; - int a; - int sum; - - Cycle_B_2_00230_A7() { - a4_0 = null; - a = 9; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - class Cycle_B_2_00230_A10 { - Cycle_B_2_00230_A8 a8_0; - int a; - int sum; - - Cycle_B_2_00230_A10() { - a8_0 = null; - a = 10; - sum = 0; - } - - void add() { - sum = a + a8_0.a; - } - } -} - -public class Cycle_Bm_2_00240 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_00010B A1_00010 = new ThreadRc_Cycle_Bm_2_00010B(); - ThreadRc_Cycle_Bm_2_00010B A2_00010 = new ThreadRc_Cycle_Bm_2_00010B(); - ThreadRc_Cycle_Bm_2_00020B A1_00020 = new ThreadRc_Cycle_Bm_2_00020B(); - ThreadRc_Cycle_Bm_2_00020B A2_00020 = new ThreadRc_Cycle_Bm_2_00020B(); - ThreadRc_Cycle_Bm_2_00030B A1_00030 = new ThreadRc_Cycle_Bm_2_00030B(); - ThreadRc_Cycle_Bm_2_00030B A2_00030 = new ThreadRc_Cycle_Bm_2_00030B(); - ThreadRc_Cycle_Bm_2_00040B A1_00040 = new ThreadRc_Cycle_Bm_2_00040B(); - ThreadRc_Cycle_Bm_2_00040B A2_00040 = new ThreadRc_Cycle_Bm_2_00040B(); - ThreadRc_Cycle_Bm_2_00050B A1_00050 = new ThreadRc_Cycle_Bm_2_00050B(); - ThreadRc_Cycle_Bm_2_00050B A2_00050 = new ThreadRc_Cycle_Bm_2_00050B(); - ThreadRc_Cycle_Bm_2_00060B A1_00060 = new ThreadRc_Cycle_Bm_2_00060B(); - ThreadRc_Cycle_Bm_2_00060B A2_00060 = new ThreadRc_Cycle_Bm_2_00060B(); - ThreadRc_Cycle_Bm_2_00070B A1_00070 = new ThreadRc_Cycle_Bm_2_00070B(); - ThreadRc_Cycle_Bm_2_00070B A2_00070 = new ThreadRc_Cycle_Bm_2_00070B(); - ThreadRc_Cycle_Bm_2_00080B A1_00080 = new ThreadRc_Cycle_Bm_2_00080B(); - ThreadRc_Cycle_Bm_2_00080B A2_00080 = new ThreadRc_Cycle_Bm_2_00080B(); - ThreadRc_Cycle_Bm_2_00090B A1_00090 = new ThreadRc_Cycle_Bm_2_00090B(); - ThreadRc_Cycle_Bm_2_00090B A2_00090 = new ThreadRc_Cycle_Bm_2_00090B(); - ThreadRc_Cycle_Bm_2_00100B A1_00100 = new ThreadRc_Cycle_Bm_2_00100B(); - ThreadRc_Cycle_Bm_2_00100B A2_00100 = new ThreadRc_Cycle_Bm_2_00100B(); - ThreadRc_Cycle_Bm_2_00110B A1_00110 = new ThreadRc_Cycle_Bm_2_00110B(); - ThreadRc_Cycle_Bm_2_00110B A2_00110 = new ThreadRc_Cycle_Bm_2_00110B(); - ThreadRc_Cycle_Bm_2_00120B A1_00120 = new ThreadRc_Cycle_Bm_2_00120B(); - ThreadRc_Cycle_Bm_2_00120B A2_00120 = new ThreadRc_Cycle_Bm_2_00120B(); - ThreadRc_Cycle_Bm_2_00130B A1_00130 = new ThreadRc_Cycle_Bm_2_00130B(); - ThreadRc_Cycle_Bm_2_00130B A2_00130 = new ThreadRc_Cycle_Bm_2_00130B(); - ThreadRc_Cycle_Bm_2_00140B A1_00140 = new ThreadRc_Cycle_Bm_2_00140B(); - ThreadRc_Cycle_Bm_2_00140B A2_00140 = new ThreadRc_Cycle_Bm_2_00140B(); - ThreadRc_Cycle_Bm_2_00150B A1_00150 = new ThreadRc_Cycle_Bm_2_00150B(); - ThreadRc_Cycle_Bm_2_00150B A2_00150 = new ThreadRc_Cycle_Bm_2_00150B(); - ThreadRc_Cycle_Bm_2_00160B A1_00160 = new ThreadRc_Cycle_Bm_2_00160B(); - ThreadRc_Cycle_Bm_2_00160B A2_00160 = new ThreadRc_Cycle_Bm_2_00160B(); - ThreadRc_Cycle_Bm_2_00170B A1_00170 = new ThreadRc_Cycle_Bm_2_00170B(); - ThreadRc_Cycle_Bm_2_00170B A2_00170 = new ThreadRc_Cycle_Bm_2_00170B(); - ThreadRc_Cycle_Bm_2_00180B A1_00180 = new ThreadRc_Cycle_Bm_2_00180B(); - ThreadRc_Cycle_Bm_2_00180B A2_00180 = new ThreadRc_Cycle_Bm_2_00180B(); - ThreadRc_Cycle_Bm_2_00190B A1_00190 = new ThreadRc_Cycle_Bm_2_00190B(); - ThreadRc_Cycle_Bm_2_00190B A2_00190 = new ThreadRc_Cycle_Bm_2_00190B(); - ThreadRc_Cycle_Bm_2_00200B A1_00200 = new ThreadRc_Cycle_Bm_2_00200B(); - ThreadRc_Cycle_Bm_2_00200B A2_00200 = new ThreadRc_Cycle_Bm_2_00200B(); - ThreadRc_Cycle_Bm_2_00210B A1_00210 = new ThreadRc_Cycle_Bm_2_00210B(); - ThreadRc_Cycle_Bm_2_00210B A2_00210 = new ThreadRc_Cycle_Bm_2_00210B(); - ThreadRc_Cycle_Bm_2_00220B A1_00220 = new ThreadRc_Cycle_Bm_2_00220B(); - ThreadRc_Cycle_Bm_2_00220B A2_00220 = new ThreadRc_Cycle_Bm_2_00220B(); - ThreadRc_Cycle_Bm_2_00230B A1_00230 = new ThreadRc_Cycle_Bm_2_00230B(); - ThreadRc_Cycle_Bm_2_00230B A2_00230 = new ThreadRc_Cycle_Bm_2_00230B(); - A1_00010.start(); - A2_00010.start(); - A1_00020.start(); - A2_00020.start(); - A1_00030.start(); - A2_00030.start(); - A1_00040.start(); - A2_00040.start(); - A1_00050.start(); - A2_00050.start(); - A1_00060.start(); - A2_00060.start(); - A1_00070.start(); - A2_00070.start(); - A1_00080.start(); - A2_00080.start(); - A1_00090.start(); - A2_00090.start(); - A1_00100.start(); - A2_00100.start(); - A1_00110.start(); - A2_00110.start(); - A1_00120.start(); - A2_00120.start(); - A1_00130.start(); - A2_00130.start(); - A1_00140.start(); - A2_00140.start(); - A1_00150.start(); - A2_00150.start(); - A1_00160.start(); - A2_00160.start(); - A1_00170.start(); - A2_00170.start(); - A1_00180.start(); - A2_00180.start(); - A1_00190.start(); - A2_00190.start(); - A1_00200.start(); - A2_00200.start(); - A1_00210.start(); - A2_00210.start(); - A1_00220.start(); - A2_00220.start(); - A1_00230.start(); - A2_00230.start(); - try { - A1_00010.join(); - A2_00010.join(); - A1_00020.join(); - A2_00020.join(); - A1_00030.join(); - A2_00030.join(); - A1_00040.join(); - A2_00040.join(); - A1_00050.join(); - A2_00050.join(); - A1_00060.join(); - A2_00060.join(); - A1_00070.join(); - A2_00070.join(); - A1_00080.join(); - A2_00080.join(); - A1_00090.join(); - A2_00090.join(); - A1_00100.join(); - A2_00100.join(); - A1_00110.join(); - A2_00110.join(); - A1_00120.join(); - A2_00120.join(); - A1_00130.join(); - A2_00130.join(); - A1_00140.join(); - A2_00140.join(); - A1_00150.join(); - A2_00150.join(); - A1_00160.join(); - A2_00160.join(); - A1_00170.join(); - A2_00170.join(); - A1_00180.join(); - A2_00180.join(); - A1_00190.join(); - A2_00190.join(); - A1_00200.join(); - A2_00200.join(); - A1_00210.join(); - A2_00210.join(); - A1_00220.join(); - A2_00220.join(); - A1_00230.join(); - A2_00230.join(); - - } catch (InterruptedException e) { - } - if (A1_00010.check() && A2_00010.check() && A1_00020.check() && A2_00020.check() && A1_00030.check() && A2_00030.check() && A1_00040.check() && A2_00040.check() && A1_00050.check() && A2_00050.check() && A1_00060.check() && A2_00060.check() && A1_00070.check() && A2_00070.check() && A1_00080.check() && A2_00080.check() && A1_00090.check() && A2_00090.check() && A1_00100.check() && A2_00100.check() && A1_00110.check() && A2_00110.check() && A1_00120.check() && A2_00120.check() && A1_00130.check() && A2_00130.check() && A1_00140.check() && A2_00140.check() && A1_00150.check() && A2_00150.check() && A1_00160.check() && A2_00160.check() && A1_00170.check() && A2_00170.check() && A1_00180.check() && A2_00180.check() && A1_00190.check() && A2_00190.check() && A1_00200.check() && A2_00200.check() && A1_00210.check() && A2_00210.check() && A1_00220.check() && A2_00220.check() && A1_00230.check() && A2_00230.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_00240.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Make Cycle_B_2_00240 together to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_00240.java + *- @ExecuteClass: Cycle_Bm_2_00240 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_00010B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00010_A1 a1_0 = new Cycle_B_2_00010_A1(); + a1_0.a2_0 = new Cycle_B_2_00010_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00010_A3(); + a1_0.a2_0.a4_0 = new Cycle_B_2_00010_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a4_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 18) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00010_A1 { + Cycle_B_2_00010_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00010_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00010_A2 { + Cycle_B_2_00010_A3 a3_0; + Cycle_B_2_00010_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00010_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00010_A3 { + Cycle_B_2_00010_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00010_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00010_A4 { + Cycle_B_2_00010_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00010_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00020B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00020_A1 a1_0 = new Cycle_B_2_00020_A1(); + a1_0.a2_0 = new Cycle_B_2_00020_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00020_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00020_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 19) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00020_A1 { + Cycle_B_2_00020_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00020_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00020_A2 { + Cycle_B_2_00020_A3 a3_0; + Cycle_B_2_00020_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00020_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00020_A3 { + Cycle_B_2_00020_A1 a1_0; + Cycle_B_2_00020_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00020_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00020_A4 { + Cycle_B_2_00020_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00020_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00030B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00030_A1 a1_0 = new Cycle_B_2_00030_A1(); + a1_0.a2_0 = new Cycle_B_2_00030_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00030_A3(); + Cycle_B_2_00030_A4 a4_0 = new Cycle_B_2_00030_A4(); + a4_0.a1_0 = a1_0; + a1_0.a4_0 = a4_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 16) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00030_A1 { + Cycle_B_2_00030_A2 a2_0; + Cycle_B_2_00030_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00030_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00030_A2 { + Cycle_B_2_00030_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00030_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00030_A3 { + Cycle_B_2_00030_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00030_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00030_A4 { + Cycle_B_2_00030_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00030_A4() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00040B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00040_A1 a1_0 = new Cycle_B_2_00040_A1(); + a1_0.a2_0 = new Cycle_B_2_00040_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00040_A3(); + Cycle_B_2_00040_A4 a4_0 = new Cycle_B_2_00040_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a4_0 = a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 19) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00040_A1 { + Cycle_B_2_00040_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00040_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00040_A2 { + Cycle_B_2_00040_A3 a3_0; + Cycle_B_2_00040_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00040_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00040_A3 { + Cycle_B_2_00040_A1 a1_0; + Cycle_B_2_00040_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00040_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00040_A4 { + Cycle_B_2_00040_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00040_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00050B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00050_A1 a1_0 = new Cycle_B_2_00050_A1(); + a1_0.a2_0 = new Cycle_B_2_00050_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00050_A3(); + Cycle_B_2_00050_A4 a4_0 = new Cycle_B_2_00050_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a4_0.a3_0.a5_0 = new Cycle_B_2_00050_A5(); + a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a4_0.a3_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00050_A1 { + Cycle_B_2_00050_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00050_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00050_A2 { + Cycle_B_2_00050_A3 a3_0; + Cycle_B_2_00050_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00050_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00050_A3 { + Cycle_B_2_00050_A1 a1_0; + Cycle_B_2_00050_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00050_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00050_A4 { + Cycle_B_2_00050_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00050_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00050_A5 { + Cycle_B_2_00050_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00050_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00060B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00060_A1 a1_0 = new Cycle_B_2_00060_A1(); + a1_0.a2_0 = new Cycle_B_2_00060_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00060_A3(); + Cycle_B_2_00060_A4 a4_0 = new Cycle_B_2_00060_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a4_0.a3_0.a5_0 = new Cycle_B_2_00060_A5(); + a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.a5_0 = a4_0.a3_0.a5_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a4_0.a3_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00060_A1 { + Cycle_B_2_00060_A2 a2_0; + Cycle_B_2_00060_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00060_A1() { + a2_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00060_A2 { + Cycle_B_2_00060_A3 a3_0; + Cycle_B_2_00060_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00060_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00060_A3 { + Cycle_B_2_00060_A1 a1_0; + Cycle_B_2_00060_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00060_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00060_A4 { + Cycle_B_2_00060_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00060_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00060_A5 { + Cycle_B_2_00060_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00060_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00070B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00070_A1 a1_0 = new Cycle_B_2_00070_A1(); + a1_0.a2_0 = new Cycle_B_2_00070_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00070_A3(); + Cycle_B_2_00070_A4 a4_0 = new Cycle_B_2_00070_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a4_0.a3_0.a5_0 = new Cycle_B_2_00070_A5(); + Cycle_B_2_00070_A6 a6_0 = new Cycle_B_2_00070_A6(); + a6_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a6_0.add(); + a4_0.a3_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum + a6_0.sum); + //System.out.println(nsum); + + if (nsum == 37) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00070_A1 { + Cycle_B_2_00070_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00070_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00070_A2 { + Cycle_B_2_00070_A3 a3_0; + Cycle_B_2_00070_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00070_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00070_A3 { + Cycle_B_2_00070_A1 a1_0; + Cycle_B_2_00070_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00070_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00070_A4 { + Cycle_B_2_00070_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00070_A4() { + a3_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00070_A5 { + Cycle_B_2_00070_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00070_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00070_A6 { + Cycle_B_2_00070_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00070_A6() { + a3_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00080B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00080_A1 a1_0 = new Cycle_B_2_00080_A1(); + a1_0.a2_0 = new Cycle_B_2_00080_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00080_A3(); + Cycle_B_2_00080_A4 a4_0 = new Cycle_B_2_00080_A4(); + a4_0.a2_0 = a1_0.a2_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a4_0.a3_0 = a1_0.a2_0.a3_0; + a4_0.a3_0.a5_0 = new Cycle_B_2_00080_A5(); + a1_0.a2_0.a3_0.a5_0 = a4_0.a3_0.a5_0; + a4_0.a3_0.a5_0.a4_0 = a4_0; + a1_0.a5_0 = a4_0.a3_0.a5_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a4_0.add(); + a4_0.a3_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum + a4_0.a3_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00080_A1 { + Cycle_B_2_00080_A2 a2_0; + Cycle_B_2_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00080_A1() { + a2_0 = null; + a5_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00080_A2 { + Cycle_B_2_00080_A3 a3_0; + Cycle_B_2_00080_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00080_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00080_A3 { + Cycle_B_2_00080_A1 a1_0; + Cycle_B_2_00080_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00080_A3() { + a1_0 = null; + a5_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00080_A4 { + Cycle_B_2_00080_A3 a3_0; + Cycle_B_2_00080_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00080_A4() { + a3_0 = null; + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00080_A5 { + Cycle_B_2_00080_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00080_A5() { + a4_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00090B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00090_A1 a1_0 = new Cycle_B_2_00090_A1(); + Cycle_B_2_00090_A3 a3_0 = new Cycle_B_2_00090_A3(); + a1_0.a2_0 = new Cycle_B_2_00090_A2(); + a1_0.a2_0.a1_0 = a1_0; + a3_0.a2_0 = a1_0.a2_0; + a3_0.a2_0.a3_0 = a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a3_0.sum); + //System.out.println(nsum); + + if (nsum == 9) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00090_A1 { + Cycle_B_2_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00090_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00090_A2 { + Cycle_B_2_00090_A1 a1_0; + Cycle_B_2_00090_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00090_A2() { + a1_0 = null; + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00090_A3 { + Cycle_B_2_00090_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00090_A3() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00100B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00100_A1 a1_0 = new Cycle_B_2_00100_A1(); + a1_0.a2_0 = new Cycle_B_2_00100_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00100_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00100_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00100_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 29) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00100_A1 { + Cycle_B_2_00100_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00100_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00100_A2 { + Cycle_B_2_00100_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00100_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00100_A3 { + Cycle_B_2_00100_A1 a1_0; + Cycle_B_2_00100_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00100_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00100_A4 { + Cycle_B_2_00100_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00100_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00100_A5 { + Cycle_B_2_00100_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00100_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00110B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00110_A1 a1_0 = new Cycle_B_2_00110_A1(); + a1_0.a2_0 = new Cycle_B_2_00110_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00110_A3(); + a1_0.a2_0.a4_0 = new Cycle_B_2_00110_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a4_0.a5_0 = new Cycle_B_2_00110_A5(); + a1_0.a2_0.a4_0.a5_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + a1_0.a2_0.a4_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum + a1_0.a2_0.a4_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 28) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00110_A1 { + Cycle_B_2_00110_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00110_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00110_A2 { + Cycle_B_2_00110_A3 a3_0; + Cycle_B_2_00110_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00110_A2() { + a3_0 = null; + a4_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00110_A3 { + Cycle_B_2_00110_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00110_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00110_A4 { + Cycle_B_2_00110_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00110_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00110_A5 { + Cycle_B_2_00110_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00110_A5() { + a2_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00120B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00120_A1 a1_0 = new Cycle_B_2_00120_A1(); + a1_0.a2_0 = new Cycle_B_2_00120_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00120_A3(); + a1_0.a4_0 = new Cycle_B_2_00120_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a4_0.a5_0 = new Cycle_B_2_00120_A5(); + a1_0.a4_0.a5_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a4_0.add(); + a1_0.a4_0.a5_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a4_0.sum + a1_0.a4_0.a5_0.sum); + //System.out.println(nsum); + + if (nsum == 27) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00120_A1 { + Cycle_B_2_00120_A2 a2_0; + Cycle_B_2_00120_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00120_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00120_A2 { + Cycle_B_2_00120_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00120_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00120_A3 { + Cycle_B_2_00120_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00120_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00120_A4 { + Cycle_B_2_00120_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00120_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00120_A5 { + Cycle_B_2_00120_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00120_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00130B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00130_A1 a1_0 = new Cycle_B_2_00130_A1(); + a1_0.a2_0 = new Cycle_B_2_00130_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00130_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00130_A4(); + a1_0.a2_0.a3_0.a4_0.a1_0 = a1_0; + Cycle_B_2_00130_A5 a5_0 = new Cycle_B_2_00130_A5(); + a1_0.a2_0.a3_0.a4_0.a6_0 = new Cycle_B_2_00130_A6(); + a1_0.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_0; + a5_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a6_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a5_0.sum + a1_0.a2_0.a3_0.a4_0.a6_0.sum); + //System.out.println(nsum); + + if (nsum == 45) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00130_A1 { + Cycle_B_2_00130_A2 a2_0; + Cycle_B_2_00130_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00130_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00130_A2 { + Cycle_B_2_00130_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00130_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00130_A3 { + Cycle_B_2_00130_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00130_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00130_A4 { + Cycle_B_2_00130_A1 a1_0; + Cycle_B_2_00130_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00130_A4() { + a1_0 = null; + a6_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + class Cycle_B_2_00130_A5 { + Cycle_B_2_00130_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00130_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00130_A6 { + Cycle_B_2_00130_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00130_A6() { + a5_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00140B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00140_A1 a1_0 = new Cycle_B_2_00140_A1(); + a1_0.a2_0 = new Cycle_B_2_00140_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00140_A3(); + a1_0.a2_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 13) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00140_A1 { + Cycle_B_2_00140_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00140_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00140_A2 { + Cycle_B_2_00140_A3 a3_0; + Cycle_B_2_00140_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00140_A2() { + a3_0 = null; + a1_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a + a1_0.a; + } + } + + class Cycle_B_2_00140_A3 { + Cycle_B_2_00140_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00140_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00150B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00150_A1 a1_0 = new Cycle_B_2_00150_A1(); + a1_0.a2_0 = new Cycle_B_2_00150_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00150_A3(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 14) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00150_A1 { + Cycle_B_2_00150_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00150_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00150_A2 { + Cycle_B_2_00150_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00150_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00150_A3 { + Cycle_B_2_00150_A1 a1_0; + Cycle_B_2_00150_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00150_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00160B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00160_A1 a1_0 = new Cycle_B_2_00160_A1(); + a1_0.a2_0 = new Cycle_B_2_00160_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00160_A3(); + a1_0.a3_0 = a1_0.a2_0.a3_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum); + //System.out.println(nsum); + + if (nsum == 15) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00160_A1 { + Cycle_B_2_00160_A2 a2_0; + Cycle_B_2_00160_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00160_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + } + + class Cycle_B_2_00160_A2 { + Cycle_B_2_00160_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00160_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00160_A3 { + Cycle_B_2_00160_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00160_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + + +class ThreadRc_Cycle_Bm_2_00170B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00170_A1 a1_0 = new Cycle_B_2_00170_A1(); + a1_0.a2_0 = new Cycle_B_2_00170_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00170_A3(); + a1_0.a2_0.a4_0 = new Cycle_B_2_00170_A4(); + a1_0.a2_0.a4_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a4_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 21) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00170_A1 { + Cycle_B_2_00170_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00170_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00170_A2 { + Cycle_B_2_00170_A3 a3_0; + Cycle_B_2_00170_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00170_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a + a4_0.a; + } + } + + class Cycle_B_2_00170_A3 { + Cycle_B_2_00170_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00170_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00170_A4 { + Cycle_B_2_00170_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00170_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00180B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00180_A1 a1_0 = new Cycle_B_2_00180_A1(); + a1_0.a2_0 = new Cycle_B_2_00180_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00180_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00180_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a1_0 = a1_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 15) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00180_A1 { + Cycle_B_2_00180_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00180_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00180_A2 { + Cycle_B_2_00180_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00180_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00180_A3 { + Cycle_B_2_00180_A1 a1_0; + Cycle_B_2_00180_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00180_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a4_0.a; + } + } + + class Cycle_B_2_00180_A4 { + Cycle_B_2_00180_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00180_A4() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00190B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00190_A1 a1_0 = new Cycle_B_2_00190_A1(); + a1_0.a2_0 = new Cycle_B_2_00190_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00190_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00190_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum); + //System.out.println(nsum); + + if (nsum == 15) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00190_A1 { + Cycle_B_2_00190_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00190_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00190_A2 { + Cycle_B_2_00190_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00190_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00190_A3 { + Cycle_B_2_00190_A1 a1_0; + Cycle_B_2_00190_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00190_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00190_A4 { + Cycle_B_2_00190_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00190_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +class ThreadRc_Cycle_Bm_2_00200B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00200_A1 a1_0 = new Cycle_B_2_00200_A1(); + a1_0.a2_0 = new Cycle_B_2_00200_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00200_A3(); + Cycle_B_2_00200_A4 a4_0 = new Cycle_B_2_00200_A4(); + a1_0.a2_0.a3_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0 = a4_0; + a4_0.a2_0 = a1_0.a2_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a4_0.sum); + //System.out.println(nsum); + + if (nsum == 16) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00200_A1 { + Cycle_B_2_00200_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00200_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00200_A2 { + Cycle_B_2_00200_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00200_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00200_A3 { + Cycle_B_2_00200_A1 a1_0; + Cycle_B_2_00200_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00200_A3() { + a1_0 = null; + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a + a1_0.a; + } + } + + class Cycle_B_2_00200_A4 { + Cycle_B_2_00200_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00200_A4() { + a2_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } +} + + +class ThreadRc_Cycle_Bm_2_00210B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00210_A1 a1_0 = new Cycle_B_2_00210_A1(); + a1_0.a2_0 = new Cycle_B_2_00210_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00210_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00210_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00210_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00210_A6(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0 = new Cycle_B_2_00210_A8(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0 = new Cycle_B_2_00210_A9(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00210_A7(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a8_0.a9_0.a7_0.sum); + //System.out.println(nsum); + + if (nsum == 94) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00210_A1 { + Cycle_B_2_00210_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00210_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00210_A2 { + Cycle_B_2_00210_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00210_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00210_A3 { + Cycle_B_2_00210_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00210_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00210_A4 { + Cycle_B_2_00210_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00210_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00210_A5 { + Cycle_B_2_00210_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00210_A5() { + a6_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_B_2_00210_A6 { + Cycle_B_2_00210_A1 a1_0; + Cycle_B_2_00210_A8 a8_0; + int a; + int sum; + + Cycle_B_2_00210_A6() { + a1_0 = null; + a8_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a8_0.a; + } + } + + class Cycle_B_2_00210_A8 { + Cycle_B_2_00210_A9 a9_0; + int a; + int sum; + + Cycle_B_2_00210_A8() { + a9_0 = null; + a = 7; + sum = 0; + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_B_2_00210_A9 { + Cycle_B_2_00210_A7 a7_0; + int a; + int sum; + + Cycle_B_2_00210_A9() { + a7_0 = null; + a = 8; + sum = 0; + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_B_2_00210_A7 { + Cycle_B_2_00210_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00210_A7() { + a4_0 = null; + a = 9; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00220B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00220_A1 a1_0 = new Cycle_B_2_00220_A1(); + a1_0.a2_0 = new Cycle_B_2_00220_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00220_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00220_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00220_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00220_A6(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; + a1_0.a8_0 = new Cycle_B_2_00220_A8(); + a1_0.a8_0.a9_0 = new Cycle_B_2_00220_A9(); + a1_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00220_A7(); + a1_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a1_0.a8_0.add(); + a1_0.a8_0.a9_0.add(); + a1_0.a8_0.a9_0.a7_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a1_0.a8_0.sum + a1_0.a8_0.a9_0.sum + a1_0.a8_0.a9_0.a7_0.sum); + //System.out.println(nsum); + + if (nsum == 94) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00220_A1 { + Cycle_B_2_00220_A2 a2_0; + Cycle_B_2_00220_A8 a8_0; + int a; + int sum; + + Cycle_B_2_00220_A1() { + a2_0 = null; + a8_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a + a8_0.a; + } + } + + class Cycle_B_2_00220_A2 { + Cycle_B_2_00220_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00220_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00220_A3 { + Cycle_B_2_00220_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00220_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00220_A4 { + Cycle_B_2_00220_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00220_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00220_A5 { + Cycle_B_2_00220_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00220_A5() { + a6_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_B_2_00220_A6 { + Cycle_B_2_00220_A1 a1_0; + int a; + int sum; + + Cycle_B_2_00220_A6() { + a1_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00220_A8 { + Cycle_B_2_00220_A9 a9_0; + int a; + int sum; + + Cycle_B_2_00220_A8() { + a9_0 = null; + a = 7; + sum = 0; + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_B_2_00220_A9 { + Cycle_B_2_00220_A7 a7_0; + int a; + int sum; + + Cycle_B_2_00220_A9() { + a7_0 = null; + a = 8; + sum = 0; + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_B_2_00220_A7 { + Cycle_B_2_00220_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00220_A7() { + a4_0 = null; + a = 9; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } +} + +class ThreadRc_Cycle_Bm_2_00230B extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00230_A1 a1_0 = new Cycle_B_2_00230_A1(); + a1_0.a2_0 = new Cycle_B_2_00230_A2(); + a1_0.a2_0.a3_0 = new Cycle_B_2_00230_A3(); + a1_0.a2_0.a3_0.a4_0 = new Cycle_B_2_00230_A4(); + a1_0.a2_0.a3_0.a4_0.a5_0 = new Cycle_B_2_00230_A5(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0 = new Cycle_B_2_00230_A6(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a1_0 = a1_0; + + Cycle_B_2_00230_A10 a10_0 = new Cycle_B_2_00230_A10(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.a10_0 = a10_0; + a10_0.a8_0 = new Cycle_B_2_00230_A8(); + a10_0.a8_0.a9_0 = new Cycle_B_2_00230_A9(); + a10_0.a8_0.a9_0.a7_0 = new Cycle_B_2_00230_A7(); + a10_0.a8_0.a9_0.a7_0.a4_0 = a1_0.a2_0.a3_0.a4_0; + a1_0.add(); + a1_0.a2_0.add(); + a1_0.a2_0.a3_0.add(); + a1_0.a2_0.a3_0.a4_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.add(); + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.add(); + a10_0.a8_0.add(); + a10_0.a8_0.a9_0.add(); + a10_0.a8_0.a9_0.a7_0.add(); + int nsum = (a1_0.sum + a1_0.a2_0.sum + a1_0.a2_0.a3_0.sum + a1_0.a2_0.a3_0.a4_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.sum + a1_0.a2_0.a3_0.a4_0.a5_0.a6_0.sum + a10_0.a8_0.sum + a10_0.a8_0.a9_0.sum + a10_0.a8_0.a9_0.a7_0.sum); + + //System.out.println(nsum); + + if (nsum == 97) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00230_A1 { + Cycle_B_2_00230_A2 a2_0; + int a; + int sum; + + Cycle_B_2_00230_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00230_A2 { + Cycle_B_2_00230_A3 a3_0; + int a; + int sum; + + Cycle_B_2_00230_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + class Cycle_B_2_00230_A3 { + Cycle_B_2_00230_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00230_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00230_A4 { + Cycle_B_2_00230_A5 a5_0; + int a; + int sum; + + Cycle_B_2_00230_A4() { + a5_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + + class Cycle_B_2_00230_A5 { + Cycle_B_2_00230_A6 a6_0; + int a; + int sum; + + Cycle_B_2_00230_A5() { + a6_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a6_0.a; + } + } + + class Cycle_B_2_00230_A6 { + Cycle_B_2_00230_A1 a1_0; + Cycle_B_2_00230_A10 a10_0; + int a; + int sum; + + Cycle_B_2_00230_A6() { + a1_0 = null; + a10_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a10_0.a; + } + } + + class Cycle_B_2_00230_A8 { + Cycle_B_2_00230_A9 a9_0; + int a; + int sum; + + Cycle_B_2_00230_A8() { + a9_0 = null; + a = 7; + sum = 0; + } + + void add() { + sum = a + a9_0.a; + } + } + + class Cycle_B_2_00230_A9 { + Cycle_B_2_00230_A7 a7_0; + int a; + int sum; + + Cycle_B_2_00230_A9() { + a7_0 = null; + a = 8; + sum = 0; + } + + void add() { + sum = a + a7_0.a; + } + } + + class Cycle_B_2_00230_A7 { + Cycle_B_2_00230_A4 a4_0; + int a; + int sum; + + Cycle_B_2_00230_A7() { + a4_0 = null; + a = 9; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + class Cycle_B_2_00230_A10 { + Cycle_B_2_00230_A8 a8_0; + int a; + int sum; + + Cycle_B_2_00230_A10() { + a8_0 = null; + a = 10; + sum = 0; + } + + void add() { + sum = a + a8_0.a; + } + } +} + +public class Cycle_Bm_2_00240 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_00010B A1_00010 = new ThreadRc_Cycle_Bm_2_00010B(); + ThreadRc_Cycle_Bm_2_00010B A2_00010 = new ThreadRc_Cycle_Bm_2_00010B(); + ThreadRc_Cycle_Bm_2_00020B A1_00020 = new ThreadRc_Cycle_Bm_2_00020B(); + ThreadRc_Cycle_Bm_2_00020B A2_00020 = new ThreadRc_Cycle_Bm_2_00020B(); + ThreadRc_Cycle_Bm_2_00030B A1_00030 = new ThreadRc_Cycle_Bm_2_00030B(); + ThreadRc_Cycle_Bm_2_00030B A2_00030 = new ThreadRc_Cycle_Bm_2_00030B(); + ThreadRc_Cycle_Bm_2_00040B A1_00040 = new ThreadRc_Cycle_Bm_2_00040B(); + ThreadRc_Cycle_Bm_2_00040B A2_00040 = new ThreadRc_Cycle_Bm_2_00040B(); + ThreadRc_Cycle_Bm_2_00050B A1_00050 = new ThreadRc_Cycle_Bm_2_00050B(); + ThreadRc_Cycle_Bm_2_00050B A2_00050 = new ThreadRc_Cycle_Bm_2_00050B(); + ThreadRc_Cycle_Bm_2_00060B A1_00060 = new ThreadRc_Cycle_Bm_2_00060B(); + ThreadRc_Cycle_Bm_2_00060B A2_00060 = new ThreadRc_Cycle_Bm_2_00060B(); + ThreadRc_Cycle_Bm_2_00070B A1_00070 = new ThreadRc_Cycle_Bm_2_00070B(); + ThreadRc_Cycle_Bm_2_00070B A2_00070 = new ThreadRc_Cycle_Bm_2_00070B(); + ThreadRc_Cycle_Bm_2_00080B A1_00080 = new ThreadRc_Cycle_Bm_2_00080B(); + ThreadRc_Cycle_Bm_2_00080B A2_00080 = new ThreadRc_Cycle_Bm_2_00080B(); + ThreadRc_Cycle_Bm_2_00090B A1_00090 = new ThreadRc_Cycle_Bm_2_00090B(); + ThreadRc_Cycle_Bm_2_00090B A2_00090 = new ThreadRc_Cycle_Bm_2_00090B(); + ThreadRc_Cycle_Bm_2_00100B A1_00100 = new ThreadRc_Cycle_Bm_2_00100B(); + ThreadRc_Cycle_Bm_2_00100B A2_00100 = new ThreadRc_Cycle_Bm_2_00100B(); + ThreadRc_Cycle_Bm_2_00110B A1_00110 = new ThreadRc_Cycle_Bm_2_00110B(); + ThreadRc_Cycle_Bm_2_00110B A2_00110 = new ThreadRc_Cycle_Bm_2_00110B(); + ThreadRc_Cycle_Bm_2_00120B A1_00120 = new ThreadRc_Cycle_Bm_2_00120B(); + ThreadRc_Cycle_Bm_2_00120B A2_00120 = new ThreadRc_Cycle_Bm_2_00120B(); + ThreadRc_Cycle_Bm_2_00130B A1_00130 = new ThreadRc_Cycle_Bm_2_00130B(); + ThreadRc_Cycle_Bm_2_00130B A2_00130 = new ThreadRc_Cycle_Bm_2_00130B(); + ThreadRc_Cycle_Bm_2_00140B A1_00140 = new ThreadRc_Cycle_Bm_2_00140B(); + ThreadRc_Cycle_Bm_2_00140B A2_00140 = new ThreadRc_Cycle_Bm_2_00140B(); + ThreadRc_Cycle_Bm_2_00150B A1_00150 = new ThreadRc_Cycle_Bm_2_00150B(); + ThreadRc_Cycle_Bm_2_00150B A2_00150 = new ThreadRc_Cycle_Bm_2_00150B(); + ThreadRc_Cycle_Bm_2_00160B A1_00160 = new ThreadRc_Cycle_Bm_2_00160B(); + ThreadRc_Cycle_Bm_2_00160B A2_00160 = new ThreadRc_Cycle_Bm_2_00160B(); + ThreadRc_Cycle_Bm_2_00170B A1_00170 = new ThreadRc_Cycle_Bm_2_00170B(); + ThreadRc_Cycle_Bm_2_00170B A2_00170 = new ThreadRc_Cycle_Bm_2_00170B(); + ThreadRc_Cycle_Bm_2_00180B A1_00180 = new ThreadRc_Cycle_Bm_2_00180B(); + ThreadRc_Cycle_Bm_2_00180B A2_00180 = new ThreadRc_Cycle_Bm_2_00180B(); + ThreadRc_Cycle_Bm_2_00190B A1_00190 = new ThreadRc_Cycle_Bm_2_00190B(); + ThreadRc_Cycle_Bm_2_00190B A2_00190 = new ThreadRc_Cycle_Bm_2_00190B(); + ThreadRc_Cycle_Bm_2_00200B A1_00200 = new ThreadRc_Cycle_Bm_2_00200B(); + ThreadRc_Cycle_Bm_2_00200B A2_00200 = new ThreadRc_Cycle_Bm_2_00200B(); + ThreadRc_Cycle_Bm_2_00210B A1_00210 = new ThreadRc_Cycle_Bm_2_00210B(); + ThreadRc_Cycle_Bm_2_00210B A2_00210 = new ThreadRc_Cycle_Bm_2_00210B(); + ThreadRc_Cycle_Bm_2_00220B A1_00220 = new ThreadRc_Cycle_Bm_2_00220B(); + ThreadRc_Cycle_Bm_2_00220B A2_00220 = new ThreadRc_Cycle_Bm_2_00220B(); + ThreadRc_Cycle_Bm_2_00230B A1_00230 = new ThreadRc_Cycle_Bm_2_00230B(); + ThreadRc_Cycle_Bm_2_00230B A2_00230 = new ThreadRc_Cycle_Bm_2_00230B(); + A1_00010.start(); + A2_00010.start(); + A1_00020.start(); + A2_00020.start(); + A1_00030.start(); + A2_00030.start(); + A1_00040.start(); + A2_00040.start(); + A1_00050.start(); + A2_00050.start(); + A1_00060.start(); + A2_00060.start(); + A1_00070.start(); + A2_00070.start(); + A1_00080.start(); + A2_00080.start(); + A1_00090.start(); + A2_00090.start(); + A1_00100.start(); + A2_00100.start(); + A1_00110.start(); + A2_00110.start(); + A1_00120.start(); + A2_00120.start(); + A1_00130.start(); + A2_00130.start(); + A1_00140.start(); + A2_00140.start(); + A1_00150.start(); + A2_00150.start(); + A1_00160.start(); + A2_00160.start(); + A1_00170.start(); + A2_00170.start(); + A1_00180.start(); + A2_00180.start(); + A1_00190.start(); + A2_00190.start(); + A1_00200.start(); + A2_00200.start(); + A1_00210.start(); + A2_00210.start(); + A1_00220.start(); + A2_00220.start(); + A1_00230.start(); + A2_00230.start(); + try { + A1_00010.join(); + A2_00010.join(); + A1_00020.join(); + A2_00020.join(); + A1_00030.join(); + A2_00030.join(); + A1_00040.join(); + A2_00040.join(); + A1_00050.join(); + A2_00050.join(); + A1_00060.join(); + A2_00060.join(); + A1_00070.join(); + A2_00070.join(); + A1_00080.join(); + A2_00080.join(); + A1_00090.join(); + A2_00090.join(); + A1_00100.join(); + A2_00100.join(); + A1_00110.join(); + A2_00110.join(); + A1_00120.join(); + A2_00120.join(); + A1_00130.join(); + A2_00130.join(); + A1_00140.join(); + A2_00140.join(); + A1_00150.join(); + A2_00150.join(); + A1_00160.join(); + A2_00160.join(); + A1_00170.join(); + A2_00170.join(); + A1_00180.join(); + A2_00180.join(); + A1_00190.join(); + A2_00190.join(); + A1_00200.join(); + A2_00200.join(); + A1_00210.join(); + A2_00210.join(); + A1_00220.join(); + A2_00220.join(); + A1_00230.join(); + A2_00230.join(); + + } catch (InterruptedException e) { + } + if (A1_00010.check() && A2_00010.check() && A1_00020.check() && A2_00020.check() && A1_00030.check() && A2_00030.check() && A1_00040.check() && A2_00040.check() && A1_00050.check() && A2_00050.check() && A1_00060.check() && A2_00060.check() && A1_00070.check() && A2_00070.check() && A1_00080.check() && A2_00080.check() && A1_00090.check() && A2_00090.check() && A1_00100.check() && A2_00100.check() && A1_00110.check() && A2_00110.check() && A1_00120.check() && A2_00120.check() && A1_00130.check() && A2_00130.check() && A1_00140.check() && A2_00140.check() && A1_00150.check() && A2_00150.check() && A1_00160.check() && A2_00160.check() && A1_00170.check() && A2_00170.check() && A1_00180.check() && A2_00180.check() && A1_00190.check() && A2_00190.check() && A1_00200.check() && A2_00200.check() && A1_00210.check() && A2_00210.check() && A1_00220.check() && A2_00220.check() && A1_00230.check() && A2_00230.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\nExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0205-rc-function-RC_Thread01-Cycle_Bm_2_10240/Cycle_Bm_2_10240.java b/test/testsuite/ouroboros/memory_management/Function/RC0205-rc-function-RC_Thread01-Cycle_Bm_2_10240/Cycle_Bm_2_10240.java index 0a3c0d82102474f5a911c5474cc608c8365ddab8..ddd60a74b5868076da23e57997883be2bd9323c5 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0205-rc-function-RC_Thread01-Cycle_Bm_2_10240/Cycle_Bm_2_10240.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0205-rc-function-RC_Thread01-Cycle_Bm_2_10240/Cycle_Bm_2_10240.java @@ -1,284 +1,284 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_10240.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Make Cycle_B_2_10240 together to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Cycle_Bm_2_10240.java - *- @ExecuteClass: Cycle_Bm_2_10240 - *- @ExecuteArgs: - */ -class ThreadRc_Cycle_Bm_2_10240 extends Thread { - private boolean checkout; - - public void run() { - Cycle_B_2_00240_A1 a1_main = new Cycle_B_2_00240_A1("a1_main"); - a1_main.a2_0 = new Cycle_B_2_00240_A2("a2_0"); - a1_main.a2_0.a3_0 = new Cycle_B_2_00240_A3("a3_0"); - a1_main.a2_0.a4_0 = new Cycle_B_2_00240_A4("a4_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; - a1_main.a2_0.a4_0.a1_0 = a1_main; - - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - a1_main.a2_0.a4_0.add(); - - - int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; - //System.out.println("RC-Testing_Result="+result); - - Cycle_B_2_00240_B1 b1_0 = new Cycle_B_2_00240_B1(); - b1_0.a3_0 = new Cycle_B_2_00240_A3("a3_b1"); - b1_0.b2_0 = new Cycle_B_2_00240_B2(); - b1_0.c2_0 = new Nocycle_B_2_00240_C2("c2_b1"); - b1_0.b2_0.b1_0 = b1_0; - b1_0.add(); - b1_0.b2_0.add(); - - int nsum = (b1_0.sum + b1_0.b2_0.sum); - // System.out.println(nsum); - - - Nocycle_B_2_00240_C1 c1_main = new Nocycle_B_2_00240_C1("c1_main"); - c1_main.c2_0 = new Nocycle_B_2_00240_C2("c2_0"); - c1_main.add(); - c1_main.c2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",c1_main.sum+c1_main.b1_0.sum); - int result2 = c1_main.sum + c1_main.c2_0.sum; - //System.out.println("RC-Testing_Result="+result2); - - if (result == 1124 && nsum == 310 && result2 == 704) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Cycle_B_2_00240_A1 { - Cycle_B_2_00240_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_B_2_00240_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - class Cycle_B_2_00240_A2 { - Cycle_B_2_00240_A1 a1_0; - Cycle_B_2_00240_A3 a3_0; - Cycle_B_2_00240_A4 a4_0; - int a; - int sum; - String strObjectName; - - Cycle_B_2_00240_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - - class Cycle_B_2_00240_A3 { - Cycle_B_2_00240_A1 a1_0; - int a; - int sum; - String strObjectName; - - Cycle_B_2_00240_A3(String strObjectName) { - a1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a; - } - } - - class Cycle_B_2_00240_A4 { - Cycle_B_2_00240_A1 a1_0; - Cycle_B_2_00240_A2 a2_0; - int a; - int sum; - String strObjectName; - - Cycle_B_2_00240_A4(String strObjectName) { - a2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a2_0.a; - } - } - - class Cycle_B_2_00240_B1 { - Cycle_B_2_00240_A3 a3_0; - Cycle_B_2_00240_B2 b2_0; - Nocycle_B_2_00240_C2 c2_0; - - - int a; - int sum; - - Cycle_B_2_00240_B1() { - a3_0 = null; - b2_0 = null; - c2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a3_0.a + b2_0.a + c2_0.a; - } - } - - class Cycle_B_2_00240_B2 { - Cycle_B_2_00240_B1 b1_0; - int a; - int sum; - - Cycle_B_2_00240_B2() { - b1_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_B_2_00240_C1 { - Nocycle_B_2_00240_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_B_2_00240_C1(String strObjectName) { - c2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - // protected void finalize() throws java.lang.Throwable { -// System.out.println("RC-Testing_Destruction_A1_"+strObjectName); -// } - void add() { - sum = a + c2_0.a; - } - } - - class Nocycle_B_2_00240_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_B_2_00240_C2(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - // protected void finalize() throws java.lang.Throwable { -// System.out.println("RC-Testing_Destruction_B1_"+strObjectName); -// } - void add() { - sum = a + a; - } - } -} - - -public class Cycle_Bm_2_10240 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Cycle_Bm_2_10240 A1_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); - ThreadRc_Cycle_Bm_2_10240 A2_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); - ThreadRc_Cycle_Bm_2_10240 A3_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); - ThreadRc_Cycle_Bm_2_10240 A4_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); - ThreadRc_Cycle_Bm_2_10240 A5_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); - ThreadRc_Cycle_Bm_2_10240 A6_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); - - A1_Cycle_Bm_2_10240.start(); - A2_Cycle_Bm_2_10240.start(); - A3_Cycle_Bm_2_10240.start(); - A4_Cycle_Bm_2_10240.start(); - A5_Cycle_Bm_2_10240.start(); - A6_Cycle_Bm_2_10240.start(); - - try { - A1_Cycle_Bm_2_10240.join(); - A2_Cycle_Bm_2_10240.join(); - A3_Cycle_Bm_2_10240.join(); - A4_Cycle_Bm_2_10240.join(); - A5_Cycle_Bm_2_10240.join(); - A6_Cycle_Bm_2_10240.join(); - - } catch (InterruptedException e) { - } - if (A1_Cycle_Bm_2_10240.check() && A2_Cycle_Bm_2_10240.check() && A3_Cycle_Bm_2_10240.check() && A4_Cycle_Bm_2_10240.check() && A5_Cycle_Bm_2_10240.check() && A6_Cycle_Bm_2_10240.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Cycle_Bm_2_10240.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Make Cycle_B_2_10240 together to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\nExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Cycle_Bm_2_10240.java + *- @ExecuteClass: Cycle_Bm_2_10240 + *- @ExecuteArgs: + */ +class ThreadRc_Cycle_Bm_2_10240 extends Thread { + private boolean checkout; + + public void run() { + Cycle_B_2_00240_A1 a1_main = new Cycle_B_2_00240_A1("a1_main"); + a1_main.a2_0 = new Cycle_B_2_00240_A2("a2_0"); + a1_main.a2_0.a3_0 = new Cycle_B_2_00240_A3("a3_0"); + a1_main.a2_0.a4_0 = new Cycle_B_2_00240_A4("a4_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main.a2_0.a4_0.a2_0 = a1_main.a2_0; + a1_main.a2_0.a4_0.a1_0 = a1_main; + + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + a1_main.a2_0.a4_0.add(); + + + int result = a1_main.sum + a1_main.a2_0.sum + a1_main.a2_0.a3_0.sum + a1_main.a2_0.a4_0.sum; + //System.out.println("RC-Testing_Result="+result); + + Cycle_B_2_00240_B1 b1_0 = new Cycle_B_2_00240_B1(); + b1_0.a3_0 = new Cycle_B_2_00240_A3("a3_b1"); + b1_0.b2_0 = new Cycle_B_2_00240_B2(); + b1_0.c2_0 = new Nocycle_B_2_00240_C2("c2_b1"); + b1_0.b2_0.b1_0 = b1_0; + b1_0.add(); + b1_0.b2_0.add(); + + int nsum = (b1_0.sum + b1_0.b2_0.sum); + // System.out.println(nsum); + + + Nocycle_B_2_00240_C1 c1_main = new Nocycle_B_2_00240_C1("c1_main"); + c1_main.c2_0 = new Nocycle_B_2_00240_C2("c2_0"); + c1_main.add(); + c1_main.c2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",c1_main.sum+c1_main.b1_0.sum); + int result2 = c1_main.sum + c1_main.c2_0.sum; + //System.out.println("RC-Testing_Result="+result2); + + if (result == 1124 && nsum == 310 && result2 == 704) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Cycle_B_2_00240_A1 { + Cycle_B_2_00240_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_B_2_00240_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + class Cycle_B_2_00240_A2 { + Cycle_B_2_00240_A1 a1_0; + Cycle_B_2_00240_A3 a3_0; + Cycle_B_2_00240_A4 a4_0; + int a; + int sum; + String strObjectName; + + Cycle_B_2_00240_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + + class Cycle_B_2_00240_A3 { + Cycle_B_2_00240_A1 a1_0; + int a; + int sum; + String strObjectName; + + Cycle_B_2_00240_A3(String strObjectName) { + a1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a; + } + } + + class Cycle_B_2_00240_A4 { + Cycle_B_2_00240_A1 a1_0; + Cycle_B_2_00240_A2 a2_0; + int a; + int sum; + String strObjectName; + + Cycle_B_2_00240_A4(String strObjectName) { + a2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a2_0.a; + } + } + + class Cycle_B_2_00240_B1 { + Cycle_B_2_00240_A3 a3_0; + Cycle_B_2_00240_B2 b2_0; + Nocycle_B_2_00240_C2 c2_0; + + + int a; + int sum; + + Cycle_B_2_00240_B1() { + a3_0 = null; + b2_0 = null; + c2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a3_0.a + b2_0.a + c2_0.a; + } + } + + class Cycle_B_2_00240_B2 { + Cycle_B_2_00240_B1 b1_0; + int a; + int sum; + + Cycle_B_2_00240_B2() { + b1_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_B_2_00240_C1 { + Nocycle_B_2_00240_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_B_2_00240_C1(String strObjectName) { + c2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + // protected void finalize() throws java.lang.Throwable { +// System.out.println("RC-Testing_Destruction_A1_"+strObjectName); +// } + void add() { + sum = a + c2_0.a; + } + } + + class Nocycle_B_2_00240_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_B_2_00240_C2(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + // protected void finalize() throws java.lang.Throwable { +// System.out.println("RC-Testing_Destruction_B1_"+strObjectName); +// } + void add() { + sum = a + a; + } + } +} + + +public class Cycle_Bm_2_10240 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Cycle_Bm_2_10240 A1_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); + ThreadRc_Cycle_Bm_2_10240 A2_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); + ThreadRc_Cycle_Bm_2_10240 A3_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); + ThreadRc_Cycle_Bm_2_10240 A4_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); + ThreadRc_Cycle_Bm_2_10240 A5_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); + ThreadRc_Cycle_Bm_2_10240 A6_Cycle_Bm_2_10240 = new ThreadRc_Cycle_Bm_2_10240(); + + A1_Cycle_Bm_2_10240.start(); + A2_Cycle_Bm_2_10240.start(); + A3_Cycle_Bm_2_10240.start(); + A4_Cycle_Bm_2_10240.start(); + A5_Cycle_Bm_2_10240.start(); + A6_Cycle_Bm_2_10240.start(); + + try { + A1_Cycle_Bm_2_10240.join(); + A2_Cycle_Bm_2_10240.join(); + A3_Cycle_Bm_2_10240.join(); + A4_Cycle_Bm_2_10240.join(); + A5_Cycle_Bm_2_10240.join(); + A6_Cycle_Bm_2_10240.join(); + + } catch (InterruptedException e) { + } + if (A1_Cycle_Bm_2_10240.check() && A2_Cycle_Bm_2_10240.check() && A3_Cycle_Bm_2_10240.check() && A4_Cycle_Bm_2_10240.check() && A5_Cycle_Bm_2_10240.check() && A6_Cycle_Bm_2_10240.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\nExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0207-rc-function-RC_Thread01-Nocycle_am_00020/Nocycle_am_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0207-rc-function-RC_Thread01-Nocycle_am_00020/Nocycle_am_00020.java index d42ad7367cf71e86e7665892430f38c04eaa093d..ec6f3885b1544f9e71bfedb734edede1ad7a74ae 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0207-rc-function-RC_Thread01-Nocycle_am_00020/Nocycle_am_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0207-rc-function-RC_Thread01-Nocycle_am_00020/Nocycle_am_00020.java @@ -1,144 +1,144 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00020 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00020.java - *- @ExecuteClass: Nocycle_am_00020 - *- @ExecuteArgs: - */ -class ThreadRc_00020 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00020_A1 a1_main = new Nocycle_a_00020_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00020_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00020_B2("b2_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result_Thread1="+result); - if (result == 1310) - checkout = true; - //System.out.println(checkout); - - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00020_A1 { - Nocycle_a_00020_B1 b1_0; - Nocycle_a_00020_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00020_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00020_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00020 A1_00020 = new ThreadRc_00020(); - ThreadRc_00020 A2_00020 = new ThreadRc_00020(); - ThreadRc_00020 A3_00020 = new ThreadRc_00020(); - ThreadRc_00020 A4_00020 = new ThreadRc_00020(); - ThreadRc_00020 A5_00020 = new ThreadRc_00020(); - ThreadRc_00020 A6_00020 = new ThreadRc_00020(); - - A1_00020.start(); - A2_00020.start(); - A3_00020.start(); - A4_00020.start(); - A5_00020.start(); - A6_00020.start(); - try { - A1_00020.join(); - A2_00020.join(); - A3_00020.join(); - A4_00020.join(); - A5_00020.join(); - A6_00020.join(); - } catch (InterruptedException e) { - } - - if (A1_00020.check() && A2_00020.check() && A3_00020.check() && A4_00020.check() && A5_00020.check() && A6_00020.check()) - System.out.println("ExpectResult"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00020 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00020.java + *- @ExecuteClass: Nocycle_am_00020 + *- @ExecuteArgs: + */ +class ThreadRc_00020 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00020_A1 a1_main = new Nocycle_a_00020_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00020_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00020_B2("b2_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result_Thread1="+result); + if (result == 1310) + checkout = true; + //System.out.println(checkout); + + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00020_A1 { + Nocycle_a_00020_B1 b1_0; + Nocycle_a_00020_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00020_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00020_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00020 A1_00020 = new ThreadRc_00020(); + ThreadRc_00020 A2_00020 = new ThreadRc_00020(); + ThreadRc_00020 A3_00020 = new ThreadRc_00020(); + ThreadRc_00020 A4_00020 = new ThreadRc_00020(); + ThreadRc_00020 A5_00020 = new ThreadRc_00020(); + ThreadRc_00020 A6_00020 = new ThreadRc_00020(); + + A1_00020.start(); + A2_00020.start(); + A3_00020.start(); + A4_00020.start(); + A5_00020.start(); + A6_00020.start(); + try { + A1_00020.join(); + A2_00020.join(); + A3_00020.join(); + A4_00020.join(); + A5_00020.join(); + A6_00020.join(); + } catch (InterruptedException e) { + } + + if (A1_00020.check() && A2_00020.check() && A3_00020.check() && A4_00020.check() && A5_00020.check() && A6_00020.check()) + System.out.println("ExpectResult"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0208-rc-function-RC_Thread01-Nocycle_am_00030/Nocycle_am_00030.java b/test/testsuite/ouroboros/memory_management/Function/RC0208-rc-function-RC_Thread01-Nocycle_am_00030/Nocycle_am_00030.java index 1ab73934060e6f198b7fcc836f2af71718534956..85d26b2a1e7304bdf6ce3b583115f7b3c3fa3826 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0208-rc-function-RC_Thread01-Nocycle_am_00030/Nocycle_am_00030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0208-rc-function-RC_Thread01-Nocycle_am_00030/Nocycle_am_00030.java @@ -1,163 +1,163 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00030 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00030.java - *- @ExecuteClass: Nocycle_am_00030 - *- @ExecuteArgs: - */ -class ThreadRc_00030 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00030_A1 a1_main = new Nocycle_a_00030_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00030_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00030_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00030_B3("b3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; - //System.out.println("RC-Testing_Result_Thread1="+result); - if (result == 1919) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00030_A1 { - Nocycle_a_00030_B1 b1_0; - Nocycle_a_00030_B2 b2_0; - Nocycle_a_00030_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00030_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00030_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00030_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00030 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00030 A1_00030 = new ThreadRc_00030(); - ThreadRc_00030 A2_00030 = new ThreadRc_00030(); - ThreadRc_00030 A3_00030 = new ThreadRc_00030(); - ThreadRc_00030 A4_00030 = new ThreadRc_00030(); - ThreadRc_00030 A5_00030 = new ThreadRc_00030(); - ThreadRc_00030 A6_00030 = new ThreadRc_00030(); - - A1_00030.start(); - A2_00030.start(); - A3_00030.start(); - A4_00030.start(); - A5_00030.start(); - A6_00030.start(); - try { - A1_00030.join(); - A2_00030.join(); - A3_00030.join(); - A4_00030.join(); - A5_00030.join(); - A6_00030.join(); - } catch (InterruptedException e) { - } - if (A1_00030.check() && A2_00030.check() && A3_00030.check() && A4_00030.check() && A5_00030.check() && A6_00030.check()) - System.out.println("ExpectResult"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00030 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00030.java + *- @ExecuteClass: Nocycle_am_00030 + *- @ExecuteArgs: + */ +class ThreadRc_00030 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00030_A1 a1_main = new Nocycle_a_00030_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00030_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00030_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00030_B3("b3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; + //System.out.println("RC-Testing_Result_Thread1="+result); + if (result == 1919) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00030_A1 { + Nocycle_a_00030_B1 b1_0; + Nocycle_a_00030_B2 b2_0; + Nocycle_a_00030_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00030_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00030_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00030_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00030 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00030 A1_00030 = new ThreadRc_00030(); + ThreadRc_00030 A2_00030 = new ThreadRc_00030(); + ThreadRc_00030 A3_00030 = new ThreadRc_00030(); + ThreadRc_00030 A4_00030 = new ThreadRc_00030(); + ThreadRc_00030 A5_00030 = new ThreadRc_00030(); + ThreadRc_00030 A6_00030 = new ThreadRc_00030(); + + A1_00030.start(); + A2_00030.start(); + A3_00030.start(); + A4_00030.start(); + A5_00030.start(); + A6_00030.start(); + try { + A1_00030.join(); + A2_00030.join(); + A3_00030.join(); + A4_00030.join(); + A5_00030.join(); + A6_00030.join(); + } catch (InterruptedException e) { + } + if (A1_00030.check() && A2_00030.check() && A3_00030.check() && A4_00030.check() && A5_00030.check() && A6_00030.check()) + System.out.println("ExpectResult"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0209-rc-function-RC_Thread01-Nocycle_am_00040/Nocycle_am_00040.java b/test/testsuite/ouroboros/memory_management/Function/RC0209-rc-function-RC_Thread01-Nocycle_am_00040/Nocycle_am_00040.java index 59064a66a95ef5a756dc2bf6f025662af0b8c752..556dc59b5126d4cd6cdd332c656a24db026c5d08 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0209-rc-function-RC_Thread01-Nocycle_am_00040/Nocycle_am_00040.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0209-rc-function-RC_Thread01-Nocycle_am_00040/Nocycle_am_00040.java @@ -1,309 +1,309 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00040.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00040 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00040.java - *- @ExecuteClass: Nocycle_am_00040 - *- @ExecuteArgs: - */ -class ThreadRc_00040 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00040_A1 a1_main = new Nocycle_a_00040_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00040_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00040_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00040_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00040_B4("b4_0"); - a1_main.b5_0 = new Nocycle_a_00040_B5("b5_0"); - a1_main.b6_0 = new Nocycle_a_00040_B6("b6_0"); - a1_main.b7_0 = new Nocycle_a_00040_B7("b7_0"); - a1_main.b8_0 = new Nocycle_a_00040_B8("b8_0"); - a1_main.b9_0 = new Nocycle_a_00040_B9("b9_0"); - a1_main.b10_0 = new Nocycle_a_00040_B10("b10_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b5_0.add(); - a1_main.b6_0.add(); - a1_main.b7_0.add(); - a1_main.b8_0.add(); - a1_main.b9_0.add(); - a1_main.b10_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b5_0.sum+a1_main.b6_0.sum+a1_main.b7_0.sum+a1_main.b8_0.sum+a1_main.b9_0.sum+a1_main.b10_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b5_0.sum + a1_main.b6_0.sum + a1_main.b7_0.sum + a1_main.b8_0.sum + a1_main.b9_0.sum + a1_main.b10_0.sum; - //System.out.println("RC-Testing_Result_Thread1="+result); - if (result == 6266) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00040_A1 { - Nocycle_a_00040_B1 b1_0; - Nocycle_a_00040_B2 b2_0; - Nocycle_a_00040_B3 b3_0; - Nocycle_a_00040_B4 b4_0; - Nocycle_a_00040_B5 b5_0; - Nocycle_a_00040_B6 b6_0; - Nocycle_a_00040_B7 b7_0; - Nocycle_a_00040_B8 b8_0; - Nocycle_a_00040_B9 b9_0; - Nocycle_a_00040_B10 b10_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - b5_0 = null; - b6_0 = null; - b7_0 = null; - b8_0 = null; - b9_0 = null; - b10_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + b5_0.a + b6_0.a + b7_0.a + b8_0.a + b9_0.a + b10_0.a; - } - } - - class Nocycle_a_00040_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B5 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B5(String strObjectName) { - a = 205; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B5_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B6 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B6(String strObjectName) { - a = 206; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B7 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B7(String strObjectName) { - a = 207; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B7_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B8 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B8(String strObjectName) { - a = 208; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B8_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B9 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B9(String strObjectName) { - a = 209; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B9_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B10 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B10(String strObjectName) { - a = 210; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B10_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -public class Nocycle_am_00040 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00040 A1_00040 = new ThreadRc_00040(); - ThreadRc_00040 A2_00040 = new ThreadRc_00040(); - ThreadRc_00040 A3_00040 = new ThreadRc_00040(); - ThreadRc_00040 A4_00040 = new ThreadRc_00040(); - ThreadRc_00040 A5_00040 = new ThreadRc_00040(); - ThreadRc_00040 A6_00040 = new ThreadRc_00040(); - - A1_00040.start(); - A2_00040.start(); - A3_00040.start(); - A4_00040.start(); - A5_00040.start(); - A6_00040.start(); - try { - A1_00040.join(); - A2_00040.join(); - A3_00040.join(); - A4_00040.join(); - A5_00040.join(); - A6_00040.join(); - } catch (InterruptedException e) { - } - if (A1_00040.check() && A2_00040.check() && A3_00040.check() && A4_00040.check() && A5_00040.check() && A6_00040.check()) - System.out.println("ExpectResult"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00040.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00040 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00040.java + *- @ExecuteClass: Nocycle_am_00040 + *- @ExecuteArgs: + */ +class ThreadRc_00040 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00040_A1 a1_main = new Nocycle_a_00040_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00040_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00040_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00040_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00040_B4("b4_0"); + a1_main.b5_0 = new Nocycle_a_00040_B5("b5_0"); + a1_main.b6_0 = new Nocycle_a_00040_B6("b6_0"); + a1_main.b7_0 = new Nocycle_a_00040_B7("b7_0"); + a1_main.b8_0 = new Nocycle_a_00040_B8("b8_0"); + a1_main.b9_0 = new Nocycle_a_00040_B9("b9_0"); + a1_main.b10_0 = new Nocycle_a_00040_B10("b10_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b5_0.add(); + a1_main.b6_0.add(); + a1_main.b7_0.add(); + a1_main.b8_0.add(); + a1_main.b9_0.add(); + a1_main.b10_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b5_0.sum+a1_main.b6_0.sum+a1_main.b7_0.sum+a1_main.b8_0.sum+a1_main.b9_0.sum+a1_main.b10_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b5_0.sum + a1_main.b6_0.sum + a1_main.b7_0.sum + a1_main.b8_0.sum + a1_main.b9_0.sum + a1_main.b10_0.sum; + //System.out.println("RC-Testing_Result_Thread1="+result); + if (result == 6266) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00040_A1 { + Nocycle_a_00040_B1 b1_0; + Nocycle_a_00040_B2 b2_0; + Nocycle_a_00040_B3 b3_0; + Nocycle_a_00040_B4 b4_0; + Nocycle_a_00040_B5 b5_0; + Nocycle_a_00040_B6 b6_0; + Nocycle_a_00040_B7 b7_0; + Nocycle_a_00040_B8 b8_0; + Nocycle_a_00040_B9 b9_0; + Nocycle_a_00040_B10 b10_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + b5_0 = null; + b6_0 = null; + b7_0 = null; + b8_0 = null; + b9_0 = null; + b10_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + b5_0.a + b6_0.a + b7_0.a + b8_0.a + b9_0.a + b10_0.a; + } + } + + class Nocycle_a_00040_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B5 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B5(String strObjectName) { + a = 205; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B5_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B6 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B6(String strObjectName) { + a = 206; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B7 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B7(String strObjectName) { + a = 207; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B7_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B8 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B8(String strObjectName) { + a = 208; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B8_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B9 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B9(String strObjectName) { + a = 209; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B9_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B10 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B10(String strObjectName) { + a = 210; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B10_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +public class Nocycle_am_00040 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00040 A1_00040 = new ThreadRc_00040(); + ThreadRc_00040 A2_00040 = new ThreadRc_00040(); + ThreadRc_00040 A3_00040 = new ThreadRc_00040(); + ThreadRc_00040 A4_00040 = new ThreadRc_00040(); + ThreadRc_00040 A5_00040 = new ThreadRc_00040(); + ThreadRc_00040 A6_00040 = new ThreadRc_00040(); + + A1_00040.start(); + A2_00040.start(); + A3_00040.start(); + A4_00040.start(); + A5_00040.start(); + A6_00040.start(); + try { + A1_00040.join(); + A2_00040.join(); + A3_00040.join(); + A4_00040.join(); + A5_00040.join(); + A6_00040.join(); + } catch (InterruptedException e) { + } + if (A1_00040.check() && A2_00040.check() && A3_00040.check() && A4_00040.check() && A5_00040.check() && A6_00040.check()) + System.out.println("ExpectResult"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0210-rc-function-RC_Thread01-Nocycle_am_00050/Nocycle_am_00050.java b/test/testsuite/ouroboros/memory_management/Function/RC0210-rc-function-RC_Thread01-Nocycle_am_00050/Nocycle_am_00050.java index 633f29b8c29b3e5411d0542e37d6781ee79387b5..1a78ae7e1aa00120c7eb453effa63c1dd17470a0 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0210-rc-function-RC_Thread01-Nocycle_am_00050/Nocycle_am_00050.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0210-rc-function-RC_Thread01-Nocycle_am_00050/Nocycle_am_00050.java @@ -1,247 +1,247 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00050.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00050 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00050.java - *- @ExecuteClass: Nocycle_am_00050 - *- @ExecuteArgs: - */ -class ThreadRc_00050 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00050_A1 a1_main = new Nocycle_a_00050_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00050_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00050_C1("c1_0"); - a1_main.b1_0.c2_0 = new Nocycle_a_00050_C2("c2_0"); - a1_main.b1_0.c3_0 = new Nocycle_a_00050_C3("c3_0"); - a1_main.b2_0 = new Nocycle_a_00050_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00050_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00050_B4("b4_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c2_0.add(); - a1_main.b1_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c2_0.sum+a1_main.b1_0.c3_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c2_0.sum + a1_main.b1_0.c3_0.sum; - //System.out.println("RC-Testing_Result_Thread1="+result); - if (result == 5048) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00050_A1 { - Nocycle_a_00050_B1 b1_0; - Nocycle_a_00050_B2 b2_0; - Nocycle_a_00050_B3 b3_0; - Nocycle_a_00050_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class Nocycle_a_00050_B1 { - Nocycle_a_00050_C1 c1_0; - Nocycle_a_00050_C2 c2_0; - Nocycle_a_00050_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class Nocycle_a_00050_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00050 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00050 A1_00050 = new ThreadRc_00050(); - ThreadRc_00050 A2_00050 = new ThreadRc_00050(); - ThreadRc_00050 A3_00050 = new ThreadRc_00050(); - ThreadRc_00050 A4_00050 = new ThreadRc_00050(); - ThreadRc_00050 A5_00050 = new ThreadRc_00050(); - ThreadRc_00050 A6_00050 = new ThreadRc_00050(); - - A1_00050.start(); - A2_00050.start(); - A3_00050.start(); - A4_00050.start(); - A5_00050.start(); - A6_00050.start(); - try { - A1_00050.join(); - A2_00050.join(); - A3_00050.join(); - A4_00050.join(); - A5_00050.join(); - A6_00050.join(); - } catch (InterruptedException e) { - } - if (A1_00050.check() && A2_00050.check() && A3_00050.check() && A4_00050.check() && A5_00050.check() && A6_00050.check()) - System.out.println("ExpectResult"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00050.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00050 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00050.java + *- @ExecuteClass: Nocycle_am_00050 + *- @ExecuteArgs: + */ +class ThreadRc_00050 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00050_A1 a1_main = new Nocycle_a_00050_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00050_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00050_C1("c1_0"); + a1_main.b1_0.c2_0 = new Nocycle_a_00050_C2("c2_0"); + a1_main.b1_0.c3_0 = new Nocycle_a_00050_C3("c3_0"); + a1_main.b2_0 = new Nocycle_a_00050_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00050_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00050_B4("b4_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c2_0.add(); + a1_main.b1_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c2_0.sum+a1_main.b1_0.c3_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c2_0.sum + a1_main.b1_0.c3_0.sum; + //System.out.println("RC-Testing_Result_Thread1="+result); + if (result == 5048) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00050_A1 { + Nocycle_a_00050_B1 b1_0; + Nocycle_a_00050_B2 b2_0; + Nocycle_a_00050_B3 b3_0; + Nocycle_a_00050_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class Nocycle_a_00050_B1 { + Nocycle_a_00050_C1 c1_0; + Nocycle_a_00050_C2 c2_0; + Nocycle_a_00050_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class Nocycle_a_00050_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00050 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00050 A1_00050 = new ThreadRc_00050(); + ThreadRc_00050 A2_00050 = new ThreadRc_00050(); + ThreadRc_00050 A3_00050 = new ThreadRc_00050(); + ThreadRc_00050 A4_00050 = new ThreadRc_00050(); + ThreadRc_00050 A5_00050 = new ThreadRc_00050(); + ThreadRc_00050 A6_00050 = new ThreadRc_00050(); + + A1_00050.start(); + A2_00050.start(); + A3_00050.start(); + A4_00050.start(); + A5_00050.start(); + A6_00050.start(); + try { + A1_00050.join(); + A2_00050.join(); + A3_00050.join(); + A4_00050.join(); + A5_00050.join(); + A6_00050.join(); + } catch (InterruptedException e) { + } + if (A1_00050.check() && A2_00050.check() && A3_00050.check() && A4_00050.check() && A5_00050.check() && A6_00050.check()) + System.out.println("ExpectResult"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0211-rc-function-RC_Thread01-Nocycle_am_00060/Nocycle_am_00060.java b/test/testsuite/ouroboros/memory_management/Function/RC0211-rc-function-RC_Thread01-Nocycle_am_00060/Nocycle_am_00060.java index 5ce8a17f0db9b675810a72c9aa85920b999b7122..f9ed36184e6d0159b53f0450469d28f0cc77818f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0211-rc-function-RC_Thread01-Nocycle_am_00060/Nocycle_am_00060.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0211-rc-function-RC_Thread01-Nocycle_am_00060/Nocycle_am_00060.java @@ -1,260 +1,260 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00060.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00060 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00060.java - *- @ExecuteClass: Nocycle_am_00060 - *- @ExecuteArgs: - */ -class ThreadRc_00060 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00060_A1 a1_main = new Nocycle_a_00060_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00060_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00060_B2("b2_0"); - a1_main.b2_0.c1_0 = new Nocycle_a_00060_C1("c1_0"); - a1_main.b2_0.c2_0 = new Nocycle_a_00060_C2("c2_0"); - a1_main.b2_0.c3_0 = new Nocycle_a_00060_C3("c3_0"); - a1_main.b3_0 = new Nocycle_a_00060_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00060_B4("b4_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b2_0.c1_0.add(); - a1_main.b2_0.c2_0.add(); - a1_main.b2_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b2_0.c1_0.sum+a1_main.b2_0.c2_0.sum+a1_main.b2_0.c3_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c1_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b2_0.c3_0.sum; - //System.out.println("RC-Testing_Result_Thread1="+result); - if (result == 5047) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00060_A1 { - Nocycle_a_00060_B1 b1_0; - Nocycle_a_00060_B2 b2_0; - Nocycle_a_00060_B3 b3_0; - Nocycle_a_00060_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class Nocycle_a_00060_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_B2 { - Nocycle_a_00060_C1 c1_0; - Nocycle_a_00060_C2 c2_0; - Nocycle_a_00060_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B2(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class Nocycle_a_00060_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -public class Nocycle_am_00060 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00060 A1_00060 = new ThreadRc_00060(); - ThreadRc_00060 A2_00060 = new ThreadRc_00060(); - ThreadRc_00060 A3_00060 = new ThreadRc_00060(); - ThreadRc_00060 A4_00060 = new ThreadRc_00060(); - ThreadRc_00060 A5_00060 = new ThreadRc_00060(); - ThreadRc_00060 A6_00060 = new ThreadRc_00060(); - ThreadRc_00060 A7_00060 = new ThreadRc_00060(); - ThreadRc_00060 A8_00060 = new ThreadRc_00060(); - ThreadRc_00060 A9_00060 = new ThreadRc_00060(); - ThreadRc_00060 A10_00060 = new ThreadRc_00060(); - - A1_00060.start(); - A2_00060.start(); - A3_00060.start(); - A4_00060.start(); - A5_00060.start(); - A6_00060.start(); - A7_00060.start(); - A8_00060.start(); - A9_00060.start(); - A10_00060.start(); - - try { - A1_00060.join(); - A2_00060.join(); - A3_00060.join(); - A4_00060.join(); - A5_00060.join(); - A6_00060.join(); - A7_00060.join(); - A8_00060.join(); - A9_00060.join(); - A10_00060.join(); - } catch (InterruptedException e) { - } - if (A1_00060.check() && A2_00060.check() && A3_00060.check() && A4_00060.check() && A5_00060.check() && A6_00060.check() && A7_00060.check() && A8_00060.check() && A9_00060.check() && A10_00060.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00060.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00060 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00060.java + *- @ExecuteClass: Nocycle_am_00060 + *- @ExecuteArgs: + */ +class ThreadRc_00060 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00060_A1 a1_main = new Nocycle_a_00060_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00060_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00060_B2("b2_0"); + a1_main.b2_0.c1_0 = new Nocycle_a_00060_C1("c1_0"); + a1_main.b2_0.c2_0 = new Nocycle_a_00060_C2("c2_0"); + a1_main.b2_0.c3_0 = new Nocycle_a_00060_C3("c3_0"); + a1_main.b3_0 = new Nocycle_a_00060_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00060_B4("b4_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b2_0.c1_0.add(); + a1_main.b2_0.c2_0.add(); + a1_main.b2_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b2_0.c1_0.sum+a1_main.b2_0.c2_0.sum+a1_main.b2_0.c3_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c1_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b2_0.c3_0.sum; + //System.out.println("RC-Testing_Result_Thread1="+result); + if (result == 5047) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00060_A1 { + Nocycle_a_00060_B1 b1_0; + Nocycle_a_00060_B2 b2_0; + Nocycle_a_00060_B3 b3_0; + Nocycle_a_00060_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class Nocycle_a_00060_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_B2 { + Nocycle_a_00060_C1 c1_0; + Nocycle_a_00060_C2 c2_0; + Nocycle_a_00060_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B2(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class Nocycle_a_00060_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +public class Nocycle_am_00060 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00060 A1_00060 = new ThreadRc_00060(); + ThreadRc_00060 A2_00060 = new ThreadRc_00060(); + ThreadRc_00060 A3_00060 = new ThreadRc_00060(); + ThreadRc_00060 A4_00060 = new ThreadRc_00060(); + ThreadRc_00060 A5_00060 = new ThreadRc_00060(); + ThreadRc_00060 A6_00060 = new ThreadRc_00060(); + ThreadRc_00060 A7_00060 = new ThreadRc_00060(); + ThreadRc_00060 A8_00060 = new ThreadRc_00060(); + ThreadRc_00060 A9_00060 = new ThreadRc_00060(); + ThreadRc_00060 A10_00060 = new ThreadRc_00060(); + + A1_00060.start(); + A2_00060.start(); + A3_00060.start(); + A4_00060.start(); + A5_00060.start(); + A6_00060.start(); + A7_00060.start(); + A8_00060.start(); + A9_00060.start(); + A10_00060.start(); + + try { + A1_00060.join(); + A2_00060.join(); + A3_00060.join(); + A4_00060.join(); + A5_00060.join(); + A6_00060.join(); + A7_00060.join(); + A8_00060.join(); + A9_00060.join(); + A10_00060.join(); + } catch (InterruptedException e) { + } + if (A1_00060.check() && A2_00060.check() && A3_00060.check() && A4_00060.check() && A5_00060.check() && A6_00060.check() && A7_00060.check() && A8_00060.check() && A9_00060.check() && A10_00060.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0212-rc-function-RC_Thread01-Nocycle_am_00070/Nocycle_am_00070.java b/test/testsuite/ouroboros/memory_management/Function/RC0212-rc-function-RC_Thread01-Nocycle_am_00070/Nocycle_am_00070.java index dc79b5d7102f4a40b821eb14f32b61f8ae0bfc70..4533582fd957187553063bd6f1491988fbe4bab0 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0212-rc-function-RC_Thread01-Nocycle_am_00070/Nocycle_am_00070.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0212-rc-function-RC_Thread01-Nocycle_am_00070/Nocycle_am_00070.java @@ -1,251 +1,251 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00070.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00070 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00070.java - *- @ExecuteClass: Nocycle_am_00070 - *- @ExecuteArgs: - */ -class ThreadRc_00070 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00070_A1 a1_main = new Nocycle_a_00070_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00070_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00070_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00070_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00070_B4("b4_0"); - a1_main.b4_0.c1_0 = new Nocycle_a_00070_C1("c1_0"); - a1_main.b4_0.c2_0 = new Nocycle_a_00070_C2("c2_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_00070_C3("c3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b4_0.c1_0.add(); - a1_main.b4_0.c2_0.add(); - a1_main.b4_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 5045) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00070_A1 { - Nocycle_a_00070_B1 b1_0; - Nocycle_a_00070_B2 b2_0; - Nocycle_a_00070_B3 b3_0; - Nocycle_a_00070_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class Nocycle_a_00070_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_B4 { - Nocycle_a_00070_C1 c1_0; - Nocycle_a_00070_C2 c2_0; - Nocycle_a_00070_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B4(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class Nocycle_a_00070_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00070 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00070 A1_00070 = new ThreadRc_00070(); - ThreadRc_00070 A2_00070 = new ThreadRc_00070(); - ThreadRc_00070 A3_00070 = new ThreadRc_00070(); - ThreadRc_00070 A4_00070 = new ThreadRc_00070(); - ThreadRc_00070 A5_00070 = new ThreadRc_00070(); - ThreadRc_00070 A6_00070 = new ThreadRc_00070(); - - A1_00070.start(); - A2_00070.start(); - A3_00070.start(); - A4_00070.start(); - A5_00070.start(); - A6_00070.start(); - - try { - A1_00070.join(); - A2_00070.join(); - A3_00070.join(); - A4_00070.join(); - A5_00070.join(); - A6_00070.join(); - - } catch (InterruptedException e) { - } - if (A1_00070.check() && A2_00070.check() && A3_00070.check() && A4_00070.check() && A5_00070.check() && A6_00070.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00070.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00070 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00070.java + *- @ExecuteClass: Nocycle_am_00070 + *- @ExecuteArgs: + */ +class ThreadRc_00070 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00070_A1 a1_main = new Nocycle_a_00070_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00070_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00070_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00070_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00070_B4("b4_0"); + a1_main.b4_0.c1_0 = new Nocycle_a_00070_C1("c1_0"); + a1_main.b4_0.c2_0 = new Nocycle_a_00070_C2("c2_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_00070_C3("c3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b4_0.c1_0.add(); + a1_main.b4_0.c2_0.add(); + a1_main.b4_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 5045) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00070_A1 { + Nocycle_a_00070_B1 b1_0; + Nocycle_a_00070_B2 b2_0; + Nocycle_a_00070_B3 b3_0; + Nocycle_a_00070_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class Nocycle_a_00070_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_B4 { + Nocycle_a_00070_C1 c1_0; + Nocycle_a_00070_C2 c2_0; + Nocycle_a_00070_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B4(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class Nocycle_a_00070_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00070 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00070 A1_00070 = new ThreadRc_00070(); + ThreadRc_00070 A2_00070 = new ThreadRc_00070(); + ThreadRc_00070 A3_00070 = new ThreadRc_00070(); + ThreadRc_00070 A4_00070 = new ThreadRc_00070(); + ThreadRc_00070 A5_00070 = new ThreadRc_00070(); + ThreadRc_00070 A6_00070 = new ThreadRc_00070(); + + A1_00070.start(); + A2_00070.start(); + A3_00070.start(); + A4_00070.start(); + A5_00070.start(); + A6_00070.start(); + + try { + A1_00070.join(); + A2_00070.join(); + A3_00070.join(); + A4_00070.join(); + A5_00070.join(); + A6_00070.join(); + + } catch (InterruptedException e) { + } + if (A1_00070.check() && A2_00070.check() && A3_00070.check() && A4_00070.check() && A5_00070.check() && A6_00070.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0213-rc-function-RC_Thread01-Nocycle_am_00080/Nocycle_am_00080.java b/test/testsuite/ouroboros/memory_management/Function/RC0213-rc-function-RC_Thread01-Nocycle_am_00080/Nocycle_am_00080.java index 069e3ad5514c0c110a5eae09bc5a6dce08061b27..ff70e2188d9a28d8252f624d1558f5094a3f2e6c 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0213-rc-function-RC_Thread01-Nocycle_am_00080/Nocycle_am_00080.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0213-rc-function-RC_Thread01-Nocycle_am_00080/Nocycle_am_00080.java @@ -1,142 +1,142 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00080.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00080 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00080.java - *- @ExecuteClass: Nocycle_am_00080 - *- @ExecuteArgs: - */ -class ThreadRc_00080 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00080_A1 a1_main = new Nocycle_a_00080_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00080_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00080_C1("c1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum; - //System.out.println("RC-Testing_Result_Thread1="+result); - if (result == 1406) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00080_A1 { - Nocycle_a_00080_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00080_B1 { - Nocycle_a_00080_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00080_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -public class Nocycle_am_00080 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00080 A1_00080 = new ThreadRc_00080(); - ThreadRc_00080 A2_00080 = new ThreadRc_00080(); - ThreadRc_00080 A3_00080 = new ThreadRc_00080(); - ThreadRc_00080 A4_00080 = new ThreadRc_00080(); - ThreadRc_00080 A5_00080 = new ThreadRc_00080(); - ThreadRc_00080 A6_00080 = new ThreadRc_00080(); - - A1_00080.start(); - A2_00080.start(); - A3_00080.start(); - A4_00080.start(); - A5_00080.start(); - A6_00080.start(); - try { - A1_00080.join(); - A2_00080.join(); - A3_00080.join(); - A4_00080.join(); - A5_00080.join(); - A6_00080.join(); - - } catch (InterruptedException e) { - } - if (A1_00080.check() && A2_00080.check() && A3_00080.check() && A4_00080.check() && A5_00080.check() && A6_00080.check()) - System.out.println("ExpectResult"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00080.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00080 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00080.java + *- @ExecuteClass: Nocycle_am_00080 + *- @ExecuteArgs: + */ +class ThreadRc_00080 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00080_A1 a1_main = new Nocycle_a_00080_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00080_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00080_C1("c1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum; + //System.out.println("RC-Testing_Result_Thread1="+result); + if (result == 1406) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00080_A1 { + Nocycle_a_00080_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00080_B1 { + Nocycle_a_00080_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00080_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +public class Nocycle_am_00080 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00080 A1_00080 = new ThreadRc_00080(); + ThreadRc_00080 A2_00080 = new ThreadRc_00080(); + ThreadRc_00080 A3_00080 = new ThreadRc_00080(); + ThreadRc_00080 A4_00080 = new ThreadRc_00080(); + ThreadRc_00080 A5_00080 = new ThreadRc_00080(); + ThreadRc_00080 A6_00080 = new ThreadRc_00080(); + + A1_00080.start(); + A2_00080.start(); + A3_00080.start(); + A4_00080.start(); + A5_00080.start(); + A6_00080.start(); + try { + A1_00080.join(); + A2_00080.join(); + A3_00080.join(); + A4_00080.join(); + A5_00080.join(); + A6_00080.join(); + + } catch (InterruptedException e) { + } + if (A1_00080.check() && A2_00080.check() && A3_00080.check() && A4_00080.check() && A5_00080.check() && A6_00080.check()) + System.out.println("ExpectResult"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0214-rc-function-RC_Thread01-Nocycle_am_00090/Nocycle_am_00090.java b/test/testsuite/ouroboros/memory_management/Function/RC0214-rc-function-RC_Thread01-Nocycle_am_00090/Nocycle_am_00090.java index 0af2e4f4c0a7535c90c1b6156b2b7cfc65568314..ff2ee96264fb9cc0053fc371f20e38333fdab5c3 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0214-rc-function-RC_Thread01-Nocycle_am_00090/Nocycle_am_00090.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0214-rc-function-RC_Thread01-Nocycle_am_00090/Nocycle_am_00090.java @@ -1,168 +1,168 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00090.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00090 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00090.java - *- @ExecuteClass: Nocycle_am_00090 - *- @ExecuteArgs: - */ -class ThreadRc_00090 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00090_A1 a1_main = new Nocycle_a_00090_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00090_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00090_C1("c1_0"); - a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00090_D1("d1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c1_0.d1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2308) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00090_A1 { - Nocycle_a_00090_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00090_B1 { - Nocycle_a_00090_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00090_C1 { - Nocycle_a_00090_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00090_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00090 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00090 A1_00090 = new ThreadRc_00090(); - ThreadRc_00090 A2_00090 = new ThreadRc_00090(); - ThreadRc_00090 A3_00090 = new ThreadRc_00090(); - ThreadRc_00090 A4_00090 = new ThreadRc_00090(); - ThreadRc_00090 A5_00090 = new ThreadRc_00090(); - ThreadRc_00090 A6_00090 = new ThreadRc_00090(); - - A1_00090.start(); - A2_00090.start(); - A3_00090.start(); - A4_00090.start(); - A5_00090.start(); - A6_00090.start(); - - try { - A1_00090.join(); - A2_00090.join(); - A3_00090.join(); - A4_00090.join(); - A5_00090.join(); - A6_00090.join(); - - } catch (InterruptedException e) { - } - if (A1_00090.check() && A2_00090.check() && A3_00090.check() && A4_00090.check() && A5_00090.check() && A6_00090.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00090.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00090 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00090.java + *- @ExecuteClass: Nocycle_am_00090 + *- @ExecuteArgs: + */ +class ThreadRc_00090 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00090_A1 a1_main = new Nocycle_a_00090_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00090_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00090_C1("c1_0"); + a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00090_D1("d1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c1_0.d1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2308) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00090_A1 { + Nocycle_a_00090_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00090_B1 { + Nocycle_a_00090_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00090_C1 { + Nocycle_a_00090_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00090_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00090 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00090 A1_00090 = new ThreadRc_00090(); + ThreadRc_00090 A2_00090 = new ThreadRc_00090(); + ThreadRc_00090 A3_00090 = new ThreadRc_00090(); + ThreadRc_00090 A4_00090 = new ThreadRc_00090(); + ThreadRc_00090 A5_00090 = new ThreadRc_00090(); + ThreadRc_00090 A6_00090 = new ThreadRc_00090(); + + A1_00090.start(); + A2_00090.start(); + A3_00090.start(); + A4_00090.start(); + A5_00090.start(); + A6_00090.start(); + + try { + A1_00090.join(); + A2_00090.join(); + A3_00090.join(); + A4_00090.join(); + A5_00090.join(); + A6_00090.join(); + + } catch (InterruptedException e) { + } + if (A1_00090.check() && A2_00090.check() && A3_00090.check() && A4_00090.check() && A5_00090.check() && A6_00090.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0215-rc-function-RC_Thread01-Nocycle_am_00100/Nocycle_am_00100.java b/test/testsuite/ouroboros/memory_management/Function/RC0215-rc-function-RC_Thread01-Nocycle_am_00100/Nocycle_am_00100.java index 726b34b9f81832afb80a520830cffa284ffa0d46..8b8f04a625cf4678bbe8d5db318b334616d72d14 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0215-rc-function-RC_Thread01-Nocycle_am_00100/Nocycle_am_00100.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0215-rc-function-RC_Thread01-Nocycle_am_00100/Nocycle_am_00100.java @@ -1,305 +1,305 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00100.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00100 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00100.java - *- @ExecuteClass: Nocycle_am_00100 - *- @ExecuteArgs: - */ -class ThreadRc_00100 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00100_A1 a1_main = new Nocycle_a_00100_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00100_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00100_C1("c1_0"); - a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00100_D1("d1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_00100_E1("e1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_00100_F1("f1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_00100_G1("g1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_00100_H1("h1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_00100_I1("i1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_00100_J1("j1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c1_0.d1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); -// System.out.printf("a=%d\n",a1_main.sum); -// System.out.printf("b=%d\n",a1_main.b1_0.sum); -// System.out.printf("c=%d\n",a1_main.b1_0.c1_0.sum); -// System.out.printf("d=%d\n",a1_main.b1_0.c1_0.d1_0.sum); -// System.out.printf("e=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.sum); -// System.out.printf("f=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum); -// System.out.printf("g=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum); -// System.out.printf("h=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum); -// System.out.printf("i=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum); -// System.out.printf("j=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; - - //System.out.println("RC-Testing_Result="+result); - - if (result == 11920) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00100_A1 { - Nocycle_a_00100_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00100_B1 { - Nocycle_a_00100_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00100_C1 { - Nocycle_a_00100_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00100_D1 { - Nocycle_a_00100_E1 e1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_D1(String strObjectName) { - e1_0 = null; - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + e1_0.a; - } - } - - class Nocycle_a_00100_E1 { - Nocycle_a_00100_F1 f1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_E1(String strObjectName) { - f1_0 = null; - a = 501; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_E1_"+strObjectName); - } - - void add() { - sum = a + f1_0.a; - } - } - - class Nocycle_a_00100_F1 { - Nocycle_a_00100_G1 g1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_F1(String strObjectName) { - g1_0 = null; - a = 601; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_F1_"+strObjectName); - } - - void add() { - sum = a + g1_0.a; - } - } - - class Nocycle_a_00100_G1 { - Nocycle_a_00100_H1 h1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_G1(String strObjectName) { - h1_0 = null; - a = 701; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_G1_"+strObjectName); - } - - void add() { - sum = a + h1_0.a; - } - } - - class Nocycle_a_00100_H1 { - Nocycle_a_00100_I1 i1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_H1(String strObjectName) { - i1_0 = null; - a = 801; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_H1_"+strObjectName); - } - - void add() { - sum = a + i1_0.a; - } - } - - class Nocycle_a_00100_I1 { - Nocycle_a_00100_J1 j1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_I1(String strObjectName) { - j1_0 = null; - a = 901; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_I1_"+strObjectName); - } - - void add() { - sum = a + j1_0.a; - } - } - - class Nocycle_a_00100_J1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_J1(String strObjectName) { - a = 1001; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_J1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00100 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00100 A1_00100 = new ThreadRc_00100(); - ThreadRc_00100 A2_00100 = new ThreadRc_00100(); - ThreadRc_00100 A3_00100 = new ThreadRc_00100(); - ThreadRc_00100 A4_00100 = new ThreadRc_00100(); - ThreadRc_00100 A5_00100 = new ThreadRc_00100(); - ThreadRc_00100 A6_00100 = new ThreadRc_00100(); - - A1_00100.start(); - A2_00100.start(); - A3_00100.start(); - A4_00100.start(); - A5_00100.start(); - A6_00100.start(); - - try { - A1_00100.join(); - A2_00100.join(); - A3_00100.join(); - A4_00100.join(); - A5_00100.join(); - A6_00100.join(); - - } catch (InterruptedException e) { - } - if (A1_00100.check() && A2_00100.check() && A3_00100.check() && A4_00100.check() && A5_00100.check() && A6_00100.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00100.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00100 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00100.java + *- @ExecuteClass: Nocycle_am_00100 + *- @ExecuteArgs: + */ +class ThreadRc_00100 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00100_A1 a1_main = new Nocycle_a_00100_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00100_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00100_C1("c1_0"); + a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00100_D1("d1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_00100_E1("e1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_00100_F1("f1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_00100_G1("g1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_00100_H1("h1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_00100_I1("i1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_00100_J1("j1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c1_0.d1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); +// System.out.printf("a=%d\n",a1_main.sum); +// System.out.printf("b=%d\n",a1_main.b1_0.sum); +// System.out.printf("c=%d\n",a1_main.b1_0.c1_0.sum); +// System.out.printf("d=%d\n",a1_main.b1_0.c1_0.d1_0.sum); +// System.out.printf("e=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.sum); +// System.out.printf("f=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum); +// System.out.printf("g=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum); +// System.out.printf("h=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum); +// System.out.printf("i=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum); +// System.out.printf("j=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; + + //System.out.println("RC-Testing_Result="+result); + + if (result == 11920) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00100_A1 { + Nocycle_a_00100_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00100_B1 { + Nocycle_a_00100_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00100_C1 { + Nocycle_a_00100_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00100_D1 { + Nocycle_a_00100_E1 e1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_D1(String strObjectName) { + e1_0 = null; + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + e1_0.a; + } + } + + class Nocycle_a_00100_E1 { + Nocycle_a_00100_F1 f1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_E1(String strObjectName) { + f1_0 = null; + a = 501; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_E1_"+strObjectName); + } + + void add() { + sum = a + f1_0.a; + } + } + + class Nocycle_a_00100_F1 { + Nocycle_a_00100_G1 g1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_F1(String strObjectName) { + g1_0 = null; + a = 601; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_F1_"+strObjectName); + } + + void add() { + sum = a + g1_0.a; + } + } + + class Nocycle_a_00100_G1 { + Nocycle_a_00100_H1 h1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_G1(String strObjectName) { + h1_0 = null; + a = 701; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_G1_"+strObjectName); + } + + void add() { + sum = a + h1_0.a; + } + } + + class Nocycle_a_00100_H1 { + Nocycle_a_00100_I1 i1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_H1(String strObjectName) { + i1_0 = null; + a = 801; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_H1_"+strObjectName); + } + + void add() { + sum = a + i1_0.a; + } + } + + class Nocycle_a_00100_I1 { + Nocycle_a_00100_J1 j1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_I1(String strObjectName) { + j1_0 = null; + a = 901; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_I1_"+strObjectName); + } + + void add() { + sum = a + j1_0.a; + } + } + + class Nocycle_a_00100_J1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_J1(String strObjectName) { + a = 1001; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_J1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00100 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00100 A1_00100 = new ThreadRc_00100(); + ThreadRc_00100 A2_00100 = new ThreadRc_00100(); + ThreadRc_00100 A3_00100 = new ThreadRc_00100(); + ThreadRc_00100 A4_00100 = new ThreadRc_00100(); + ThreadRc_00100 A5_00100 = new ThreadRc_00100(); + ThreadRc_00100 A6_00100 = new ThreadRc_00100(); + + A1_00100.start(); + A2_00100.start(); + A3_00100.start(); + A4_00100.start(); + A5_00100.start(); + A6_00100.start(); + + try { + A1_00100.join(); + A2_00100.join(); + A3_00100.join(); + A4_00100.join(); + A5_00100.join(); + A6_00100.join(); + + } catch (InterruptedException e) { + } + if (A1_00100.check() && A2_00100.check() && A3_00100.check() && A4_00100.check() && A5_00100.check() && A6_00100.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0216-rc-function-RC_Thread01-Nocycle_am_00110/Nocycle_am_00110.java b/test/testsuite/ouroboros/memory_management/Function/RC0216-rc-function-RC_Thread01-Nocycle_am_00110/Nocycle_am_00110.java index 766ab5f8d7e6e84ce119b767c62f1e365396f33f..0382d5fc62174e6f49a04954a41b5b7c481c573a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0216-rc-function-RC_Thread01-Nocycle_am_00110/Nocycle_am_00110.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0216-rc-function-RC_Thread01-Nocycle_am_00110/Nocycle_am_00110.java @@ -1,355 +1,355 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00110.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00110 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00110.java - *- @ExecuteClass: Nocycle_am_00110 - *- @ExecuteArgs: - */ -class ThreadRc_00110 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00110_A1 a1_main = new Nocycle_a_00110_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00110_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00110_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00110_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00110_B4("b4_0"); - a1_main.b1_0.d1_0 = new Nocycle_a_00110_D1("d1_0"); - a1_main.b2_0.c2_0 = new Nocycle_a_00110_C2("c2_0"); - a1_main.b3_0.c1_0 = new Nocycle_a_00110_C1("c1_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_00110_C3("c3_0"); - a1_main.b3_0.c1_0.d2_0 = new Nocycle_a_00110_D2("d2_0"); - a1_main.b2_0.c2_0.d3_0 = new Nocycle_a_00110_D3("d3_0"); - a1_main.b2_0.c2_0.d4_0 = new Nocycle_a_00110_D4("d4_0"); - a1_main.d5_0 = new Nocycle_a_00110_D5("d5_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b2_0.c2_0.add(); - a1_main.b3_0.c1_0.add(); - a1_main.b4_0.c3_0.add(); - a1_main.b1_0.d1_0.add(); - a1_main.b3_0.c1_0.d2_0.add(); - a1_main.b2_0.c2_0.d3_0.add(); - a1_main.b2_0.c2_0.d4_0.add(); - a1_main.d5_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b2_0.c2_0.sum+a1_main.b3_0.c1_0.sum+a1_main.b4_0.c3_0.sum+a1_main.b1_0.d1_0.sum+a1_main.b3_0.c1_0.d2_0.sum+a1_main.b2_0.c2_0.d3_0.sum+a1_main.b2_0.c2_0.d4_0.sum+a1_main.d5_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b3_0.c1_0.sum + a1_main.b4_0.c3_0.sum + a1_main.b1_0.d1_0.sum + a1_main.b3_0.c1_0.d2_0.sum + a1_main.b2_0.c2_0.d3_0.sum + a1_main.b2_0.c2_0.d4_0.sum + a1_main.d5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 9881) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00110_A1 { - Nocycle_a_00110_B1 b1_0; - Nocycle_a_00110_B2 b2_0; - Nocycle_a_00110_B3 b3_0; - Nocycle_a_00110_B4 b4_0; - Nocycle_a_00110_D5 d5_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - d5_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + d5_0.a; - } - } - - class Nocycle_a_00110_B1 { - Nocycle_a_00110_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00110_B2 { - Nocycle_a_00110_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B2(String strObjectName) { - c2_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c2_0.a; - } - } - - class Nocycle_a_00110_B3 { - Nocycle_a_00110_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00110_B4 { - Nocycle_a_00110_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B4(String strObjectName) { - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c3_0.a; - } - } - - class Nocycle_a_00110_C1 { - Nocycle_a_00110_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C1(String strObjectName) { - d2_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - class Nocycle_a_00110_C2 { - Nocycle_a_00110_D3 d3_0; - Nocycle_a_00110_D4 d4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C2(String strObjectName) { - d3_0 = null; - d4_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d3_0.a + d4_0.a; - } - } - - class Nocycle_a_00110_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D4(String strObjectName) { - a = 404; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D5 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D5(String strObjectName) { - a = 405; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D5_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00110 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00110 A1_00110 = new ThreadRc_00110(); - ThreadRc_00110 A2_00110 = new ThreadRc_00110(); - ThreadRc_00110 A3_00110 = new ThreadRc_00110(); - ThreadRc_00110 A4_00110 = new ThreadRc_00110(); - ThreadRc_00110 A5_00110 = new ThreadRc_00110(); - ThreadRc_00110 A6_00110 = new ThreadRc_00110(); - - A1_00110.start(); - A2_00110.start(); - A3_00110.start(); - A4_00110.start(); - A5_00110.start(); - A6_00110.start(); - - try { - A1_00110.join(); - A2_00110.join(); - A3_00110.join(); - A4_00110.join(); - A5_00110.join(); - A6_00110.join(); - - } catch (InterruptedException e) { - } - if (A1_00110.check() && A2_00110.check() && A3_00110.check() && A4_00110.check() && A5_00110.check() && A6_00110.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00110.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00110 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00110.java + *- @ExecuteClass: Nocycle_am_00110 + *- @ExecuteArgs: + */ +class ThreadRc_00110 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00110_A1 a1_main = new Nocycle_a_00110_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00110_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00110_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00110_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00110_B4("b4_0"); + a1_main.b1_0.d1_0 = new Nocycle_a_00110_D1("d1_0"); + a1_main.b2_0.c2_0 = new Nocycle_a_00110_C2("c2_0"); + a1_main.b3_0.c1_0 = new Nocycle_a_00110_C1("c1_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_00110_C3("c3_0"); + a1_main.b3_0.c1_0.d2_0 = new Nocycle_a_00110_D2("d2_0"); + a1_main.b2_0.c2_0.d3_0 = new Nocycle_a_00110_D3("d3_0"); + a1_main.b2_0.c2_0.d4_0 = new Nocycle_a_00110_D4("d4_0"); + a1_main.d5_0 = new Nocycle_a_00110_D5("d5_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b2_0.c2_0.add(); + a1_main.b3_0.c1_0.add(); + a1_main.b4_0.c3_0.add(); + a1_main.b1_0.d1_0.add(); + a1_main.b3_0.c1_0.d2_0.add(); + a1_main.b2_0.c2_0.d3_0.add(); + a1_main.b2_0.c2_0.d4_0.add(); + a1_main.d5_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b2_0.c2_0.sum+a1_main.b3_0.c1_0.sum+a1_main.b4_0.c3_0.sum+a1_main.b1_0.d1_0.sum+a1_main.b3_0.c1_0.d2_0.sum+a1_main.b2_0.c2_0.d3_0.sum+a1_main.b2_0.c2_0.d4_0.sum+a1_main.d5_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b3_0.c1_0.sum + a1_main.b4_0.c3_0.sum + a1_main.b1_0.d1_0.sum + a1_main.b3_0.c1_0.d2_0.sum + a1_main.b2_0.c2_0.d3_0.sum + a1_main.b2_0.c2_0.d4_0.sum + a1_main.d5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 9881) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00110_A1 { + Nocycle_a_00110_B1 b1_0; + Nocycle_a_00110_B2 b2_0; + Nocycle_a_00110_B3 b3_0; + Nocycle_a_00110_B4 b4_0; + Nocycle_a_00110_D5 d5_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + d5_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + d5_0.a; + } + } + + class Nocycle_a_00110_B1 { + Nocycle_a_00110_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00110_B2 { + Nocycle_a_00110_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B2(String strObjectName) { + c2_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c2_0.a; + } + } + + class Nocycle_a_00110_B3 { + Nocycle_a_00110_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00110_B4 { + Nocycle_a_00110_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B4(String strObjectName) { + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c3_0.a; + } + } + + class Nocycle_a_00110_C1 { + Nocycle_a_00110_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C1(String strObjectName) { + d2_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + class Nocycle_a_00110_C2 { + Nocycle_a_00110_D3 d3_0; + Nocycle_a_00110_D4 d4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C2(String strObjectName) { + d3_0 = null; + d4_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d3_0.a + d4_0.a; + } + } + + class Nocycle_a_00110_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D4(String strObjectName) { + a = 404; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D5 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D5(String strObjectName) { + a = 405; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D5_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00110 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00110 A1_00110 = new ThreadRc_00110(); + ThreadRc_00110 A2_00110 = new ThreadRc_00110(); + ThreadRc_00110 A3_00110 = new ThreadRc_00110(); + ThreadRc_00110 A4_00110 = new ThreadRc_00110(); + ThreadRc_00110 A5_00110 = new ThreadRc_00110(); + ThreadRc_00110 A6_00110 = new ThreadRc_00110(); + + A1_00110.start(); + A2_00110.start(); + A3_00110.start(); + A4_00110.start(); + A5_00110.start(); + A6_00110.start(); + + try { + A1_00110.join(); + A2_00110.join(); + A3_00110.join(); + A4_00110.join(); + A5_00110.join(); + A6_00110.join(); + + } catch (InterruptedException e) { + } + if (A1_00110.check() && A2_00110.check() && A3_00110.check() && A4_00110.check() && A5_00110.check() && A6_00110.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0217-rc-function-RC_Thread01-Nocycle_am_00120/Nocycle_am_00120.java b/test/testsuite/ouroboros/memory_management/Function/RC0217-rc-function-RC_Thread01-Nocycle_am_00120/Nocycle_am_00120.java index c0e7ae5e20d48f66f14c3688151a44ef0ad868aa..39b9e6a841779690311352bde0c9c831b440b4d2 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0217-rc-function-RC_Thread01-Nocycle_am_00120/Nocycle_am_00120.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0217-rc-function-RC_Thread01-Nocycle_am_00120/Nocycle_am_00120.java @@ -1,148 +1,148 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00120.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00120 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00120.java - *- @ExecuteClass: Nocycle_am_00120 - *- @ExecuteArgs: - */ -class ThreadRc_00120 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00120_A1 a1_main = new Nocycle_a_00120_A1("a1_main"); - Nocycle_a_00120_A2 a2_main = new Nocycle_a_00120_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); - a2_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a2_main.b1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1007) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00120_A1 { - Nocycle_a_00120_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00120_A2 { - Nocycle_a_00120_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00120_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00120 { - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00120 A1_00120 = new ThreadRc_00120(); - ThreadRc_00120 A2_00120 = new ThreadRc_00120(); - ThreadRc_00120 A3_00120 = new ThreadRc_00120(); - ThreadRc_00120 A4_00120 = new ThreadRc_00120(); - ThreadRc_00120 A5_00120 = new ThreadRc_00120(); - ThreadRc_00120 A6_00120 = new ThreadRc_00120(); - - A1_00120.start(); - A2_00120.start(); - A3_00120.start(); - A4_00120.start(); - A5_00120.start(); - A6_00120.start(); - - try { - A1_00120.join(); - A2_00120.join(); - A3_00120.join(); - A4_00120.join(); - A5_00120.join(); - A6_00120.join(); - - } catch (InterruptedException e) { - } - if (A1_00120.check() && A2_00120.check() && A3_00120.check() && A4_00120.check() && A5_00120.check() && A6_00120.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00120.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00120 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00120.java + *- @ExecuteClass: Nocycle_am_00120 + *- @ExecuteArgs: + */ +class ThreadRc_00120 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00120_A1 a1_main = new Nocycle_a_00120_A1("a1_main"); + Nocycle_a_00120_A2 a2_main = new Nocycle_a_00120_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); + a2_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a2_main.b1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1007) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00120_A1 { + Nocycle_a_00120_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00120_A2 { + Nocycle_a_00120_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00120_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00120 { + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00120 A1_00120 = new ThreadRc_00120(); + ThreadRc_00120 A2_00120 = new ThreadRc_00120(); + ThreadRc_00120 A3_00120 = new ThreadRc_00120(); + ThreadRc_00120 A4_00120 = new ThreadRc_00120(); + ThreadRc_00120 A5_00120 = new ThreadRc_00120(); + ThreadRc_00120 A6_00120 = new ThreadRc_00120(); + + A1_00120.start(); + A2_00120.start(); + A3_00120.start(); + A4_00120.start(); + A5_00120.start(); + A6_00120.start(); + + try { + A1_00120.join(); + A2_00120.join(); + A3_00120.join(); + A4_00120.join(); + A5_00120.join(); + A6_00120.join(); + + } catch (InterruptedException e) { + } + if (A1_00120.check() && A2_00120.check() && A3_00120.check() && A4_00120.check() && A5_00120.check() && A6_00120.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0218-rc-function-RC_Thread01-Nocycle_am_00130/Nocycle_am_00130.java b/test/testsuite/ouroboros/memory_management/Function/RC0218-rc-function-RC_Thread01-Nocycle_am_00130/Nocycle_am_00130.java index fca9151418fac7652b5f70b2509267d44bfbc3dc..44b542684112cd534da40a426cd7bf2aa7bdd480 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0218-rc-function-RC_Thread01-Nocycle_am_00130/Nocycle_am_00130.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0218-rc-function-RC_Thread01-Nocycle_am_00130/Nocycle_am_00130.java @@ -1,332 +1,332 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00130.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00130 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00130.java - *- @ExecuteClass: Nocycle_am_00130 - *- @ExecuteArgs: - */ -class ThreadRc_00130 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00130_A1 a1_main = new Nocycle_a_00130_A1("a1_main"); - Nocycle_a_00130_A2 a2_main = new Nocycle_a_00130_A2("a2_main"); - Nocycle_a_00130_A3 a3_main = new Nocycle_a_00130_A3("a3_main"); - Nocycle_a_00130_A4 a4_main = new Nocycle_a_00130_A4("a4_main"); - Nocycle_a_00130_A5 a5_main = new Nocycle_a_00130_A5("a5_main"); - Nocycle_a_00130_A6 a6_main = new Nocycle_a_00130_A6("a6_main"); - Nocycle_a_00130_A7 a7_main = new Nocycle_a_00130_A7("a7_main"); - Nocycle_a_00130_A8 a8_main = new Nocycle_a_00130_A8("a8_main"); - Nocycle_a_00130_A9 a9_main = new Nocycle_a_00130_A9("a9_main"); - Nocycle_a_00130_A10 a10_main = new Nocycle_a_00130_A10("a10_main"); - a1_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a2_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a3_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a4_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a5_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a6_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a7_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a8_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a9_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a10_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a5_main.add(); - a6_main.add(); - a7_main.add(); - a8_main.add(); - a9_main.add(); - a10_main.add(); - a1_main.b1_0.add(); - a2_main.b1_0.add(); - a3_main.b1_0.add(); - a4_main.b1_0.add(); - a5_main.b1_0.add(); - a6_main.b1_0.add(); - a7_main.b1_0.add(); - a8_main.b1_0.add(); - a9_main.b1_0.add(); - a10_main.b1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a5_main.sum+a6_main.sum+a7_main.sum+a8_main.sum+a9_main.sum+a10_main.sum+a1_main.b1_0.sum); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a5_main.sum + a6_main.sum + a7_main.sum + a8_main.sum + a9_main.sum + a10_main.sum + a1_main.b1_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 3467) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00130_A1 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A2 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A3 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A3(String strObjectName) { - b1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A4 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A4(String strObjectName) { - b1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A5 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A5(String strObjectName) { - b1_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A6 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A6(String strObjectName) { - b1_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A7 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A7(String strObjectName) { - b1_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A8 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A8(String strObjectName) { - b1_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A9 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A9(String strObjectName) { - b1_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A10 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A10(String strObjectName) { - b1_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00130 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00130 A1_00130 = new ThreadRc_00130(); - ThreadRc_00130 A2_00130 = new ThreadRc_00130(); - ThreadRc_00130 A3_00130 = new ThreadRc_00130(); - ThreadRc_00130 A4_00130 = new ThreadRc_00130(); - ThreadRc_00130 A5_00130 = new ThreadRc_00130(); - ThreadRc_00130 A6_00130 = new ThreadRc_00130(); - - A1_00130.start(); - A2_00130.start(); - A3_00130.start(); - A4_00130.start(); - A5_00130.start(); - A6_00130.start(); - - try { - A1_00130.join(); - A2_00130.join(); - A3_00130.join(); - A4_00130.join(); - A5_00130.join(); - A6_00130.join(); - - } catch (InterruptedException e) { - } - if (A1_00130.check() && A2_00130.check() && A3_00130.check() && A4_00130.check() && A5_00130.check() && A6_00130.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00130.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00130 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00130.java + *- @ExecuteClass: Nocycle_am_00130 + *- @ExecuteArgs: + */ +class ThreadRc_00130 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00130_A1 a1_main = new Nocycle_a_00130_A1("a1_main"); + Nocycle_a_00130_A2 a2_main = new Nocycle_a_00130_A2("a2_main"); + Nocycle_a_00130_A3 a3_main = new Nocycle_a_00130_A3("a3_main"); + Nocycle_a_00130_A4 a4_main = new Nocycle_a_00130_A4("a4_main"); + Nocycle_a_00130_A5 a5_main = new Nocycle_a_00130_A5("a5_main"); + Nocycle_a_00130_A6 a6_main = new Nocycle_a_00130_A6("a6_main"); + Nocycle_a_00130_A7 a7_main = new Nocycle_a_00130_A7("a7_main"); + Nocycle_a_00130_A8 a8_main = new Nocycle_a_00130_A8("a8_main"); + Nocycle_a_00130_A9 a9_main = new Nocycle_a_00130_A9("a9_main"); + Nocycle_a_00130_A10 a10_main = new Nocycle_a_00130_A10("a10_main"); + a1_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a2_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a3_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a4_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a5_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a6_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a7_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a8_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a9_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a10_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a5_main.add(); + a6_main.add(); + a7_main.add(); + a8_main.add(); + a9_main.add(); + a10_main.add(); + a1_main.b1_0.add(); + a2_main.b1_0.add(); + a3_main.b1_0.add(); + a4_main.b1_0.add(); + a5_main.b1_0.add(); + a6_main.b1_0.add(); + a7_main.b1_0.add(); + a8_main.b1_0.add(); + a9_main.b1_0.add(); + a10_main.b1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a5_main.sum+a6_main.sum+a7_main.sum+a8_main.sum+a9_main.sum+a10_main.sum+a1_main.b1_0.sum); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a5_main.sum + a6_main.sum + a7_main.sum + a8_main.sum + a9_main.sum + a10_main.sum + a1_main.b1_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 3467) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00130_A1 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A2 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A3 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A3(String strObjectName) { + b1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A4 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A4(String strObjectName) { + b1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A5 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A5(String strObjectName) { + b1_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A6 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A6(String strObjectName) { + b1_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A7 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A7(String strObjectName) { + b1_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A8 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A8(String strObjectName) { + b1_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A9 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A9(String strObjectName) { + b1_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A10 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A10(String strObjectName) { + b1_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00130 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00130 A1_00130 = new ThreadRc_00130(); + ThreadRc_00130 A2_00130 = new ThreadRc_00130(); + ThreadRc_00130 A3_00130 = new ThreadRc_00130(); + ThreadRc_00130 A4_00130 = new ThreadRc_00130(); + ThreadRc_00130 A5_00130 = new ThreadRc_00130(); + ThreadRc_00130 A6_00130 = new ThreadRc_00130(); + + A1_00130.start(); + A2_00130.start(); + A3_00130.start(); + A4_00130.start(); + A5_00130.start(); + A6_00130.start(); + + try { + A1_00130.join(); + A2_00130.join(); + A3_00130.join(); + A4_00130.join(); + A5_00130.join(); + A6_00130.join(); + + } catch (InterruptedException e) { + } + if (A1_00130.check() && A2_00130.check() && A3_00130.check() && A4_00130.check() && A5_00130.check() && A6_00130.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0219-rc-function-RC_Thread01-Nocycle_am_00140/Nocycle_am_00140.java b/test/testsuite/ouroboros/memory_management/Function/RC0219-rc-function-RC_Thread01-Nocycle_am_00140/Nocycle_am_00140.java index 5538667d522564a54a7480d9af0c5a29460cc5a7..7f8fe099f04751f1c4e0cbc34dfe2911968115c5 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0219-rc-function-RC_Thread01-Nocycle_am_00140/Nocycle_am_00140.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0219-rc-function-RC_Thread01-Nocycle_am_00140/Nocycle_am_00140.java @@ -1,170 +1,170 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00140.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00140 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00140.java - *- @ExecuteClass: Nocycle_am_00140 - *- @ExecuteArgs: - */ -class ThreadRc_00140 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00140_A1 a1_main = new Nocycle_a_00140_A1("a1_main"); - Nocycle_a_00140_A2 a2_main = new Nocycle_a_00140_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00140_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1613) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00140_A1 { - Nocycle_a_00140_B1 b1_0; - Nocycle_a_00140_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00140_A2 { - Nocycle_a_00140_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00140_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00140_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00140 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00140 A1_00140 = new ThreadRc_00140(); - ThreadRc_00140 A2_00140 = new ThreadRc_00140(); - ThreadRc_00140 A3_00140 = new ThreadRc_00140(); - ThreadRc_00140 A4_00140 = new ThreadRc_00140(); - ThreadRc_00140 A5_00140 = new ThreadRc_00140(); - ThreadRc_00140 A6_00140 = new ThreadRc_00140(); - - A1_00140.start(); - A2_00140.start(); - A3_00140.start(); - A4_00140.start(); - A5_00140.start(); - A6_00140.start(); - - try { - A1_00140.join(); - A2_00140.join(); - A3_00140.join(); - A4_00140.join(); - A5_00140.join(); - A6_00140.join(); - - } catch (InterruptedException e) { - } - if (A1_00140.check() && A2_00140.check() && A3_00140.check() && A4_00140.check() && A5_00140.check() && A6_00140.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00140.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00140 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00140.java + *- @ExecuteClass: Nocycle_am_00140 + *- @ExecuteArgs: + */ +class ThreadRc_00140 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00140_A1 a1_main = new Nocycle_a_00140_A1("a1_main"); + Nocycle_a_00140_A2 a2_main = new Nocycle_a_00140_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00140_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1613) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00140_A1 { + Nocycle_a_00140_B1 b1_0; + Nocycle_a_00140_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00140_A2 { + Nocycle_a_00140_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00140_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00140_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00140 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00140 A1_00140 = new ThreadRc_00140(); + ThreadRc_00140 A2_00140 = new ThreadRc_00140(); + ThreadRc_00140 A3_00140 = new ThreadRc_00140(); + ThreadRc_00140 A4_00140 = new ThreadRc_00140(); + ThreadRc_00140 A5_00140 = new ThreadRc_00140(); + ThreadRc_00140 A6_00140 = new ThreadRc_00140(); + + A1_00140.start(); + A2_00140.start(); + A3_00140.start(); + A4_00140.start(); + A5_00140.start(); + A6_00140.start(); + + try { + A1_00140.join(); + A2_00140.join(); + A3_00140.join(); + A4_00140.join(); + A5_00140.join(); + A6_00140.join(); + + } catch (InterruptedException e) { + } + if (A1_00140.check() && A2_00140.check() && A3_00140.check() && A4_00140.check() && A5_00140.check() && A6_00140.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0220-rc-function-RC_Thread01-Nocycle_am_00150/Nocycle_am_00150.java b/test/testsuite/ouroboros/memory_management/Function/RC0220-rc-function-RC_Thread01-Nocycle_am_00150/Nocycle_am_00150.java index aff127f63105cfcddd07904a46c5b93624b884dd..25433850e52f9f1173c76f1908d4ea5fbc437b53 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0220-rc-function-RC_Thread01-Nocycle_am_00150/Nocycle_am_00150.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0220-rc-function-RC_Thread01-Nocycle_am_00150/Nocycle_am_00150.java @@ -1,174 +1,174 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00150.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00150 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00150.java - *- @ExecuteClass: Nocycle_am_00150 - *- @ExecuteArgs: - */ -class ThreadRc_00150 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); - Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1815) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00150_A1 { - Nocycle_a_00150_B1 b1_0; - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00150_A2 { - Nocycle_a_00150_B1 b1_0; - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00150_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00150_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00150 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00150 A1_00150 = new ThreadRc_00150(); - ThreadRc_00150 A2_00150 = new ThreadRc_00150(); - ThreadRc_00150 A3_00150 = new ThreadRc_00150(); - ThreadRc_00150 A4_00150 = new ThreadRc_00150(); - ThreadRc_00150 A5_00150 = new ThreadRc_00150(); - ThreadRc_00150 A6_00150 = new ThreadRc_00150(); - - A1_00150.start(); - A2_00150.start(); - A3_00150.start(); - A4_00150.start(); - A5_00150.start(); - A6_00150.start(); - - try { - A1_00150.join(); - A2_00150.join(); - A3_00150.join(); - A4_00150.join(); - A5_00150.join(); - A6_00150.join(); - - } catch (InterruptedException e) { - } - if (A1_00150.check() && A2_00150.check() && A3_00150.check() && A4_00150.check() && A5_00150.check() && A6_00150.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00150.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00150 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00150.java + *- @ExecuteClass: Nocycle_am_00150 + *- @ExecuteArgs: + */ +class ThreadRc_00150 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); + Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1815) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00150_A1 { + Nocycle_a_00150_B1 b1_0; + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00150_A2 { + Nocycle_a_00150_B1 b1_0; + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00150_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00150_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00150 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00150 A1_00150 = new ThreadRc_00150(); + ThreadRc_00150 A2_00150 = new ThreadRc_00150(); + ThreadRc_00150 A3_00150 = new ThreadRc_00150(); + ThreadRc_00150 A4_00150 = new ThreadRc_00150(); + ThreadRc_00150 A5_00150 = new ThreadRc_00150(); + ThreadRc_00150 A6_00150 = new ThreadRc_00150(); + + A1_00150.start(); + A2_00150.start(); + A3_00150.start(); + A4_00150.start(); + A5_00150.start(); + A6_00150.start(); + + try { + A1_00150.join(); + A2_00150.join(); + A3_00150.join(); + A4_00150.join(); + A5_00150.join(); + A6_00150.join(); + + } catch (InterruptedException e) { + } + if (A1_00150.check() && A2_00150.check() && A3_00150.check() && A4_00150.check() && A5_00150.check() && A6_00150.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0221-rc-function-RC_Thread01-Nocycle_am_00160/Nocycle_am_00160.java b/test/testsuite/ouroboros/memory_management/Function/RC0221-rc-function-RC_Thread01-Nocycle_am_00160/Nocycle_am_00160.java index 9a3a9c87e55ef518345c197f2bdc37839333d425..ffb9f9dba1135e58f68006da4a4267d1257e258b 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0221-rc-function-RC_Thread01-Nocycle_am_00160/Nocycle_am_00160.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0221-rc-function-RC_Thread01-Nocycle_am_00160/Nocycle_am_00160.java @@ -1,228 +1,228 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00160.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00160 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00160.java - *- @ExecuteClass: Nocycle_am_00160 - *- @ExecuteArgs: - */ -class ThreadRc_00160 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00160_A1 a1_main = new Nocycle_a_00160_A1("a1_main"); - Nocycle_a_00160_A2 a2_main = new Nocycle_a_00160_A2("a2_main"); - Nocycle_a_00160_A3 a3_main = new Nocycle_a_00160_A3("a3_main"); - Nocycle_a_00160_A4 a4_main = new Nocycle_a_00160_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a3_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a3_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a4_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a4_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); - a3_main.b1_0.add(); - a3_main.b2_0.add(); - a4_main.b1_0.add(); - a4_main.b2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2828) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00160_A1 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00160_A2 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00160_A3 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A3(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00160_A4 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A4(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00160_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00160_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00160 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00160 A1_00160 = new ThreadRc_00160(); - ThreadRc_00160 A2_00160 = new ThreadRc_00160(); - ThreadRc_00160 A3_00160 = new ThreadRc_00160(); - ThreadRc_00160 A4_00160 = new ThreadRc_00160(); - ThreadRc_00160 A5_00160 = new ThreadRc_00160(); - ThreadRc_00160 A6_00160 = new ThreadRc_00160(); - - A1_00160.start(); - A2_00160.start(); - A3_00160.start(); - A4_00160.start(); - A5_00160.start(); - A6_00160.start(); - - try { - A1_00160.join(); - A2_00160.join(); - A3_00160.join(); - A4_00160.join(); - A5_00160.join(); - A6_00160.join(); - - } catch (InterruptedException e) { - } - if (A1_00160.check() && A2_00160.check() && A3_00160.check() && A4_00160.check() && A5_00160.check() && A6_00160.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00160.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00160 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00160.java + *- @ExecuteClass: Nocycle_am_00160 + *- @ExecuteArgs: + */ +class ThreadRc_00160 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00160_A1 a1_main = new Nocycle_a_00160_A1("a1_main"); + Nocycle_a_00160_A2 a2_main = new Nocycle_a_00160_A2("a2_main"); + Nocycle_a_00160_A3 a3_main = new Nocycle_a_00160_A3("a3_main"); + Nocycle_a_00160_A4 a4_main = new Nocycle_a_00160_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a3_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a3_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a4_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a4_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); + a3_main.b1_0.add(); + a3_main.b2_0.add(); + a4_main.b1_0.add(); + a4_main.b2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2828) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00160_A1 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00160_A2 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00160_A3 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A3(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00160_A4 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A4(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00160_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00160_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00160 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00160 A1_00160 = new ThreadRc_00160(); + ThreadRc_00160 A2_00160 = new ThreadRc_00160(); + ThreadRc_00160 A3_00160 = new ThreadRc_00160(); + ThreadRc_00160 A4_00160 = new ThreadRc_00160(); + ThreadRc_00160 A5_00160 = new ThreadRc_00160(); + ThreadRc_00160 A6_00160 = new ThreadRc_00160(); + + A1_00160.start(); + A2_00160.start(); + A3_00160.start(); + A4_00160.start(); + A5_00160.start(); + A6_00160.start(); + + try { + A1_00160.join(); + A2_00160.join(); + A3_00160.join(); + A4_00160.join(); + A5_00160.join(); + A6_00160.join(); + + } catch (InterruptedException e) { + } + if (A1_00160.check() && A2_00160.check() && A3_00160.check() && A4_00160.check() && A5_00160.check() && A6_00160.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0222-rc-function-RC_Thread01-Nocycle_am_00170/Nocycle_am_00170.java b/test/testsuite/ouroboros/memory_management/Function/RC0222-rc-function-RC_Thread01-Nocycle_am_00170/Nocycle_am_00170.java index ef3ca396ef6049ec80c811f8f73ecd5aded6b32b..5c4bae0cc36f596b94b3a6d374d1b50c44b4850b 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0222-rc-function-RC_Thread01-Nocycle_am_00170/Nocycle_am_00170.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0222-rc-function-RC_Thread01-Nocycle_am_00170/Nocycle_am_00170.java @@ -1,262 +1,262 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00170.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00170 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00170.java - *- @ExecuteClass: Nocycle_am_00170 - *- @ExecuteArgs: - */ -class ThreadRc_00170 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00170_A1 a1_main = new Nocycle_a_00170_A1("a1_main"); - Nocycle_a_00170_A2 a2_main = new Nocycle_a_00170_A2("a2_main"); - Nocycle_a_00170_A3 a3_main = new Nocycle_a_00170_A3("a3_main"); - Nocycle_a_00170_A4 a4_main = new Nocycle_a_00170_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a2_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a2_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a3_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a3_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a3_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a4_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a4_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a4_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); - a2_main.b3_0.add(); - a3_main.b1_0.add(); - a3_main.b2_0.add(); - a3_main.b3_0.add(); - a4_main.b1_0.add(); - a4_main.b2_0.add(); - a4_main.b3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 4046) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00170_A1 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00170_A2 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00170_A3 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A3(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00170_A4 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A4(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00170_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00170_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00170_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00170 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00170 A1_00170 = new ThreadRc_00170(); - ThreadRc_00170 A2_00170 = new ThreadRc_00170(); - ThreadRc_00170 A3_00170 = new ThreadRc_00170(); - ThreadRc_00170 A4_00170 = new ThreadRc_00170(); - ThreadRc_00170 A5_00170 = new ThreadRc_00170(); - ThreadRc_00170 A6_00170 = new ThreadRc_00170(); - - A1_00170.start(); - A2_00170.start(); - A3_00170.start(); - A4_00170.start(); - A5_00170.start(); - A6_00170.start(); - - try { - A1_00170.join(); - A2_00170.join(); - A3_00170.join(); - A4_00170.join(); - A5_00170.join(); - A6_00170.join(); - - } catch (InterruptedException e) { - } - if (A1_00170.check() && A2_00170.check() && A3_00170.check() && A4_00170.check() && A5_00170.check() && A6_00170.check()) - System.out.println("ExpectResult"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00170.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00170 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00170.java + *- @ExecuteClass: Nocycle_am_00170 + *- @ExecuteArgs: + */ +class ThreadRc_00170 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00170_A1 a1_main = new Nocycle_a_00170_A1("a1_main"); + Nocycle_a_00170_A2 a2_main = new Nocycle_a_00170_A2("a2_main"); + Nocycle_a_00170_A3 a3_main = new Nocycle_a_00170_A3("a3_main"); + Nocycle_a_00170_A4 a4_main = new Nocycle_a_00170_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a2_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a2_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a3_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a3_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a3_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a4_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a4_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a4_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); + a2_main.b3_0.add(); + a3_main.b1_0.add(); + a3_main.b2_0.add(); + a3_main.b3_0.add(); + a4_main.b1_0.add(); + a4_main.b2_0.add(); + a4_main.b3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 4046) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00170_A1 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00170_A2 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00170_A3 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A3(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00170_A4 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A4(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00170_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00170_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00170_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00170 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00170 A1_00170 = new ThreadRc_00170(); + ThreadRc_00170 A2_00170 = new ThreadRc_00170(); + ThreadRc_00170 A3_00170 = new ThreadRc_00170(); + ThreadRc_00170 A4_00170 = new ThreadRc_00170(); + ThreadRc_00170 A5_00170 = new ThreadRc_00170(); + ThreadRc_00170 A6_00170 = new ThreadRc_00170(); + + A1_00170.start(); + A2_00170.start(); + A3_00170.start(); + A4_00170.start(); + A5_00170.start(); + A6_00170.start(); + + try { + A1_00170.join(); + A2_00170.join(); + A3_00170.join(); + A4_00170.join(); + A5_00170.join(); + A6_00170.join(); + + } catch (InterruptedException e) { + } + if (A1_00170.check() && A2_00170.check() && A3_00170.check() && A4_00170.check() && A5_00170.check() && A6_00170.check()) + System.out.println("ExpectResult"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0223-rc-function-RC_Thread01-Nocycle_am_00180/Nocycle_am_00180.java b/test/testsuite/ouroboros/memory_management/Function/RC0223-rc-function-RC_Thread01-Nocycle_am_00180/Nocycle_am_00180.java index 05a22ecee5d53ed0ec6b793d6693e5294f2e901f..4f4f2e5614a29badd03a873583c2a1c8caeb2515 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0223-rc-function-RC_Thread01-Nocycle_am_00180/Nocycle_am_00180.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0223-rc-function-RC_Thread01-Nocycle_am_00180/Nocycle_am_00180.java @@ -1,402 +1,402 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00180.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_00180 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00180.java - *- @ExecuteClass: Nocycle_am_00180 - *- @ExecuteArgs: - */ -class ThreadRc_00180 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); - Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); - Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); - Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); - a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - - a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a2_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a2_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - - a3_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); - a3_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a3_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a3_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a3_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); - a3_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a3_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); - a4_main.b3_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a4_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); - a4_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a4_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.d1_0.add(); - a1_main.b1_0.d2_0.add(); - - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - -// System.out.printf("a1_main.sum=%d\n",a1_main.sum); -// System.out.printf("a2_main.sum=%d\n",a2_main.sum); -// System.out.printf("a3_main.sum=%d\n",a3_main.sum); -// System.out.printf("a4_main.sum=%d\n",a4_main.sum); -// System.out.printf("a1_main.b1_0.sum=%d\n",a1_main.b1_0.sum); -// System.out.printf("a2_main.b2_0.sum=%d\n",a2_main.b2_0.sum); -// System.out.printf("a4_main.b3_0.sum=%d\n",a4_main.b3_0.sum); -// System.out.printf("a2_main.b2_0.c1_0.sum=%d\n",a2_main.b2_0.c1_0.sum); -// System.out.printf("a3_main.c2_0.sum=%d\n",a3_main.c2_0.sum); -// System.out.printf("a1_main.d1_0.sum=%d\n",a1_main.d1_0.sum); -// System.out.printf("a3_main.c2_0.d2_0.sum=%d\n",a3_main.c2_0.d2_0.sum); -// System.out.printf("a3_main.c2_0.d3_0.sum=%d\n",a3_main.c2_0.d3_0.sum); - - -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a2_main.b2_0.sum+a4_main.b3_0.sum+a2_main.b2_0.c1_0.sum+a3_main.c2_0.sum+a1_main.d1_0.sum+a3_main.c2_0.d2_0.sum+a3_main.c2_0.d3_0.sum); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 9260) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00180_A1 { - Nocycle_a_00180_B1 b1_0; - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - class Nocycle_a_00180_A2 { - Nocycle_a_00180_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - class Nocycle_a_00180_A3 { - Nocycle_a_00180_B2 b2_0; - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class Nocycle_a_00180_A4 { - Nocycle_a_00180_B3 b3_0; - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - class Nocycle_a_00180_B1 { - Nocycle_a_00180_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - class Nocycle_a_00180_B2 { - Nocycle_a_00180_C1 c1_0; - Nocycle_a_00180_D1 d1_0; - Nocycle_a_00180_D2 d2_0; - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_00180_B3 { - Nocycle_a_00180_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00180_C1 { - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00180_C2 { - Nocycle_a_00180_D2 d2_0; - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_00180_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00180_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00180_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_00180 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00180 A1_00180 = new ThreadRc_00180(); - ThreadRc_00180 A2_00180 = new ThreadRc_00180(); - ThreadRc_00180 A3_00180 = new ThreadRc_00180(); - ThreadRc_00180 A4_00180 = new ThreadRc_00180(); - ThreadRc_00180 A5_00180 = new ThreadRc_00180(); - ThreadRc_00180 A6_00180 = new ThreadRc_00180(); - - A1_00180.start(); - A2_00180.start(); - A3_00180.start(); - A4_00180.start(); - A5_00180.start(); - A6_00180.start(); - - try { - A1_00180.join(); - A2_00180.join(); - A3_00180.join(); - A4_00180.join(); - A5_00180.join(); - A6_00180.join(); - - } catch (InterruptedException e) { - } - if (A1_00180.check() && A2_00180.check() && A3_00180.check() && A4_00180.check() && A5_00180.check() && A6_00180.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00180.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_00180 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00180.java + *- @ExecuteClass: Nocycle_am_00180 + *- @ExecuteArgs: + */ +class ThreadRc_00180 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); + Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); + Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); + Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); + a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + + a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a2_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a2_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + + a3_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); + a3_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a3_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a3_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a3_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); + a3_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a3_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); + a4_main.b3_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a4_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); + a4_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a4_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.d1_0.add(); + a1_main.b1_0.d2_0.add(); + + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + +// System.out.printf("a1_main.sum=%d\n",a1_main.sum); +// System.out.printf("a2_main.sum=%d\n",a2_main.sum); +// System.out.printf("a3_main.sum=%d\n",a3_main.sum); +// System.out.printf("a4_main.sum=%d\n",a4_main.sum); +// System.out.printf("a1_main.b1_0.sum=%d\n",a1_main.b1_0.sum); +// System.out.printf("a2_main.b2_0.sum=%d\n",a2_main.b2_0.sum); +// System.out.printf("a4_main.b3_0.sum=%d\n",a4_main.b3_0.sum); +// System.out.printf("a2_main.b2_0.c1_0.sum=%d\n",a2_main.b2_0.c1_0.sum); +// System.out.printf("a3_main.c2_0.sum=%d\n",a3_main.c2_0.sum); +// System.out.printf("a1_main.d1_0.sum=%d\n",a1_main.d1_0.sum); +// System.out.printf("a3_main.c2_0.d2_0.sum=%d\n",a3_main.c2_0.d2_0.sum); +// System.out.printf("a3_main.c2_0.d3_0.sum=%d\n",a3_main.c2_0.d3_0.sum); + + +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a2_main.b2_0.sum+a4_main.b3_0.sum+a2_main.b2_0.c1_0.sum+a3_main.c2_0.sum+a1_main.d1_0.sum+a3_main.c2_0.d2_0.sum+a3_main.c2_0.d3_0.sum); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 9260) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00180_A1 { + Nocycle_a_00180_B1 b1_0; + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + class Nocycle_a_00180_A2 { + Nocycle_a_00180_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + class Nocycle_a_00180_A3 { + Nocycle_a_00180_B2 b2_0; + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class Nocycle_a_00180_A4 { + Nocycle_a_00180_B3 b3_0; + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + class Nocycle_a_00180_B1 { + Nocycle_a_00180_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + class Nocycle_a_00180_B2 { + Nocycle_a_00180_C1 c1_0; + Nocycle_a_00180_D1 d1_0; + Nocycle_a_00180_D2 d2_0; + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_00180_B3 { + Nocycle_a_00180_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00180_C1 { + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00180_C2 { + Nocycle_a_00180_D2 d2_0; + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_00180_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00180_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00180_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_00180 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00180 A1_00180 = new ThreadRc_00180(); + ThreadRc_00180 A2_00180 = new ThreadRc_00180(); + ThreadRc_00180 A3_00180 = new ThreadRc_00180(); + ThreadRc_00180 A4_00180 = new ThreadRc_00180(); + ThreadRc_00180 A5_00180 = new ThreadRc_00180(); + ThreadRc_00180 A6_00180 = new ThreadRc_00180(); + + A1_00180.start(); + A2_00180.start(); + A3_00180.start(); + A4_00180.start(); + A5_00180.start(); + A6_00180.start(); + + try { + A1_00180.join(); + A2_00180.join(); + A3_00180.join(); + A4_00180.join(); + A5_00180.join(); + A6_00180.join(); + + } catch (InterruptedException e) { + } + if (A1_00180.check() && A2_00180.check() && A3_00180.check() && A4_00180.check() && A5_00180.check() && A6_00180.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0224-rc-function-RC_Thread01-Nocycle_am_00190/Nocycle_am_00190.java b/test/testsuite/ouroboros/memory_management/Function/RC0224-rc-function-RC_Thread01-Nocycle_am_00190/Nocycle_am_00190.java index 5fe141fd47d51306427828732a32983013c1cb31..2b0a44fbe4dfed887bcee002065a490371b24bb2 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0224-rc-function-RC_Thread01-Nocycle_am_00190/Nocycle_am_00190.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0224-rc-function-RC_Thread01-Nocycle_am_00190/Nocycle_am_00190.java @@ -1,3148 +1,3148 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00190.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:make Nocycle_a_xx together to this Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_00190.java - *- @ExecuteClass: Nocycle_am_00190 - *- @ExecuteArgs: - */ -class ThreadRc_00010B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_am_00010_A1 a1_main = new Nocycle_am_00010_A1("a1_main"); - a1_main.b1_0 = new Nocycle_am_00010_B1("b1_0"); - a1_main.add(); - a1_main.b1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 704) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_am_00010_A1 { - Nocycle_am_00010_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_am_00010_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - // protected void finalize() throws java.lang.Throwable { -// System.out.println("RC-Testing_Destruction_A1_"+strObjectName); -// } - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_am_00010_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_am_00010_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - // protected void finalize() throws java.lang.Throwable { -// System.out.println("RC-Testing_Destruction_B1_"+strObjectName); -// } - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00020B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00020_A1 a1_main = new Nocycle_a_00020_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00020_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00020_B2("b2_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 1310) - checkout = true; - //System.out.println(checkout); - - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00020_A1 { - Nocycle_a_00020_B1 b1_0; - Nocycle_a_00020_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00020_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00020_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00020_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00030B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00030_A1 a1_main = new Nocycle_a_00030_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00030_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00030_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00030_B3("b3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 1919) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00030_A1 { - Nocycle_a_00030_B1 b1_0; - Nocycle_a_00030_B2 b2_0; - Nocycle_a_00030_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00030_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00030_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00030_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00030_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00040B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00040_A1 a1_main = new Nocycle_a_00040_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00040_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00040_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00040_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00040_B4("b4_0"); - a1_main.b5_0 = new Nocycle_a_00040_B5("b5_0"); - a1_main.b6_0 = new Nocycle_a_00040_B6("b6_0"); - a1_main.b7_0 = new Nocycle_a_00040_B7("b7_0"); - a1_main.b8_0 = new Nocycle_a_00040_B8("b8_0"); - a1_main.b9_0 = new Nocycle_a_00040_B9("b9_0"); - a1_main.b10_0 = new Nocycle_a_00040_B10("b10_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b5_0.add(); - a1_main.b6_0.add(); - a1_main.b7_0.add(); - a1_main.b8_0.add(); - a1_main.b9_0.add(); - a1_main.b10_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b5_0.sum+a1_main.b6_0.sum+a1_main.b7_0.sum+a1_main.b8_0.sum+a1_main.b9_0.sum+a1_main.b10_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b5_0.sum + a1_main.b6_0.sum + a1_main.b7_0.sum + a1_main.b8_0.sum + a1_main.b9_0.sum + a1_main.b10_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 6266) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00040_A1 { - Nocycle_a_00040_B1 b1_0; - Nocycle_a_00040_B2 b2_0; - Nocycle_a_00040_B3 b3_0; - Nocycle_a_00040_B4 b4_0; - Nocycle_a_00040_B5 b5_0; - Nocycle_a_00040_B6 b6_0; - Nocycle_a_00040_B7 b7_0; - Nocycle_a_00040_B8 b8_0; - Nocycle_a_00040_B9 b9_0; - Nocycle_a_00040_B10 b10_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - b5_0 = null; - b6_0 = null; - b7_0 = null; - b8_0 = null; - b9_0 = null; - b10_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + b5_0.a + b6_0.a + b7_0.a + b8_0.a + b9_0.a + b10_0.a; - } - } - - class Nocycle_a_00040_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B5 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B5(String strObjectName) { - a = 205; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B5_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B6 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B6(String strObjectName) { - a = 206; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B6_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B7 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B7(String strObjectName) { - a = 207; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B7_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B8 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B8(String strObjectName) { - a = 208; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B8_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B9 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B9(String strObjectName) { - a = 209; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B9_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00040_B10 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00040_B10(String strObjectName) { - a = 210; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B10_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00050B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00050_A1 a1_main = new Nocycle_a_00050_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00050_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00050_C1("c1_0"); - a1_main.b1_0.c2_0 = new Nocycle_a_00050_C2("c2_0"); - a1_main.b1_0.c3_0 = new Nocycle_a_00050_C3("c3_0"); - a1_main.b2_0 = new Nocycle_a_00050_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00050_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00050_B4("b4_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c2_0.add(); - a1_main.b1_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c2_0.sum+a1_main.b1_0.c3_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c2_0.sum + a1_main.b1_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 5048) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00050_A1 { - Nocycle_a_00050_B1 b1_0; - Nocycle_a_00050_B2 b2_0; - Nocycle_a_00050_B3 b3_0; - Nocycle_a_00050_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class Nocycle_a_00050_B1 { - Nocycle_a_00050_C1 c1_0; - Nocycle_a_00050_C2 c2_0; - Nocycle_a_00050_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class Nocycle_a_00050_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00050_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00050_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00060B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00060_A1 a1_main = new Nocycle_a_00060_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00060_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00060_B2("b2_0"); - a1_main.b2_0.c1_0 = new Nocycle_a_00060_C1("c1_0"); - a1_main.b2_0.c2_0 = new Nocycle_a_00060_C2("c2_0"); - a1_main.b2_0.c3_0 = new Nocycle_a_00060_C3("c3_0"); - a1_main.b3_0 = new Nocycle_a_00060_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00060_B4("b4_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b2_0.c1_0.add(); - a1_main.b2_0.c2_0.add(); - a1_main.b2_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b2_0.c1_0.sum+a1_main.b2_0.c2_0.sum+a1_main.b2_0.c3_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c1_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b2_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 5047) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00060_A1 { - Nocycle_a_00060_B1 b1_0; - Nocycle_a_00060_B2 b2_0; - Nocycle_a_00060_B3 b3_0; - Nocycle_a_00060_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class Nocycle_a_00060_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_B2 { - Nocycle_a_00060_C1 c1_0; - Nocycle_a_00060_C2 c2_0; - Nocycle_a_00060_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B2(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class Nocycle_a_00060_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_B4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00060_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00060_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00070B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00070_A1 a1_main = new Nocycle_a_00070_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00070_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00070_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00070_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00070_B4("b4_0"); - a1_main.b4_0.c1_0 = new Nocycle_a_00070_C1("c1_0"); - a1_main.b4_0.c2_0 = new Nocycle_a_00070_C2("c2_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_00070_C3("c3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b4_0.c1_0.add(); - a1_main.b4_0.c2_0.add(); - a1_main.b4_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 5045) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00070_A1 { - Nocycle_a_00070_B1 b1_0; - Nocycle_a_00070_B2 b2_0; - Nocycle_a_00070_B3 b3_0; - Nocycle_a_00070_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class Nocycle_a_00070_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_B4 { - Nocycle_a_00070_C1 c1_0; - Nocycle_a_00070_C2 c2_0; - Nocycle_a_00070_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_B4(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class Nocycle_a_00070_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00070_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00070_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00080B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00080_A1 a1_main = new Nocycle_a_00080_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00080_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00080_C1("c1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 1406) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00080_A1 { - Nocycle_a_00080_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00080_B1 { - Nocycle_a_00080_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00080_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00080_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00090B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00090_A1 a1_main = new Nocycle_a_00090_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00090_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00090_C1("c1_0"); - a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00090_D1("d1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c1_0.d1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2308) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00090_A1 { - Nocycle_a_00090_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00090_B1 { - Nocycle_a_00090_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00090_C1 { - Nocycle_a_00090_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00090_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00090_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00100B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00100_A1 a1_main = new Nocycle_a_00100_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00100_B1("b1_0"); - a1_main.b1_0.c1_0 = new Nocycle_a_00100_C1("c1_0"); - a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00100_D1("d1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_00100_E1("e1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_00100_F1("f1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_00100_G1("g1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_00100_H1("h1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_00100_I1("i1_0"); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_00100_J1("j1_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b1_0.c1_0.add(); - a1_main.b1_0.c1_0.d1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); - a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); -// System.out.printf("a=%d\n",a1_main.sum); -// System.out.printf("b=%d\n",a1_main.b1_0.sum); -// System.out.printf("c=%d\n",a1_main.b1_0.c1_0.sum); -// System.out.printf("d=%d\n",a1_main.b1_0.c1_0.d1_0.sum); -// System.out.printf("e=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.sum); -// System.out.printf("f=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum); -// System.out.printf("g=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum); -// System.out.printf("h=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum); -// System.out.printf("i=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum); -// System.out.printf("j=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum); - - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; - - //System.out.println("RC-Testing_Result="+result); - - if (result == 11920) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00100_A1 { - Nocycle_a_00100_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00100_B1 { - Nocycle_a_00100_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00100_C1 { - Nocycle_a_00100_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00100_D1 { - Nocycle_a_00100_E1 e1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_D1(String strObjectName) { - e1_0 = null; - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + e1_0.a; - } - } - - class Nocycle_a_00100_E1 { - Nocycle_a_00100_F1 f1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_E1(String strObjectName) { - f1_0 = null; - a = 501; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_E1_"+strObjectName); - } - - void add() { - sum = a + f1_0.a; - } - } - - class Nocycle_a_00100_F1 { - Nocycle_a_00100_G1 g1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_F1(String strObjectName) { - g1_0 = null; - a = 601; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_F1_"+strObjectName); - } - - void add() { - sum = a + g1_0.a; - } - } - - class Nocycle_a_00100_G1 { - Nocycle_a_00100_H1 h1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_G1(String strObjectName) { - h1_0 = null; - a = 701; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_G1_"+strObjectName); - } - - void add() { - sum = a + h1_0.a; - } - } - - class Nocycle_a_00100_H1 { - Nocycle_a_00100_I1 i1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_H1(String strObjectName) { - i1_0 = null; - a = 801; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_H1_"+strObjectName); - } - - void add() { - sum = a + i1_0.a; - } - } - - class Nocycle_a_00100_I1 { - Nocycle_a_00100_J1 j1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_I1(String strObjectName) { - j1_0 = null; - a = 901; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_I1_"+strObjectName); - } - - void add() { - sum = a + j1_0.a; - } - } - - class Nocycle_a_00100_J1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00100_J1(String strObjectName) { - a = 1001; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_J1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00110B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00110_A1 a1_main = new Nocycle_a_00110_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_00110_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00110_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00110_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_00110_B4("b4_0"); - a1_main.b1_0.d1_0 = new Nocycle_a_00110_D1("d1_0"); - a1_main.b2_0.c2_0 = new Nocycle_a_00110_C2("c2_0"); - a1_main.b3_0.c1_0 = new Nocycle_a_00110_C1("c1_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_00110_C3("c3_0"); - a1_main.b3_0.c1_0.d2_0 = new Nocycle_a_00110_D2("d2_0"); - a1_main.b2_0.c2_0.d3_0 = new Nocycle_a_00110_D3("d3_0"); - a1_main.b2_0.c2_0.d4_0 = new Nocycle_a_00110_D4("d4_0"); - a1_main.d5_0 = new Nocycle_a_00110_D5("d5_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b2_0.c2_0.add(); - a1_main.b3_0.c1_0.add(); - a1_main.b4_0.c3_0.add(); - a1_main.b1_0.d1_0.add(); - a1_main.b3_0.c1_0.d2_0.add(); - a1_main.b2_0.c2_0.d3_0.add(); - a1_main.b2_0.c2_0.d4_0.add(); - a1_main.d5_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b2_0.c2_0.sum+a1_main.b3_0.c1_0.sum+a1_main.b4_0.c3_0.sum+a1_main.b1_0.d1_0.sum+a1_main.b3_0.c1_0.d2_0.sum+a1_main.b2_0.c2_0.d3_0.sum+a1_main.b2_0.c2_0.d4_0.sum+a1_main.d5_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b3_0.c1_0.sum + a1_main.b4_0.c3_0.sum + a1_main.b1_0.d1_0.sum + a1_main.b3_0.c1_0.d2_0.sum + a1_main.b2_0.c2_0.d3_0.sum + a1_main.b2_0.c2_0.d4_0.sum + a1_main.d5_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 9881) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00110_A1 { - Nocycle_a_00110_B1 b1_0; - Nocycle_a_00110_B2 b2_0; - Nocycle_a_00110_B3 b3_0; - Nocycle_a_00110_B4 b4_0; - Nocycle_a_00110_D5 d5_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - d5_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + d5_0.a; - } - } - - class Nocycle_a_00110_B1 { - Nocycle_a_00110_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00110_B2 { - Nocycle_a_00110_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B2(String strObjectName) { - c2_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c2_0.a; - } - } - - class Nocycle_a_00110_B3 { - Nocycle_a_00110_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00110_B4 { - Nocycle_a_00110_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_B4(String strObjectName) { - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c3_0.a; - } - } - - class Nocycle_a_00110_C1 { - Nocycle_a_00110_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C1(String strObjectName) { - d2_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - class Nocycle_a_00110_C2 { - Nocycle_a_00110_D3 d3_0; - Nocycle_a_00110_D4 d4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C2(String strObjectName) { - d3_0 = null; - d4_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d3_0.a + d4_0.a; - } - } - - class Nocycle_a_00110_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D4 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D4(String strObjectName) { - a = 404; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00110_D5 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00110_D5(String strObjectName) { - a = 405; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D5_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00120B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00120_A1 a1_main = new Nocycle_a_00120_A1("a1_main"); - Nocycle_a_00120_A2 a2_main = new Nocycle_a_00120_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); - a2_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a2_main.b1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1007) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00120_A1 { - Nocycle_a_00120_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00120_A2 { - Nocycle_a_00120_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00120_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00120_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00130B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00130_A1 a1_main = new Nocycle_a_00130_A1("a1_main"); - Nocycle_a_00130_A2 a2_main = new Nocycle_a_00130_A2("a2_main"); - Nocycle_a_00130_A3 a3_main = new Nocycle_a_00130_A3("a3_main"); - Nocycle_a_00130_A4 a4_main = new Nocycle_a_00130_A4("a4_main"); - Nocycle_a_00130_A5 a5_main = new Nocycle_a_00130_A5("a5_main"); - Nocycle_a_00130_A6 a6_main = new Nocycle_a_00130_A6("a6_main"); - Nocycle_a_00130_A7 a7_main = new Nocycle_a_00130_A7("a7_main"); - Nocycle_a_00130_A8 a8_main = new Nocycle_a_00130_A8("a8_main"); - Nocycle_a_00130_A9 a9_main = new Nocycle_a_00130_A9("a9_main"); - Nocycle_a_00130_A10 a10_main = new Nocycle_a_00130_A10("a10_main"); - a1_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a2_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a3_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a4_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a5_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a6_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a7_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a8_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a9_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a10_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a5_main.add(); - a6_main.add(); - a7_main.add(); - a8_main.add(); - a9_main.add(); - a10_main.add(); - a1_main.b1_0.add(); - a2_main.b1_0.add(); - a3_main.b1_0.add(); - a4_main.b1_0.add(); - a5_main.b1_0.add(); - a6_main.b1_0.add(); - a7_main.b1_0.add(); - a8_main.b1_0.add(); - a9_main.b1_0.add(); - a10_main.b1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a5_main.sum+a6_main.sum+a7_main.sum+a8_main.sum+a9_main.sum+a10_main.sum+a1_main.b1_0.sum); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a5_main.sum + a6_main.sum + a7_main.sum + a8_main.sum + a9_main.sum + a10_main.sum + a1_main.b1_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 3467) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00130_A1 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A2 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A3 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A3(String strObjectName) { - b1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A4 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A4(String strObjectName) { - b1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A5 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A5(String strObjectName) { - b1_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A6 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A6(String strObjectName) { - b1_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A7 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A7(String strObjectName) { - b1_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A8 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A8(String strObjectName) { - b1_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A9 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A9(String strObjectName) { - b1_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_A10 { - Nocycle_a_00130_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_A10(String strObjectName) { - b1_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00130_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00130_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00140B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00140_A1 a1_main = new Nocycle_a_00140_A1("a1_main"); - Nocycle_a_00140_A2 a2_main = new Nocycle_a_00140_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00140_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1613) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00140_A1 { - Nocycle_a_00140_B1 b1_0; - Nocycle_a_00140_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00140_A2 { - Nocycle_a_00140_B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_00140_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00140_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00140_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00150B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); - Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); - a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); - a1_main.add(); - a2_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - - int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1815) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00150_A1 { - Nocycle_a_00150_B1 b1_0; - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00150_A2 { - Nocycle_a_00150_B1 b1_0; - Nocycle_a_00150_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00150_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00150_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00150_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00160B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00160_A1 a1_main = new Nocycle_a_00160_A1("a1_main"); - Nocycle_a_00160_A2 a2_main = new Nocycle_a_00160_A2("a2_main"); - Nocycle_a_00160_A3 a3_main = new Nocycle_a_00160_A3("a3_main"); - Nocycle_a_00160_A4 a4_main = new Nocycle_a_00160_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a2_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a3_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a3_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a4_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); - a4_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); - a3_main.b1_0.add(); - a3_main.b2_0.add(); - a4_main.b1_0.add(); - a4_main.b2_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 2828) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00160_A1 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00160_A2 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00160_A3 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A3(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00160_A4 { - Nocycle_a_00160_B1 b1_0; - Nocycle_a_00160_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_A4(String strObjectName) { - b1_0 = null; - b2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a; - } - } - - class Nocycle_a_00160_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00160_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00160_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_00170B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00170_A1 a1_main = new Nocycle_a_00170_A1("a1_main"); - Nocycle_a_00170_A2 a2_main = new Nocycle_a_00170_A2("a2_main"); - Nocycle_a_00170_A3 a3_main = new Nocycle_a_00170_A3("a3_main"); - Nocycle_a_00170_A4 a4_main = new Nocycle_a_00170_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a2_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a2_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a2_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a3_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a3_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a3_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a4_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); - a4_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); - a4_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a2_main.b1_0.add(); - a2_main.b2_0.add(); - a2_main.b3_0.add(); - a3_main.b1_0.add(); - a3_main.b2_0.add(); - a3_main.b3_0.add(); - a4_main.b1_0.add(); - a4_main.b2_0.add(); - a4_main.b3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 4046) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00170_A1 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00170_A2 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A2(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00170_A3 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A3(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00170_A4 { - Nocycle_a_00170_B1 b1_0; - Nocycle_a_00170_B2 b2_0; - Nocycle_a_00170_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_A4(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_00170_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00170_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00170_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00170_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -class ThreadRc_00180B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); - Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); - Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); - Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); - a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); - a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - - a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a2_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a2_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - - a3_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); - a3_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a3_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a3_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a3_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); - a3_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a3_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); - a4_main.b3_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); - a4_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); - a4_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); - a4_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); - - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main.b1_0.add(); - a1_main.d1_0.add(); - a1_main.b1_0.d2_0.add(); - - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - -// System.out.printf("a1_main.sum=%d\n",a1_main.sum); -// System.out.printf("a2_main.sum=%d\n",a2_main.sum); -// System.out.printf("a3_main.sum=%d\n",a3_main.sum); -// System.out.printf("a4_main.sum=%d\n",a4_main.sum); -// System.out.printf("a1_main.b1_0.sum=%d\n",a1_main.b1_0.sum); -// System.out.printf("a2_main.b2_0.sum=%d\n",a2_main.b2_0.sum); -// System.out.printf("a4_main.b3_0.sum=%d\n",a4_main.b3_0.sum); -// System.out.printf("a2_main.b2_0.c1_0.sum=%d\n",a2_main.b2_0.c1_0.sum); -// System.out.printf("a3_main.c2_0.sum=%d\n",a3_main.c2_0.sum); -// System.out.printf("a1_main.d1_0.sum=%d\n",a1_main.d1_0.sum); -// System.out.printf("a3_main.c2_0.d2_0.sum=%d\n",a3_main.c2_0.d2_0.sum); -// System.out.printf("a3_main.c2_0.d3_0.sum=%d\n",a3_main.c2_0.d3_0.sum); - - -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a2_main.b2_0.sum+a4_main.b3_0.sum+a2_main.b2_0.c1_0.sum+a3_main.c2_0.sum+a1_main.d1_0.sum+a3_main.c2_0.d2_0.sum+a3_main.c2_0.d3_0.sum); - - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 9260) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_00180_A1 { - Nocycle_a_00180_B1 b1_0; - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - class Nocycle_a_00180_A2 { - Nocycle_a_00180_B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - class Nocycle_a_00180_A3 { - Nocycle_a_00180_B2 b2_0; - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class Nocycle_a_00180_A4 { - Nocycle_a_00180_B3 b3_0; - Nocycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - class Nocycle_a_00180_B1 { - Nocycle_a_00180_D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - class Nocycle_a_00180_B2 { - Nocycle_a_00180_C1 c1_0; - Nocycle_a_00180_D1 d1_0; - Nocycle_a_00180_D2 d2_0; - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_00180_B3 { - Nocycle_a_00180_C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_00180_C1 { - Nocycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_00180_C2 { - Nocycle_a_00180_D2 d2_0; - Nocycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_00180_D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00180_D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_00180_D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_00180_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -public class Nocycle_am_00190 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_00010B A1_00010 = new ThreadRc_00010B(); - ThreadRc_00010B A2_00010 = new ThreadRc_00010B(); - ThreadRc_00020B A1_00020 = new ThreadRc_00020B(); - ThreadRc_00020B A2_00020 = new ThreadRc_00020B(); - ThreadRc_00030B A1_00030 = new ThreadRc_00030B(); - ThreadRc_00030B A2_00030 = new ThreadRc_00030B(); - ThreadRc_00040B A1_00040 = new ThreadRc_00040B(); - ThreadRc_00040B A2_00040 = new ThreadRc_00040B(); - ThreadRc_00050B A1_00050 = new ThreadRc_00050B(); - ThreadRc_00050B A2_00050 = new ThreadRc_00050B(); - ThreadRc_00060B A1_00060 = new ThreadRc_00060B(); - ThreadRc_00060B A2_00060 = new ThreadRc_00060B(); - ThreadRc_00070B A1_00070 = new ThreadRc_00070B(); - ThreadRc_00070B A2_00070 = new ThreadRc_00070B(); - ThreadRc_00080B A1_00080 = new ThreadRc_00080B(); - ThreadRc_00080B A2_00080 = new ThreadRc_00080B(); - ThreadRc_00090B A1_00090 = new ThreadRc_00090B(); - ThreadRc_00090B A2_00090 = new ThreadRc_00090B(); - ThreadRc_00100B A1_00100 = new ThreadRc_00100B(); - ThreadRc_00100B A2_00100 = new ThreadRc_00100B(); - ThreadRc_00110B A1_00110 = new ThreadRc_00110B(); - ThreadRc_00110B A2_00110 = new ThreadRc_00110B(); - ThreadRc_00120B A1_00120 = new ThreadRc_00120B(); - ThreadRc_00120B A2_00120 = new ThreadRc_00120B(); - ThreadRc_00130B A1_00130 = new ThreadRc_00130B(); - ThreadRc_00130B A2_00130 = new ThreadRc_00130B(); - ThreadRc_00140B A1_00140 = new ThreadRc_00140B(); - ThreadRc_00140B A2_00140 = new ThreadRc_00140B(); - ThreadRc_00150B A1_00150 = new ThreadRc_00150B(); - ThreadRc_00150B A2_00150 = new ThreadRc_00150B(); - ThreadRc_00160B A1_00160 = new ThreadRc_00160B(); - ThreadRc_00160B A2_00160 = new ThreadRc_00160B(); - ThreadRc_00170B A1_00170 = new ThreadRc_00170B(); - ThreadRc_00170B A2_00170 = new ThreadRc_00170B(); - ThreadRc_00180B A1_00180 = new ThreadRc_00180B(); - ThreadRc_00180B A2_00180 = new ThreadRc_00180B(); - A1_00010.start(); - A2_00010.start(); - A1_00020.start(); - A2_00020.start(); - A1_00030.start(); - A2_00030.start(); - A1_00040.start(); - A2_00040.start(); - A1_00050.start(); - A2_00050.start(); - A1_00060.start(); - A2_00060.start(); - A1_00070.start(); - A2_00070.start(); - A1_00080.start(); - A2_00080.start(); - A1_00090.start(); - A2_00090.start(); - A1_00100.start(); - A2_00100.start(); - A1_00110.start(); - A2_00110.start(); - A1_00120.start(); - A2_00120.start(); - A1_00130.start(); - A2_00130.start(); - A1_00140.start(); - A2_00140.start(); - A1_00150.start(); - A2_00150.start(); - A1_00160.start(); - A2_00160.start(); - A1_00170.start(); - A2_00170.start(); - A1_00180.start(); - A2_00180.start(); - try { - A1_00010.join(); - A2_00010.join(); - A1_00020.join(); - A2_00020.join(); - A1_00030.join(); - A2_00030.join(); - A1_00040.join(); - A2_00040.join(); - A1_00050.join(); - A2_00050.join(); - A1_00060.join(); - A2_00060.join(); - A1_00070.join(); - A2_00070.join(); - A1_00080.join(); - A2_00080.join(); - A1_00090.join(); - A2_00090.join(); - A1_00100.join(); - A2_00100.join(); - A1_00110.join(); - A2_00110.join(); - A1_00120.join(); - A2_00120.join(); - A1_00130.join(); - A2_00130.join(); - A1_00140.join(); - A2_00140.join(); - A1_00150.join(); - A2_00150.join(); - A1_00160.join(); - A2_00160.join(); - A1_00170.join(); - A2_00170.join(); - A1_00180.join(); - A2_00180.join(); - } catch (InterruptedException e) { - } - if (A1_00010.check() && A2_00010.check() && A1_00020.check() && A2_00020.check() && A1_00030.check() && A2_00030.check() && A1_00040.check() && A2_00040.check() && A1_00050.check() && A2_00050.check() && A1_00060.check() && A2_00060.check() && A1_00070.check() && A2_00070.check() && A1_00080.check() && A2_00080.check() && A1_00090.check() && A2_00090.check() && A1_00100.check() && A2_00100.check() && A1_00110.check() && A2_00110.check() && A1_00120.check() && A2_00120.check() && A1_00130.check() && A2_00130.check() && A1_00140.check() && A2_00140.check() && A1_00150.check() && A2_00150.check() && A1_00160.check() && A2_00160.check() && A1_00170.check() && A2_00170.check() && A1_00180.check() && A2_00180.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_00190.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:make Nocycle_a_xx together to this Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_00190.java + *- @ExecuteClass: Nocycle_am_00190 + *- @ExecuteArgs: + */ +class ThreadRc_00010B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_am_00010_A1 a1_main = new Nocycle_am_00010_A1("a1_main"); + a1_main.b1_0 = new Nocycle_am_00010_B1("b1_0"); + a1_main.add(); + a1_main.b1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 704) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_am_00010_A1 { + Nocycle_am_00010_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_am_00010_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + // protected void finalize() throws java.lang.Throwable { +// System.out.println("RC-Testing_Destruction_A1_"+strObjectName); +// } + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_am_00010_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_am_00010_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + // protected void finalize() throws java.lang.Throwable { +// System.out.println("RC-Testing_Destruction_B1_"+strObjectName); +// } + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00020B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00020_A1 a1_main = new Nocycle_a_00020_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00020_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00020_B2("b2_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 1310) + checkout = true; + //System.out.println(checkout); + + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00020_A1 { + Nocycle_a_00020_B1 b1_0; + Nocycle_a_00020_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00020_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00020_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00020_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00030B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00030_A1 a1_main = new Nocycle_a_00030_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00030_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00030_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00030_B3("b3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 1919) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00030_A1 { + Nocycle_a_00030_B1 b1_0; + Nocycle_a_00030_B2 b2_0; + Nocycle_a_00030_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00030_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00030_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00030_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00030_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00040B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00040_A1 a1_main = new Nocycle_a_00040_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00040_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00040_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00040_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00040_B4("b4_0"); + a1_main.b5_0 = new Nocycle_a_00040_B5("b5_0"); + a1_main.b6_0 = new Nocycle_a_00040_B6("b6_0"); + a1_main.b7_0 = new Nocycle_a_00040_B7("b7_0"); + a1_main.b8_0 = new Nocycle_a_00040_B8("b8_0"); + a1_main.b9_0 = new Nocycle_a_00040_B9("b9_0"); + a1_main.b10_0 = new Nocycle_a_00040_B10("b10_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b5_0.add(); + a1_main.b6_0.add(); + a1_main.b7_0.add(); + a1_main.b8_0.add(); + a1_main.b9_0.add(); + a1_main.b10_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b5_0.sum+a1_main.b6_0.sum+a1_main.b7_0.sum+a1_main.b8_0.sum+a1_main.b9_0.sum+a1_main.b10_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b5_0.sum + a1_main.b6_0.sum + a1_main.b7_0.sum + a1_main.b8_0.sum + a1_main.b9_0.sum + a1_main.b10_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 6266) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00040_A1 { + Nocycle_a_00040_B1 b1_0; + Nocycle_a_00040_B2 b2_0; + Nocycle_a_00040_B3 b3_0; + Nocycle_a_00040_B4 b4_0; + Nocycle_a_00040_B5 b5_0; + Nocycle_a_00040_B6 b6_0; + Nocycle_a_00040_B7 b7_0; + Nocycle_a_00040_B8 b8_0; + Nocycle_a_00040_B9 b9_0; + Nocycle_a_00040_B10 b10_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + b5_0 = null; + b6_0 = null; + b7_0 = null; + b8_0 = null; + b9_0 = null; + b10_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + b5_0.a + b6_0.a + b7_0.a + b8_0.a + b9_0.a + b10_0.a; + } + } + + class Nocycle_a_00040_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B5 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B5(String strObjectName) { + a = 205; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B5_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B6 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B6(String strObjectName) { + a = 206; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B6_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B7 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B7(String strObjectName) { + a = 207; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B7_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B8 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B8(String strObjectName) { + a = 208; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B8_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B9 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B9(String strObjectName) { + a = 209; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B9_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00040_B10 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00040_B10(String strObjectName) { + a = 210; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B10_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00050B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00050_A1 a1_main = new Nocycle_a_00050_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00050_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00050_C1("c1_0"); + a1_main.b1_0.c2_0 = new Nocycle_a_00050_C2("c2_0"); + a1_main.b1_0.c3_0 = new Nocycle_a_00050_C3("c3_0"); + a1_main.b2_0 = new Nocycle_a_00050_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00050_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00050_B4("b4_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c2_0.add(); + a1_main.b1_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c2_0.sum+a1_main.b1_0.c3_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c2_0.sum + a1_main.b1_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 5048) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00050_A1 { + Nocycle_a_00050_B1 b1_0; + Nocycle_a_00050_B2 b2_0; + Nocycle_a_00050_B3 b3_0; + Nocycle_a_00050_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class Nocycle_a_00050_B1 { + Nocycle_a_00050_C1 c1_0; + Nocycle_a_00050_C2 c2_0; + Nocycle_a_00050_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class Nocycle_a_00050_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00050_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00050_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00060B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00060_A1 a1_main = new Nocycle_a_00060_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00060_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00060_B2("b2_0"); + a1_main.b2_0.c1_0 = new Nocycle_a_00060_C1("c1_0"); + a1_main.b2_0.c2_0 = new Nocycle_a_00060_C2("c2_0"); + a1_main.b2_0.c3_0 = new Nocycle_a_00060_C3("c3_0"); + a1_main.b3_0 = new Nocycle_a_00060_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00060_B4("b4_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b2_0.c1_0.add(); + a1_main.b2_0.c2_0.add(); + a1_main.b2_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b2_0.c1_0.sum+a1_main.b2_0.c2_0.sum+a1_main.b2_0.c3_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c1_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b2_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 5047) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00060_A1 { + Nocycle_a_00060_B1 b1_0; + Nocycle_a_00060_B2 b2_0; + Nocycle_a_00060_B3 b3_0; + Nocycle_a_00060_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class Nocycle_a_00060_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_B2 { + Nocycle_a_00060_C1 c1_0; + Nocycle_a_00060_C2 c2_0; + Nocycle_a_00060_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B2(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class Nocycle_a_00060_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_B4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00060_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00060_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00070B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00070_A1 a1_main = new Nocycle_a_00070_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00070_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00070_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00070_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00070_B4("b4_0"); + a1_main.b4_0.c1_0 = new Nocycle_a_00070_C1("c1_0"); + a1_main.b4_0.c2_0 = new Nocycle_a_00070_C2("c2_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_00070_C3("c3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b4_0.c1_0.add(); + a1_main.b4_0.c2_0.add(); + a1_main.b4_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 5045) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00070_A1 { + Nocycle_a_00070_B1 b1_0; + Nocycle_a_00070_B2 b2_0; + Nocycle_a_00070_B3 b3_0; + Nocycle_a_00070_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class Nocycle_a_00070_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_B4 { + Nocycle_a_00070_C1 c1_0; + Nocycle_a_00070_C2 c2_0; + Nocycle_a_00070_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_B4(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class Nocycle_a_00070_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00070_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00070_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00080B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00080_A1 a1_main = new Nocycle_a_00080_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00080_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00080_C1("c1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 1406) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00080_A1 { + Nocycle_a_00080_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00080_B1 { + Nocycle_a_00080_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00080_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00080_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00090B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00090_A1 a1_main = new Nocycle_a_00090_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00090_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00090_C1("c1_0"); + a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00090_D1("d1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c1_0.d1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2308) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00090_A1 { + Nocycle_a_00090_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00090_B1 { + Nocycle_a_00090_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00090_C1 { + Nocycle_a_00090_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00090_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00090_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00100B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00100_A1 a1_main = new Nocycle_a_00100_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00100_B1("b1_0"); + a1_main.b1_0.c1_0 = new Nocycle_a_00100_C1("c1_0"); + a1_main.b1_0.c1_0.d1_0 = new Nocycle_a_00100_D1("d1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_00100_E1("e1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_00100_F1("f1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_00100_G1("g1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_00100_H1("h1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_00100_I1("i1_0"); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_00100_J1("j1_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b1_0.c1_0.add(); + a1_main.b1_0.c1_0.d1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); +// System.out.printf("a=%d\n",a1_main.sum); +// System.out.printf("b=%d\n",a1_main.b1_0.sum); +// System.out.printf("c=%d\n",a1_main.b1_0.c1_0.sum); +// System.out.printf("d=%d\n",a1_main.b1_0.c1_0.d1_0.sum); +// System.out.printf("e=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.sum); +// System.out.printf("f=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum); +// System.out.printf("g=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum); +// System.out.printf("h=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum); +// System.out.printf("i=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum); +// System.out.printf("j=%d\n",a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b1_0.c1_0.sum+a1_main.b1_0.c1_0.d1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum+a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum); + + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b1_0.c1_0.sum + a1_main.b1_0.c1_0.d1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; + + //System.out.println("RC-Testing_Result="+result); + + if (result == 11920) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00100_A1 { + Nocycle_a_00100_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00100_B1 { + Nocycle_a_00100_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00100_C1 { + Nocycle_a_00100_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00100_D1 { + Nocycle_a_00100_E1 e1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_D1(String strObjectName) { + e1_0 = null; + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + e1_0.a; + } + } + + class Nocycle_a_00100_E1 { + Nocycle_a_00100_F1 f1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_E1(String strObjectName) { + f1_0 = null; + a = 501; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_E1_"+strObjectName); + } + + void add() { + sum = a + f1_0.a; + } + } + + class Nocycle_a_00100_F1 { + Nocycle_a_00100_G1 g1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_F1(String strObjectName) { + g1_0 = null; + a = 601; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_F1_"+strObjectName); + } + + void add() { + sum = a + g1_0.a; + } + } + + class Nocycle_a_00100_G1 { + Nocycle_a_00100_H1 h1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_G1(String strObjectName) { + h1_0 = null; + a = 701; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_G1_"+strObjectName); + } + + void add() { + sum = a + h1_0.a; + } + } + + class Nocycle_a_00100_H1 { + Nocycle_a_00100_I1 i1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_H1(String strObjectName) { + i1_0 = null; + a = 801; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_H1_"+strObjectName); + } + + void add() { + sum = a + i1_0.a; + } + } + + class Nocycle_a_00100_I1 { + Nocycle_a_00100_J1 j1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_I1(String strObjectName) { + j1_0 = null; + a = 901; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_I1_"+strObjectName); + } + + void add() { + sum = a + j1_0.a; + } + } + + class Nocycle_a_00100_J1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00100_J1(String strObjectName) { + a = 1001; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_J1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00110B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00110_A1 a1_main = new Nocycle_a_00110_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_00110_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00110_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00110_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_00110_B4("b4_0"); + a1_main.b1_0.d1_0 = new Nocycle_a_00110_D1("d1_0"); + a1_main.b2_0.c2_0 = new Nocycle_a_00110_C2("c2_0"); + a1_main.b3_0.c1_0 = new Nocycle_a_00110_C1("c1_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_00110_C3("c3_0"); + a1_main.b3_0.c1_0.d2_0 = new Nocycle_a_00110_D2("d2_0"); + a1_main.b2_0.c2_0.d3_0 = new Nocycle_a_00110_D3("d3_0"); + a1_main.b2_0.c2_0.d4_0 = new Nocycle_a_00110_D4("d4_0"); + a1_main.d5_0 = new Nocycle_a_00110_D5("d5_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b2_0.c2_0.add(); + a1_main.b3_0.c1_0.add(); + a1_main.b4_0.c3_0.add(); + a1_main.b1_0.d1_0.add(); + a1_main.b3_0.c1_0.d2_0.add(); + a1_main.b2_0.c2_0.d3_0.add(); + a1_main.b2_0.c2_0.d4_0.add(); + a1_main.d5_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b2_0.c2_0.sum+a1_main.b3_0.c1_0.sum+a1_main.b4_0.c3_0.sum+a1_main.b1_0.d1_0.sum+a1_main.b3_0.c1_0.d2_0.sum+a1_main.b2_0.c2_0.d3_0.sum+a1_main.b2_0.c2_0.d4_0.sum+a1_main.d5_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b2_0.c2_0.sum + a1_main.b3_0.c1_0.sum + a1_main.b4_0.c3_0.sum + a1_main.b1_0.d1_0.sum + a1_main.b3_0.c1_0.d2_0.sum + a1_main.b2_0.c2_0.d3_0.sum + a1_main.b2_0.c2_0.d4_0.sum + a1_main.d5_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 9881) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00110_A1 { + Nocycle_a_00110_B1 b1_0; + Nocycle_a_00110_B2 b2_0; + Nocycle_a_00110_B3 b3_0; + Nocycle_a_00110_B4 b4_0; + Nocycle_a_00110_D5 d5_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + d5_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a + d5_0.a; + } + } + + class Nocycle_a_00110_B1 { + Nocycle_a_00110_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00110_B2 { + Nocycle_a_00110_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B2(String strObjectName) { + c2_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c2_0.a; + } + } + + class Nocycle_a_00110_B3 { + Nocycle_a_00110_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00110_B4 { + Nocycle_a_00110_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_B4(String strObjectName) { + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c3_0.a; + } + } + + class Nocycle_a_00110_C1 { + Nocycle_a_00110_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C1(String strObjectName) { + d2_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + class Nocycle_a_00110_C2 { + Nocycle_a_00110_D3 d3_0; + Nocycle_a_00110_D4 d4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C2(String strObjectName) { + d3_0 = null; + d4_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d3_0.a + d4_0.a; + } + } + + class Nocycle_a_00110_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D4 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D4(String strObjectName) { + a = 404; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00110_D5 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00110_D5(String strObjectName) { + a = 405; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D5_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00120B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00120_A1 a1_main = new Nocycle_a_00120_A1("a1_main"); + Nocycle_a_00120_A2 a2_main = new Nocycle_a_00120_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); + a2_main.b1_0 = new Nocycle_a_00120_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a2_main.b1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1007) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00120_A1 { + Nocycle_a_00120_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00120_A2 { + Nocycle_a_00120_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00120_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00120_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00130B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00130_A1 a1_main = new Nocycle_a_00130_A1("a1_main"); + Nocycle_a_00130_A2 a2_main = new Nocycle_a_00130_A2("a2_main"); + Nocycle_a_00130_A3 a3_main = new Nocycle_a_00130_A3("a3_main"); + Nocycle_a_00130_A4 a4_main = new Nocycle_a_00130_A4("a4_main"); + Nocycle_a_00130_A5 a5_main = new Nocycle_a_00130_A5("a5_main"); + Nocycle_a_00130_A6 a6_main = new Nocycle_a_00130_A6("a6_main"); + Nocycle_a_00130_A7 a7_main = new Nocycle_a_00130_A7("a7_main"); + Nocycle_a_00130_A8 a8_main = new Nocycle_a_00130_A8("a8_main"); + Nocycle_a_00130_A9 a9_main = new Nocycle_a_00130_A9("a9_main"); + Nocycle_a_00130_A10 a10_main = new Nocycle_a_00130_A10("a10_main"); + a1_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a2_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a3_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a4_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a5_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a6_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a7_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a8_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a9_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a10_main.b1_0 = new Nocycle_a_00130_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a5_main.add(); + a6_main.add(); + a7_main.add(); + a8_main.add(); + a9_main.add(); + a10_main.add(); + a1_main.b1_0.add(); + a2_main.b1_0.add(); + a3_main.b1_0.add(); + a4_main.b1_0.add(); + a5_main.b1_0.add(); + a6_main.b1_0.add(); + a7_main.b1_0.add(); + a8_main.b1_0.add(); + a9_main.b1_0.add(); + a10_main.b1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a5_main.sum+a6_main.sum+a7_main.sum+a8_main.sum+a9_main.sum+a10_main.sum+a1_main.b1_0.sum); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a5_main.sum + a6_main.sum + a7_main.sum + a8_main.sum + a9_main.sum + a10_main.sum + a1_main.b1_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 3467) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00130_A1 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A2 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A3 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A3(String strObjectName) { + b1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A4 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A4(String strObjectName) { + b1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A5 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A5(String strObjectName) { + b1_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A6 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A6(String strObjectName) { + b1_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A7 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A7(String strObjectName) { + b1_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A8 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A8(String strObjectName) { + b1_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A9 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A9(String strObjectName) { + b1_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_A10 { + Nocycle_a_00130_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_A10(String strObjectName) { + b1_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00130_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00130_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00140B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00140_A1 a1_main = new Nocycle_a_00140_A1("a1_main"); + Nocycle_a_00140_A2 a2_main = new Nocycle_a_00140_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00140_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00140_B1("b1_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1613) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00140_A1 { + Nocycle_a_00140_B1 b1_0; + Nocycle_a_00140_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00140_A2 { + Nocycle_a_00140_B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_00140_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00140_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00140_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00150B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00150_A1 a1_main = new Nocycle_a_00150_A1("a1_main"); + Nocycle_a_00150_A2 a2_main = new Nocycle_a_00150_A2("a2_main"); + a1_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00150_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00150_B2("b2_0"); + a1_main.add(); + a2_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + + int result = a1_main.sum + a2_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1815) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00150_A1 { + Nocycle_a_00150_B1 b1_0; + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00150_A2 { + Nocycle_a_00150_B1 b1_0; + Nocycle_a_00150_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00150_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00150_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00150_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00160B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00160_A1 a1_main = new Nocycle_a_00160_A1("a1_main"); + Nocycle_a_00160_A2 a2_main = new Nocycle_a_00160_A2("a2_main"); + Nocycle_a_00160_A3 a3_main = new Nocycle_a_00160_A3("a3_main"); + Nocycle_a_00160_A4 a4_main = new Nocycle_a_00160_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a2_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a3_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a3_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a4_main.b1_0 = new Nocycle_a_00160_B1("b1_0"); + a4_main.b2_0 = new Nocycle_a_00160_B2("b2_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); + a3_main.b1_0.add(); + a3_main.b2_0.add(); + a4_main.b1_0.add(); + a4_main.b2_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 2828) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00160_A1 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00160_A2 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00160_A3 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A3(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00160_A4 { + Nocycle_a_00160_B1 b1_0; + Nocycle_a_00160_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_A4(String strObjectName) { + b1_0 = null; + b2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a; + } + } + + class Nocycle_a_00160_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00160_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00160_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_00170B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00170_A1 a1_main = new Nocycle_a_00170_A1("a1_main"); + Nocycle_a_00170_A2 a2_main = new Nocycle_a_00170_A2("a2_main"); + Nocycle_a_00170_A3 a3_main = new Nocycle_a_00170_A3("a3_main"); + Nocycle_a_00170_A4 a4_main = new Nocycle_a_00170_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a2_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a2_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a2_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a3_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a3_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a3_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a4_main.b1_0 = new Nocycle_a_00170_B1("b1_0"); + a4_main.b2_0 = new Nocycle_a_00170_B2("b2_0"); + a4_main.b3_0 = new Nocycle_a_00170_B3("b3_0"); + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a2_main.b1_0.add(); + a2_main.b2_0.add(); + a2_main.b3_0.add(); + a3_main.b1_0.add(); + a3_main.b2_0.add(); + a3_main.b3_0.add(); + a4_main.b1_0.add(); + a4_main.b2_0.add(); + a4_main.b3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 4046) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00170_A1 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00170_A2 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A2(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00170_A3 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A3(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00170_A4 { + Nocycle_a_00170_B1 b1_0; + Nocycle_a_00170_B2 b2_0; + Nocycle_a_00170_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_A4(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_00170_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00170_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00170_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00170_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +class ThreadRc_00180B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_00180_A1 a1_main = new Nocycle_a_00180_A1("a1_main"); + Nocycle_a_00180_A2 a2_main = new Nocycle_a_00180_A2("a2_main"); + Nocycle_a_00180_A3 a3_main = new Nocycle_a_00180_A3("a3_main"); + Nocycle_a_00180_A4 a4_main = new Nocycle_a_00180_A4("a4_main"); + a1_main.b1_0 = new Nocycle_a_00180_B1("b1_0"); + a1_main.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a1_main.b1_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + + a2_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a2_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a2_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + + a3_main.b2_0 = new Nocycle_a_00180_B2("b2_0"); + a3_main.b2_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a3_main.b2_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a3_main.b2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a3_main.b2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a3_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); + a3_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a3_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a4_main.b3_0 = new Nocycle_a_00180_B3("b3_0"); + a4_main.b3_0.c1_0 = new Nocycle_a_00180_C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_00180_D1("d1_0"); + a4_main.c2_0 = new Nocycle_a_00180_C2("c2_0"); + a4_main.c2_0.d2_0 = new Nocycle_a_00180_D2("d2_0"); + a4_main.c2_0.d3_0 = new Nocycle_a_00180_D3("d3_0"); + + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main.b1_0.add(); + a1_main.d1_0.add(); + a1_main.b1_0.d2_0.add(); + + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + +// System.out.printf("a1_main.sum=%d\n",a1_main.sum); +// System.out.printf("a2_main.sum=%d\n",a2_main.sum); +// System.out.printf("a3_main.sum=%d\n",a3_main.sum); +// System.out.printf("a4_main.sum=%d\n",a4_main.sum); +// System.out.printf("a1_main.b1_0.sum=%d\n",a1_main.b1_0.sum); +// System.out.printf("a2_main.b2_0.sum=%d\n",a2_main.b2_0.sum); +// System.out.printf("a4_main.b3_0.sum=%d\n",a4_main.b3_0.sum); +// System.out.printf("a2_main.b2_0.c1_0.sum=%d\n",a2_main.b2_0.c1_0.sum); +// System.out.printf("a3_main.c2_0.sum=%d\n",a3_main.c2_0.sum); +// System.out.printf("a1_main.d1_0.sum=%d\n",a1_main.d1_0.sum); +// System.out.printf("a3_main.c2_0.d2_0.sum=%d\n",a3_main.c2_0.d2_0.sum); +// System.out.printf("a3_main.c2_0.d3_0.sum=%d\n",a3_main.c2_0.d3_0.sum); + + +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a2_main.sum+a3_main.sum+a4_main.sum+a1_main.b1_0.sum+a2_main.b2_0.sum+a4_main.b3_0.sum+a2_main.b2_0.c1_0.sum+a3_main.c2_0.sum+a1_main.d1_0.sum+a3_main.c2_0.d2_0.sum+a3_main.c2_0.d3_0.sum); + + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 9260) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_00180_A1 { + Nocycle_a_00180_B1 b1_0; + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + class Nocycle_a_00180_A2 { + Nocycle_a_00180_B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + class Nocycle_a_00180_A3 { + Nocycle_a_00180_B2 b2_0; + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class Nocycle_a_00180_A4 { + Nocycle_a_00180_B3 b3_0; + Nocycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + class Nocycle_a_00180_B1 { + Nocycle_a_00180_D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + class Nocycle_a_00180_B2 { + Nocycle_a_00180_C1 c1_0; + Nocycle_a_00180_D1 d1_0; + Nocycle_a_00180_D2 d2_0; + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_00180_B3 { + Nocycle_a_00180_C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_00180_C1 { + Nocycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_00180_C2 { + Nocycle_a_00180_D2 d2_0; + Nocycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_00180_D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00180_D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_00180_D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_00180_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +public class Nocycle_am_00190 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_00010B A1_00010 = new ThreadRc_00010B(); + ThreadRc_00010B A2_00010 = new ThreadRc_00010B(); + ThreadRc_00020B A1_00020 = new ThreadRc_00020B(); + ThreadRc_00020B A2_00020 = new ThreadRc_00020B(); + ThreadRc_00030B A1_00030 = new ThreadRc_00030B(); + ThreadRc_00030B A2_00030 = new ThreadRc_00030B(); + ThreadRc_00040B A1_00040 = new ThreadRc_00040B(); + ThreadRc_00040B A2_00040 = new ThreadRc_00040B(); + ThreadRc_00050B A1_00050 = new ThreadRc_00050B(); + ThreadRc_00050B A2_00050 = new ThreadRc_00050B(); + ThreadRc_00060B A1_00060 = new ThreadRc_00060B(); + ThreadRc_00060B A2_00060 = new ThreadRc_00060B(); + ThreadRc_00070B A1_00070 = new ThreadRc_00070B(); + ThreadRc_00070B A2_00070 = new ThreadRc_00070B(); + ThreadRc_00080B A1_00080 = new ThreadRc_00080B(); + ThreadRc_00080B A2_00080 = new ThreadRc_00080B(); + ThreadRc_00090B A1_00090 = new ThreadRc_00090B(); + ThreadRc_00090B A2_00090 = new ThreadRc_00090B(); + ThreadRc_00100B A1_00100 = new ThreadRc_00100B(); + ThreadRc_00100B A2_00100 = new ThreadRc_00100B(); + ThreadRc_00110B A1_00110 = new ThreadRc_00110B(); + ThreadRc_00110B A2_00110 = new ThreadRc_00110B(); + ThreadRc_00120B A1_00120 = new ThreadRc_00120B(); + ThreadRc_00120B A2_00120 = new ThreadRc_00120B(); + ThreadRc_00130B A1_00130 = new ThreadRc_00130B(); + ThreadRc_00130B A2_00130 = new ThreadRc_00130B(); + ThreadRc_00140B A1_00140 = new ThreadRc_00140B(); + ThreadRc_00140B A2_00140 = new ThreadRc_00140B(); + ThreadRc_00150B A1_00150 = new ThreadRc_00150B(); + ThreadRc_00150B A2_00150 = new ThreadRc_00150B(); + ThreadRc_00160B A1_00160 = new ThreadRc_00160B(); + ThreadRc_00160B A2_00160 = new ThreadRc_00160B(); + ThreadRc_00170B A1_00170 = new ThreadRc_00170B(); + ThreadRc_00170B A2_00170 = new ThreadRc_00170B(); + ThreadRc_00180B A1_00180 = new ThreadRc_00180B(); + ThreadRc_00180B A2_00180 = new ThreadRc_00180B(); + A1_00010.start(); + A2_00010.start(); + A1_00020.start(); + A2_00020.start(); + A1_00030.start(); + A2_00030.start(); + A1_00040.start(); + A2_00040.start(); + A1_00050.start(); + A2_00050.start(); + A1_00060.start(); + A2_00060.start(); + A1_00070.start(); + A2_00070.start(); + A1_00080.start(); + A2_00080.start(); + A1_00090.start(); + A2_00090.start(); + A1_00100.start(); + A2_00100.start(); + A1_00110.start(); + A2_00110.start(); + A1_00120.start(); + A2_00120.start(); + A1_00130.start(); + A2_00130.start(); + A1_00140.start(); + A2_00140.start(); + A1_00150.start(); + A2_00150.start(); + A1_00160.start(); + A2_00160.start(); + A1_00170.start(); + A2_00170.start(); + A1_00180.start(); + A2_00180.start(); + try { + A1_00010.join(); + A2_00010.join(); + A1_00020.join(); + A2_00020.join(); + A1_00030.join(); + A2_00030.join(); + A1_00040.join(); + A2_00040.join(); + A1_00050.join(); + A2_00050.join(); + A1_00060.join(); + A2_00060.join(); + A1_00070.join(); + A2_00070.join(); + A1_00080.join(); + A2_00080.join(); + A1_00090.join(); + A2_00090.join(); + A1_00100.join(); + A2_00100.join(); + A1_00110.join(); + A2_00110.join(); + A1_00120.join(); + A2_00120.join(); + A1_00130.join(); + A2_00130.join(); + A1_00140.join(); + A2_00140.join(); + A1_00150.join(); + A2_00150.join(); + A1_00160.join(); + A2_00160.join(); + A1_00170.join(); + A2_00170.join(); + A1_00180.join(); + A2_00180.join(); + } catch (InterruptedException e) { + } + if (A1_00010.check() && A2_00010.check() && A1_00020.check() && A2_00020.check() && A1_00030.check() && A2_00030.check() && A1_00040.check() && A2_00040.check() && A1_00050.check() && A2_00050.check() && A1_00060.check() && A2_00060.check() && A1_00070.check() && A2_00070.check() && A1_00080.check() && A2_00080.check() && A1_00090.check() && A2_00090.check() && A1_00100.check() && A2_00100.check() && A1_00110.check() && A2_00110.check() && A1_00120.check() && A2_00120.check() && A1_00130.check() && A2_00130.check() && A1_00140.check() && A2_00140.check() && A1_00150.check() && A2_00150.check() && A1_00160.check() && A2_00160.check() && A1_00170.check() && A2_00170.check() && A1_00180.check() && A2_00180.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0225-rc-function-RC_Thread01-Nocycle_am_2_00010/Nocycle_am_2_00010.java b/test/testsuite/ouroboros/memory_management/Function/RC0225-rc-function-RC_Thread01-Nocycle_am_2_00010/Nocycle_am_2_00010.java index 4411929d03f0a716f2fdcd9294aa5f98d9149c68..acc08f7c98532d5010b47038fecc9209ba1237e9 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0225-rc-function-RC_Thread01-Nocycle_am_2_00010/Nocycle_am_2_00010.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0225-rc-function-RC_Thread01-Nocycle_am_2_00010/Nocycle_am_2_00010.java @@ -1,186 +1,186 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_2_00010.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_2_00010 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_2_00010.java - *- @ExecuteClass: Nocycle_am_2_00010 - *- @ExecuteArgs: - */ -class ThreadRc_Nocycle_am_2_00010 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_2_00010_A1 a1_main = new Nocycle_a_2_00010_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_2_00010_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_2_00010_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_2_00010_B3("b3_0"); - Nocycle_a_2_00010_A2 a2_main = new Nocycle_a_2_00010_A2("a2_main"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a2_main.add(); - // System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a2_main.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1939) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_2_00010_A1 { - Nocycle_a_2_00010_B1 b1_0; - Nocycle_a_2_00010_B2 b2_0; - Nocycle_a_2_00010_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_2_00010_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00010_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00010_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00010_A2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_A2(String strObjectName) { - a = 10; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_2_00010 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Nocycle_am_2_00010 A1_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); - ThreadRc_Nocycle_am_2_00010 A2_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); - ThreadRc_Nocycle_am_2_00010 A3_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); - ThreadRc_Nocycle_am_2_00010 A4_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); - ThreadRc_Nocycle_am_2_00010 A5_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); - ThreadRc_Nocycle_am_2_00010 A6_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); - - A1_Nocycle_am_2_00010.start(); - A2_Nocycle_am_2_00010.start(); - A3_Nocycle_am_2_00010.start(); - A4_Nocycle_am_2_00010.start(); - A5_Nocycle_am_2_00010.start(); - A6_Nocycle_am_2_00010.start(); - - try { - A1_Nocycle_am_2_00010.join(); - A2_Nocycle_am_2_00010.join(); - A3_Nocycle_am_2_00010.join(); - A4_Nocycle_am_2_00010.join(); - A5_Nocycle_am_2_00010.join(); - A6_Nocycle_am_2_00010.join(); - - } catch (InterruptedException e) { - } - if (A1_Nocycle_am_2_00010.check() && A2_Nocycle_am_2_00010.check() && A3_Nocycle_am_2_00010.check() && A4_Nocycle_am_2_00010.check() && A5_Nocycle_am_2_00010.check() && A6_Nocycle_am_2_00010.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_2_00010.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_2_00010 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_2_00010.java + *- @ExecuteClass: Nocycle_am_2_00010 + *- @ExecuteArgs: + */ +class ThreadRc_Nocycle_am_2_00010 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_2_00010_A1 a1_main = new Nocycle_a_2_00010_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_2_00010_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_2_00010_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_2_00010_B3("b3_0"); + Nocycle_a_2_00010_A2 a2_main = new Nocycle_a_2_00010_A2("a2_main"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a2_main.add(); + // System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a2_main.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1939) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_2_00010_A1 { + Nocycle_a_2_00010_B1 b1_0; + Nocycle_a_2_00010_B2 b2_0; + Nocycle_a_2_00010_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_2_00010_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00010_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00010_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00010_A2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_A2(String strObjectName) { + a = 10; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_2_00010 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Nocycle_am_2_00010 A1_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); + ThreadRc_Nocycle_am_2_00010 A2_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); + ThreadRc_Nocycle_am_2_00010 A3_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); + ThreadRc_Nocycle_am_2_00010 A4_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); + ThreadRc_Nocycle_am_2_00010 A5_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); + ThreadRc_Nocycle_am_2_00010 A6_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010(); + + A1_Nocycle_am_2_00010.start(); + A2_Nocycle_am_2_00010.start(); + A3_Nocycle_am_2_00010.start(); + A4_Nocycle_am_2_00010.start(); + A5_Nocycle_am_2_00010.start(); + A6_Nocycle_am_2_00010.start(); + + try { + A1_Nocycle_am_2_00010.join(); + A2_Nocycle_am_2_00010.join(); + A3_Nocycle_am_2_00010.join(); + A4_Nocycle_am_2_00010.join(); + A5_Nocycle_am_2_00010.join(); + A6_Nocycle_am_2_00010.join(); + + } catch (InterruptedException e) { + } + if (A1_Nocycle_am_2_00010.check() && A2_Nocycle_am_2_00010.check() && A3_Nocycle_am_2_00010.check() && A4_Nocycle_am_2_00010.check() && A5_Nocycle_am_2_00010.check() && A6_Nocycle_am_2_00010.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0226-rc-function-RC_Thread01-Nocycle_am_2_00020/Nocycle_am_2_00020.java b/test/testsuite/ouroboros/memory_management/Function/RC0226-rc-function-RC_Thread01-Nocycle_am_2_00020/Nocycle_am_2_00020.java index 623007417077e7e83d9aa30b83b51405e9125c1e..e489cf8ff008b0e50d563ed8a7658731b42bd6f1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0226-rc-function-RC_Thread01-Nocycle_am_2_00020/Nocycle_am_2_00020.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0226-rc-function-RC_Thread01-Nocycle_am_2_00020/Nocycle_am_2_00020.java @@ -1,769 +1,769 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_2_00020.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_2_00020 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_2_00020.java - *- @ExecuteClass: Nocycle_am_2_00020 - *- @ExecuteArgs: - */ -class ThreadRc_Nocycle_am_2_00020 extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_2_00020_A1 a1_main = new Nocycle_a_2_00020_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_2_00020_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_2_00020_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_2_00020_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_2_00020_B4("b4_0"); - a1_main.b4_0.c1_0 = new Nocycle_a_2_00020_C1("c1_0"); - a1_main.b4_0.c2_0 = new Nocycle_a_2_00020_C2("c2_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_2_00020_C3("c3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b4_0.c1_0.add(); - a1_main.b4_0.c2_0.add(); - a1_main.b4_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); - - int result1 = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result1); - Nocycle_a_2_00020_2A1 a1_main2 = new Nocycle_a_2_00020_2A1("a1_main2"); - a1_main2.b1_0 = new Nocycle_a_2_00020_2B1("b1_0"); - a1_main2.b1_0.c1_0 = new Nocycle_a_2_00020_2C1("c1_0"); - a1_main2.b1_0.c1_0.d1_0 = new Nocycle_a_2_00020_2D1("d1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_2_00020_2E1("e1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_2_00020_2F1("f1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_2_00020_2G1("g1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_2_00020_2H1("h1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_2_00020_2I1("i1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_2_00020_2J1("j1_0"); - a1_main2.add(); - a1_main2.b1_0.add(); - a1_main2.b1_0.c1_0.add(); - a1_main2.b1_0.c1_0.d1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); - - int result2 = a1_main2.sum + a1_main2.b1_0.sum + a1_main2.b1_0.c1_0.sum + a1_main2.b1_0.c1_0.d1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; - - Nocycle_a_2_00020_3A1 a1_main3 = new Nocycle_a_2_00020_3A1("a1_main3"); - Nocycle_a_2_00020_3A2 a2_main = new Nocycle_a_2_00020_3A2("a2_main"); - Nocycle_a_2_00020_3A3 a3_main = new Nocycle_a_2_00020_3A3("a3_main"); - Nocycle_a_2_00020_3A4 a4_main = new Nocycle_a_2_00020_3A4("a4_main"); - a1_main3.b1_0 = new Nocycle_a_2_00020_3B1("b1_0"); - a1_main3.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a1_main3.b1_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - - a2_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a2_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a2_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - - a3_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); - a3_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a3_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a3_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a3_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - - a3_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); - a3_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a3_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - - a4_main.b3_0 = new Nocycle_a_2_00020_3B3("b3_0"); - a4_main.b3_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a4_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); - a4_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a4_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - - a1_main3.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main3.b1_0.add(); - a1_main3.d1_0.add(); - a1_main3.b1_0.d2_0.add(); - - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - - - int result3 = a1_main3.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main3.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main3.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; - - int result = result1 + result2 + result3; - - if (result == 26225) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_2_00020_A1 { - Nocycle_a_2_00020_B1 b1_0; - Nocycle_a_2_00020_B2 b2_0; - Nocycle_a_2_00020_B3 b3_0; - Nocycle_a_2_00020_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class Nocycle_a_2_00020_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_B4 { - Nocycle_a_2_00020_C1 c1_0; - Nocycle_a_2_00020_C2 c2_0; - Nocycle_a_2_00020_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B4(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class Nocycle_a_2_00020_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_2A1 { - Nocycle_a_2_00020_2B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_2_00020_2B1 { - Nocycle_a_2_00020_2C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_2_00020_2C1 { - Nocycle_a_2_00020_2D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_2_00020_2D1 { - Nocycle_a_2_00020_2E1 e1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2D1(String strObjectName) { - e1_0 = null; - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + e1_0.a; - } - } - - class Nocycle_a_2_00020_2E1 { - Nocycle_a_2_00020_2F1 f1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2E1(String strObjectName) { - f1_0 = null; - a = 501; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_E1_"+strObjectName); - } - - void add() { - sum = a + f1_0.a; - } - } - - class Nocycle_a_2_00020_2F1 { - Nocycle_a_2_00020_2G1 g1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2F1(String strObjectName) { - g1_0 = null; - a = 601; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_F1_"+strObjectName); - } - - void add() { - sum = a + g1_0.a; - } - } - - class Nocycle_a_2_00020_2G1 { - Nocycle_a_2_00020_2H1 h1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2G1(String strObjectName) { - h1_0 = null; - a = 701; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_G1_"+strObjectName); - } - - void add() { - sum = a + h1_0.a; - } - } - - class Nocycle_a_2_00020_2H1 { - Nocycle_a_2_00020_2I1 i1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2H1(String strObjectName) { - i1_0 = null; - a = 801; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_H1_"+strObjectName); - } - - void add() { - sum = a + i1_0.a; - } - } - - class Nocycle_a_2_00020_2I1 { - Nocycle_a_2_00020_2J1 j1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2I1(String strObjectName) { - j1_0 = null; - a = 901; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_I1_"+strObjectName); - } - - void add() { - sum = a + j1_0.a; - } - } - - class Nocycle_a_2_00020_2J1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2J1(String strObjectName) { - a = 1001; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_J1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_3A1 { - Nocycle_a_2_00020_3B1 b1_0; - Nocycle_a_2_00020_3D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - class Nocycle_a_2_00020_3A2 { - Nocycle_a_2_00020_3B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - class Nocycle_a_2_00020_3A3 { - Nocycle_a_2_00020_3B2 b2_0; - Nocycle_a_2_00020_3C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class Nocycle_a_2_00020_3A4 { - Nocycle_a_2_00020_3B3 b3_0; - Nocycle_a_2_00020_3C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - class Nocycle_a_2_00020_3B1 { - Nocycle_a_2_00020_3D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - class Nocycle_a_2_00020_3B2 { - Nocycle_a_2_00020_3C1 c1_0; - Nocycle_a_2_00020_3D1 d1_0; - Nocycle_a_2_00020_3D2 d2_0; - Nocycle_a_2_00020_3D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_2_00020_3B3 { - Nocycle_a_2_00020_3C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_2_00020_3C1 { - Nocycle_a_2_00020_3D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_2_00020_3C2 { - Nocycle_a_2_00020_3D2 d2_0; - Nocycle_a_2_00020_3D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_2_00020_3D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_3D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_3D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -public class Nocycle_am_2_00020 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Nocycle_am_2_00020 A1_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); - ThreadRc_Nocycle_am_2_00020 A2_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); - ThreadRc_Nocycle_am_2_00020 A3_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); - ThreadRc_Nocycle_am_2_00020 A4_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); - ThreadRc_Nocycle_am_2_00020 A5_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); - ThreadRc_Nocycle_am_2_00020 A6_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); - - A1_Nocycle_am_2_00020.start(); - A2_Nocycle_am_2_00020.start(); - A3_Nocycle_am_2_00020.start(); - A4_Nocycle_am_2_00020.start(); - A5_Nocycle_am_2_00020.start(); - A6_Nocycle_am_2_00020.start(); - - try { - A1_Nocycle_am_2_00020.join(); - A2_Nocycle_am_2_00020.join(); - A3_Nocycle_am_2_00020.join(); - A4_Nocycle_am_2_00020.join(); - A5_Nocycle_am_2_00020.join(); - A6_Nocycle_am_2_00020.join(); - - } catch (InterruptedException e) { - } - if (A1_Nocycle_am_2_00020.check() && A2_Nocycle_am_2_00020.check() && A3_Nocycle_am_2_00020.check() && A4_Nocycle_am_2_00020.check() && A5_Nocycle_am_2_00020.check() && A6_Nocycle_am_2_00020.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_2_00020.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_2_00020 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_2_00020.java + *- @ExecuteClass: Nocycle_am_2_00020 + *- @ExecuteArgs: + */ +class ThreadRc_Nocycle_am_2_00020 extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_2_00020_A1 a1_main = new Nocycle_a_2_00020_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_2_00020_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_2_00020_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_2_00020_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_2_00020_B4("b4_0"); + a1_main.b4_0.c1_0 = new Nocycle_a_2_00020_C1("c1_0"); + a1_main.b4_0.c2_0 = new Nocycle_a_2_00020_C2("c2_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_2_00020_C3("c3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b4_0.c1_0.add(); + a1_main.b4_0.c2_0.add(); + a1_main.b4_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); + + int result1 = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result1); + Nocycle_a_2_00020_2A1 a1_main2 = new Nocycle_a_2_00020_2A1("a1_main2"); + a1_main2.b1_0 = new Nocycle_a_2_00020_2B1("b1_0"); + a1_main2.b1_0.c1_0 = new Nocycle_a_2_00020_2C1("c1_0"); + a1_main2.b1_0.c1_0.d1_0 = new Nocycle_a_2_00020_2D1("d1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_2_00020_2E1("e1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_2_00020_2F1("f1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_2_00020_2G1("g1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_2_00020_2H1("h1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_2_00020_2I1("i1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_2_00020_2J1("j1_0"); + a1_main2.add(); + a1_main2.b1_0.add(); + a1_main2.b1_0.c1_0.add(); + a1_main2.b1_0.c1_0.d1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); + + int result2 = a1_main2.sum + a1_main2.b1_0.sum + a1_main2.b1_0.c1_0.sum + a1_main2.b1_0.c1_0.d1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; + + Nocycle_a_2_00020_3A1 a1_main3 = new Nocycle_a_2_00020_3A1("a1_main3"); + Nocycle_a_2_00020_3A2 a2_main = new Nocycle_a_2_00020_3A2("a2_main"); + Nocycle_a_2_00020_3A3 a3_main = new Nocycle_a_2_00020_3A3("a3_main"); + Nocycle_a_2_00020_3A4 a4_main = new Nocycle_a_2_00020_3A4("a4_main"); + a1_main3.b1_0 = new Nocycle_a_2_00020_3B1("b1_0"); + a1_main3.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a1_main3.b1_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + + a2_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a2_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a2_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + + a3_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); + a3_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a3_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a3_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a3_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + + a3_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); + a3_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a3_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + + a4_main.b3_0 = new Nocycle_a_2_00020_3B3("b3_0"); + a4_main.b3_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a4_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); + a4_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a4_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + + a1_main3.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main3.b1_0.add(); + a1_main3.d1_0.add(); + a1_main3.b1_0.d2_0.add(); + + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + + + int result3 = a1_main3.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main3.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main3.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; + + int result = result1 + result2 + result3; + + if (result == 26225) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_2_00020_A1 { + Nocycle_a_2_00020_B1 b1_0; + Nocycle_a_2_00020_B2 b2_0; + Nocycle_a_2_00020_B3 b3_0; + Nocycle_a_2_00020_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class Nocycle_a_2_00020_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_B4 { + Nocycle_a_2_00020_C1 c1_0; + Nocycle_a_2_00020_C2 c2_0; + Nocycle_a_2_00020_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B4(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class Nocycle_a_2_00020_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_2A1 { + Nocycle_a_2_00020_2B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_2_00020_2B1 { + Nocycle_a_2_00020_2C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_2_00020_2C1 { + Nocycle_a_2_00020_2D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_2_00020_2D1 { + Nocycle_a_2_00020_2E1 e1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2D1(String strObjectName) { + e1_0 = null; + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + e1_0.a; + } + } + + class Nocycle_a_2_00020_2E1 { + Nocycle_a_2_00020_2F1 f1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2E1(String strObjectName) { + f1_0 = null; + a = 501; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_E1_"+strObjectName); + } + + void add() { + sum = a + f1_0.a; + } + } + + class Nocycle_a_2_00020_2F1 { + Nocycle_a_2_00020_2G1 g1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2F1(String strObjectName) { + g1_0 = null; + a = 601; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_F1_"+strObjectName); + } + + void add() { + sum = a + g1_0.a; + } + } + + class Nocycle_a_2_00020_2G1 { + Nocycle_a_2_00020_2H1 h1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2G1(String strObjectName) { + h1_0 = null; + a = 701; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_G1_"+strObjectName); + } + + void add() { + sum = a + h1_0.a; + } + } + + class Nocycle_a_2_00020_2H1 { + Nocycle_a_2_00020_2I1 i1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2H1(String strObjectName) { + i1_0 = null; + a = 801; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_H1_"+strObjectName); + } + + void add() { + sum = a + i1_0.a; + } + } + + class Nocycle_a_2_00020_2I1 { + Nocycle_a_2_00020_2J1 j1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2I1(String strObjectName) { + j1_0 = null; + a = 901; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_I1_"+strObjectName); + } + + void add() { + sum = a + j1_0.a; + } + } + + class Nocycle_a_2_00020_2J1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2J1(String strObjectName) { + a = 1001; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_J1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_3A1 { + Nocycle_a_2_00020_3B1 b1_0; + Nocycle_a_2_00020_3D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + class Nocycle_a_2_00020_3A2 { + Nocycle_a_2_00020_3B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + class Nocycle_a_2_00020_3A3 { + Nocycle_a_2_00020_3B2 b2_0; + Nocycle_a_2_00020_3C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class Nocycle_a_2_00020_3A4 { + Nocycle_a_2_00020_3B3 b3_0; + Nocycle_a_2_00020_3C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + class Nocycle_a_2_00020_3B1 { + Nocycle_a_2_00020_3D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + class Nocycle_a_2_00020_3B2 { + Nocycle_a_2_00020_3C1 c1_0; + Nocycle_a_2_00020_3D1 d1_0; + Nocycle_a_2_00020_3D2 d2_0; + Nocycle_a_2_00020_3D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_2_00020_3B3 { + Nocycle_a_2_00020_3C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_2_00020_3C1 { + Nocycle_a_2_00020_3D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_2_00020_3C2 { + Nocycle_a_2_00020_3D2 d2_0; + Nocycle_a_2_00020_3D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_2_00020_3D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_3D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_3D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +public class Nocycle_am_2_00020 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Nocycle_am_2_00020 A1_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); + ThreadRc_Nocycle_am_2_00020 A2_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); + ThreadRc_Nocycle_am_2_00020 A3_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); + ThreadRc_Nocycle_am_2_00020 A4_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); + ThreadRc_Nocycle_am_2_00020 A5_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); + ThreadRc_Nocycle_am_2_00020 A6_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020(); + + A1_Nocycle_am_2_00020.start(); + A2_Nocycle_am_2_00020.start(); + A3_Nocycle_am_2_00020.start(); + A4_Nocycle_am_2_00020.start(); + A5_Nocycle_am_2_00020.start(); + A6_Nocycle_am_2_00020.start(); + + try { + A1_Nocycle_am_2_00020.join(); + A2_Nocycle_am_2_00020.join(); + A3_Nocycle_am_2_00020.join(); + A4_Nocycle_am_2_00020.join(); + A5_Nocycle_am_2_00020.join(); + A6_Nocycle_am_2_00020.join(); + + } catch (InterruptedException e) { + } + if (A1_Nocycle_am_2_00020.check() && A2_Nocycle_am_2_00020.check() && A3_Nocycle_am_2_00020.check() && A4_Nocycle_am_2_00020.check() && A5_Nocycle_am_2_00020.check() && A6_Nocycle_am_2_00020.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0227-rc-function-RC_Thread01-Nocycle_am_2_00030/Nocycle_am_2_00030.java b/test/testsuite/ouroboros/memory_management/Function/RC0227-rc-function-RC_Thread01-Nocycle_am_2_00030/Nocycle_am_2_00030.java index db9d40997a0d59a6767711f4001309fed2edc115..1db9e38b15788a5277a076bf3402d17d9f8a4a0f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0227-rc-function-RC_Thread01-Nocycle_am_2_00030/Nocycle_am_2_00030.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0227-rc-function-RC_Thread01-Nocycle_am_2_00030/Nocycle_am_2_00030.java @@ -1,905 +1,905 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_2_00030.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Change Nocycle_a_2_00030 in RC测试-No-Cycle-00.vsd to Multi thread testcase. - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: Nocycle_am_2_00030.java - *- @ExecuteClass: Nocycle_am_2_00030 - *- @ExecuteArgs: - */ -class ThreadRc_Nocycle_am_2_00010B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_2_00010_A1 a1_main = new Nocycle_a_2_00010_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_2_00010_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_2_00010_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_2_00010_B3("b3_0"); - Nocycle_a_2_00010_A2 a2_main = new Nocycle_a_2_00010_A2("a2_main"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a2_main.add(); - // System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); - int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a2_main.sum; - //System.out.println("RC-Testing_Result="+result); - - if (result == 1939) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_2_00010_A1 { - Nocycle_a_2_00010_B1 b1_0; - Nocycle_a_2_00010_B2 b2_0; - Nocycle_a_2_00010_B3 b3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a; - } - } - - class Nocycle_a_2_00010_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00010_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00010_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00010_A2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00010_A2(String strObjectName) { - a = 10; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -class ThreadRc_Nocycle_am_2_00020B extends Thread { - private boolean checkout; - - public void run() { - Nocycle_a_2_00020_A1 a1_main = new Nocycle_a_2_00020_A1("a1_main"); - a1_main.b1_0 = new Nocycle_a_2_00020_B1("b1_0"); - a1_main.b2_0 = new Nocycle_a_2_00020_B2("b2_0"); - a1_main.b3_0 = new Nocycle_a_2_00020_B3("b3_0"); - a1_main.b4_0 = new Nocycle_a_2_00020_B4("b4_0"); - a1_main.b4_0.c1_0 = new Nocycle_a_2_00020_C1("c1_0"); - a1_main.b4_0.c2_0 = new Nocycle_a_2_00020_C2("c2_0"); - a1_main.b4_0.c3_0 = new Nocycle_a_2_00020_C3("c3_0"); - a1_main.add(); - a1_main.b1_0.add(); - a1_main.b2_0.add(); - a1_main.b3_0.add(); - a1_main.b4_0.add(); - a1_main.b4_0.c1_0.add(); - a1_main.b4_0.c2_0.add(); - a1_main.b4_0.c3_0.add(); -// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); - - int result1 = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; - //System.out.println("RC-Testing_Result="+result1); - Nocycle_a_2_00020_2A1 a1_main2 = new Nocycle_a_2_00020_2A1("a1_main2"); - a1_main2.b1_0 = new Nocycle_a_2_00020_2B1("b1_0"); - a1_main2.b1_0.c1_0 = new Nocycle_a_2_00020_2C1("c1_0"); - a1_main2.b1_0.c1_0.d1_0 = new Nocycle_a_2_00020_2D1("d1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_2_00020_2E1("e1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_2_00020_2F1("f1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_2_00020_2G1("g1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_2_00020_2H1("h1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_2_00020_2I1("i1_0"); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_2_00020_2J1("j1_0"); - a1_main2.add(); - a1_main2.b1_0.add(); - a1_main2.b1_0.c1_0.add(); - a1_main2.b1_0.c1_0.d1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); - a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); - - int result2 = a1_main2.sum + a1_main2.b1_0.sum + a1_main2.b1_0.c1_0.sum + a1_main2.b1_0.c1_0.d1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; - - Nocycle_a_2_00020_3A1 a1_main3 = new Nocycle_a_2_00020_3A1("a1_main3"); - Nocycle_a_2_00020_3A2 a2_main = new Nocycle_a_2_00020_3A2("a2_main"); - Nocycle_a_2_00020_3A3 a3_main = new Nocycle_a_2_00020_3A3("a3_main"); - Nocycle_a_2_00020_3A4 a4_main = new Nocycle_a_2_00020_3A4("a4_main"); - a1_main3.b1_0 = new Nocycle_a_2_00020_3B1("b1_0"); - a1_main3.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a1_main3.b1_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - - a2_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); - a2_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a2_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a2_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a2_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - - a3_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); - a3_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a3_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a3_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a3_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - - a3_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); - a3_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a3_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - - a4_main.b3_0 = new Nocycle_a_2_00020_3B3("b3_0"); - a4_main.b3_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); - a4_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); - a4_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); - a4_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); - - a1_main3.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a1_main3.b1_0.add(); - a1_main3.d1_0.add(); - a1_main3.b1_0.d2_0.add(); - - a2_main.b2_0.add(); - a2_main.b2_0.c1_0.add(); - a2_main.b2_0.d1_0.add(); - a2_main.b2_0.d2_0.add(); - a2_main.b2_0.d3_0.add(); - a2_main.b2_0.c1_0.d1_0.add(); - - a3_main.b2_0.add(); - a3_main.b2_0.c1_0.add(); - a3_main.b2_0.c1_0.d1_0.add(); - a3_main.b2_0.d1_0.add(); - a3_main.b2_0.d2_0.add(); - a3_main.b2_0.d3_0.add(); - - a3_main.c2_0.add(); - a3_main.c2_0.d2_0.add(); - a3_main.c2_0.d3_0.add(); - - a4_main.b3_0.add(); - a4_main.b3_0.c1_0.add(); - a4_main.b3_0.c1_0.d1_0.add(); - a4_main.c2_0.add(); - a4_main.c2_0.d2_0.add(); - a4_main.c2_0.d3_0.add(); - - - int result3 = a1_main3.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main3.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main3.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; - - int result = result1 + result2 + result3; - - if (result == 26225) - checkout = true; - //System.out.println(checkout); - } - - public boolean check() { - return checkout; - } - - class Nocycle_a_2_00020_A1 { - Nocycle_a_2_00020_B1 b1_0; - Nocycle_a_2_00020_B2 b2_0; - Nocycle_a_2_00020_B3 b3_0; - Nocycle_a_2_00020_B4 b4_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class Nocycle_a_2_00020_B1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_B2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_B3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_B4 { - Nocycle_a_2_00020_C1 c1_0; - Nocycle_a_2_00020_C2 c2_0; - Nocycle_a_2_00020_C3 c3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_B4(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class Nocycle_a_2_00020_C1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_C2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_C3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_2A1 { - Nocycle_a_2_00020_2B1 b1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } - } - - class Nocycle_a_2_00020_2B1 { - Nocycle_a_2_00020_2C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2B1(String strObjectName) { - c1_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_2_00020_2C1 { - Nocycle_a_2_00020_2D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_2_00020_2D1 { - Nocycle_a_2_00020_2E1 e1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2D1(String strObjectName) { - e1_0 = null; - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + e1_0.a; - } - } - - class Nocycle_a_2_00020_2E1 { - Nocycle_a_2_00020_2F1 f1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2E1(String strObjectName) { - f1_0 = null; - a = 501; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_E1_"+strObjectName); - } - - void add() { - sum = a + f1_0.a; - } - } - - class Nocycle_a_2_00020_2F1 { - Nocycle_a_2_00020_2G1 g1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2F1(String strObjectName) { - g1_0 = null; - a = 601; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_F1_"+strObjectName); - } - - void add() { - sum = a + g1_0.a; - } - } - - class Nocycle_a_2_00020_2G1 { - Nocycle_a_2_00020_2H1 h1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2G1(String strObjectName) { - h1_0 = null; - a = 701; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_G1_"+strObjectName); - } - - void add() { - sum = a + h1_0.a; - } - } - - class Nocycle_a_2_00020_2H1 { - Nocycle_a_2_00020_2I1 i1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2H1(String strObjectName) { - i1_0 = null; - a = 801; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_H1_"+strObjectName); - } - - void add() { - sum = a + i1_0.a; - } - } - - class Nocycle_a_2_00020_2I1 { - Nocycle_a_2_00020_2J1 j1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2I1(String strObjectName) { - j1_0 = null; - a = 901; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_I1_"+strObjectName); - } - - void add() { - sum = a + j1_0.a; - } - } - - class Nocycle_a_2_00020_2J1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_2J1(String strObjectName) { - a = 1001; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_J1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_3A1 { - Nocycle_a_2_00020_3B1 b1_0; - Nocycle_a_2_00020_3D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - class Nocycle_a_2_00020_3A2 { - Nocycle_a_2_00020_3B2 b2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - class Nocycle_a_2_00020_3A3 { - Nocycle_a_2_00020_3B2 b2_0; - Nocycle_a_2_00020_3C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class Nocycle_a_2_00020_3A4 { - Nocycle_a_2_00020_3B3 b3_0; - Nocycle_a_2_00020_3C2 c2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - class Nocycle_a_2_00020_3B1 { - Nocycle_a_2_00020_3D2 d2_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - class Nocycle_a_2_00020_3B2 { - Nocycle_a_2_00020_3C1 c1_0; - Nocycle_a_2_00020_3D1 d1_0; - Nocycle_a_2_00020_3D2 d2_0; - Nocycle_a_2_00020_3D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_2_00020_3B3 { - Nocycle_a_2_00020_3C1 c1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - class Nocycle_a_2_00020_3C1 { - Nocycle_a_2_00020_3D1 d1_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class Nocycle_a_2_00020_3C2 { - Nocycle_a_2_00020_3D2 d2_0; - Nocycle_a_2_00020_3D3 d3_0; - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - class Nocycle_a_2_00020_3D1 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_3D2 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class Nocycle_a_2_00020_3D3 { - int a; - int sum; - String strObjectName; - - Nocycle_a_2_00020_3D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - -public class Nocycle_am_2_00030 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - } - - private static void rc_testcase_main_wrapper() { - ThreadRc_Nocycle_am_2_00010B A1_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); - ThreadRc_Nocycle_am_2_00010B A2_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); - ThreadRc_Nocycle_am_2_00010B A3_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); - ThreadRc_Nocycle_am_2_00010B A4_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); - ThreadRc_Nocycle_am_2_00010B A5_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); - ThreadRc_Nocycle_am_2_00010B A6_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); - ThreadRc_Nocycle_am_2_00020B A1_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); - ThreadRc_Nocycle_am_2_00020B A2_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); - ThreadRc_Nocycle_am_2_00020B A3_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); - ThreadRc_Nocycle_am_2_00020B A4_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); - ThreadRc_Nocycle_am_2_00020B A5_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); - ThreadRc_Nocycle_am_2_00020B A6_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); - - A1_Nocycle_am_2_00010.start(); - A2_Nocycle_am_2_00010.start(); - A3_Nocycle_am_2_00010.start(); - A4_Nocycle_am_2_00010.start(); - A5_Nocycle_am_2_00010.start(); - A6_Nocycle_am_2_00010.start(); - A1_Nocycle_am_2_00020.start(); - A2_Nocycle_am_2_00020.start(); - A3_Nocycle_am_2_00020.start(); - A4_Nocycle_am_2_00020.start(); - A5_Nocycle_am_2_00020.start(); - A6_Nocycle_am_2_00020.start(); - - try { - A1_Nocycle_am_2_00010.join(); - A2_Nocycle_am_2_00010.join(); - A3_Nocycle_am_2_00010.join(); - A4_Nocycle_am_2_00010.join(); - A5_Nocycle_am_2_00010.join(); - A6_Nocycle_am_2_00010.join(); - A1_Nocycle_am_2_00020.join(); - A2_Nocycle_am_2_00020.join(); - A3_Nocycle_am_2_00020.join(); - A4_Nocycle_am_2_00020.join(); - A5_Nocycle_am_2_00020.join(); - A6_Nocycle_am_2_00020.join(); - - } catch (InterruptedException e) { - } - if (A1_Nocycle_am_2_00010.check() && A2_Nocycle_am_2_00010.check() && A3_Nocycle_am_2_00010.check() && A4_Nocycle_am_2_00010.check() && A5_Nocycle_am_2_00010.check() && A6_Nocycle_am_2_00010.check() && A1_Nocycle_am_2_00020.check() && A2_Nocycle_am_2_00020.check() && A3_Nocycle_am_2_00020.check() && A4_Nocycle_am_2_00020.check() && A5_Nocycle_am_2_00020.check() && A6_Nocycle_am_2_00020.check()) - System.out.println("ExpectResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread01/Nocycle_am_2_00030.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Change Nocycle_a_2_00030 in RC测试-No-Cycle-00.vsd to Multi thread testcase. + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: Nocycle_am_2_00030.java + *- @ExecuteClass: Nocycle_am_2_00030 + *- @ExecuteArgs: + */ +class ThreadRc_Nocycle_am_2_00010B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_2_00010_A1 a1_main = new Nocycle_a_2_00010_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_2_00010_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_2_00010_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_2_00010_B3("b3_0"); + Nocycle_a_2_00010_A2 a2_main = new Nocycle_a_2_00010_A2("a2_main"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a2_main.add(); + // System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum); + int result = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a2_main.sum; + //System.out.println("RC-Testing_Result="+result); + + if (result == 1939) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_2_00010_A1 { + Nocycle_a_2_00010_B1 b1_0; + Nocycle_a_2_00010_B2 b2_0; + Nocycle_a_2_00010_B3 b3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a; + } + } + + class Nocycle_a_2_00010_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00010_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00010_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00010_A2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00010_A2(String strObjectName) { + a = 10; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +class ThreadRc_Nocycle_am_2_00020B extends Thread { + private boolean checkout; + + public void run() { + Nocycle_a_2_00020_A1 a1_main = new Nocycle_a_2_00020_A1("a1_main"); + a1_main.b1_0 = new Nocycle_a_2_00020_B1("b1_0"); + a1_main.b2_0 = new Nocycle_a_2_00020_B2("b2_0"); + a1_main.b3_0 = new Nocycle_a_2_00020_B3("b3_0"); + a1_main.b4_0 = new Nocycle_a_2_00020_B4("b4_0"); + a1_main.b4_0.c1_0 = new Nocycle_a_2_00020_C1("c1_0"); + a1_main.b4_0.c2_0 = new Nocycle_a_2_00020_C2("c2_0"); + a1_main.b4_0.c3_0 = new Nocycle_a_2_00020_C3("c3_0"); + a1_main.add(); + a1_main.b1_0.add(); + a1_main.b2_0.add(); + a1_main.b3_0.add(); + a1_main.b4_0.add(); + a1_main.b4_0.c1_0.add(); + a1_main.b4_0.c2_0.add(); + a1_main.b4_0.c3_0.add(); +// System.out.printf("RC-Testing_Result=%d\n",a1_main.sum+a1_main.b1_0.sum+a1_main.b2_0.sum+a1_main.b3_0.sum+a1_main.b4_0.sum+a1_main.b4_0.c1_0.sum+a1_main.b4_0.c2_0.sum+a1_main.b4_0.c3_0.sum); + + int result1 = a1_main.sum + a1_main.b1_0.sum + a1_main.b2_0.sum + a1_main.b3_0.sum + a1_main.b4_0.sum + a1_main.b4_0.c1_0.sum + a1_main.b4_0.c2_0.sum + a1_main.b4_0.c3_0.sum; + //System.out.println("RC-Testing_Result="+result1); + Nocycle_a_2_00020_2A1 a1_main2 = new Nocycle_a_2_00020_2A1("a1_main2"); + a1_main2.b1_0 = new Nocycle_a_2_00020_2B1("b1_0"); + a1_main2.b1_0.c1_0 = new Nocycle_a_2_00020_2C1("c1_0"); + a1_main2.b1_0.c1_0.d1_0 = new Nocycle_a_2_00020_2D1("d1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0 = new Nocycle_a_2_00020_2E1("e1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0 = new Nocycle_a_2_00020_2F1("f1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0 = new Nocycle_a_2_00020_2G1("g1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0 = new Nocycle_a_2_00020_2H1("h1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0 = new Nocycle_a_2_00020_2I1("i1_0"); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0 = new Nocycle_a_2_00020_2J1("j1_0"); + a1_main2.add(); + a1_main2.b1_0.add(); + a1_main2.b1_0.c1_0.add(); + a1_main2.b1_0.c1_0.d1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.add(); + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.add(); + + int result2 = a1_main2.sum + a1_main2.b1_0.sum + a1_main2.b1_0.c1_0.sum + a1_main2.b1_0.c1_0.d1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.sum + a1_main2.b1_0.c1_0.d1_0.e1_0.f1_0.g1_0.h1_0.i1_0.j1_0.sum; + + Nocycle_a_2_00020_3A1 a1_main3 = new Nocycle_a_2_00020_3A1("a1_main3"); + Nocycle_a_2_00020_3A2 a2_main = new Nocycle_a_2_00020_3A2("a2_main"); + Nocycle_a_2_00020_3A3 a3_main = new Nocycle_a_2_00020_3A3("a3_main"); + Nocycle_a_2_00020_3A4 a4_main = new Nocycle_a_2_00020_3A4("a4_main"); + a1_main3.b1_0 = new Nocycle_a_2_00020_3B1("b1_0"); + a1_main3.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a1_main3.b1_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + + a2_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); + a2_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a2_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a2_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a2_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + + a3_main.b2_0 = new Nocycle_a_2_00020_3B2("b2_0"); + a3_main.b2_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a3_main.b2_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a3_main.b2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a3_main.b2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + + a3_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); + a3_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a3_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + + a4_main.b3_0 = new Nocycle_a_2_00020_3B3("b3_0"); + a4_main.b3_0.c1_0 = new Nocycle_a_2_00020_3C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new Nocycle_a_2_00020_3D1("d1_0"); + a4_main.c2_0 = new Nocycle_a_2_00020_3C2("c2_0"); + a4_main.c2_0.d2_0 = new Nocycle_a_2_00020_3D2("d2_0"); + a4_main.c2_0.d3_0 = new Nocycle_a_2_00020_3D3("d3_0"); + + a1_main3.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a1_main3.b1_0.add(); + a1_main3.d1_0.add(); + a1_main3.b1_0.d2_0.add(); + + a2_main.b2_0.add(); + a2_main.b2_0.c1_0.add(); + a2_main.b2_0.d1_0.add(); + a2_main.b2_0.d2_0.add(); + a2_main.b2_0.d3_0.add(); + a2_main.b2_0.c1_0.d1_0.add(); + + a3_main.b2_0.add(); + a3_main.b2_0.c1_0.add(); + a3_main.b2_0.c1_0.d1_0.add(); + a3_main.b2_0.d1_0.add(); + a3_main.b2_0.d2_0.add(); + a3_main.b2_0.d3_0.add(); + + a3_main.c2_0.add(); + a3_main.c2_0.d2_0.add(); + a3_main.c2_0.d3_0.add(); + + a4_main.b3_0.add(); + a4_main.b3_0.c1_0.add(); + a4_main.b3_0.c1_0.d1_0.add(); + a4_main.c2_0.add(); + a4_main.c2_0.d2_0.add(); + a4_main.c2_0.d3_0.add(); + + + int result3 = a1_main3.sum + a2_main.sum + a3_main.sum + a4_main.sum + a1_main3.b1_0.sum + a2_main.b2_0.sum + a4_main.b3_0.sum + a2_main.b2_0.c1_0.sum + a3_main.c2_0.sum + a1_main3.d1_0.sum + a3_main.c2_0.d2_0.sum + a3_main.c2_0.d3_0.sum; + + int result = result1 + result2 + result3; + + if (result == 26225) + checkout = true; + //System.out.println(checkout); + } + + public boolean check() { + return checkout; + } + + class Nocycle_a_2_00020_A1 { + Nocycle_a_2_00020_B1 b1_0; + Nocycle_a_2_00020_B2 b2_0; + Nocycle_a_2_00020_B3 b3_0; + Nocycle_a_2_00020_B4 b4_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class Nocycle_a_2_00020_B1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_B2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_B3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_B4 { + Nocycle_a_2_00020_C1 c1_0; + Nocycle_a_2_00020_C2 c2_0; + Nocycle_a_2_00020_C3 c3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_B4(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class Nocycle_a_2_00020_C1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_C2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_C3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_2A1 { + Nocycle_a_2_00020_2B1 b1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } + } + + class Nocycle_a_2_00020_2B1 { + Nocycle_a_2_00020_2C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2B1(String strObjectName) { + c1_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_2_00020_2C1 { + Nocycle_a_2_00020_2D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_2_00020_2D1 { + Nocycle_a_2_00020_2E1 e1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2D1(String strObjectName) { + e1_0 = null; + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + e1_0.a; + } + } + + class Nocycle_a_2_00020_2E1 { + Nocycle_a_2_00020_2F1 f1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2E1(String strObjectName) { + f1_0 = null; + a = 501; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_E1_"+strObjectName); + } + + void add() { + sum = a + f1_0.a; + } + } + + class Nocycle_a_2_00020_2F1 { + Nocycle_a_2_00020_2G1 g1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2F1(String strObjectName) { + g1_0 = null; + a = 601; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_F1_"+strObjectName); + } + + void add() { + sum = a + g1_0.a; + } + } + + class Nocycle_a_2_00020_2G1 { + Nocycle_a_2_00020_2H1 h1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2G1(String strObjectName) { + h1_0 = null; + a = 701; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_G1_"+strObjectName); + } + + void add() { + sum = a + h1_0.a; + } + } + + class Nocycle_a_2_00020_2H1 { + Nocycle_a_2_00020_2I1 i1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2H1(String strObjectName) { + i1_0 = null; + a = 801; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_H1_"+strObjectName); + } + + void add() { + sum = a + i1_0.a; + } + } + + class Nocycle_a_2_00020_2I1 { + Nocycle_a_2_00020_2J1 j1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2I1(String strObjectName) { + j1_0 = null; + a = 901; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_I1_"+strObjectName); + } + + void add() { + sum = a + j1_0.a; + } + } + + class Nocycle_a_2_00020_2J1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_2J1(String strObjectName) { + a = 1001; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_J1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_3A1 { + Nocycle_a_2_00020_3B1 b1_0; + Nocycle_a_2_00020_3D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + class Nocycle_a_2_00020_3A2 { + Nocycle_a_2_00020_3B2 b2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + class Nocycle_a_2_00020_3A3 { + Nocycle_a_2_00020_3B2 b2_0; + Nocycle_a_2_00020_3C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class Nocycle_a_2_00020_3A4 { + Nocycle_a_2_00020_3B3 b3_0; + Nocycle_a_2_00020_3C2 c2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + class Nocycle_a_2_00020_3B1 { + Nocycle_a_2_00020_3D2 d2_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + class Nocycle_a_2_00020_3B2 { + Nocycle_a_2_00020_3C1 c1_0; + Nocycle_a_2_00020_3D1 d1_0; + Nocycle_a_2_00020_3D2 d2_0; + Nocycle_a_2_00020_3D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_2_00020_3B3 { + Nocycle_a_2_00020_3C1 c1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + class Nocycle_a_2_00020_3C1 { + Nocycle_a_2_00020_3D1 d1_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class Nocycle_a_2_00020_3C2 { + Nocycle_a_2_00020_3D2 d2_0; + Nocycle_a_2_00020_3D3 d3_0; + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + class Nocycle_a_2_00020_3D1 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_3D2 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class Nocycle_a_2_00020_3D3 { + int a; + int sum; + String strObjectName; + + Nocycle_a_2_00020_3D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + +public class Nocycle_am_2_00030 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + } + + private static void rc_testcase_main_wrapper() { + ThreadRc_Nocycle_am_2_00010B A1_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); + ThreadRc_Nocycle_am_2_00010B A2_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); + ThreadRc_Nocycle_am_2_00010B A3_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); + ThreadRc_Nocycle_am_2_00010B A4_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); + ThreadRc_Nocycle_am_2_00010B A5_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); + ThreadRc_Nocycle_am_2_00010B A6_Nocycle_am_2_00010 = new ThreadRc_Nocycle_am_2_00010B(); + ThreadRc_Nocycle_am_2_00020B A1_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); + ThreadRc_Nocycle_am_2_00020B A2_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); + ThreadRc_Nocycle_am_2_00020B A3_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); + ThreadRc_Nocycle_am_2_00020B A4_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); + ThreadRc_Nocycle_am_2_00020B A5_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); + ThreadRc_Nocycle_am_2_00020B A6_Nocycle_am_2_00020 = new ThreadRc_Nocycle_am_2_00020B(); + + A1_Nocycle_am_2_00010.start(); + A2_Nocycle_am_2_00010.start(); + A3_Nocycle_am_2_00010.start(); + A4_Nocycle_am_2_00010.start(); + A5_Nocycle_am_2_00010.start(); + A6_Nocycle_am_2_00010.start(); + A1_Nocycle_am_2_00020.start(); + A2_Nocycle_am_2_00020.start(); + A3_Nocycle_am_2_00020.start(); + A4_Nocycle_am_2_00020.start(); + A5_Nocycle_am_2_00020.start(); + A6_Nocycle_am_2_00020.start(); + + try { + A1_Nocycle_am_2_00010.join(); + A2_Nocycle_am_2_00010.join(); + A3_Nocycle_am_2_00010.join(); + A4_Nocycle_am_2_00010.join(); + A5_Nocycle_am_2_00010.join(); + A6_Nocycle_am_2_00010.join(); + A1_Nocycle_am_2_00020.join(); + A2_Nocycle_am_2_00020.join(); + A3_Nocycle_am_2_00020.join(); + A4_Nocycle_am_2_00020.join(); + A5_Nocycle_am_2_00020.join(); + A6_Nocycle_am_2_00020.join(); + + } catch (InterruptedException e) { + } + if (A1_Nocycle_am_2_00010.check() && A2_Nocycle_am_2_00010.check() && A3_Nocycle_am_2_00010.check() && A4_Nocycle_am_2_00010.check() && A5_Nocycle_am_2_00010.check() && A6_Nocycle_am_2_00010.check() && A1_Nocycle_am_2_00020.check() && A2_Nocycle_am_2_00020.check() && A3_Nocycle_am_2_00020.check() && A4_Nocycle_am_2_00020.check() && A5_Nocycle_am_2_00020.check() && A6_Nocycle_am_2_00020.check()) + System.out.println("ExpectResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0228-rc-function-RC_Thread02-RC_Thread_01/RC_Thread_01.java b/test/testsuite/ouroboros/memory_management/Function/RC0228-rc-function-RC_Thread02-RC_Thread_01/RC_Thread_01.java index 7588709700a02b2dc5dbb6df7b8f77085b77828a..f448377d12a7686b67cd808d512c1c7c8e452e14 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0228-rc-function-RC_Thread02-RC_Thread_01/RC_Thread_01.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0228-rc-function-RC_Thread02-RC_Thread_01/RC_Thread_01.java @@ -1,435 +1,435 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_01.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_01.java - *- @ExecuteClass: RC_Thread_01 - *- @ExecuteArgs: - - * - */ - -class RC_Thread_01_1 extends Thread { - public void run() { - RC_Thread_01 rcth01 = new RC_Thread_01(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_01_2 extends Thread { - public void run() { - RC_Thread_01 rcth01 = new RC_Thread_01(); - try { - rcth01.setA2null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_01_3 extends Thread { - public void run() { - RC_Thread_01 rcth01 = new RC_Thread_01(); - try { - rcth01.setA3(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_01_4 extends Thread { - public void run() { - RC_Thread_01 rcth01 = new RC_Thread_01(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_01_5 extends Thread { - public void run() { - RC_Thread_01 rcth01 = new RC_Thread_01(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - - -public class RC_Thread_01 { - private volatile static RC_Thread_01_A1 a1_main = null; - private volatile static RC_Thread_01_A2 a2_main = null; - private volatile static RC_Thread_01_A3 a3_main = null; - private volatile static RC_Thread_01_A4 a4_main = null; - - RC_Thread_01() { - try { - a1_main = new RC_Thread_01_A1("a1_main"); - a2_main = new RC_Thread_01_A2("a2_main"); - a3_main = new RC_Thread_01_A3("a3_main"); - a4_main = new RC_Thread_01_A4("a4_main"); - a1_main.b1_0 = new RC_Thread_01_B1("b1_0"); - a1_main.d1_0 = new RC_Thread_01_D1("d1_0"); - a1_main.b1_0.d2_0 = new RC_Thread_01_D2("d2_0"); - - a2_main.b2_0 = new RC_Thread_01_B2("b2_0"); - a2_main.b2_0.c1_0 = new RC_Thread_01_C1("c1_0"); - a2_main.b2_0.d1_0 = new RC_Thread_01_D1("d1_0"); - a2_main.b2_0.d2_0 = new RC_Thread_01_D2("d2_0"); - a2_main.b2_0.d3_0 = new RC_Thread_01_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new RC_Thread_01_D1("d1_0"); - - a3_main.b2_0 = new RC_Thread_01_B2("b2_0"); - a3_main.b2_0.c1_0 = new RC_Thread_01_C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new RC_Thread_01_D1("d1_0"); - a3_main.b2_0.d1_0 = new RC_Thread_01_D1("d1_0"); - a3_main.b2_0.d2_0 = new RC_Thread_01_D2("d2_0"); - a3_main.b2_0.d3_0 = new RC_Thread_01_D3("d3_0"); - - a3_main.c2_0 = new RC_Thread_01_C2("c2_0"); - a3_main.c2_0.d2_0 = new RC_Thread_01_D2("d2_0"); - a3_main.c2_0.d3_0 = new RC_Thread_01_D3("d3_0"); - - a4_main.b3_0 = new RC_Thread_01_B3("b3_0"); - a4_main.b3_0.c1_0 = new RC_Thread_01_C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new RC_Thread_01_D1("d1_0"); - a4_main.c2_0 = new RC_Thread_01_C2("c2_0"); - a4_main.c2_0.d2_0 = new RC_Thread_01_D2("d2_0"); - a4_main.c2_0.d3_0 = new RC_Thread_01_D3("d3_0"); - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_01_1 t1 = new RC_Thread_01_1(); - RC_Thread_01_2 t2 = new RC_Thread_01_2(); - RC_Thread_01_3 t3 = new RC_Thread_01_3(); - RC_Thread_01_4 t4 = new RC_Thread_01_4(); - RC_Thread_01_5 t5 = new RC_Thread_01_5(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - t5.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - } catch (InterruptedException e) { - } - - } - - - public void setA1null() { - a1_main = null; - } - - public void setA2null() { - a2_main = null; - } - - public void setA3() { - try { - a3_main.c2_0.d2_0 = new RC_Thread_01_D2("new"); - a3_main = new RC_Thread_01_A3("a3_new"); - a3_main = null; - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - a3_main = null; - } - - public void setA4null() { - a4_main = null; - } - - class RC_Thread_01_A1 { - volatile RC_Thread_01_B1 b1_0; - volatile RC_Thread_01_D1 d1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - - class RC_Thread_01_A2 { - volatile RC_Thread_01_B2 b2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - - class RC_Thread_01_A3 { - volatile RC_Thread_01_B2 b2_0; - volatile RC_Thread_01_C2 c2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class RC_Thread_01_A4 { - volatile RC_Thread_01_B3 b3_0; - volatile RC_Thread_01_C2 c2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - - class RC_Thread_01_B1 { - volatile RC_Thread_01_D2 d2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - - class RC_Thread_01_B2 { - volatile RC_Thread_01_C1 c1_0; - volatile RC_Thread_01_D1 d1_0; - volatile RC_Thread_01_D2 d2_0; - volatile RC_Thread_01_D3 d3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - - class RC_Thread_01_B3 { - volatile RC_Thread_01_C1 c1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - - class RC_Thread_01_C1 { - volatile RC_Thread_01_D1 d1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class RC_Thread_01_C2 { - volatile RC_Thread_01_D2 d2_0; - volatile RC_Thread_01_D3 d3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_01_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - - class RC_Thread_01_D1 { - int a; - int sum; - String strObjectName; - - RC_Thread_01_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_01_D2 { - int a; - int sum; - String strObjectName; - - RC_Thread_01_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_01_D3 { - int a; - int sum; - String strObjectName; - - RC_Thread_01_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_01.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_01.java + *- @ExecuteClass: RC_Thread_01 + *- @ExecuteArgs: + + * + */ + +class RC_Thread_01_1 extends Thread { + public void run() { + RC_Thread_01 rcth01 = new RC_Thread_01(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_01_2 extends Thread { + public void run() { + RC_Thread_01 rcth01 = new RC_Thread_01(); + try { + rcth01.setA2null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_01_3 extends Thread { + public void run() { + RC_Thread_01 rcth01 = new RC_Thread_01(); + try { + rcth01.setA3(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_01_4 extends Thread { + public void run() { + RC_Thread_01 rcth01 = new RC_Thread_01(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_01_5 extends Thread { + public void run() { + RC_Thread_01 rcth01 = new RC_Thread_01(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + + +public class RC_Thread_01 { + private volatile static RC_Thread_01_A1 a1_main = null; + private volatile static RC_Thread_01_A2 a2_main = null; + private volatile static RC_Thread_01_A3 a3_main = null; + private volatile static RC_Thread_01_A4 a4_main = null; + + RC_Thread_01() { + try { + a1_main = new RC_Thread_01_A1("a1_main"); + a2_main = new RC_Thread_01_A2("a2_main"); + a3_main = new RC_Thread_01_A3("a3_main"); + a4_main = new RC_Thread_01_A4("a4_main"); + a1_main.b1_0 = new RC_Thread_01_B1("b1_0"); + a1_main.d1_0 = new RC_Thread_01_D1("d1_0"); + a1_main.b1_0.d2_0 = new RC_Thread_01_D2("d2_0"); + + a2_main.b2_0 = new RC_Thread_01_B2("b2_0"); + a2_main.b2_0.c1_0 = new RC_Thread_01_C1("c1_0"); + a2_main.b2_0.d1_0 = new RC_Thread_01_D1("d1_0"); + a2_main.b2_0.d2_0 = new RC_Thread_01_D2("d2_0"); + a2_main.b2_0.d3_0 = new RC_Thread_01_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new RC_Thread_01_D1("d1_0"); + + a3_main.b2_0 = new RC_Thread_01_B2("b2_0"); + a3_main.b2_0.c1_0 = new RC_Thread_01_C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new RC_Thread_01_D1("d1_0"); + a3_main.b2_0.d1_0 = new RC_Thread_01_D1("d1_0"); + a3_main.b2_0.d2_0 = new RC_Thread_01_D2("d2_0"); + a3_main.b2_0.d3_0 = new RC_Thread_01_D3("d3_0"); + + a3_main.c2_0 = new RC_Thread_01_C2("c2_0"); + a3_main.c2_0.d2_0 = new RC_Thread_01_D2("d2_0"); + a3_main.c2_0.d3_0 = new RC_Thread_01_D3("d3_0"); + + a4_main.b3_0 = new RC_Thread_01_B3("b3_0"); + a4_main.b3_0.c1_0 = new RC_Thread_01_C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new RC_Thread_01_D1("d1_0"); + a4_main.c2_0 = new RC_Thread_01_C2("c2_0"); + a4_main.c2_0.d2_0 = new RC_Thread_01_D2("d2_0"); + a4_main.c2_0.d3_0 = new RC_Thread_01_D3("d3_0"); + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_01_1 t1 = new RC_Thread_01_1(); + RC_Thread_01_2 t2 = new RC_Thread_01_2(); + RC_Thread_01_3 t3 = new RC_Thread_01_3(); + RC_Thread_01_4 t4 = new RC_Thread_01_4(); + RC_Thread_01_5 t5 = new RC_Thread_01_5(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t5.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + t5.join(); + } catch (InterruptedException e) { + } + + } + + + public void setA1null() { + a1_main = null; + } + + public void setA2null() { + a2_main = null; + } + + public void setA3() { + try { + a3_main.c2_0.d2_0 = new RC_Thread_01_D2("new"); + a3_main = new RC_Thread_01_A3("a3_new"); + a3_main = null; + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + a3_main = null; + } + + public void setA4null() { + a4_main = null; + } + + class RC_Thread_01_A1 { + volatile RC_Thread_01_B1 b1_0; + volatile RC_Thread_01_D1 d1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + + class RC_Thread_01_A2 { + volatile RC_Thread_01_B2 b2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + + class RC_Thread_01_A3 { + volatile RC_Thread_01_B2 b2_0; + volatile RC_Thread_01_C2 c2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class RC_Thread_01_A4 { + volatile RC_Thread_01_B3 b3_0; + volatile RC_Thread_01_C2 c2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + + class RC_Thread_01_B1 { + volatile RC_Thread_01_D2 d2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + + class RC_Thread_01_B2 { + volatile RC_Thread_01_C1 c1_0; + volatile RC_Thread_01_D1 d1_0; + volatile RC_Thread_01_D2 d2_0; + volatile RC_Thread_01_D3 d3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + + class RC_Thread_01_B3 { + volatile RC_Thread_01_C1 c1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + + class RC_Thread_01_C1 { + volatile RC_Thread_01_D1 d1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class RC_Thread_01_C2 { + volatile RC_Thread_01_D2 d2_0; + volatile RC_Thread_01_D3 d3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_01_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + + class RC_Thread_01_D1 { + int a; + int sum; + String strObjectName; + + RC_Thread_01_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_01_D2 { + int a; + int sum; + String strObjectName; + + RC_Thread_01_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_01_D3 { + int a; + int sum; + String strObjectName; + + RC_Thread_01_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0229-rc-function-RC_Thread02-RC_Thread_02/RC_Thread_02.java b/test/testsuite/ouroboros/memory_management/Function/RC0229-rc-function-RC_Thread02-RC_Thread_02/RC_Thread_02.java index 0a7d9670a33995db46288fa44bcafbe68e509468..9aad3696c796f5e7cd895331007c0ddb973f57c1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0229-rc-function-RC_Thread02-RC_Thread_02/RC_Thread_02.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0229-rc-function-RC_Thread02-RC_Thread_02/RC_Thread_02.java @@ -1,303 +1,303 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00050 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_02.java - *- @ExecuteClass: RC_Thread_02 - *- @ExecuteArgs: - - * - */ -class RC_Thread_02_1 extends Thread { - public void run() { - RC_Thread_02 rcth01 = new RC_Thread_02("rcth01"); - try { - rcth01.addSum(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_02_2 extends Thread { - public void run() { - RC_Thread_02 rcth01 = new RC_Thread_02("rcth01"); - try { - rcth01.ModifyB4(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_02_3 extends Thread { - public void run() { - RC_Thread_02 rcth01 = new RC_Thread_02("rcth01"); - try { - rcth01.deleteA1(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_02_4 extends Thread { - public void run() { - RC_Thread_02 rcth01 = new RC_Thread_02("rcth01"); - try { - rcth01.setA1(null); - } catch (NullPointerException e) { - - } - } -} - - -public class RC_Thread_02 { - private volatile static RC_Thread_02_A1 a1 = null; - - RC_Thread_02(String str) { - try { - a1 = new RC_Thread_02_A1("a1"); - a1.b1_0 = new RC_Thread_02_B1("b1_0"); - a1.b1_0.c1_0 = new RC_Thread_02_C1("c1_0"); - a1.b1_0.c2_0 = new RC_Thread_02_C2("c2_0"); - a1.b1_0.c3_0 = new RC_Thread_02_C3("c3_0"); - a1.b2_0 = new RC_Thread_02_B2("b2_0"); - a1.b3_0 = new RC_Thread_02_B3("b3_0"); - a1.b4_0 = new RC_Thread_02_B4("b4_0"); - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_02_1 t1 = new RC_Thread_02_1(); - RC_Thread_02_2 t2 = new RC_Thread_02_2(); - RC_Thread_02_3 t3 = new RC_Thread_02_3(); - RC_Thread_02_4 t4 = new RC_Thread_02_4(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - - } catch (InterruptedException e) { - } - } - - public void deleteA1() { - a1 = null; - } - - public void ModifyB4() { - try { - a1.b4_0 = new RC_Thread_02_B4("new_b4"); - } catch (NullPointerException e) { - - } - } - - public void addSum() { - try { - a1.add(); - a1.b1_0.add(); - a1.b2_0.add(); - a1.b3_0.add(); - a1.b4_0.add(); - a1.b1_0.c1_0.add(); - a1.b1_0.c2_0.add(); - a1.b1_0.c3_0.add(); - } catch (NullPointerException e) { - - } - } - - public void setA1(RC_Thread_02_A1 a1) { - this.a1 = a1; - } - - class RC_Thread_02_A1 { - volatile RC_Thread_02_B1 b1_0; - volatile RC_Thread_02_B2 b2_0; - volatile RC_Thread_02_B3 b3_0; - volatile RC_Thread_02_B4 b4_0; - int a; - int sum; - String strObjectName; - - RC_Thread_02_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class RC_Thread_02_B1 { - volatile RC_Thread_02_C1 c1_0; - volatile RC_Thread_02_C2 c2_0; - volatile RC_Thread_02_C3 c3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_02_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class RC_Thread_02_B2 { - int a; - int sum; - String strObjectName; - - RC_Thread_02_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - - class RC_Thread_02_B3 { - int a; - int sum; - String strObjectName; - - RC_Thread_02_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_02_B4 { - int a; - int sum; - String strObjectName; - - RC_Thread_02_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_02_C1 { - int a; - int sum; - String strObjectName; - - RC_Thread_02_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_02_C2 { - int a; - int sum; - String strObjectName; - - RC_Thread_02_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_02_C3 { - int a; - int sum; - String strObjectName; - - RC_Thread_02_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00050 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_02.java + *- @ExecuteClass: RC_Thread_02 + *- @ExecuteArgs: + + * + */ +class RC_Thread_02_1 extends Thread { + public void run() { + RC_Thread_02 rcth01 = new RC_Thread_02("rcth01"); + try { + rcth01.addSum(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_02_2 extends Thread { + public void run() { + RC_Thread_02 rcth01 = new RC_Thread_02("rcth01"); + try { + rcth01.ModifyB4(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_02_3 extends Thread { + public void run() { + RC_Thread_02 rcth01 = new RC_Thread_02("rcth01"); + try { + rcth01.deleteA1(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_02_4 extends Thread { + public void run() { + RC_Thread_02 rcth01 = new RC_Thread_02("rcth01"); + try { + rcth01.setA1(null); + } catch (NullPointerException e) { + + } + } +} + + +public class RC_Thread_02 { + private volatile static RC_Thread_02_A1 a1 = null; + + RC_Thread_02(String str) { + try { + a1 = new RC_Thread_02_A1("a1"); + a1.b1_0 = new RC_Thread_02_B1("b1_0"); + a1.b1_0.c1_0 = new RC_Thread_02_C1("c1_0"); + a1.b1_0.c2_0 = new RC_Thread_02_C2("c2_0"); + a1.b1_0.c3_0 = new RC_Thread_02_C3("c3_0"); + a1.b2_0 = new RC_Thread_02_B2("b2_0"); + a1.b3_0 = new RC_Thread_02_B3("b3_0"); + a1.b4_0 = new RC_Thread_02_B4("b4_0"); + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_02_1 t1 = new RC_Thread_02_1(); + RC_Thread_02_2 t2 = new RC_Thread_02_2(); + RC_Thread_02_3 t3 = new RC_Thread_02_3(); + RC_Thread_02_4 t4 = new RC_Thread_02_4(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + + } catch (InterruptedException e) { + } + } + + public void deleteA1() { + a1 = null; + } + + public void ModifyB4() { + try { + a1.b4_0 = new RC_Thread_02_B4("new_b4"); + } catch (NullPointerException e) { + + } + } + + public void addSum() { + try { + a1.add(); + a1.b1_0.add(); + a1.b2_0.add(); + a1.b3_0.add(); + a1.b4_0.add(); + a1.b1_0.c1_0.add(); + a1.b1_0.c2_0.add(); + a1.b1_0.c3_0.add(); + } catch (NullPointerException e) { + + } + } + + public void setA1(RC_Thread_02_A1 a1) { + this.a1 = a1; + } + + class RC_Thread_02_A1 { + volatile RC_Thread_02_B1 b1_0; + volatile RC_Thread_02_B2 b2_0; + volatile RC_Thread_02_B3 b3_0; + volatile RC_Thread_02_B4 b4_0; + int a; + int sum; + String strObjectName; + + RC_Thread_02_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class RC_Thread_02_B1 { + volatile RC_Thread_02_C1 c1_0; + volatile RC_Thread_02_C2 c2_0; + volatile RC_Thread_02_C3 c3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_02_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class RC_Thread_02_B2 { + int a; + int sum; + String strObjectName; + + RC_Thread_02_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + + class RC_Thread_02_B3 { + int a; + int sum; + String strObjectName; + + RC_Thread_02_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_02_B4 { + int a; + int sum; + String strObjectName; + + RC_Thread_02_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_02_C1 { + int a; + int sum; + String strObjectName; + + RC_Thread_02_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_02_C2 { + int a; + int sum; + String strObjectName; + + RC_Thread_02_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_02_C3 { + int a; + int sum; + String strObjectName; + + RC_Thread_02_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0230-rc-function-RC_Thread02-RC_Thread_03/RC_Thread_03.java b/test/testsuite/ouroboros/memory_management/Function/RC0230-rc-function-RC_Thread02-RC_Thread_03/RC_Thread_03.java index 2e0381114a236ab9fa2b3d22322e6239af0a70a3..78b509d13be3f265effb6d4cc1e553ca782090ac 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0230-rc-function-RC_Thread02-RC_Thread_03/RC_Thread_03.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0230-rc-function-RC_Thread02-RC_Thread_03/RC_Thread_03.java @@ -1,437 +1,437 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_03.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_03.java - *- @ExecuteClass: RC_Thread_03 - *- @ExecuteArgs: - - * - */ - -class RC_Thread_03_1 extends Thread { - public void run() { - RC_Thread_03 rcth01 = new RC_Thread_03(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_03_2 extends Thread { - public void run() { - RC_Thread_03 rcth01 = new RC_Thread_03(); - try { - rcth01.setA2null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_03_3 extends Thread { - public void run() { - RC_Thread_03 rcth01 = new RC_Thread_03(); - try { - rcth01.setA3(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_03_4 extends Thread { - public void run() { - RC_Thread_03 rcth01 = new RC_Thread_03(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_03_5 extends Thread { - public void run() { - RC_Thread_03 rcth01 = new RC_Thread_03(); - try { - rcth01.setA4(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_03 { - private volatile static RC_Thread_03_A1 a1_main = null; - private volatile static RC_Thread_03_A2 a2_main = null; - private volatile static RC_Thread_03_A3 a3_main = null; - private volatile static RC_Thread_03_A4 a4_main = null; - - RC_Thread_03() { - try { - a1_main = new RC_Thread_03_A1("a1_main"); - a2_main = new RC_Thread_03_A2("a2_main"); - a3_main = new RC_Thread_03_A3("a3_main"); - a4_main = new RC_Thread_03_A4("a4_main"); - a1_main.b1_0 = new RC_Thread_03_B1("b1_0"); - a1_main.d1_0 = new RC_Thread_03_D1("d1_0"); - a1_main.b1_0.d2_0 = new RC_Thread_03_D2("d2_0"); - - a2_main.b2_0 = new RC_Thread_03_B2("b2_0"); - a2_main.b2_0.c1_0 = new RC_Thread_03_C1("c1_0"); - a2_main.b2_0.d1_0 = new RC_Thread_03_D1("d1_0"); - a2_main.b2_0.d2_0 = new RC_Thread_03_D2("d2_0"); - a2_main.b2_0.d3_0 = new RC_Thread_03_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new RC_Thread_03_D1("d1_0"); - - a3_main.b2_0 = new RC_Thread_03_B2("b2_0"); - a3_main.b2_0.c1_0 = new RC_Thread_03_C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new RC_Thread_03_D1("d1_0"); - a3_main.b2_0.d1_0 = new RC_Thread_03_D1("d1_0"); - a3_main.b2_0.d2_0 = new RC_Thread_03_D2("d2_0"); - a3_main.b2_0.d3_0 = new RC_Thread_03_D3("d3_0"); - - a3_main.c2_0 = new RC_Thread_03_C2("c2_0"); - a3_main.c2_0.d2_0 = new RC_Thread_03_D2("d2_0"); - a3_main.c2_0.d3_0 = new RC_Thread_03_D3("d3_0"); - - a4_main.b3_0 = new RC_Thread_03_B3("b3_0"); - a4_main.b3_0.c1_0 = new RC_Thread_03_C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new RC_Thread_03_D1("d1_0"); - a4_main.c2_0 = new RC_Thread_03_C2("c2_0"); - a4_main.c2_0.d2_0 = new RC_Thread_03_D2("d2_0"); - a4_main.c2_0.d3_0 = new RC_Thread_03_D3("d3_0"); - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_03_1 t1 = new RC_Thread_03_1(); - RC_Thread_03_2 t2 = new RC_Thread_03_2(); - RC_Thread_03_3 t3 = new RC_Thread_03_3(); - RC_Thread_03_4 t4 = new RC_Thread_03_4(); - RC_Thread_03_5 t5 = new RC_Thread_03_5(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - t5.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA2null() { - a2_main = null; - } - - public void setA3() { - try { - a3_main.c2_0.d2_0 = new RC_Thread_03_D2("new"); - a3_main = new RC_Thread_03_A3("a3_new"); - a3_main = null; - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - a3_main = null; - } - - public void setA4() { - try { - a4_main = new RC_Thread_03_A4("a4_new"); - - } catch (NullPointerException e) { - } - } - - class RC_Thread_03_A1 { - volatile RC_Thread_03_B1 b1_0; - volatile RC_Thread_03_D1 d1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - - class RC_Thread_03_A2 { - volatile RC_Thread_03_B2 b2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - - class RC_Thread_03_A3 { - volatile RC_Thread_03_B2 b2_0; - volatile RC_Thread_03_C2 c2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class RC_Thread_03_A4 { - volatile RC_Thread_03_B3 b3_0; - volatile RC_Thread_03_C2 c2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - - class RC_Thread_03_B1 { - volatile RC_Thread_03_D2 d2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - - class RC_Thread_03_B2 { - volatile RC_Thread_03_C1 c1_0; - volatile RC_Thread_03_D1 d1_0; - volatile RC_Thread_03_D2 d2_0; - volatile RC_Thread_03_D3 d3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - - class RC_Thread_03_B3 { - volatile RC_Thread_03_C1 c1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - - class RC_Thread_03_C1 { - volatile RC_Thread_03_D1 d1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class RC_Thread_03_C2 { - volatile RC_Thread_03_D2 d2_0; - volatile RC_Thread_03_D3 d3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_03_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - - class RC_Thread_03_D1 { - int a; - int sum; - String strObjectName; - - RC_Thread_03_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_03_D2 { - int a; - int sum; - String strObjectName; - - RC_Thread_03_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_03_D3 { - int a; - int sum; - String strObjectName; - - RC_Thread_03_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_03.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_03.java + *- @ExecuteClass: RC_Thread_03 + *- @ExecuteArgs: + + * + */ + +class RC_Thread_03_1 extends Thread { + public void run() { + RC_Thread_03 rcth01 = new RC_Thread_03(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_03_2 extends Thread { + public void run() { + RC_Thread_03 rcth01 = new RC_Thread_03(); + try { + rcth01.setA2null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_03_3 extends Thread { + public void run() { + RC_Thread_03 rcth01 = new RC_Thread_03(); + try { + rcth01.setA3(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_03_4 extends Thread { + public void run() { + RC_Thread_03 rcth01 = new RC_Thread_03(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_03_5 extends Thread { + public void run() { + RC_Thread_03 rcth01 = new RC_Thread_03(); + try { + rcth01.setA4(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_03 { + private volatile static RC_Thread_03_A1 a1_main = null; + private volatile static RC_Thread_03_A2 a2_main = null; + private volatile static RC_Thread_03_A3 a3_main = null; + private volatile static RC_Thread_03_A4 a4_main = null; + + RC_Thread_03() { + try { + a1_main = new RC_Thread_03_A1("a1_main"); + a2_main = new RC_Thread_03_A2("a2_main"); + a3_main = new RC_Thread_03_A3("a3_main"); + a4_main = new RC_Thread_03_A4("a4_main"); + a1_main.b1_0 = new RC_Thread_03_B1("b1_0"); + a1_main.d1_0 = new RC_Thread_03_D1("d1_0"); + a1_main.b1_0.d2_0 = new RC_Thread_03_D2("d2_0"); + + a2_main.b2_0 = new RC_Thread_03_B2("b2_0"); + a2_main.b2_0.c1_0 = new RC_Thread_03_C1("c1_0"); + a2_main.b2_0.d1_0 = new RC_Thread_03_D1("d1_0"); + a2_main.b2_0.d2_0 = new RC_Thread_03_D2("d2_0"); + a2_main.b2_0.d3_0 = new RC_Thread_03_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new RC_Thread_03_D1("d1_0"); + + a3_main.b2_0 = new RC_Thread_03_B2("b2_0"); + a3_main.b2_0.c1_0 = new RC_Thread_03_C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new RC_Thread_03_D1("d1_0"); + a3_main.b2_0.d1_0 = new RC_Thread_03_D1("d1_0"); + a3_main.b2_0.d2_0 = new RC_Thread_03_D2("d2_0"); + a3_main.b2_0.d3_0 = new RC_Thread_03_D3("d3_0"); + + a3_main.c2_0 = new RC_Thread_03_C2("c2_0"); + a3_main.c2_0.d2_0 = new RC_Thread_03_D2("d2_0"); + a3_main.c2_0.d3_0 = new RC_Thread_03_D3("d3_0"); + + a4_main.b3_0 = new RC_Thread_03_B3("b3_0"); + a4_main.b3_0.c1_0 = new RC_Thread_03_C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new RC_Thread_03_D1("d1_0"); + a4_main.c2_0 = new RC_Thread_03_C2("c2_0"); + a4_main.c2_0.d2_0 = new RC_Thread_03_D2("d2_0"); + a4_main.c2_0.d3_0 = new RC_Thread_03_D3("d3_0"); + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_03_1 t1 = new RC_Thread_03_1(); + RC_Thread_03_2 t2 = new RC_Thread_03_2(); + RC_Thread_03_3 t3 = new RC_Thread_03_3(); + RC_Thread_03_4 t4 = new RC_Thread_03_4(); + RC_Thread_03_5 t5 = new RC_Thread_03_5(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t5.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + t5.join(); + + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA2null() { + a2_main = null; + } + + public void setA3() { + try { + a3_main.c2_0.d2_0 = new RC_Thread_03_D2("new"); + a3_main = new RC_Thread_03_A3("a3_new"); + a3_main = null; + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + a3_main = null; + } + + public void setA4() { + try { + a4_main = new RC_Thread_03_A4("a4_new"); + + } catch (NullPointerException e) { + } + } + + class RC_Thread_03_A1 { + volatile RC_Thread_03_B1 b1_0; + volatile RC_Thread_03_D1 d1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + + class RC_Thread_03_A2 { + volatile RC_Thread_03_B2 b2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + + class RC_Thread_03_A3 { + volatile RC_Thread_03_B2 b2_0; + volatile RC_Thread_03_C2 c2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class RC_Thread_03_A4 { + volatile RC_Thread_03_B3 b3_0; + volatile RC_Thread_03_C2 c2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + + class RC_Thread_03_B1 { + volatile RC_Thread_03_D2 d2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + + class RC_Thread_03_B2 { + volatile RC_Thread_03_C1 c1_0; + volatile RC_Thread_03_D1 d1_0; + volatile RC_Thread_03_D2 d2_0; + volatile RC_Thread_03_D3 d3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + + class RC_Thread_03_B3 { + volatile RC_Thread_03_C1 c1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + + class RC_Thread_03_C1 { + volatile RC_Thread_03_D1 d1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class RC_Thread_03_C2 { + volatile RC_Thread_03_D2 d2_0; + volatile RC_Thread_03_D3 d3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_03_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + + class RC_Thread_03_D1 { + int a; + int sum; + String strObjectName; + + RC_Thread_03_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_03_D2 { + int a; + int sum; + String strObjectName; + + RC_Thread_03_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_03_D3 { + int a; + int sum; + String strObjectName; + + RC_Thread_03_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0231-rc-function-RC_Thread02-RC_Thread_04/RC_Thread_04.java b/test/testsuite/ouroboros/memory_management/Function/RC0231-rc-function-RC_Thread02-RC_Thread_04/RC_Thread_04.java index 8de40524b830282df614495f7ad8788b165bfde8..636147a4707faa9184a845f0dac8765eb0e52527 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0231-rc-function-RC_Thread02-RC_Thread_04/RC_Thread_04.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0231-rc-function-RC_Thread02-RC_Thread_04/RC_Thread_04.java @@ -1,231 +1,231 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_04.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_04.java - *- @ExecuteClass: RC_Thread_04 - *- @ExecuteArgs: - - * - */ - -class RC_Thread_04_1 extends Thread { - public void run() { - RC_Thread_04 rcth01 = new RC_Thread_04(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_04_2 extends Thread { - public void run() { - RC_Thread_04 rcth01 = new RC_Thread_04(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_04_3 extends Thread { - public void run() { - RC_Thread_04 rcth01 = new RC_Thread_04(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_04 { - private volatile static RC_Thread_04_A1 a1_main = null; - private volatile static RC_Thread_04_A4 a4_main = null; - private volatile static RC_Thread_04_A5 a5_main = null; - - RC_Thread_04() { - try { - RC_Thread_04_A1 a1 = new RC_Thread_04_A1(); - a1.a2_0 = new RC_Thread_04_A2(); - a1.a2_0.a3_0 = new RC_Thread_04_A3(); - RC_Thread_04_A4 a4 = new RC_Thread_04_A4(); - RC_Thread_04_A5 a5 = new RC_Thread_04_A5(); - a4.a1_0 = a1; - a5.a1_0 = a1; - a1.a2_0.a3_0.a1_0 = a1; - a1_main = a1; - a4_main = a4; - a5_main = a5; - } catch (NullPointerException e) { - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - a1_main = new RC_Thread_04_A1(); - a1_main.a2_0 = new RC_Thread_04_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_04_A3(); - a4_main = new RC_Thread_04_A4(); - a5_main = new RC_Thread_04_A5(); - a4_main.a1_0 = a1_main; - a5_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main = null; - a4_main = null; - a5_main = null; - Runtime.getRuntime().gc();//单独构造一次Cycle_B_1_00180环,通过gc学习到环模式 - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_04_1 t1 = new RC_Thread_04_1(); - RC_Thread_04_2 t2 = new RC_Thread_04_2(); - RC_Thread_04_3 t3 = new RC_Thread_04_3(); - t1.start(); - t2.start(); - t3.start(); - - try { - t1.join(); - t2.join(); - t3.join(); - - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - a4_main = null; - } - - public void setA5null() { - a5_main = null; - } - - static class RC_Thread_04_A1 { - volatile RC_Thread_04_A2 a2_0; - int a; - int sum; - - RC_Thread_04_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_04_A2 { - volatile RC_Thread_04_A3 a3_0; - int a; - int sum; - - RC_Thread_04_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_04_A3 { - volatile RC_Thread_04_A1 a1_0; - int a; - int sum; - - RC_Thread_04_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - static class RC_Thread_04_A4 { - volatile RC_Thread_04_A1 a1_0; - int a; - int sum; - - RC_Thread_04_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - - static class RC_Thread_04_A5 { - volatile RC_Thread_04_A1 a1_0; - int a; - int sum; - - RC_Thread_04_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_04.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_04.java + *- @ExecuteClass: RC_Thread_04 + *- @ExecuteArgs: + + * + */ + +class RC_Thread_04_1 extends Thread { + public void run() { + RC_Thread_04 rcth01 = new RC_Thread_04(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_04_2 extends Thread { + public void run() { + RC_Thread_04 rcth01 = new RC_Thread_04(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_04_3 extends Thread { + public void run() { + RC_Thread_04 rcth01 = new RC_Thread_04(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_04 { + private volatile static RC_Thread_04_A1 a1_main = null; + private volatile static RC_Thread_04_A4 a4_main = null; + private volatile static RC_Thread_04_A5 a5_main = null; + + RC_Thread_04() { + try { + RC_Thread_04_A1 a1 = new RC_Thread_04_A1(); + a1.a2_0 = new RC_Thread_04_A2(); + a1.a2_0.a3_0 = new RC_Thread_04_A3(); + RC_Thread_04_A4 a4 = new RC_Thread_04_A4(); + RC_Thread_04_A5 a5 = new RC_Thread_04_A5(); + a4.a1_0 = a1; + a5.a1_0 = a1; + a1.a2_0.a3_0.a1_0 = a1; + a1_main = a1; + a4_main = a4; + a5_main = a5; + } catch (NullPointerException e) { + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + a1_main = new RC_Thread_04_A1(); + a1_main.a2_0 = new RC_Thread_04_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_04_A3(); + a4_main = new RC_Thread_04_A4(); + a5_main = new RC_Thread_04_A5(); + a4_main.a1_0 = a1_main; + a5_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main = null; + a4_main = null; + a5_main = null; + Runtime.getRuntime().gc();//单独构造一次Cycle_B_1_00180环,通过gc学习到环模式 + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_04_1 t1 = new RC_Thread_04_1(); + RC_Thread_04_2 t2 = new RC_Thread_04_2(); + RC_Thread_04_3 t3 = new RC_Thread_04_3(); + t1.start(); + t2.start(); + t3.start(); + + try { + t1.join(); + t2.join(); + t3.join(); + + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + a4_main = null; + } + + public void setA5null() { + a5_main = null; + } + + static class RC_Thread_04_A1 { + volatile RC_Thread_04_A2 a2_0; + int a; + int sum; + + RC_Thread_04_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_04_A2 { + volatile RC_Thread_04_A3 a3_0; + int a; + int sum; + + RC_Thread_04_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_04_A3 { + volatile RC_Thread_04_A1 a1_0; + int a; + int sum; + + RC_Thread_04_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + static class RC_Thread_04_A4 { + volatile RC_Thread_04_A1 a1_0; + int a; + int sum; + + RC_Thread_04_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + + static class RC_Thread_04_A5 { + volatile RC_Thread_04_A1 a1_0; + int a; + int sum; + + RC_Thread_04_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0232-rc-function-RC_Thread02-RC_Thread_05/RC_Thread_05.java b/test/testsuite/ouroboros/memory_management/Function/RC0232-rc-function-RC_Thread02-RC_Thread_05/RC_Thread_05.java index 2722bbf3a2c84e385ddcb49d9003d23367dfe56f..b45b74ba0d3aae187ae9b8702597d7c93d735f22 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0232-rc-function-RC_Thread02-RC_Thread_05/RC_Thread_05.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0232-rc-function-RC_Thread02-RC_Thread_05/RC_Thread_05.java @@ -1,302 +1,302 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_05.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_05.java - *- @ExecuteClass: RC_Thread_05 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_05_1 extends Thread { - public void run() { - RC_Thread_05 rcth01 = new RC_Thread_05(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_05_2 extends Thread { - public void run() { - RC_Thread_05 rcth01 = new RC_Thread_05(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_05_3 extends Thread { - public void run() { - RC_Thread_05 rcth01 = new RC_Thread_05(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_05_4 extends Thread { - public void run() { - RC_Thread_05 rcth01 = new RC_Thread_05(); - try { - rcth01.setA1(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_05_5 extends Thread { - public void run() { - RC_Thread_05 rcth01 = new RC_Thread_05(); - try { - rcth01.checkA3(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_05_6 extends Thread { - public void run() { - RC_Thread_05 rcth01 = new RC_Thread_05(); - try { - rcth01.setA3_a(5); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_05 { - private volatile static RC_Thread_05_A1 a1_main = null; - private volatile static RC_Thread_05_A4 a4_main = null; - private volatile static RC_Thread_05_A5 a5_main = null; - - RC_Thread_05() { - try { - a1_main = new RC_Thread_05_A1(); - a1_main.a2_0 = new RC_Thread_05_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_05_A3(); - a4_main = new RC_Thread_05_A4(); - a5_main = new RC_Thread_05_A5(); - a4_main.a1_0 = a1_main; - a5_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - a1_main = new RC_Thread_05_A1(); - a1_main.a2_0 = new RC_Thread_05_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_05_A3(); - a4_main = new RC_Thread_05_A4(); - a5_main = new RC_Thread_05_A5(); - a4_main.a1_0 = a1_main; - a5_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main = null; - a4_main = null; - a5_main = null; - Runtime.getRuntime().gc();//单独构造一次Cycle_B_1_00180环,通过gc学习到环模式 - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_05_1 t1 = new RC_Thread_05_1(); - RC_Thread_05_2 t2 = new RC_Thread_05_2(); - RC_Thread_05_3 t3 = new RC_Thread_05_3(); - RC_Thread_05_4 t4 = new RC_Thread_05_4(); - RC_Thread_05_5 t5 = new RC_Thread_05_5(); - RC_Thread_05_6 t6 = new RC_Thread_05_6(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - t5.start(); - t6.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - t6.join(); - - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - a4_main = null; - } - - public void setA5null() { - a5_main = null; - } - - public void setA1() { - try { - this.a1_main = new RC_Thread_05_A1(); - a1_main.a2_0 = new RC_Thread_05_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_05_A3(); - } catch (NullPointerException e) { - - } - - } - - public void checkA3() { - try { - int a = a1_main.a2_0.a3_0.a; - } catch (NullPointerException e) { - - } - - } - - public void setA3_a(int a) { - try { - this.a1_main.a2_0.a3_0.a = a; - } catch (NullPointerException e) { - } - } - - static class RC_Thread_05_A1 { - volatile RC_Thread_05_A2 a2_0; - int a; - int sum; - - RC_Thread_05_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_05_A2 { - volatile RC_Thread_05_A3 a3_0; - int a; - int sum; - - RC_Thread_05_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_05_A3 { - volatile RC_Thread_05_A1 a1_0; - int a; - int sum; - - RC_Thread_05_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - static class RC_Thread_05_A4 { - volatile RC_Thread_05_A1 a1_0; - int a; - int sum; - - RC_Thread_05_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - - static class RC_Thread_05_A5 { - volatile RC_Thread_05_A1 a1_0; - int a; - int sum; - - RC_Thread_05_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_05.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_05.java + *- @ExecuteClass: RC_Thread_05 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_05_1 extends Thread { + public void run() { + RC_Thread_05 rcth01 = new RC_Thread_05(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_05_2 extends Thread { + public void run() { + RC_Thread_05 rcth01 = new RC_Thread_05(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_05_3 extends Thread { + public void run() { + RC_Thread_05 rcth01 = new RC_Thread_05(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_05_4 extends Thread { + public void run() { + RC_Thread_05 rcth01 = new RC_Thread_05(); + try { + rcth01.setA1(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_05_5 extends Thread { + public void run() { + RC_Thread_05 rcth01 = new RC_Thread_05(); + try { + rcth01.checkA3(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_05_6 extends Thread { + public void run() { + RC_Thread_05 rcth01 = new RC_Thread_05(); + try { + rcth01.setA3_a(5); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_05 { + private volatile static RC_Thread_05_A1 a1_main = null; + private volatile static RC_Thread_05_A4 a4_main = null; + private volatile static RC_Thread_05_A5 a5_main = null; + + RC_Thread_05() { + try { + a1_main = new RC_Thread_05_A1(); + a1_main.a2_0 = new RC_Thread_05_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_05_A3(); + a4_main = new RC_Thread_05_A4(); + a5_main = new RC_Thread_05_A5(); + a4_main.a1_0 = a1_main; + a5_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + a1_main = new RC_Thread_05_A1(); + a1_main.a2_0 = new RC_Thread_05_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_05_A3(); + a4_main = new RC_Thread_05_A4(); + a5_main = new RC_Thread_05_A5(); + a4_main.a1_0 = a1_main; + a5_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main = null; + a4_main = null; + a5_main = null; + Runtime.getRuntime().gc();//单独构造一次Cycle_B_1_00180环,通过gc学习到环模式 + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_05_1 t1 = new RC_Thread_05_1(); + RC_Thread_05_2 t2 = new RC_Thread_05_2(); + RC_Thread_05_3 t3 = new RC_Thread_05_3(); + RC_Thread_05_4 t4 = new RC_Thread_05_4(); + RC_Thread_05_5 t5 = new RC_Thread_05_5(); + RC_Thread_05_6 t6 = new RC_Thread_05_6(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t5.start(); + t6.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + t5.join(); + t6.join(); + + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + a4_main = null; + } + + public void setA5null() { + a5_main = null; + } + + public void setA1() { + try { + this.a1_main = new RC_Thread_05_A1(); + a1_main.a2_0 = new RC_Thread_05_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_05_A3(); + } catch (NullPointerException e) { + + } + + } + + public void checkA3() { + try { + int a = a1_main.a2_0.a3_0.a; + } catch (NullPointerException e) { + + } + + } + + public void setA3_a(int a) { + try { + this.a1_main.a2_0.a3_0.a = a; + } catch (NullPointerException e) { + } + } + + static class RC_Thread_05_A1 { + volatile RC_Thread_05_A2 a2_0; + int a; + int sum; + + RC_Thread_05_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_05_A2 { + volatile RC_Thread_05_A3 a3_0; + int a; + int sum; + + RC_Thread_05_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_05_A3 { + volatile RC_Thread_05_A1 a1_0; + int a; + int sum; + + RC_Thread_05_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + static class RC_Thread_05_A4 { + volatile RC_Thread_05_A1 a1_0; + int a; + int sum; + + RC_Thread_05_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + + static class RC_Thread_05_A5 { + volatile RC_Thread_05_A1 a1_0; + int a; + int sum; + + RC_Thread_05_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0233-rc-function-RC_Thread02-RC_Thread_06/RC_Thread_06.java b/test/testsuite/ouroboros/memory_management/Function/RC0233-rc-function-RC_Thread02-RC_Thread_06/RC_Thread_06.java index 5448e7f3bd0bb9d9221023ebd871f4e2ddde1577..59fb7a5c2c3348b129cf0617596e97c517cd0e1b 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0233-rc-function-RC_Thread02-RC_Thread_06/RC_Thread_06.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0233-rc-function-RC_Thread02-RC_Thread_06/RC_Thread_06.java @@ -1,271 +1,271 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_06.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_06.java - *- @ExecuteClass: RC_Thread_06 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_06_1 extends Thread { - public void run() { - RC_Thread_06 rcth01 = new RC_Thread_06(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - } -} - -class RC_Thread_06_2 extends Thread { - public void run() { - RC_Thread_06 rcth01 = new RC_Thread_06(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - } -} - -class RC_Thread_06_3 extends Thread { - public void run() { - RC_Thread_06 rcth01 = new RC_Thread_06(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - - } -} - -public class RC_Thread_06 { - private volatile static RC_Thread_06_A1 a1_main = null; - private volatile static RC_Thread_06_A5 a5_main = null; - - RC_Thread_06() { - try { - a1_main = new RC_Thread_06_A1(); - a1_main.a2_0 = new RC_Thread_06_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_06_A3(); - a1_main.a2_0.a3_0.a4_0 = new RC_Thread_06_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a5_main = new RC_Thread_06_A5(); - a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_06_A6(); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - } catch (NullPointerException e) { - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - Runtime.getRuntime().gc(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - a1_main = new RC_Thread_06_A1(); - a1_main.a2_0 = new RC_Thread_06_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_06_A3(); - a1_main.a2_0.a3_0.a4_0 = new RC_Thread_06_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a5_main = new RC_Thread_06_A5(); - a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_06_A6(); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a1_main = null; - a5_main = null; - - a1_main = new RC_Thread_06_A1(); - a1_main.a2_0 = new RC_Thread_06_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_06_A3(); - a1_main.a2_0.a3_0.a4_0 = new RC_Thread_06_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main = null; - - a1_main = new RC_Thread_06_A1(); - a1_main.a2_0 = new RC_Thread_06_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_06_A3(); - a1_main.a2_0.a3_0.a4_0 = new RC_Thread_06_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a5_main = new RC_Thread_06_A5(); - a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_06_A6(); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0 = null; - a1_main = null; - a5_main = null; //总共三种环类型 - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_06_1 t1 = new RC_Thread_06_1(); - RC_Thread_06_2 t2 = new RC_Thread_06_2(); - RC_Thread_06_3 t3 = new RC_Thread_06_3(); - t1.start(); - t2.start(); - t3.start(); - try { - t1.join(); - t2.join(); - t3.join(); - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - try { - a1_main.a2_0.a3_0.a4_0 = null; - a5_main.a3_0.a4_0 = null; - } catch (NullPointerException e) { - } - } - - public void setA5null() { - a5_main = null; - } - - static class RC_Thread_06_A1 { - volatile RC_Thread_06_A2 a2_0; - volatile RC_Thread_06_A4 a4_0; - int a; - int sum; - - RC_Thread_06_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_06_A2 { - volatile RC_Thread_06_A3 a3_0; - int a; - int sum; - - RC_Thread_06_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_06_A3 { - volatile RC_Thread_06_A4 a4_0; - int a; - int sum; - - RC_Thread_06_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - - static class RC_Thread_06_A4 { - volatile RC_Thread_06_A1 a1_0; - volatile RC_Thread_06_A6 a6_0; - int a; - int sum; - - RC_Thread_06_A4() { - a1_0 = null; - a6_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - static class RC_Thread_06_A5 { - volatile RC_Thread_06_A3 a3_0; - int a; - int sum; - - RC_Thread_06_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RC_Thread_06_A6 { - volatile RC_Thread_06_A5 a5_0; - int a; - int sum; - - RC_Thread_06_A6() { - a5_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_06.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_06.java + *- @ExecuteClass: RC_Thread_06 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_06_1 extends Thread { + public void run() { + RC_Thread_06 rcth01 = new RC_Thread_06(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + } +} + +class RC_Thread_06_2 extends Thread { + public void run() { + RC_Thread_06 rcth01 = new RC_Thread_06(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + } +} + +class RC_Thread_06_3 extends Thread { + public void run() { + RC_Thread_06 rcth01 = new RC_Thread_06(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + + } +} + +public class RC_Thread_06 { + private volatile static RC_Thread_06_A1 a1_main = null; + private volatile static RC_Thread_06_A5 a5_main = null; + + RC_Thread_06() { + try { + a1_main = new RC_Thread_06_A1(); + a1_main.a2_0 = new RC_Thread_06_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_06_A3(); + a1_main.a2_0.a3_0.a4_0 = new RC_Thread_06_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a5_main = new RC_Thread_06_A5(); + a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_06_A6(); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + } catch (NullPointerException e) { + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + Runtime.getRuntime().gc(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + a1_main = new RC_Thread_06_A1(); + a1_main.a2_0 = new RC_Thread_06_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_06_A3(); + a1_main.a2_0.a3_0.a4_0 = new RC_Thread_06_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a5_main = new RC_Thread_06_A5(); + a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_06_A6(); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a1_main = null; + a5_main = null; + + a1_main = new RC_Thread_06_A1(); + a1_main.a2_0 = new RC_Thread_06_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_06_A3(); + a1_main.a2_0.a3_0.a4_0 = new RC_Thread_06_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main = null; + + a1_main = new RC_Thread_06_A1(); + a1_main.a2_0 = new RC_Thread_06_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_06_A3(); + a1_main.a2_0.a3_0.a4_0 = new RC_Thread_06_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a5_main = new RC_Thread_06_A5(); + a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_06_A6(); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0 = null; + a1_main = null; + a5_main = null; //总共三种环类型 + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_06_1 t1 = new RC_Thread_06_1(); + RC_Thread_06_2 t2 = new RC_Thread_06_2(); + RC_Thread_06_3 t3 = new RC_Thread_06_3(); + t1.start(); + t2.start(); + t3.start(); + try { + t1.join(); + t2.join(); + t3.join(); + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + try { + a1_main.a2_0.a3_0.a4_0 = null; + a5_main.a3_0.a4_0 = null; + } catch (NullPointerException e) { + } + } + + public void setA5null() { + a5_main = null; + } + + static class RC_Thread_06_A1 { + volatile RC_Thread_06_A2 a2_0; + volatile RC_Thread_06_A4 a4_0; + int a; + int sum; + + RC_Thread_06_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_06_A2 { + volatile RC_Thread_06_A3 a3_0; + int a; + int sum; + + RC_Thread_06_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_06_A3 { + volatile RC_Thread_06_A4 a4_0; + int a; + int sum; + + RC_Thread_06_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + + static class RC_Thread_06_A4 { + volatile RC_Thread_06_A1 a1_0; + volatile RC_Thread_06_A6 a6_0; + int a; + int sum; + + RC_Thread_06_A4() { + a1_0 = null; + a6_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + static class RC_Thread_06_A5 { + volatile RC_Thread_06_A3 a3_0; + int a; + int sum; + + RC_Thread_06_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RC_Thread_06_A6 { + volatile RC_Thread_06_A5 a5_0; + int a; + int sum; + + RC_Thread_06_A6() { + a5_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0234-rc-function-RC_Thread02-RC_Thread_07/RC_Thread_07.java b/test/testsuite/ouroboros/memory_management/Function/RC0234-rc-function-RC_Thread02-RC_Thread_07/RC_Thread_07.java index 6f65117e68c82bb55cf1642e0ad537ab50479372..da49ebc594e634a6926bdd2134bb12222bac178c 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0234-rc-function-RC_Thread02-RC_Thread_07/RC_Thread_07.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0234-rc-function-RC_Thread02-RC_Thread_07/RC_Thread_07.java @@ -1,281 +1,281 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_07.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_07.java - *- @ExecuteClass: RC_Thread_07 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_07_1 extends Thread { - public void run() { - RC_Thread_07 rcth01 = new RC_Thread_07(); - try { - rcth01.ModifyA1(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_07_2 extends Thread { - public void run() { - RC_Thread_07 rcth01 = new RC_Thread_07(); - try { - rcth01.checkA4(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_07_3 extends Thread { - public void run() { - RC_Thread_07 rcth01 = new RC_Thread_07(); - try { - rcth01.setA5(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_07 { - private volatile static RC_Thread_07_A1 a1_main = null; - private volatile static RC_Thread_07_A5 a5_main = null; - - RC_Thread_07() { - try { - RC_Thread_07_A1 a1_1 = new RC_Thread_07_A1(); - a1_1.a2_0 = new RC_Thread_07_A2(); - a1_1.a2_0.a3_0 = new RC_Thread_07_A3(); - a1_1.a2_0.a3_0.a4_0 = new RC_Thread_07_A4(); - a1_1.a2_0.a3_0.a4_0.a1_0 = a1_1; - RC_Thread_07_A5 a5_1 = new RC_Thread_07_A5(); - a1_1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_07_A6(); - a1_1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_1; - a5_1.a3_0 = a1_1.a2_0.a3_0; - a1_main = a1_1; - a5_main = a5_1; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - Runtime.getRuntime().gc(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - RC_Thread_07_A1 a1 = new RC_Thread_07_A1(); - a1.a2_0 = new RC_Thread_07_A2(); - a1.a2_0.a3_0 = new RC_Thread_07_A3(); - a1.a2_0.a3_0.a4_0 = new RC_Thread_07_A4(); - a1.a2_0.a3_0.a4_0.a1_0 = a1; - RC_Thread_07_A5 a5 = new RC_Thread_07_A5(); - a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_07_A6(); - a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; - a5.a3_0 = a1.a2_0.a3_0; - a1 = null; - a5 = null; - - a1 = new RC_Thread_07_A1(); - a1.a2_0 = new RC_Thread_07_A2(); - a1.a2_0.a3_0 = new RC_Thread_07_A3(); - a1.a2_0.a3_0.a4_0 = new RC_Thread_07_A4(); - a1.a2_0.a3_0.a4_0.a1_0 = a1; - a1 = null; - - a1 = new RC_Thread_07_A1(); - a1.a2_0 = new RC_Thread_07_A2(); - a1.a2_0.a3_0 = new RC_Thread_07_A3(); - a1.a2_0.a3_0.a4_0 = new RC_Thread_07_A4(); - a1.a2_0.a3_0.a4_0.a1_0 = a1; - a5 = new RC_Thread_07_A5(); - a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_07_A6(); - a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; - a5.a3_0 = a1.a2_0.a3_0; - a1.a2_0.a3_0 = null; - a1 = null; - a5 = null; - - - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_07_1 t1 = new RC_Thread_07_1(); - RC_Thread_07_2 t2 = new RC_Thread_07_2(); - RC_Thread_07_3 t3 = new RC_Thread_07_3(); - t1.start(); - t2.start(); - t3.start(); - try { - t1.join(); - t2.join(); - t3.join(); - } catch (InterruptedException e) { - } - } - - public void ModifyA1() { - a1_main.a2_0.a3_0 = null; - a1_main = null; - } - - public void checkA4() { - try { - int[] arr = new int[2]; - arr[0] = a5_main.a3_0.a4_0.sum; - arr[1] = a5_main.a3_0.a4_0.a; - } catch (NullPointerException e) { - - } - } - - public void setA5() { - RC_Thread_07_A5 a5 = new RC_Thread_07_A5(); - a5 = this.a5_main; - a5_main = null; - } - - static class RC_Thread_07_A1 { - volatile RC_Thread_07_A2 a2_0; - volatile RC_Thread_07_A4 a4_0; - int a; - int sum; - - RC_Thread_07_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_07_A2 { - volatile RC_Thread_07_A3 a3_0; - int a; - int sum; - - RC_Thread_07_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_07_A3 { - volatile RC_Thread_07_A4 a4_0; - int a; - int sum; - - RC_Thread_07_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - - static class RC_Thread_07_A4 { - volatile RC_Thread_07_A1 a1_0; - volatile RC_Thread_07_A6 a6_0; - int a; - int sum; - - RC_Thread_07_A4() { - a1_0 = null; - a6_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - static class RC_Thread_07_A5 { - volatile RC_Thread_07_A3 a3_0; - int a; - int sum; - - RC_Thread_07_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RC_Thread_07_A6 { - volatile RC_Thread_07_A5 a5_0; - int a; - int sum; - - RC_Thread_07_A6() { - a5_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_07.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_07.java + *- @ExecuteClass: RC_Thread_07 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_07_1 extends Thread { + public void run() { + RC_Thread_07 rcth01 = new RC_Thread_07(); + try { + rcth01.ModifyA1(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_07_2 extends Thread { + public void run() { + RC_Thread_07 rcth01 = new RC_Thread_07(); + try { + rcth01.checkA4(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_07_3 extends Thread { + public void run() { + RC_Thread_07 rcth01 = new RC_Thread_07(); + try { + rcth01.setA5(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_07 { + private volatile static RC_Thread_07_A1 a1_main = null; + private volatile static RC_Thread_07_A5 a5_main = null; + + RC_Thread_07() { + try { + RC_Thread_07_A1 a1_1 = new RC_Thread_07_A1(); + a1_1.a2_0 = new RC_Thread_07_A2(); + a1_1.a2_0.a3_0 = new RC_Thread_07_A3(); + a1_1.a2_0.a3_0.a4_0 = new RC_Thread_07_A4(); + a1_1.a2_0.a3_0.a4_0.a1_0 = a1_1; + RC_Thread_07_A5 a5_1 = new RC_Thread_07_A5(); + a1_1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_07_A6(); + a1_1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_1; + a5_1.a3_0 = a1_1.a2_0.a3_0; + a1_main = a1_1; + a5_main = a5_1; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + Runtime.getRuntime().gc(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + RC_Thread_07_A1 a1 = new RC_Thread_07_A1(); + a1.a2_0 = new RC_Thread_07_A2(); + a1.a2_0.a3_0 = new RC_Thread_07_A3(); + a1.a2_0.a3_0.a4_0 = new RC_Thread_07_A4(); + a1.a2_0.a3_0.a4_0.a1_0 = a1; + RC_Thread_07_A5 a5 = new RC_Thread_07_A5(); + a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_07_A6(); + a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; + a5.a3_0 = a1.a2_0.a3_0; + a1 = null; + a5 = null; + + a1 = new RC_Thread_07_A1(); + a1.a2_0 = new RC_Thread_07_A2(); + a1.a2_0.a3_0 = new RC_Thread_07_A3(); + a1.a2_0.a3_0.a4_0 = new RC_Thread_07_A4(); + a1.a2_0.a3_0.a4_0.a1_0 = a1; + a1 = null; + + a1 = new RC_Thread_07_A1(); + a1.a2_0 = new RC_Thread_07_A2(); + a1.a2_0.a3_0 = new RC_Thread_07_A3(); + a1.a2_0.a3_0.a4_0 = new RC_Thread_07_A4(); + a1.a2_0.a3_0.a4_0.a1_0 = a1; + a5 = new RC_Thread_07_A5(); + a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_07_A6(); + a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; + a5.a3_0 = a1.a2_0.a3_0; + a1.a2_0.a3_0 = null; + a1 = null; + a5 = null; + + + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_07_1 t1 = new RC_Thread_07_1(); + RC_Thread_07_2 t2 = new RC_Thread_07_2(); + RC_Thread_07_3 t3 = new RC_Thread_07_3(); + t1.start(); + t2.start(); + t3.start(); + try { + t1.join(); + t2.join(); + t3.join(); + } catch (InterruptedException e) { + } + } + + public void ModifyA1() { + a1_main.a2_0.a3_0 = null; + a1_main = null; + } + + public void checkA4() { + try { + int[] arr = new int[2]; + arr[0] = a5_main.a3_0.a4_0.sum; + arr[1] = a5_main.a3_0.a4_0.a; + } catch (NullPointerException e) { + + } + } + + public void setA5() { + RC_Thread_07_A5 a5 = new RC_Thread_07_A5(); + a5 = this.a5_main; + a5_main = null; + } + + static class RC_Thread_07_A1 { + volatile RC_Thread_07_A2 a2_0; + volatile RC_Thread_07_A4 a4_0; + int a; + int sum; + + RC_Thread_07_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_07_A2 { + volatile RC_Thread_07_A3 a3_0; + int a; + int sum; + + RC_Thread_07_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_07_A3 { + volatile RC_Thread_07_A4 a4_0; + int a; + int sum; + + RC_Thread_07_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + + static class RC_Thread_07_A4 { + volatile RC_Thread_07_A1 a1_0; + volatile RC_Thread_07_A6 a6_0; + int a; + int sum; + + RC_Thread_07_A4() { + a1_0 = null; + a6_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + static class RC_Thread_07_A5 { + volatile RC_Thread_07_A3 a3_0; + int a; + int sum; + + RC_Thread_07_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RC_Thread_07_A6 { + volatile RC_Thread_07_A5 a5_0; + int a; + int sum; + + RC_Thread_07_A6() { + a5_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0235-rc-function-RC_Thread02-RC_Thread_08/RC_Thread_08.java b/test/testsuite/ouroboros/memory_management/Function/RC0235-rc-function-RC_Thread02-RC_Thread_08/RC_Thread_08.java index ed4b935efc08d28ed359246ea81834ee9b6c5ef6..5c6e1ea6618707302b011efc76ca398ba3ef3035 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0235-rc-function-RC_Thread02-RC_Thread_08/RC_Thread_08.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0235-rc-function-RC_Thread02-RC_Thread_08/RC_Thread_08.java @@ -1,296 +1,296 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_08.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_08.java - *- @ExecuteClass: RC_Thread_08 - *- @ExecuteArgs: - * - */ - -import java.lang.Runtime; - -class RC_Thread_08_1 extends Thread { - public void run() { - RC_Thread_08 rcth01 = new RC_Thread_08(); - try { - rcth01.ModifyA3(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_08_2 extends Thread { - public void run() { - RC_Thread_08 rcth01 = new RC_Thread_08(); - try { - rcth01.checkA3(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_08_3 extends Thread { - public void run() { - RC_Thread_08 rcth01 = new RC_Thread_08(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_08 { - private volatile static RC_Thread_08_A1 a1_main = null; - private volatile static RC_Thread_08_A4 a4_main = null; - private volatile static RC_Thread_08_A6 a6_main = null; - - RC_Thread_08() { - try { - RC_Thread_08_A1 a1 = new RC_Thread_08_A1("a1"); - RC_Thread_08_A4 a4 = new RC_Thread_08_A4("a4"); - RC_Thread_08_A6 a6 = new RC_Thread_08_A6("a6"); - a1.a2_0 = new RC_Thread_08_A2("a2_0"); - a1.a2_0.a3_0 = new RC_Thread_08_A3("a3_0"); - a1.a2_0.a3_0.a1_0 = a1; - a1.a2_0.a3_0.a5_0 = new RC_Thread_08_A5("a5_0"); - a1.a2_0.a3_0.a5_0.a6_0 = a6; - a6.a1_0 = a1; - a6.a3_0 = a1.a2_0.a3_0; - a4.a5_0 = a1.a2_0.a3_0.a5_0; - a6.a4_0 = a4; - a1_main = a1; - a4_main = a4; - a6_main = a6; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - - } - - private static void cycle_pattern_wrapper() { - RC_Thread_08_A1 a1 = new RC_Thread_08_A1("a1"); - RC_Thread_08_A4 a4 = new RC_Thread_08_A4("a4"); - RC_Thread_08_A6 a6 = new RC_Thread_08_A6("a6"); - a1.a2_0 = new RC_Thread_08_A2("a2_0"); - a1.a2_0.a3_0 = new RC_Thread_08_A3("a3_0"); - a1.a2_0.a3_0.a1_0 = a1; - a1.a2_0.a3_0.a5_0 = new RC_Thread_08_A5("a5_0"); - a1.a2_0.a3_0.a5_0.a6_0 = a6; - a6.a1_0 = a1; - a6.a3_0 = a1.a2_0.a3_0; - a4.a5_0 = a1.a2_0.a3_0.a5_0; - a6.a4_0 = a4; - a1 = null; - a4 = null; - a6 = null; - Runtime.getRuntime().gc(); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_08_1 t_00010 = new RC_Thread_08_1(); - RC_Thread_08_2 t_00020 = new RC_Thread_08_2(); - RC_Thread_08_3 t_00030 = new RC_Thread_08_3(); - t_00010.start(); - t_00020.start(); - t_00030.start(); - try { - t_00010.join(); - t_00020.join(); - t_00030.join(); - - } catch (InterruptedException e) { - } - - } - - public void checkA3() { - int[] arr = new int[2]; - try { - arr[0] = a1_main.a2_0.a3_0.a; - arr[1] = a1_main.a2_0.a3_0.sum; - } catch (NullPointerException e) { - - } - } - - public void ModifyA3() { - try { - a1_main.a2_0.a3_0 = new RC_Thread_08_A3("new-a3"); - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - RC_Thread_08_A3 a3 = new RC_Thread_08_A3("test"); - try { - a3 = this.a1_main.a2_0.a3_0; - this.a1_main.a2_0.a3_0 = null; - } catch (NullPointerException e) { - - } - - } - - static class RC_Thread_08_A1 { - volatile RC_Thread_08_A2 a2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_08_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - static class RC_Thread_08_A2 { - volatile RC_Thread_08_A3 a3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_08_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RC_Thread_08_A3 { - volatile RC_Thread_08_A1 a1_0; - volatile RC_Thread_08_A5 a5_0; - int a; - int sum; - String strObjectName; - - RC_Thread_08_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - - static class RC_Thread_08_A4 { - volatile RC_Thread_08_A5 a5_0; - int a; - int sum; - String strObjectName; - - RC_Thread_08_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - static class RC_Thread_08_A5 { - volatile RC_Thread_08_A6 a6_0; - int a; - int sum; - String strObjectName; - - RC_Thread_08_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - static class RC_Thread_08_A6 { - volatile RC_Thread_08_A1 a1_0; - volatile RC_Thread_08_A3 a3_0; - volatile RC_Thread_08_A4 a4_0; - int a; - int sum; - String strObjectName; - - RC_Thread_08_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_08.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_08.java + *- @ExecuteClass: RC_Thread_08 + *- @ExecuteArgs: + * + */ + +import java.lang.Runtime; + +class RC_Thread_08_1 extends Thread { + public void run() { + RC_Thread_08 rcth01 = new RC_Thread_08(); + try { + rcth01.ModifyA3(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_08_2 extends Thread { + public void run() { + RC_Thread_08 rcth01 = new RC_Thread_08(); + try { + rcth01.checkA3(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_08_3 extends Thread { + public void run() { + RC_Thread_08 rcth01 = new RC_Thread_08(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_08 { + private volatile static RC_Thread_08_A1 a1_main = null; + private volatile static RC_Thread_08_A4 a4_main = null; + private volatile static RC_Thread_08_A6 a6_main = null; + + RC_Thread_08() { + try { + RC_Thread_08_A1 a1 = new RC_Thread_08_A1("a1"); + RC_Thread_08_A4 a4 = new RC_Thread_08_A4("a4"); + RC_Thread_08_A6 a6 = new RC_Thread_08_A6("a6"); + a1.a2_0 = new RC_Thread_08_A2("a2_0"); + a1.a2_0.a3_0 = new RC_Thread_08_A3("a3_0"); + a1.a2_0.a3_0.a1_0 = a1; + a1.a2_0.a3_0.a5_0 = new RC_Thread_08_A5("a5_0"); + a1.a2_0.a3_0.a5_0.a6_0 = a6; + a6.a1_0 = a1; + a6.a3_0 = a1.a2_0.a3_0; + a4.a5_0 = a1.a2_0.a3_0.a5_0; + a6.a4_0 = a4; + a1_main = a1; + a4_main = a4; + a6_main = a6; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + + } + + private static void cycle_pattern_wrapper() { + RC_Thread_08_A1 a1 = new RC_Thread_08_A1("a1"); + RC_Thread_08_A4 a4 = new RC_Thread_08_A4("a4"); + RC_Thread_08_A6 a6 = new RC_Thread_08_A6("a6"); + a1.a2_0 = new RC_Thread_08_A2("a2_0"); + a1.a2_0.a3_0 = new RC_Thread_08_A3("a3_0"); + a1.a2_0.a3_0.a1_0 = a1; + a1.a2_0.a3_0.a5_0 = new RC_Thread_08_A5("a5_0"); + a1.a2_0.a3_0.a5_0.a6_0 = a6; + a6.a1_0 = a1; + a6.a3_0 = a1.a2_0.a3_0; + a4.a5_0 = a1.a2_0.a3_0.a5_0; + a6.a4_0 = a4; + a1 = null; + a4 = null; + a6 = null; + Runtime.getRuntime().gc(); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_08_1 t_00010 = new RC_Thread_08_1(); + RC_Thread_08_2 t_00020 = new RC_Thread_08_2(); + RC_Thread_08_3 t_00030 = new RC_Thread_08_3(); + t_00010.start(); + t_00020.start(); + t_00030.start(); + try { + t_00010.join(); + t_00020.join(); + t_00030.join(); + + } catch (InterruptedException e) { + } + + } + + public void checkA3() { + int[] arr = new int[2]; + try { + arr[0] = a1_main.a2_0.a3_0.a; + arr[1] = a1_main.a2_0.a3_0.sum; + } catch (NullPointerException e) { + + } + } + + public void ModifyA3() { + try { + a1_main.a2_0.a3_0 = new RC_Thread_08_A3("new-a3"); + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + RC_Thread_08_A3 a3 = new RC_Thread_08_A3("test"); + try { + a3 = this.a1_main.a2_0.a3_0; + this.a1_main.a2_0.a3_0 = null; + } catch (NullPointerException e) { + + } + + } + + static class RC_Thread_08_A1 { + volatile RC_Thread_08_A2 a2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_08_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + static class RC_Thread_08_A2 { + volatile RC_Thread_08_A3 a3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_08_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RC_Thread_08_A3 { + volatile RC_Thread_08_A1 a1_0; + volatile RC_Thread_08_A5 a5_0; + int a; + int sum; + String strObjectName; + + RC_Thread_08_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + + static class RC_Thread_08_A4 { + volatile RC_Thread_08_A5 a5_0; + int a; + int sum; + String strObjectName; + + RC_Thread_08_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + static class RC_Thread_08_A5 { + volatile RC_Thread_08_A6 a6_0; + int a; + int sum; + String strObjectName; + + RC_Thread_08_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + static class RC_Thread_08_A6 { + volatile RC_Thread_08_A1 a1_0; + volatile RC_Thread_08_A3 a3_0; + volatile RC_Thread_08_A4 a4_0; + int a; + int sum; + String strObjectName; + + RC_Thread_08_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0236-rc-function-RC_Thread02-RC_Thread_09/RC_Thread_09.java b/test/testsuite/ouroboros/memory_management/Function/RC0236-rc-function-RC_Thread02-RC_Thread_09/RC_Thread_09.java index 973866373c5b3b808e0abc875119727ff1eefe47..64870340460bfe5068c689f43208a6a28ec394e4 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0236-rc-function-RC_Thread02-RC_Thread_09/RC_Thread_09.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0236-rc-function-RC_Thread02-RC_Thread_09/RC_Thread_09.java @@ -1,434 +1,434 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_09 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_09.java - *- @ExecuteClass: RC_Thread_09 - *- @ExecuteArgs: - - * - */ - -class RC_Thread_09_1 extends Thread { - public void run() { - RC_Thread_09 rcth01 = new RC_Thread_09(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_09_2 extends Thread { - public void run() { - RC_Thread_09 rcth01 = new RC_Thread_09(); - try { - rcth01.setA2null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_09_3 extends Thread { - public void run() { - RC_Thread_09 rcth01 = new RC_Thread_09(); - try { - rcth01.setA3(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_09_4 extends Thread { - public void run() { - RC_Thread_09 rcth01 = new RC_Thread_09(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_09_5 extends Thread { - public void run() { - RC_Thread_09 rcth01 = new RC_Thread_09(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - - -public class RC_Thread_09 { - private static RC_Thread_09_A1 a1_main = null; - private static RC_Thread_09_A2 a2_main = null; - private static RC_Thread_09_A3 a3_main = null; - private static RC_Thread_09_A4 a4_main = null; - - RC_Thread_09() { - try { - a1_main = new RC_Thread_09_A1("a1_main"); - a2_main = new RC_Thread_09_A2("a2_main"); - a3_main = new RC_Thread_09_A3("a3_main"); - a4_main = new RC_Thread_09_A4("a4_main"); - a1_main.b1_0 = new RC_Thread_09_B1("b1_0"); - a1_main.d1_0 = new RC_Thread_09_D1("d1_0"); - a1_main.b1_0.d2_0 = new RC_Thread_09_D2("d2_0"); - - a2_main.b2_0 = new RC_Thread_09_B2("b2_0"); - a2_main.b2_0.c1_0 = new RC_Thread_09_C1("c1_0"); - a2_main.b2_0.d1_0 = new RC_Thread_09_D1("d1_0"); - a2_main.b2_0.d2_0 = new RC_Thread_09_D2("d2_0"); - a2_main.b2_0.d3_0 = new RC_Thread_09_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new RC_Thread_09_D1("d1_0"); - - a3_main.b2_0 = new RC_Thread_09_B2("b2_0"); - a3_main.b2_0.c1_0 = new RC_Thread_09_C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new RC_Thread_09_D1("d1_0"); - a3_main.b2_0.d1_0 = new RC_Thread_09_D1("d1_0"); - a3_main.b2_0.d2_0 = new RC_Thread_09_D2("d2_0"); - a3_main.b2_0.d3_0 = new RC_Thread_09_D3("d3_0"); - - a3_main.c2_0 = new RC_Thread_09_C2("c2_0"); - a3_main.c2_0.d2_0 = new RC_Thread_09_D2("d2_0"); - a3_main.c2_0.d3_0 = new RC_Thread_09_D3("d3_0"); - - a4_main.b3_0 = new RC_Thread_09_B3("b3_0"); - a4_main.b3_0.c1_0 = new RC_Thread_09_C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new RC_Thread_09_D1("d1_0"); - a4_main.c2_0 = new RC_Thread_09_C2("c2_0"); - a4_main.c2_0.d2_0 = new RC_Thread_09_D2("d2_0"); - a4_main.c2_0.d3_0 = new RC_Thread_09_D3("d3_0"); - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_09_1 t1 = new RC_Thread_09_1(); - RC_Thread_09_2 t2 = new RC_Thread_09_2(); - RC_Thread_09_3 t3 = new RC_Thread_09_3(); - RC_Thread_09_4 t4 = new RC_Thread_09_4(); - RC_Thread_09_5 t5 = new RC_Thread_09_5(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - t5.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - } catch (InterruptedException e) { - } - - } - - - public void setA1null() { - a1_main = null; - } - - public void setA2null() { - a2_main = null; - } - - public void setA3() { - try { - a3_main.c2_0.d2_0 = new RC_Thread_09_D2("new"); - a3_main = new RC_Thread_09_A3("a3_new"); - a3_main = null; - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - a3_main = null; - } - - public void setA4null() { - a4_main = null; - } - - class RC_Thread_09_A1 { - RC_Thread_09_B1 b1_0; - RC_Thread_09_D1 d1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - - class RC_Thread_09_A2 { - RC_Thread_09_B2 b2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - - class RC_Thread_09_A3 { - RC_Thread_09_B2 b2_0; - RC_Thread_09_C2 c2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class RC_Thread_09_A4 { - RC_Thread_09_B3 b3_0; - RC_Thread_09_C2 c2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - - class RC_Thread_09_B1 { - RC_Thread_09_D2 d2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - - class RC_Thread_09_B2 { - RC_Thread_09_C1 c1_0; - RC_Thread_09_D1 d1_0; - RC_Thread_09_D2 d2_0; - RC_Thread_09_D3 d3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - - class RC_Thread_09_B3 { - RC_Thread_09_C1 c1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - - class RC_Thread_09_C1 { - RC_Thread_09_D1 d1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class RC_Thread_09_C2 { - RC_Thread_09_D2 d2_0; - RC_Thread_09_D3 d3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_09_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - - class RC_Thread_09_D1 { - int a; - int sum; - String strObjectName; - - RC_Thread_09_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_09_D2 { - int a; - int sum; - String strObjectName; - - RC_Thread_09_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_09_D3 { - int a; - int sum; - String strObjectName; - - RC_Thread_09_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_09 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_09.java + *- @ExecuteClass: RC_Thread_09 + *- @ExecuteArgs: + + * + */ + +class RC_Thread_09_1 extends Thread { + public void run() { + RC_Thread_09 rcth01 = new RC_Thread_09(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_09_2 extends Thread { + public void run() { + RC_Thread_09 rcth01 = new RC_Thread_09(); + try { + rcth01.setA2null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_09_3 extends Thread { + public void run() { + RC_Thread_09 rcth01 = new RC_Thread_09(); + try { + rcth01.setA3(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_09_4 extends Thread { + public void run() { + RC_Thread_09 rcth01 = new RC_Thread_09(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_09_5 extends Thread { + public void run() { + RC_Thread_09 rcth01 = new RC_Thread_09(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + + +public class RC_Thread_09 { + private static RC_Thread_09_A1 a1_main = null; + private static RC_Thread_09_A2 a2_main = null; + private static RC_Thread_09_A3 a3_main = null; + private static RC_Thread_09_A4 a4_main = null; + + RC_Thread_09() { + try { + a1_main = new RC_Thread_09_A1("a1_main"); + a2_main = new RC_Thread_09_A2("a2_main"); + a3_main = new RC_Thread_09_A3("a3_main"); + a4_main = new RC_Thread_09_A4("a4_main"); + a1_main.b1_0 = new RC_Thread_09_B1("b1_0"); + a1_main.d1_0 = new RC_Thread_09_D1("d1_0"); + a1_main.b1_0.d2_0 = new RC_Thread_09_D2("d2_0"); + + a2_main.b2_0 = new RC_Thread_09_B2("b2_0"); + a2_main.b2_0.c1_0 = new RC_Thread_09_C1("c1_0"); + a2_main.b2_0.d1_0 = new RC_Thread_09_D1("d1_0"); + a2_main.b2_0.d2_0 = new RC_Thread_09_D2("d2_0"); + a2_main.b2_0.d3_0 = new RC_Thread_09_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new RC_Thread_09_D1("d1_0"); + + a3_main.b2_0 = new RC_Thread_09_B2("b2_0"); + a3_main.b2_0.c1_0 = new RC_Thread_09_C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new RC_Thread_09_D1("d1_0"); + a3_main.b2_0.d1_0 = new RC_Thread_09_D1("d1_0"); + a3_main.b2_0.d2_0 = new RC_Thread_09_D2("d2_0"); + a3_main.b2_0.d3_0 = new RC_Thread_09_D3("d3_0"); + + a3_main.c2_0 = new RC_Thread_09_C2("c2_0"); + a3_main.c2_0.d2_0 = new RC_Thread_09_D2("d2_0"); + a3_main.c2_0.d3_0 = new RC_Thread_09_D3("d3_0"); + + a4_main.b3_0 = new RC_Thread_09_B3("b3_0"); + a4_main.b3_0.c1_0 = new RC_Thread_09_C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new RC_Thread_09_D1("d1_0"); + a4_main.c2_0 = new RC_Thread_09_C2("c2_0"); + a4_main.c2_0.d2_0 = new RC_Thread_09_D2("d2_0"); + a4_main.c2_0.d3_0 = new RC_Thread_09_D3("d3_0"); + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_09_1 t1 = new RC_Thread_09_1(); + RC_Thread_09_2 t2 = new RC_Thread_09_2(); + RC_Thread_09_3 t3 = new RC_Thread_09_3(); + RC_Thread_09_4 t4 = new RC_Thread_09_4(); + RC_Thread_09_5 t5 = new RC_Thread_09_5(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t5.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + t5.join(); + } catch (InterruptedException e) { + } + + } + + + public void setA1null() { + a1_main = null; + } + + public void setA2null() { + a2_main = null; + } + + public void setA3() { + try { + a3_main.c2_0.d2_0 = new RC_Thread_09_D2("new"); + a3_main = new RC_Thread_09_A3("a3_new"); + a3_main = null; + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + a3_main = null; + } + + public void setA4null() { + a4_main = null; + } + + class RC_Thread_09_A1 { + RC_Thread_09_B1 b1_0; + RC_Thread_09_D1 d1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + + class RC_Thread_09_A2 { + RC_Thread_09_B2 b2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + + class RC_Thread_09_A3 { + RC_Thread_09_B2 b2_0; + RC_Thread_09_C2 c2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class RC_Thread_09_A4 { + RC_Thread_09_B3 b3_0; + RC_Thread_09_C2 c2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + + class RC_Thread_09_B1 { + RC_Thread_09_D2 d2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + + class RC_Thread_09_B2 { + RC_Thread_09_C1 c1_0; + RC_Thread_09_D1 d1_0; + RC_Thread_09_D2 d2_0; + RC_Thread_09_D3 d3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + + class RC_Thread_09_B3 { + RC_Thread_09_C1 c1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + + class RC_Thread_09_C1 { + RC_Thread_09_D1 d1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class RC_Thread_09_C2 { + RC_Thread_09_D2 d2_0; + RC_Thread_09_D3 d3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_09_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + + class RC_Thread_09_D1 { + int a; + int sum; + String strObjectName; + + RC_Thread_09_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_09_D2 { + int a; + int sum; + String strObjectName; + + RC_Thread_09_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_09_D3 { + int a; + int sum; + String strObjectName; + + RC_Thread_09_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0237-rc-function-RC_Thread02-RC_Thread_10/RC_Thread_10.java b/test/testsuite/ouroboros/memory_management/Function/RC0237-rc-function-RC_Thread02-RC_Thread_10/RC_Thread_10.java index ea0161fa586dcf53dd7fd33be868e338c28ec0bf..3ec60fa162ceb847fb82ffe7f0ca0286156a6fa6 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0237-rc-function-RC_Thread02-RC_Thread_10/RC_Thread_10.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0237-rc-function-RC_Thread02-RC_Thread_10/RC_Thread_10.java @@ -1,303 +1,303 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_10 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00050 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_10.java - *- @ExecuteClass: RC_Thread_10 - *- @ExecuteArgs: - - * - */ -class RC_Thread_10_1 extends Thread { - public void run() { - RC_Thread_10 rcth01 = new RC_Thread_10("rcth01"); - try { - rcth01.addSum(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_10_2 extends Thread { - public void run() { - RC_Thread_10 rcth01 = new RC_Thread_10("rcth01"); - try { - rcth01.ModifyB4(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_10_3 extends Thread { - public void run() { - RC_Thread_10 rcth01 = new RC_Thread_10("rcth01"); - try { - rcth01.deleteA1(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_10_4 extends Thread { - public void run() { - RC_Thread_10 rcth01 = new RC_Thread_10("rcth01"); - try { - rcth01.setA1(null); - } catch (NullPointerException e) { - - } - } -} - - -public class RC_Thread_10 { - private static RC_Thread_10_A1 a1 = null; - - RC_Thread_10(String str) { - try { - a1 = new RC_Thread_10_A1("a1"); - a1.b1_0 = new RC_Thread_10_B1("b1_0"); - a1.b1_0.c1_0 = new RC_Thread_10_C1("c1_0"); - a1.b1_0.c2_0 = new RC_Thread_10_C2("c2_0"); - a1.b1_0.c3_0 = new RC_Thread_10_C3("c3_0"); - a1.b2_0 = new RC_Thread_10_B2("b2_0"); - a1.b3_0 = new RC_Thread_10_B3("b3_0"); - a1.b4_0 = new RC_Thread_10_B4("b4_0"); - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_10_1 t1 = new RC_Thread_10_1(); - RC_Thread_10_2 t2 = new RC_Thread_10_2(); - RC_Thread_10_3 t3 = new RC_Thread_10_3(); - RC_Thread_10_4 t4 = new RC_Thread_10_4(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - - } catch (InterruptedException e) { - } - } - - public void deleteA1() { - a1 = null; - } - - public void ModifyB4() { - try { - a1.b4_0 = new RC_Thread_10_B4("new_b4"); - } catch (NullPointerException e) { - - } - } - - public void addSum() { - try { - a1.add(); - a1.b1_0.add(); - a1.b2_0.add(); - a1.b3_0.add(); - a1.b4_0.add(); - a1.b1_0.c1_0.add(); - a1.b1_0.c2_0.add(); - a1.b1_0.c3_0.add(); - } catch (NullPointerException e) { - - } - } - - public void setA1(RC_Thread_10_A1 a1) { - this.a1 = a1; - } - - class RC_Thread_10_A1 { - RC_Thread_10_B1 b1_0; - RC_Thread_10_B2 b2_0; - RC_Thread_10_B3 b3_0; - RC_Thread_10_B4 b4_0; - int a; - int sum; - String strObjectName; - - RC_Thread_10_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class RC_Thread_10_B1 { - RC_Thread_10_C1 c1_0; - RC_Thread_10_C2 c2_0; - RC_Thread_10_C3 c3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_10_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class RC_Thread_10_B2 { - int a; - int sum; - String strObjectName; - - RC_Thread_10_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - - class RC_Thread_10_B3 { - int a; - int sum; - String strObjectName; - - RC_Thread_10_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_10_B4 { - int a; - int sum; - String strObjectName; - - RC_Thread_10_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_10_C1 { - int a; - int sum; - String strObjectName; - - RC_Thread_10_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_10_C2 { - int a; - int sum; - String strObjectName; - - RC_Thread_10_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_10_C3 { - int a; - int sum; - String strObjectName; - - RC_Thread_10_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_10 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00050 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_10.java + *- @ExecuteClass: RC_Thread_10 + *- @ExecuteArgs: + + * + */ +class RC_Thread_10_1 extends Thread { + public void run() { + RC_Thread_10 rcth01 = new RC_Thread_10("rcth01"); + try { + rcth01.addSum(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_10_2 extends Thread { + public void run() { + RC_Thread_10 rcth01 = new RC_Thread_10("rcth01"); + try { + rcth01.ModifyB4(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_10_3 extends Thread { + public void run() { + RC_Thread_10 rcth01 = new RC_Thread_10("rcth01"); + try { + rcth01.deleteA1(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_10_4 extends Thread { + public void run() { + RC_Thread_10 rcth01 = new RC_Thread_10("rcth01"); + try { + rcth01.setA1(null); + } catch (NullPointerException e) { + + } + } +} + + +public class RC_Thread_10 { + private static RC_Thread_10_A1 a1 = null; + + RC_Thread_10(String str) { + try { + a1 = new RC_Thread_10_A1("a1"); + a1.b1_0 = new RC_Thread_10_B1("b1_0"); + a1.b1_0.c1_0 = new RC_Thread_10_C1("c1_0"); + a1.b1_0.c2_0 = new RC_Thread_10_C2("c2_0"); + a1.b1_0.c3_0 = new RC_Thread_10_C3("c3_0"); + a1.b2_0 = new RC_Thread_10_B2("b2_0"); + a1.b3_0 = new RC_Thread_10_B3("b3_0"); + a1.b4_0 = new RC_Thread_10_B4("b4_0"); + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_10_1 t1 = new RC_Thread_10_1(); + RC_Thread_10_2 t2 = new RC_Thread_10_2(); + RC_Thread_10_3 t3 = new RC_Thread_10_3(); + RC_Thread_10_4 t4 = new RC_Thread_10_4(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + + } catch (InterruptedException e) { + } + } + + public void deleteA1() { + a1 = null; + } + + public void ModifyB4() { + try { + a1.b4_0 = new RC_Thread_10_B4("new_b4"); + } catch (NullPointerException e) { + + } + } + + public void addSum() { + try { + a1.add(); + a1.b1_0.add(); + a1.b2_0.add(); + a1.b3_0.add(); + a1.b4_0.add(); + a1.b1_0.c1_0.add(); + a1.b1_0.c2_0.add(); + a1.b1_0.c3_0.add(); + } catch (NullPointerException e) { + + } + } + + public void setA1(RC_Thread_10_A1 a1) { + this.a1 = a1; + } + + class RC_Thread_10_A1 { + RC_Thread_10_B1 b1_0; + RC_Thread_10_B2 b2_0; + RC_Thread_10_B3 b3_0; + RC_Thread_10_B4 b4_0; + int a; + int sum; + String strObjectName; + + RC_Thread_10_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class RC_Thread_10_B1 { + RC_Thread_10_C1 c1_0; + RC_Thread_10_C2 c2_0; + RC_Thread_10_C3 c3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_10_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class RC_Thread_10_B2 { + int a; + int sum; + String strObjectName; + + RC_Thread_10_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + + class RC_Thread_10_B3 { + int a; + int sum; + String strObjectName; + + RC_Thread_10_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_10_B4 { + int a; + int sum; + String strObjectName; + + RC_Thread_10_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_10_C1 { + int a; + int sum; + String strObjectName; + + RC_Thread_10_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_10_C2 { + int a; + int sum; + String strObjectName; + + RC_Thread_10_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_10_C3 { + int a; + int sum; + String strObjectName; + + RC_Thread_10_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0238-rc-function-RC_Thread02-RC_Thread_11/RC_Thread_11.java b/test/testsuite/ouroboros/memory_management/Function/RC0238-rc-function-RC_Thread02-RC_Thread_11/RC_Thread_11.java index 70901f43633ef8099889a951e67f4cb22dc3bf00..57932ef1412e20029ec3de7a8bcfbef38f7e1337 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0238-rc-function-RC_Thread02-RC_Thread_11/RC_Thread_11.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0238-rc-function-RC_Thread02-RC_Thread_11/RC_Thread_11.java @@ -1,437 +1,437 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_11 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_11.java - *- @ExecuteClass: RC_Thread_11 - *- @ExecuteArgs: - - * - */ - -class RC_Thread_11_1 extends Thread { - public void run() { - RC_Thread_11 rcth01 = new RC_Thread_11(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_11_2 extends Thread { - public void run() { - RC_Thread_11 rcth01 = new RC_Thread_11(); - try { - rcth01.setA2null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_11_3 extends Thread { - public void run() { - RC_Thread_11 rcth01 = new RC_Thread_11(); - try { - rcth01.setA3(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_11_4 extends Thread { - public void run() { - RC_Thread_11 rcth01 = new RC_Thread_11(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_11_5 extends Thread { - public void run() { - RC_Thread_11 rcth01 = new RC_Thread_11(); - try { - rcth01.setA4(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_11 { - private static RC_Thread_11_A1 a1_main = null; - private static RC_Thread_11_A2 a2_main = null; - private static RC_Thread_11_A3 a3_main = null; - private static RC_Thread_11_A4 a4_main = null; - - RC_Thread_11() { - try { - a1_main = new RC_Thread_11_A1("a1_main"); - a2_main = new RC_Thread_11_A2("a2_main"); - a3_main = new RC_Thread_11_A3("a3_main"); - a4_main = new RC_Thread_11_A4("a4_main"); - a1_main.b1_0 = new RC_Thread_11_B1("b1_0"); - a1_main.d1_0 = new RC_Thread_11_D1("d1_0"); - a1_main.b1_0.d2_0 = new RC_Thread_11_D2("d2_0"); - - a2_main.b2_0 = new RC_Thread_11_B2("b2_0"); - a2_main.b2_0.c1_0 = new RC_Thread_11_C1("c1_0"); - a2_main.b2_0.d1_0 = new RC_Thread_11_D1("d1_0"); - a2_main.b2_0.d2_0 = new RC_Thread_11_D2("d2_0"); - a2_main.b2_0.d3_0 = new RC_Thread_11_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new RC_Thread_11_D1("d1_0"); - - a3_main.b2_0 = new RC_Thread_11_B2("b2_0"); - a3_main.b2_0.c1_0 = new RC_Thread_11_C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new RC_Thread_11_D1("d1_0"); - a3_main.b2_0.d1_0 = new RC_Thread_11_D1("d1_0"); - a3_main.b2_0.d2_0 = new RC_Thread_11_D2("d2_0"); - a3_main.b2_0.d3_0 = new RC_Thread_11_D3("d3_0"); - - a3_main.c2_0 = new RC_Thread_11_C2("c2_0"); - a3_main.c2_0.d2_0 = new RC_Thread_11_D2("d2_0"); - a3_main.c2_0.d3_0 = new RC_Thread_11_D3("d3_0"); - - a4_main.b3_0 = new RC_Thread_11_B3("b3_0"); - a4_main.b3_0.c1_0 = new RC_Thread_11_C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new RC_Thread_11_D1("d1_0"); - a4_main.c2_0 = new RC_Thread_11_C2("c2_0"); - a4_main.c2_0.d2_0 = new RC_Thread_11_D2("d2_0"); - a4_main.c2_0.d3_0 = new RC_Thread_11_D3("d3_0"); - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_11_1 t1 = new RC_Thread_11_1(); - RC_Thread_11_2 t2 = new RC_Thread_11_2(); - RC_Thread_11_3 t3 = new RC_Thread_11_3(); - RC_Thread_11_4 t4 = new RC_Thread_11_4(); - RC_Thread_11_5 t5 = new RC_Thread_11_5(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - t5.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA2null() { - a2_main = null; - } - - public void setA3() { - try { - a3_main.c2_0.d2_0 = new RC_Thread_11_D2("new"); - a3_main = new RC_Thread_11_A3("a3_new"); - a3_main = null; - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - a3_main = null; - } - - public void setA4() { - try { - a4_main = new RC_Thread_11_A4("a4_new"); - - } catch (NullPointerException e) { - } - } - - class RC_Thread_11_A1 { - RC_Thread_11_B1 b1_0; - RC_Thread_11_D1 d1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } - } - - - class RC_Thread_11_A2 { - RC_Thread_11_B2 b2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } - } - - - class RC_Thread_11_A3 { - RC_Thread_11_B2 b2_0; - RC_Thread_11_C2 c2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } - } - - class RC_Thread_11_A4 { - RC_Thread_11_B3 b3_0; - RC_Thread_11_C2 c2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } - } - - - class RC_Thread_11_B1 { - RC_Thread_11_D2 d2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } - } - - - class RC_Thread_11_B2 { - RC_Thread_11_C1 c1_0; - RC_Thread_11_D1 d1_0; - RC_Thread_11_D2 d2_0; - RC_Thread_11_D3 d3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } - } - - - class RC_Thread_11_B3 { - RC_Thread_11_C1 c1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } - } - - - class RC_Thread_11_C1 { - RC_Thread_11_D1 d1_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } - } - - class RC_Thread_11_C2 { - RC_Thread_11_D2 d2_0; - RC_Thread_11_D3 d3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_11_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } - } - - - class RC_Thread_11_D1 { - int a; - int sum; - String strObjectName; - - RC_Thread_11_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_11_D2 { - int a; - int sum; - String strObjectName; - - RC_Thread_11_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_11_D3 { - int a; - int sum; - String strObjectName; - - RC_Thread_11_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_11 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_11.java + *- @ExecuteClass: RC_Thread_11 + *- @ExecuteArgs: + + * + */ + +class RC_Thread_11_1 extends Thread { + public void run() { + RC_Thread_11 rcth01 = new RC_Thread_11(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_11_2 extends Thread { + public void run() { + RC_Thread_11 rcth01 = new RC_Thread_11(); + try { + rcth01.setA2null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_11_3 extends Thread { + public void run() { + RC_Thread_11 rcth01 = new RC_Thread_11(); + try { + rcth01.setA3(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_11_4 extends Thread { + public void run() { + RC_Thread_11 rcth01 = new RC_Thread_11(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_11_5 extends Thread { + public void run() { + RC_Thread_11 rcth01 = new RC_Thread_11(); + try { + rcth01.setA4(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_11 { + private static RC_Thread_11_A1 a1_main = null; + private static RC_Thread_11_A2 a2_main = null; + private static RC_Thread_11_A3 a3_main = null; + private static RC_Thread_11_A4 a4_main = null; + + RC_Thread_11() { + try { + a1_main = new RC_Thread_11_A1("a1_main"); + a2_main = new RC_Thread_11_A2("a2_main"); + a3_main = new RC_Thread_11_A3("a3_main"); + a4_main = new RC_Thread_11_A4("a4_main"); + a1_main.b1_0 = new RC_Thread_11_B1("b1_0"); + a1_main.d1_0 = new RC_Thread_11_D1("d1_0"); + a1_main.b1_0.d2_0 = new RC_Thread_11_D2("d2_0"); + + a2_main.b2_0 = new RC_Thread_11_B2("b2_0"); + a2_main.b2_0.c1_0 = new RC_Thread_11_C1("c1_0"); + a2_main.b2_0.d1_0 = new RC_Thread_11_D1("d1_0"); + a2_main.b2_0.d2_0 = new RC_Thread_11_D2("d2_0"); + a2_main.b2_0.d3_0 = new RC_Thread_11_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new RC_Thread_11_D1("d1_0"); + + a3_main.b2_0 = new RC_Thread_11_B2("b2_0"); + a3_main.b2_0.c1_0 = new RC_Thread_11_C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new RC_Thread_11_D1("d1_0"); + a3_main.b2_0.d1_0 = new RC_Thread_11_D1("d1_0"); + a3_main.b2_0.d2_0 = new RC_Thread_11_D2("d2_0"); + a3_main.b2_0.d3_0 = new RC_Thread_11_D3("d3_0"); + + a3_main.c2_0 = new RC_Thread_11_C2("c2_0"); + a3_main.c2_0.d2_0 = new RC_Thread_11_D2("d2_0"); + a3_main.c2_0.d3_0 = new RC_Thread_11_D3("d3_0"); + + a4_main.b3_0 = new RC_Thread_11_B3("b3_0"); + a4_main.b3_0.c1_0 = new RC_Thread_11_C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new RC_Thread_11_D1("d1_0"); + a4_main.c2_0 = new RC_Thread_11_C2("c2_0"); + a4_main.c2_0.d2_0 = new RC_Thread_11_D2("d2_0"); + a4_main.c2_0.d3_0 = new RC_Thread_11_D3("d3_0"); + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_11_1 t1 = new RC_Thread_11_1(); + RC_Thread_11_2 t2 = new RC_Thread_11_2(); + RC_Thread_11_3 t3 = new RC_Thread_11_3(); + RC_Thread_11_4 t4 = new RC_Thread_11_4(); + RC_Thread_11_5 t5 = new RC_Thread_11_5(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t5.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + t5.join(); + + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA2null() { + a2_main = null; + } + + public void setA3() { + try { + a3_main.c2_0.d2_0 = new RC_Thread_11_D2("new"); + a3_main = new RC_Thread_11_A3("a3_new"); + a3_main = null; + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + a3_main = null; + } + + public void setA4() { + try { + a4_main = new RC_Thread_11_A4("a4_new"); + + } catch (NullPointerException e) { + } + } + + class RC_Thread_11_A1 { + RC_Thread_11_B1 b1_0; + RC_Thread_11_D1 d1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } + } + + + class RC_Thread_11_A2 { + RC_Thread_11_B2 b2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } + } + + + class RC_Thread_11_A3 { + RC_Thread_11_B2 b2_0; + RC_Thread_11_C2 c2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } + } + + class RC_Thread_11_A4 { + RC_Thread_11_B3 b3_0; + RC_Thread_11_C2 c2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } + } + + + class RC_Thread_11_B1 { + RC_Thread_11_D2 d2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } + } + + + class RC_Thread_11_B2 { + RC_Thread_11_C1 c1_0; + RC_Thread_11_D1 d1_0; + RC_Thread_11_D2 d2_0; + RC_Thread_11_D3 d3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } + } + + + class RC_Thread_11_B3 { + RC_Thread_11_C1 c1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } + } + + + class RC_Thread_11_C1 { + RC_Thread_11_D1 d1_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } + } + + class RC_Thread_11_C2 { + RC_Thread_11_D2 d2_0; + RC_Thread_11_D3 d3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_11_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } + } + + + class RC_Thread_11_D1 { + int a; + int sum; + String strObjectName; + + RC_Thread_11_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_11_D2 { + int a; + int sum; + String strObjectName; + + RC_Thread_11_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_11_D3 { + int a; + int sum; + String strObjectName; + + RC_Thread_11_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0239-rc-function-RC_Thread02-RC_Thread_12/RC_Thread_12.java b/test/testsuite/ouroboros/memory_management/Function/RC0239-rc-function-RC_Thread02-RC_Thread_12/RC_Thread_12.java index 5127e8f77201a86d5412ce4205efb83c10a64581..f078c0fb6b0b368d7f638326cdec4f37d35e26c7 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0239-rc-function-RC_Thread02-RC_Thread_12/RC_Thread_12.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0239-rc-function-RC_Thread02-RC_Thread_12/RC_Thread_12.java @@ -1,229 +1,229 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_12 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_12.java - *- @ExecuteClass: RC_Thread_12 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_12_1 extends Thread { - public void run() { - RC_Thread_12 rcth01 = new RC_Thread_12(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_12_2 extends Thread { - public void run() { - RC_Thread_12 rcth01 = new RC_Thread_12(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_12_3 extends Thread { - public void run() { - RC_Thread_12 rcth01 = new RC_Thread_12(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_12 { - private static RC_Thread_12_A1 a1_main = null; - private static RC_Thread_12_A4 a4_main = null; - private static RC_Thread_12_A5 a5_main = null; - - RC_Thread_12() { - try { - a1_main = new RC_Thread_12_A1(); - a1_main.a2_0 = new RC_Thread_12_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_12_A3(); - a4_main = new RC_Thread_12_A4(); - a5_main = new RC_Thread_12_A5(); - a4_main.a1_0 = a1_main; - a5_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - a1_main = new RC_Thread_12_A1(); - a1_main.a2_0 = new RC_Thread_12_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_12_A3(); - a4_main = new RC_Thread_12_A4(); - a5_main = new RC_Thread_12_A5(); - a4_main.a1_0 = a1_main; - a5_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main = null; - a4_main = null; - a5_main = null; - Runtime.getRuntime().gc(); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_12_1 t1 = new RC_Thread_12_1(); - RC_Thread_12_2 t2 = new RC_Thread_12_2(); - RC_Thread_12_3 t3 = new RC_Thread_12_3(); - t1.start(); - t2.start(); - t3.start(); - try { - t1.join(); - t2.join(); - t3.join(); - - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - a4_main = null; - } - - public void setA5null() { - a5_main = null; - } - - static class RC_Thread_12_A1 { - RC_Thread_12_A2 a2_0; - int a; - int sum; - - RC_Thread_12_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_12_A2 { - RC_Thread_12_A3 a3_0; - int a; - int sum; - - RC_Thread_12_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_12_A3 { - RC_Thread_12_A1 a1_0; - int a; - int sum; - - RC_Thread_12_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - static class RC_Thread_12_A4 { - RC_Thread_12_A1 a1_0; - int a; - int sum; - - RC_Thread_12_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - - static class RC_Thread_12_A5 { - RC_Thread_12_A1 a1_0; - int a; - int sum; - - RC_Thread_12_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_12 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_12.java + *- @ExecuteClass: RC_Thread_12 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_12_1 extends Thread { + public void run() { + RC_Thread_12 rcth01 = new RC_Thread_12(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_12_2 extends Thread { + public void run() { + RC_Thread_12 rcth01 = new RC_Thread_12(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_12_3 extends Thread { + public void run() { + RC_Thread_12 rcth01 = new RC_Thread_12(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_12 { + private static RC_Thread_12_A1 a1_main = null; + private static RC_Thread_12_A4 a4_main = null; + private static RC_Thread_12_A5 a5_main = null; + + RC_Thread_12() { + try { + a1_main = new RC_Thread_12_A1(); + a1_main.a2_0 = new RC_Thread_12_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_12_A3(); + a4_main = new RC_Thread_12_A4(); + a5_main = new RC_Thread_12_A5(); + a4_main.a1_0 = a1_main; + a5_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + a1_main = new RC_Thread_12_A1(); + a1_main.a2_0 = new RC_Thread_12_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_12_A3(); + a4_main = new RC_Thread_12_A4(); + a5_main = new RC_Thread_12_A5(); + a4_main.a1_0 = a1_main; + a5_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main = null; + a4_main = null; + a5_main = null; + Runtime.getRuntime().gc(); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_12_1 t1 = new RC_Thread_12_1(); + RC_Thread_12_2 t2 = new RC_Thread_12_2(); + RC_Thread_12_3 t3 = new RC_Thread_12_3(); + t1.start(); + t2.start(); + t3.start(); + try { + t1.join(); + t2.join(); + t3.join(); + + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + a4_main = null; + } + + public void setA5null() { + a5_main = null; + } + + static class RC_Thread_12_A1 { + RC_Thread_12_A2 a2_0; + int a; + int sum; + + RC_Thread_12_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_12_A2 { + RC_Thread_12_A3 a3_0; + int a; + int sum; + + RC_Thread_12_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_12_A3 { + RC_Thread_12_A1 a1_0; + int a; + int sum; + + RC_Thread_12_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + static class RC_Thread_12_A4 { + RC_Thread_12_A1 a1_0; + int a; + int sum; + + RC_Thread_12_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + + static class RC_Thread_12_A5 { + RC_Thread_12_A1 a1_0; + int a; + int sum; + + RC_Thread_12_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0240-rc-function-RC_Thread02-RC_Thread_13/RC_Thread_13.java b/test/testsuite/ouroboros/memory_management/Function/RC0240-rc-function-RC_Thread02-RC_Thread_13/RC_Thread_13.java index f76da4ad25d371d95145cc1b1c2ab97b51ef33c6..dd662a25eb5947be5c0542a2d327de17d8ee1b0b 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0240-rc-function-RC_Thread02-RC_Thread_13/RC_Thread_13.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0240-rc-function-RC_Thread02-RC_Thread_13/RC_Thread_13.java @@ -1,284 +1,284 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_13 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_13.java - *- @ExecuteClass: RC_Thread_13 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_13_1 extends Thread { - public void run() { - RC_Thread_13 rcth01 = new RC_Thread_13(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_13_2 extends Thread { - public void run() { - RC_Thread_13 rcth01 = new RC_Thread_13(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_13_3 extends Thread { - public void run() { - RC_Thread_13 rcth01 = new RC_Thread_13(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_13_4 extends Thread { - public void run() { - RC_Thread_13 rcth01 = new RC_Thread_13(); - try { - rcth01.setA1(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_13_5 extends Thread { - public void run() { - RC_Thread_13 rcth01 = new RC_Thread_13(); - try { - rcth01.checkA3(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_13_6 extends Thread { - public void run() { - RC_Thread_13 rcth01 = new RC_Thread_13(); - try { - rcth01.setA3_a(5); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_13 { - private static RC_Thread_13_A1 a1_main = null; - private static RC_Thread_13_A4 a4_main = null; - private static RC_Thread_13_A5 a5_main = null; - - RC_Thread_13() { - try { - a1_main = new RC_Thread_13_A1(); - a1_main.a2_0 = new RC_Thread_13_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_13_A3(); - a4_main = new RC_Thread_13_A4(); - a5_main = new RC_Thread_13_A5(); - a4_main.a1_0 = a1_main; - a5_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_13_1 t1 = new RC_Thread_13_1(); - RC_Thread_13_2 t2 = new RC_Thread_13_2(); - RC_Thread_13_3 t3 = new RC_Thread_13_3(); - RC_Thread_13_4 t4 = new RC_Thread_13_4(); - RC_Thread_13_5 t5 = new RC_Thread_13_5(); - RC_Thread_13_6 t6 = new RC_Thread_13_6(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - t5.start(); - t6.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - t6.join(); - - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - a4_main = null; - } - - public void setA5null() { - a5_main = null; - } - - public void setA1() { - try { - this.a1_main = new RC_Thread_13_A1(); - a1_main.a2_0 = new RC_Thread_13_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_13_A3(); - } catch (NullPointerException e) { - - } - - } - - public void checkA3() { - try { - int a = a1_main.a2_0.a3_0.a; - } catch (NullPointerException e) { - - } - - } - - public void setA3_a(int a) { - try { - this.a1_main.a2_0.a3_0.a = a; - } catch (NullPointerException e) { - } - } - - class RC_Thread_13_A1 { - RC_Thread_13_A2 a2_0; - int a; - int sum; - - RC_Thread_13_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - class RC_Thread_13_A2 { - RC_Thread_13_A3 a3_0; - int a; - int sum; - - RC_Thread_13_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - class RC_Thread_13_A3 { - RC_Thread_13_A1 a1_0; - int a; - int sum; - - RC_Thread_13_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - class RC_Thread_13_A4 { - RC_Thread_13_A1 a1_0; - int a; - int sum; - - RC_Thread_13_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - - class RC_Thread_13_A5 { - RC_Thread_13_A1 a1_0; - int a; - int sum; - - RC_Thread_13_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_13 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_13.java + *- @ExecuteClass: RC_Thread_13 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_13_1 extends Thread { + public void run() { + RC_Thread_13 rcth01 = new RC_Thread_13(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_13_2 extends Thread { + public void run() { + RC_Thread_13 rcth01 = new RC_Thread_13(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_13_3 extends Thread { + public void run() { + RC_Thread_13 rcth01 = new RC_Thread_13(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_13_4 extends Thread { + public void run() { + RC_Thread_13 rcth01 = new RC_Thread_13(); + try { + rcth01.setA1(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_13_5 extends Thread { + public void run() { + RC_Thread_13 rcth01 = new RC_Thread_13(); + try { + rcth01.checkA3(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_13_6 extends Thread { + public void run() { + RC_Thread_13 rcth01 = new RC_Thread_13(); + try { + rcth01.setA3_a(5); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_13 { + private static RC_Thread_13_A1 a1_main = null; + private static RC_Thread_13_A4 a4_main = null; + private static RC_Thread_13_A5 a5_main = null; + + RC_Thread_13() { + try { + a1_main = new RC_Thread_13_A1(); + a1_main.a2_0 = new RC_Thread_13_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_13_A3(); + a4_main = new RC_Thread_13_A4(); + a5_main = new RC_Thread_13_A5(); + a4_main.a1_0 = a1_main; + a5_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_13_1 t1 = new RC_Thread_13_1(); + RC_Thread_13_2 t2 = new RC_Thread_13_2(); + RC_Thread_13_3 t3 = new RC_Thread_13_3(); + RC_Thread_13_4 t4 = new RC_Thread_13_4(); + RC_Thread_13_5 t5 = new RC_Thread_13_5(); + RC_Thread_13_6 t6 = new RC_Thread_13_6(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t5.start(); + t6.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + t5.join(); + t6.join(); + + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + a4_main = null; + } + + public void setA5null() { + a5_main = null; + } + + public void setA1() { + try { + this.a1_main = new RC_Thread_13_A1(); + a1_main.a2_0 = new RC_Thread_13_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_13_A3(); + } catch (NullPointerException e) { + + } + + } + + public void checkA3() { + try { + int a = a1_main.a2_0.a3_0.a; + } catch (NullPointerException e) { + + } + + } + + public void setA3_a(int a) { + try { + this.a1_main.a2_0.a3_0.a = a; + } catch (NullPointerException e) { + } + } + + class RC_Thread_13_A1 { + RC_Thread_13_A2 a2_0; + int a; + int sum; + + RC_Thread_13_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + class RC_Thread_13_A2 { + RC_Thread_13_A3 a3_0; + int a; + int sum; + + RC_Thread_13_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + class RC_Thread_13_A3 { + RC_Thread_13_A1 a1_0; + int a; + int sum; + + RC_Thread_13_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + class RC_Thread_13_A4 { + RC_Thread_13_A1 a1_0; + int a; + int sum; + + RC_Thread_13_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + + class RC_Thread_13_A5 { + RC_Thread_13_A1 a1_0; + int a; + int sum; + + RC_Thread_13_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0241-rc-function-RC_Thread02-RC_Thread_14/RC_Thread_14.java b/test/testsuite/ouroboros/memory_management/Function/RC0241-rc-function-RC_Thread02-RC_Thread_14/RC_Thread_14.java index b19a0180ad171799f9f6666091e749ec47b71743..7e888d8450a34d1b6b099972a24c043330f27cd6 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0241-rc-function-RC_Thread02-RC_Thread_14/RC_Thread_14.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0241-rc-function-RC_Thread02-RC_Thread_14/RC_Thread_14.java @@ -1,272 +1,272 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_14 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_14.java - *- @ExecuteClass: RC_Thread_14 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_14_1 extends Thread { - public void run() { - RC_Thread_14 rcth01 = new RC_Thread_14(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - } -} - -class RC_Thread_14_2 extends Thread { - public void run() { - RC_Thread_14 rcth01 = new RC_Thread_14(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - } -} - -class RC_Thread_14_3 extends Thread { - public void run() { - RC_Thread_14 rcth01 = new RC_Thread_14(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - - } -} - -public class RC_Thread_14 { - private static RC_Thread_14_A1 a1_main = null; - private static RC_Thread_14_A5 a5_main = null; - - RC_Thread_14() { - try { - a1_main = new RC_Thread_14_A1(); - a1_main.a2_0 = new RC_Thread_14_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_14_A3(); - a1_main.a2_0.a3_0.a4_0 = new RC_Thread_14_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a5_main = new RC_Thread_14_A5(); - a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_14_A6(); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - } catch (NullPointerException e) { - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - Runtime.getRuntime().gc(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - a1_main = new RC_Thread_14_A1(); - a1_main.a2_0 = new RC_Thread_14_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_14_A3(); - a1_main.a2_0.a3_0.a4_0 = new RC_Thread_14_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a5_main = new RC_Thread_14_A5(); - a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_14_A6(); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a1_main = null; - a5_main = null; - - a1_main = new RC_Thread_14_A1(); - a1_main.a2_0 = new RC_Thread_14_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_14_A3(); - a1_main.a2_0.a3_0.a4_0 = new RC_Thread_14_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a1_main = null; - - a1_main = new RC_Thread_14_A1(); - a1_main.a2_0 = new RC_Thread_14_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_14_A3(); - a1_main.a2_0.a3_0.a4_0 = new RC_Thread_14_A4(); - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a5_main = new RC_Thread_14_A5(); - a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_14_A6(); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a2_0.a3_0 = null; - a1_main = null; - a5_main = null; - //Runtime.getRuntime().gc(); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_14_1 t1 = new RC_Thread_14_1(); - RC_Thread_14_2 t2 = new RC_Thread_14_2(); - RC_Thread_14_3 t3 = new RC_Thread_14_3(); - t1.start(); - t2.start(); - t3.start(); - try { - t1.join(); - t2.join(); - t3.join(); - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - try { - a1_main.a2_0.a3_0.a4_0 = null; - a5_main.a3_0.a4_0 = null; - } catch (NullPointerException e) { - } - } - - public void setA5null() { - a5_main = null; - } - - static class RC_Thread_14_A1 { - RC_Thread_14_A2 a2_0; - RC_Thread_14_A4 a4_0; - int a; - int sum; - - RC_Thread_14_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_14_A2 { - RC_Thread_14_A3 a3_0; - int a; - int sum; - - RC_Thread_14_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_14_A3 { - RC_Thread_14_A4 a4_0; - int a; - int sum; - - RC_Thread_14_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - - static class RC_Thread_14_A4 { - RC_Thread_14_A1 a1_0; - RC_Thread_14_A6 a6_0; - int a; - int sum; - - RC_Thread_14_A4() { - a1_0 = null; - a6_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - static class RC_Thread_14_A5 { - RC_Thread_14_A3 a3_0; - int a; - int sum; - - RC_Thread_14_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RC_Thread_14_A6 { - RC_Thread_14_A5 a5_0; - int a; - int sum; - - RC_Thread_14_A6() { - a5_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_14 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_14.java + *- @ExecuteClass: RC_Thread_14 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_14_1 extends Thread { + public void run() { + RC_Thread_14 rcth01 = new RC_Thread_14(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + } +} + +class RC_Thread_14_2 extends Thread { + public void run() { + RC_Thread_14 rcth01 = new RC_Thread_14(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + } +} + +class RC_Thread_14_3 extends Thread { + public void run() { + RC_Thread_14 rcth01 = new RC_Thread_14(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + + } +} + +public class RC_Thread_14 { + private static RC_Thread_14_A1 a1_main = null; + private static RC_Thread_14_A5 a5_main = null; + + RC_Thread_14() { + try { + a1_main = new RC_Thread_14_A1(); + a1_main.a2_0 = new RC_Thread_14_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_14_A3(); + a1_main.a2_0.a3_0.a4_0 = new RC_Thread_14_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a5_main = new RC_Thread_14_A5(); + a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_14_A6(); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + } catch (NullPointerException e) { + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + Runtime.getRuntime().gc(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + a1_main = new RC_Thread_14_A1(); + a1_main.a2_0 = new RC_Thread_14_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_14_A3(); + a1_main.a2_0.a3_0.a4_0 = new RC_Thread_14_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a5_main = new RC_Thread_14_A5(); + a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_14_A6(); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a1_main = null; + a5_main = null; + + a1_main = new RC_Thread_14_A1(); + a1_main.a2_0 = new RC_Thread_14_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_14_A3(); + a1_main.a2_0.a3_0.a4_0 = new RC_Thread_14_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a1_main = null; + + a1_main = new RC_Thread_14_A1(); + a1_main.a2_0 = new RC_Thread_14_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_14_A3(); + a1_main.a2_0.a3_0.a4_0 = new RC_Thread_14_A4(); + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a5_main = new RC_Thread_14_A5(); + a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_14_A6(); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a2_0.a3_0 = null; + a1_main = null; + a5_main = null; + //Runtime.getRuntime().gc(); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_14_1 t1 = new RC_Thread_14_1(); + RC_Thread_14_2 t2 = new RC_Thread_14_2(); + RC_Thread_14_3 t3 = new RC_Thread_14_3(); + t1.start(); + t2.start(); + t3.start(); + try { + t1.join(); + t2.join(); + t3.join(); + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + try { + a1_main.a2_0.a3_0.a4_0 = null; + a5_main.a3_0.a4_0 = null; + } catch (NullPointerException e) { + } + } + + public void setA5null() { + a5_main = null; + } + + static class RC_Thread_14_A1 { + RC_Thread_14_A2 a2_0; + RC_Thread_14_A4 a4_0; + int a; + int sum; + + RC_Thread_14_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_14_A2 { + RC_Thread_14_A3 a3_0; + int a; + int sum; + + RC_Thread_14_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_14_A3 { + RC_Thread_14_A4 a4_0; + int a; + int sum; + + RC_Thread_14_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + + static class RC_Thread_14_A4 { + RC_Thread_14_A1 a1_0; + RC_Thread_14_A6 a6_0; + int a; + int sum; + + RC_Thread_14_A4() { + a1_0 = null; + a6_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + static class RC_Thread_14_A5 { + RC_Thread_14_A3 a3_0; + int a; + int sum; + + RC_Thread_14_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RC_Thread_14_A6 { + RC_Thread_14_A5 a5_0; + int a; + int sum; + + RC_Thread_14_A6() { + a5_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0242-rc-function-RC_Thread02-RC_Thread_15/RC_Thread_15.java b/test/testsuite/ouroboros/memory_management/Function/RC0242-rc-function-RC_Thread02-RC_Thread_15/RC_Thread_15.java index 13830f1f4711ee68bf5d4e1323b26e912e7721e7..8bca46fd5ef7e31ea030682965cd7571cbfd6117 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0242-rc-function-RC_Thread02-RC_Thread_15/RC_Thread_15.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0242-rc-function-RC_Thread02-RC_Thread_15/RC_Thread_15.java @@ -1,259 +1,259 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_15 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_15.java - *- @ExecuteClass: RC_Thread_15 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_15_1 extends Thread { - public void run() { - RC_Thread_15 rcth01 = new RC_Thread_15(); - try { - rcth01.ModifyA1(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_15_2 extends Thread { - public void run() { - RC_Thread_15 rcth01 = new RC_Thread_15(); - try { - rcth01.checkA4(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_15_3 extends Thread { - public void run() { - RC_Thread_15 rcth01 = new RC_Thread_15(); - try { - rcth01.setA5(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_15 { - private static RC_Thread_15_A1 a1_main = null; - private static RC_Thread_15_A5 a5_main = null; - - RC_Thread_15() { - try { - RC_Thread_15_A1 a1 = new RC_Thread_15_A1(); - a1.a2_0 = new RC_Thread_15_A2(); - a1.a2_0.a3_0 = new RC_Thread_15_A3(); - a1.a2_0.a3_0.a4_0 = new RC_Thread_15_A4(); - a1.a2_0.a3_0.a4_0.a1_0 = a1; - RC_Thread_15_A5 a5 = new RC_Thread_15_A5(); - a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_15_A6(); - a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; - a5.a3_0 = a1.a2_0.a3_0; - a1_main = a1; - a5_main = a5; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - RC_Thread_15_A1 a1 = new RC_Thread_15_A1(); - a1.a2_0 = new RC_Thread_15_A2(); - a1.a2_0.a3_0 = new RC_Thread_15_A3(); - a1.a2_0.a3_0.a4_0 = new RC_Thread_15_A4(); - a1.a2_0.a3_0.a4_0.a1_0 = a1; - RC_Thread_15_A5 a5 = new RC_Thread_15_A5(); - a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_15_A6(); - a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; - a5.a3_0 = a1.a2_0.a3_0; - a1 = null; - a5 = null; - Runtime.getRuntime().gc(); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_15_1 t1 = new RC_Thread_15_1(); - RC_Thread_15_2 t2 = new RC_Thread_15_2(); - RC_Thread_15_3 t3 = new RC_Thread_15_3(); - t1.start(); - t2.start(); - t3.start(); - try { - t1.join(); - t2.join(); - t3.join(); - } catch (InterruptedException e) { - } - } - - public void ModifyA1() { - a1_main.a2_0.a3_0 = null; - a1_main = null; - } - - public void checkA4() { - try { - int[] arr = new int[2]; - arr[0] = a5_main.a3_0.a4_0.sum; - arr[1] = a5_main.a3_0.a4_0.a; - } catch (NullPointerException e) { - - } - } - - public void setA5() { - RC_Thread_15_A5 a5 = new RC_Thread_15_A5(); - a5 = this.a5_main; - a5_main = null; - } - - static class RC_Thread_15_A1 { - RC_Thread_15_A2 a2_0; - RC_Thread_15_A4 a4_0; - int a; - int sum; - - RC_Thread_15_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_15_A2 { - RC_Thread_15_A3 a3_0; - int a; - int sum; - - RC_Thread_15_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_15_A3 { - RC_Thread_15_A4 a4_0; - int a; - int sum; - - RC_Thread_15_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - - static class RC_Thread_15_A4 { - RC_Thread_15_A1 a1_0; - RC_Thread_15_A6 a6_0; - int a; - int sum; - - RC_Thread_15_A4() { - a1_0 = null; - a6_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - static class RC_Thread_15_A5 { - RC_Thread_15_A3 a3_0; - int a; - int sum; - - RC_Thread_15_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RC_Thread_15_A6 { - RC_Thread_15_A5 a5_0; - int a; - int sum; - - RC_Thread_15_A6() { - a5_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_15 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_15.java + *- @ExecuteClass: RC_Thread_15 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_15_1 extends Thread { + public void run() { + RC_Thread_15 rcth01 = new RC_Thread_15(); + try { + rcth01.ModifyA1(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_15_2 extends Thread { + public void run() { + RC_Thread_15 rcth01 = new RC_Thread_15(); + try { + rcth01.checkA4(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_15_3 extends Thread { + public void run() { + RC_Thread_15 rcth01 = new RC_Thread_15(); + try { + rcth01.setA5(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_15 { + private static RC_Thread_15_A1 a1_main = null; + private static RC_Thread_15_A5 a5_main = null; + + RC_Thread_15() { + try { + RC_Thread_15_A1 a1 = new RC_Thread_15_A1(); + a1.a2_0 = new RC_Thread_15_A2(); + a1.a2_0.a3_0 = new RC_Thread_15_A3(); + a1.a2_0.a3_0.a4_0 = new RC_Thread_15_A4(); + a1.a2_0.a3_0.a4_0.a1_0 = a1; + RC_Thread_15_A5 a5 = new RC_Thread_15_A5(); + a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_15_A6(); + a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; + a5.a3_0 = a1.a2_0.a3_0; + a1_main = a1; + a5_main = a5; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + RC_Thread_15_A1 a1 = new RC_Thread_15_A1(); + a1.a2_0 = new RC_Thread_15_A2(); + a1.a2_0.a3_0 = new RC_Thread_15_A3(); + a1.a2_0.a3_0.a4_0 = new RC_Thread_15_A4(); + a1.a2_0.a3_0.a4_0.a1_0 = a1; + RC_Thread_15_A5 a5 = new RC_Thread_15_A5(); + a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_15_A6(); + a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; + a5.a3_0 = a1.a2_0.a3_0; + a1 = null; + a5 = null; + Runtime.getRuntime().gc(); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_15_1 t1 = new RC_Thread_15_1(); + RC_Thread_15_2 t2 = new RC_Thread_15_2(); + RC_Thread_15_3 t3 = new RC_Thread_15_3(); + t1.start(); + t2.start(); + t3.start(); + try { + t1.join(); + t2.join(); + t3.join(); + } catch (InterruptedException e) { + } + } + + public void ModifyA1() { + a1_main.a2_0.a3_0 = null; + a1_main = null; + } + + public void checkA4() { + try { + int[] arr = new int[2]; + arr[0] = a5_main.a3_0.a4_0.sum; + arr[1] = a5_main.a3_0.a4_0.a; + } catch (NullPointerException e) { + + } + } + + public void setA5() { + RC_Thread_15_A5 a5 = new RC_Thread_15_A5(); + a5 = this.a5_main; + a5_main = null; + } + + static class RC_Thread_15_A1 { + RC_Thread_15_A2 a2_0; + RC_Thread_15_A4 a4_0; + int a; + int sum; + + RC_Thread_15_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_15_A2 { + RC_Thread_15_A3 a3_0; + int a; + int sum; + + RC_Thread_15_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_15_A3 { + RC_Thread_15_A4 a4_0; + int a; + int sum; + + RC_Thread_15_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + + static class RC_Thread_15_A4 { + RC_Thread_15_A1 a1_0; + RC_Thread_15_A6 a6_0; + int a; + int sum; + + RC_Thread_15_A4() { + a1_0 = null; + a6_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + static class RC_Thread_15_A5 { + RC_Thread_15_A3 a3_0; + int a; + int sum; + + RC_Thread_15_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RC_Thread_15_A6 { + RC_Thread_15_A5 a5_0; + int a; + int sum; + + RC_Thread_15_A6() { + a5_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0243-rc-function-RC_Thread02-RC_Thread_16/RC_Thread_16.java b/test/testsuite/ouroboros/memory_management/Function/RC0243-rc-function-RC_Thread02-RC_Thread_16/RC_Thread_16.java index 7afa6017c6d02d1d78fb764cce922a97ec0e55c5..d70bc1c3d80c5b3692a06b4f60930f7b48d48cdb 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0243-rc-function-RC_Thread02-RC_Thread_16/RC_Thread_16.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0243-rc-function-RC_Thread02-RC_Thread_16/RC_Thread_16.java @@ -1,295 +1,295 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_16 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_16.java - *- @ExecuteClass: RC_Thread_16 - *- @ExecuteArgs: - * - */ - -import java.lang.Runtime; - -class RC_Thread_16_1 extends Thread { - public void run() { - RC_Thread_16 rcth01 = new RC_Thread_16(); - try { - rcth01.ModifyA3(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_16_2 extends Thread { - public void run() { - RC_Thread_16 rcth01 = new RC_Thread_16(); - try { - rcth01.checkA3(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_16_3 extends Thread { - public void run() { - RC_Thread_16 rcth01 = new RC_Thread_16(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_16 { - private static RC_Thread_16_A1 a1_main = null; - private static RC_Thread_16_A4 a4_main = null; - private static RC_Thread_16_A6 a6_main = null; - - RC_Thread_16() { - try { - RC_Thread_16_A1 a1 = new RC_Thread_16_A1("a1"); - RC_Thread_16_A4 a4 = new RC_Thread_16_A4("a4"); - RC_Thread_16_A6 a6 = new RC_Thread_16_A6("a6"); - a1.a2_0 = new RC_Thread_16_A2("a2_0"); - a1.a2_0.a3_0 = new RC_Thread_16_A3("a3_0"); - a1.a2_0.a3_0.a1_0 = a1; - a1.a2_0.a3_0.a5_0 = new RC_Thread_16_A5("a5_0"); - a1.a2_0.a3_0.a5_0.a6_0 = a6; - a6.a1_0 = a1; - a6.a3_0 = a1.a2_0.a3_0; - a4.a5_0 = a1.a2_0.a3_0.a5_0; - a6.a4_0 = a4; - a1_main = a1; - a4_main = a4; - a6_main = a6; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - RC_Thread_16_A1 a1 = new RC_Thread_16_A1("a1"); - RC_Thread_16_A4 a4 = new RC_Thread_16_A4("a4"); - RC_Thread_16_A6 a6 = new RC_Thread_16_A6("a6"); - a1.a2_0 = new RC_Thread_16_A2("a2_0"); - a1.a2_0.a3_0 = new RC_Thread_16_A3("a3_0"); - a1.a2_0.a3_0.a1_0 = a1; - a1.a2_0.a3_0.a5_0 = new RC_Thread_16_A5("a5_0"); - a1.a2_0.a3_0.a5_0.a6_0 = a6; - a6.a1_0 = a1; - a6.a3_0 = a1.a2_0.a3_0; - a4.a5_0 = a1.a2_0.a3_0.a5_0; - a6.a4_0 = a4; - a1 = null; - a4 = null; - a6 = null; - Runtime.getRuntime().gc(); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_16_1 t_00010 = new RC_Thread_16_1(); - RC_Thread_16_2 t_00020 = new RC_Thread_16_2(); - RC_Thread_16_3 t_00030 = new RC_Thread_16_3(); - t_00010.start(); - t_00020.start(); - t_00030.start(); - try { - t_00010.join(); - t_00020.join(); - t_00030.join(); - - } catch (InterruptedException e) { - } - - } - - public void checkA3() { - int[] arr = new int[2]; - try { - arr[0] = a1_main.a2_0.a3_0.a; - arr[1] = a1_main.a2_0.a3_0.sum; - } catch (NullPointerException e) { - - } - } - - public void ModifyA3() { - try { - a1_main.a2_0.a3_0 = new RC_Thread_16_A3("new-a3"); - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - RC_Thread_16_A3 a3 = new RC_Thread_16_A3("test"); - try { - a3 = this.a1_main.a2_0.a3_0; - this.a1_main.a2_0.a3_0 = null; - } catch (NullPointerException e) { - - } - - } - - static class RC_Thread_16_A1 { - RC_Thread_16_A2 a2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_16_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - static class RC_Thread_16_A2 { - RC_Thread_16_A3 a3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_16_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RC_Thread_16_A3 { - RC_Thread_16_A1 a1_0; - RC_Thread_16_A5 a5_0; - int a; - int sum; - String strObjectName; - - RC_Thread_16_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - - static class RC_Thread_16_A4 { - RC_Thread_16_A5 a5_0; - int a; - int sum; - String strObjectName; - - RC_Thread_16_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - static class RC_Thread_16_A5 { - RC_Thread_16_A6 a6_0; - int a; - int sum; - String strObjectName; - - RC_Thread_16_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - static class RC_Thread_16_A6 { - RC_Thread_16_A1 a1_0; - RC_Thread_16_A3 a3_0; - RC_Thread_16_A4 a4_0; - int a; - int sum; - String strObjectName; - - RC_Thread_16_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_16 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_16.java + *- @ExecuteClass: RC_Thread_16 + *- @ExecuteArgs: + * + */ + +import java.lang.Runtime; + +class RC_Thread_16_1 extends Thread { + public void run() { + RC_Thread_16 rcth01 = new RC_Thread_16(); + try { + rcth01.ModifyA3(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_16_2 extends Thread { + public void run() { + RC_Thread_16 rcth01 = new RC_Thread_16(); + try { + rcth01.checkA3(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_16_3 extends Thread { + public void run() { + RC_Thread_16 rcth01 = new RC_Thread_16(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_16 { + private static RC_Thread_16_A1 a1_main = null; + private static RC_Thread_16_A4 a4_main = null; + private static RC_Thread_16_A6 a6_main = null; + + RC_Thread_16() { + try { + RC_Thread_16_A1 a1 = new RC_Thread_16_A1("a1"); + RC_Thread_16_A4 a4 = new RC_Thread_16_A4("a4"); + RC_Thread_16_A6 a6 = new RC_Thread_16_A6("a6"); + a1.a2_0 = new RC_Thread_16_A2("a2_0"); + a1.a2_0.a3_0 = new RC_Thread_16_A3("a3_0"); + a1.a2_0.a3_0.a1_0 = a1; + a1.a2_0.a3_0.a5_0 = new RC_Thread_16_A5("a5_0"); + a1.a2_0.a3_0.a5_0.a6_0 = a6; + a6.a1_0 = a1; + a6.a3_0 = a1.a2_0.a3_0; + a4.a5_0 = a1.a2_0.a3_0.a5_0; + a6.a4_0 = a4; + a1_main = a1; + a4_main = a4; + a6_main = a6; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + RC_Thread_16_A1 a1 = new RC_Thread_16_A1("a1"); + RC_Thread_16_A4 a4 = new RC_Thread_16_A4("a4"); + RC_Thread_16_A6 a6 = new RC_Thread_16_A6("a6"); + a1.a2_0 = new RC_Thread_16_A2("a2_0"); + a1.a2_0.a3_0 = new RC_Thread_16_A3("a3_0"); + a1.a2_0.a3_0.a1_0 = a1; + a1.a2_0.a3_0.a5_0 = new RC_Thread_16_A5("a5_0"); + a1.a2_0.a3_0.a5_0.a6_0 = a6; + a6.a1_0 = a1; + a6.a3_0 = a1.a2_0.a3_0; + a4.a5_0 = a1.a2_0.a3_0.a5_0; + a6.a4_0 = a4; + a1 = null; + a4 = null; + a6 = null; + Runtime.getRuntime().gc(); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_16_1 t_00010 = new RC_Thread_16_1(); + RC_Thread_16_2 t_00020 = new RC_Thread_16_2(); + RC_Thread_16_3 t_00030 = new RC_Thread_16_3(); + t_00010.start(); + t_00020.start(); + t_00030.start(); + try { + t_00010.join(); + t_00020.join(); + t_00030.join(); + + } catch (InterruptedException e) { + } + + } + + public void checkA3() { + int[] arr = new int[2]; + try { + arr[0] = a1_main.a2_0.a3_0.a; + arr[1] = a1_main.a2_0.a3_0.sum; + } catch (NullPointerException e) { + + } + } + + public void ModifyA3() { + try { + a1_main.a2_0.a3_0 = new RC_Thread_16_A3("new-a3"); + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + RC_Thread_16_A3 a3 = new RC_Thread_16_A3("test"); + try { + a3 = this.a1_main.a2_0.a3_0; + this.a1_main.a2_0.a3_0 = null; + } catch (NullPointerException e) { + + } + + } + + static class RC_Thread_16_A1 { + RC_Thread_16_A2 a2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_16_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + static class RC_Thread_16_A2 { + RC_Thread_16_A3 a3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_16_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RC_Thread_16_A3 { + RC_Thread_16_A1 a1_0; + RC_Thread_16_A5 a5_0; + int a; + int sum; + String strObjectName; + + RC_Thread_16_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + + static class RC_Thread_16_A4 { + RC_Thread_16_A5 a5_0; + int a; + int sum; + String strObjectName; + + RC_Thread_16_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + static class RC_Thread_16_A5 { + RC_Thread_16_A6 a6_0; + int a; + int sum; + String strObjectName; + + RC_Thread_16_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + static class RC_Thread_16_A6 { + RC_Thread_16_A1 a1_0; + RC_Thread_16_A3 a3_0; + RC_Thread_16_A4 a4_0; + int a; + int sum; + String strObjectName; + + RC_Thread_16_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0244-rc-function-RC_Thread02-RC_Thread_17/RC_Thread_17.java b/test/testsuite/ouroboros/memory_management/Function/RC0244-rc-function-RC_Thread02-RC_Thread_17/RC_Thread_17.java index ec083a752720b797778cc85bfa734bb36f6fc7bb..aae63124fe486fa7a1fb93ac31ac6cb868104484 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0244-rc-function-RC_Thread02-RC_Thread_17/RC_Thread_17.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0244-rc-function-RC_Thread02-RC_Thread_17/RC_Thread_17.java @@ -1,233 +1,233 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_17 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_17.java - *- @ExecuteClass: RC_Thread_17 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_17_1 extends Thread { - public void run() { - RC_Thread_17 rcth01 = new RC_Thread_17(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_17_2 extends Thread { - public void run() { - RC_Thread_17 rcth01 = new RC_Thread_17(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_17_3 extends Thread { - public void run() { - RC_Thread_17 rcth01 = new RC_Thread_17(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_17 { - private static RC_Thread_17_A1 a1_main = null; - private static RC_Thread_17_A4 a4_main = null; - private static RC_Thread_17_A5 a5_main = null; - private static RC_Thread_17_A2 a2 = null; - - RC_Thread_17() { - try { - a1_main = new RC_Thread_17_A1(); - a2 = new RC_Thread_17_A2(); - a1_main.a2_0 = a2; - a1_main.a2_0.a3_0 = new RC_Thread_17_A3(); - a4_main = new RC_Thread_17_A4(); - a5_main = new RC_Thread_17_A5(); - a4_main.a1_0 = a1_main; - a5_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - a1_main = new RC_Thread_17_A1(); - a2 = new RC_Thread_17_A2(); - a1_main.a2_0 = a2; - a1_main.a2_0.a3_0 = new RC_Thread_17_A3(); - a4_main = new RC_Thread_17_A4(); - a5_main = new RC_Thread_17_A5(); - a4_main.a1_0 = a1_main; - a5_main.a1_0 = a1_main; - a1_main.a2_0.a3_0.a1_0 = a1_main; - a1_main = null; - a4_main = null; - a2 = null; - a5_main = null; - Runtime.getRuntime().gc(); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_17_1 t1 = new RC_Thread_17_1(); - RC_Thread_17_2 t2 = new RC_Thread_17_2(); - RC_Thread_17_3 t3 = new RC_Thread_17_3(); - t1.start(); - t2.start(); - t3.start(); - try { - t1.join(); - t2.join(); - t3.join(); - - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - a4_main = null; - } - - public void setA5null() { - a5_main = null; - } - - static class RC_Thread_17_A1 { - RC_Thread_17_A2 a2_0; - int a; - int sum; - - RC_Thread_17_A1() { - a2_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_17_A2 { - RC_Thread_17_A3 a3_0; - int a; - int sum; - - RC_Thread_17_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_17_A3 { - RC_Thread_17_A1 a1_0; - int a; - int sum; - - RC_Thread_17_A3() { - a1_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - static class RC_Thread_17_A4 { - RC_Thread_17_A1 a1_0; - int a; - int sum; - - RC_Thread_17_A4() { - a1_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - - - static class RC_Thread_17_A5 { - RC_Thread_17_A1 a1_0; - int a; - int sum; - - RC_Thread_17_A5() { - a1_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a1_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_17 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_1_00180 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_17.java + *- @ExecuteClass: RC_Thread_17 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_17_1 extends Thread { + public void run() { + RC_Thread_17 rcth01 = new RC_Thread_17(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_17_2 extends Thread { + public void run() { + RC_Thread_17 rcth01 = new RC_Thread_17(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_17_3 extends Thread { + public void run() { + RC_Thread_17 rcth01 = new RC_Thread_17(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_17 { + private static RC_Thread_17_A1 a1_main = null; + private static RC_Thread_17_A4 a4_main = null; + private static RC_Thread_17_A5 a5_main = null; + private static RC_Thread_17_A2 a2 = null; + + RC_Thread_17() { + try { + a1_main = new RC_Thread_17_A1(); + a2 = new RC_Thread_17_A2(); + a1_main.a2_0 = a2; + a1_main.a2_0.a3_0 = new RC_Thread_17_A3(); + a4_main = new RC_Thread_17_A4(); + a5_main = new RC_Thread_17_A5(); + a4_main.a1_0 = a1_main; + a5_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + a1_main = new RC_Thread_17_A1(); + a2 = new RC_Thread_17_A2(); + a1_main.a2_0 = a2; + a1_main.a2_0.a3_0 = new RC_Thread_17_A3(); + a4_main = new RC_Thread_17_A4(); + a5_main = new RC_Thread_17_A5(); + a4_main.a1_0 = a1_main; + a5_main.a1_0 = a1_main; + a1_main.a2_0.a3_0.a1_0 = a1_main; + a1_main = null; + a4_main = null; + a2 = null; + a5_main = null; + Runtime.getRuntime().gc(); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_17_1 t1 = new RC_Thread_17_1(); + RC_Thread_17_2 t2 = new RC_Thread_17_2(); + RC_Thread_17_3 t3 = new RC_Thread_17_3(); + t1.start(); + t2.start(); + t3.start(); + try { + t1.join(); + t2.join(); + t3.join(); + + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + a4_main = null; + } + + public void setA5null() { + a5_main = null; + } + + static class RC_Thread_17_A1 { + RC_Thread_17_A2 a2_0; + int a; + int sum; + + RC_Thread_17_A1() { + a2_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_17_A2 { + RC_Thread_17_A3 a3_0; + int a; + int sum; + + RC_Thread_17_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_17_A3 { + RC_Thread_17_A1 a1_0; + int a; + int sum; + + RC_Thread_17_A3() { + a1_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + static class RC_Thread_17_A4 { + RC_Thread_17_A1 a1_0; + int a; + int sum; + + RC_Thread_17_A4() { + a1_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + + + static class RC_Thread_17_A5 { + RC_Thread_17_A1 a1_0; + int a; + int sum; + + RC_Thread_17_A5() { + a1_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a1_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0245-rc-function-RC_Thread02-RC_Thread_18/RC_Thread_18.java b/test/testsuite/ouroboros/memory_management/Function/RC0245-rc-function-RC_Thread02-RC_Thread_18/RC_Thread_18.java index 18330b1ecb317ee3aebc12a8d0a5ceccf5f014f0..606ae69838262dfc4d7848246ab70c7c94e3f4c0 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0245-rc-function-RC_Thread02-RC_Thread_18/RC_Thread_18.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0245-rc-function-RC_Thread02-RC_Thread_18/RC_Thread_18.java @@ -1,300 +1,300 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_18.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_18.java - *- @ExecuteClass: RC_Thread_18 - *- @ExecuteArgs: - * - */ - -import java.lang.Runtime; - -class RC_Thread_18_1 extends Thread { - public void run() { - RC_Thread_18 rcth01 = new RC_Thread_18(); - try { - rcth01.ModifyA3(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_18_2 extends Thread { - public void run() { - RC_Thread_18 rcth01 = new RC_Thread_18(); - try { - rcth01.checkA3(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_18_3 extends Thread { - public void run() { - RC_Thread_18 rcth01 = new RC_Thread_18(); - try { - rcth01.setA3null(); - } catch (NullPointerException e) { - - } - - } -} - -public class RC_Thread_18 { - private volatile static RC_Thread_18_A1 a1_main = null; - private volatile static RC_Thread_18_A4 a4_main = null; - private volatile static RC_Thread_18_A6 a6_main = null; - private static RC_Thread_18_A2 a2 = null; - - RC_Thread_18() { - try { - RC_Thread_18_A1 a1 = new RC_Thread_18_A1("a1"); - RC_Thread_18_A4 a4 = new RC_Thread_18_A4("a4"); - RC_Thread_18_A6 a6 = new RC_Thread_18_A6("a6"); - a2 = new RC_Thread_18_A2("a2_0"); - a1.a2_0 = a2; - a1.a2_0.a3_0 = new RC_Thread_18_A3("a3_0"); - a1.a2_0.a3_0.a1_0 = a1; - a1.a2_0.a3_0.a5_0 = new RC_Thread_18_A5("a5_0"); - a1.a2_0.a3_0.a5_0.a6_0 = a6; - a6.a1_0 = a1; - a6.a3_0 = a1.a2_0.a3_0; - a4.a5_0 = a1.a2_0.a3_0.a5_0; - a6.a4_0 = a4; - a1_main = a1; - a4_main = a4; - a6_main = a6; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - - } - - private static void cycle_pattern_wrapper() { - RC_Thread_18_A1 a1 = new RC_Thread_18_A1("a1"); - RC_Thread_18_A4 a4 = new RC_Thread_18_A4("a4"); - RC_Thread_18_A6 a6 = new RC_Thread_18_A6("a6"); - a2 = new RC_Thread_18_A2("a2_0"); - a1.a2_0 = a2; - a1.a2_0.a3_0 = new RC_Thread_18_A3("a3_0"); - a1.a2_0.a3_0.a1_0 = a1; - a1.a2_0.a3_0.a5_0 = new RC_Thread_18_A5("a5_0"); - a1.a2_0.a3_0.a5_0.a6_0 = a6; - a6.a1_0 = a1; - a6.a3_0 = a1.a2_0.a3_0; - a4.a5_0 = a1.a2_0.a3_0.a5_0; - a6.a4_0 = a4; - a1 = null; - a2 = null; - a4 = null; - a6 = null; - Runtime.getRuntime().gc(); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_18_1 t_00010 = new RC_Thread_18_1(); - RC_Thread_18_2 t_00020 = new RC_Thread_18_2(); - RC_Thread_18_3 t_00030 = new RC_Thread_18_3(); - t_00010.start(); - t_00020.start(); - t_00030.start(); - try { - t_00010.join(); - t_00020.join(); - t_00030.join(); - - } catch (InterruptedException e) { - } - - } - - public void checkA3() { - int[] arr = new int[2]; - try { - arr[0] = a1_main.a2_0.a3_0.a; - arr[1] = a1_main.a2_0.a3_0.sum; - } catch (NullPointerException e) { - - } - } - - public void ModifyA3() { - try { - a1_main.a2_0.a3_0 = new RC_Thread_18_A3("new-a3"); - } catch (NullPointerException e) { - - } - } - - public void setA3null() { - RC_Thread_18_A3 a3 = new RC_Thread_18_A3("test"); - try { - a3 = this.a1_main.a2_0.a3_0; - this.a1_main.a2_0.a3_0 = null; - } catch (NullPointerException e) { - - } - - } - - static class RC_Thread_18_A1 { - volatile RC_Thread_18_A2 a2_0; - int a; - int sum; - String strObjectName; - - RC_Thread_18_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a; - } - } - - static class RC_Thread_18_A2 { - volatile RC_Thread_18_A3 a3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_18_A2(String strObjectName) { - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RC_Thread_18_A3 { - volatile RC_Thread_18_A1 a1_0; - volatile RC_Thread_18_A5 a5_0; - int a; - int sum; - String strObjectName; - - RC_Thread_18_A3(String strObjectName) { - a1_0 = null; - a5_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a5_0.a; - } - } - - - static class RC_Thread_18_A4 { - volatile RC_Thread_18_A5 a5_0; - int a; - int sum; - String strObjectName; - - RC_Thread_18_A4(String strObjectName) { - a5_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + a5_0.a; - } - } - - static class RC_Thread_18_A5 { - volatile RC_Thread_18_A6 a6_0; - int a; - int sum; - String strObjectName; - - RC_Thread_18_A5(String strObjectName) { - a6_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + a6_0.a; - } - } - - static class RC_Thread_18_A6 { - volatile RC_Thread_18_A1 a1_0; - volatile RC_Thread_18_A3 a3_0; - volatile RC_Thread_18_A4 a4_0; - int a; - int sum; - String strObjectName; - - RC_Thread_18_A6(String strObjectName) { - a1_0 = null; - a3_0 = null; - a4_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + a1_0.a + a3_0.a + a4_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_18.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_a_00320 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_18.java + *- @ExecuteClass: RC_Thread_18 + *- @ExecuteArgs: + * + */ + +import java.lang.Runtime; + +class RC_Thread_18_1 extends Thread { + public void run() { + RC_Thread_18 rcth01 = new RC_Thread_18(); + try { + rcth01.ModifyA3(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_18_2 extends Thread { + public void run() { + RC_Thread_18 rcth01 = new RC_Thread_18(); + try { + rcth01.checkA3(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_18_3 extends Thread { + public void run() { + RC_Thread_18 rcth01 = new RC_Thread_18(); + try { + rcth01.setA3null(); + } catch (NullPointerException e) { + + } + + } +} + +public class RC_Thread_18 { + private volatile static RC_Thread_18_A1 a1_main = null; + private volatile static RC_Thread_18_A4 a4_main = null; + private volatile static RC_Thread_18_A6 a6_main = null; + private static RC_Thread_18_A2 a2 = null; + + RC_Thread_18() { + try { + RC_Thread_18_A1 a1 = new RC_Thread_18_A1("a1"); + RC_Thread_18_A4 a4 = new RC_Thread_18_A4("a4"); + RC_Thread_18_A6 a6 = new RC_Thread_18_A6("a6"); + a2 = new RC_Thread_18_A2("a2_0"); + a1.a2_0 = a2; + a1.a2_0.a3_0 = new RC_Thread_18_A3("a3_0"); + a1.a2_0.a3_0.a1_0 = a1; + a1.a2_0.a3_0.a5_0 = new RC_Thread_18_A5("a5_0"); + a1.a2_0.a3_0.a5_0.a6_0 = a6; + a6.a1_0 = a1; + a6.a3_0 = a1.a2_0.a3_0; + a4.a5_0 = a1.a2_0.a3_0.a5_0; + a6.a4_0 = a4; + a1_main = a1; + a4_main = a4; + a6_main = a6; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + + } + + private static void cycle_pattern_wrapper() { + RC_Thread_18_A1 a1 = new RC_Thread_18_A1("a1"); + RC_Thread_18_A4 a4 = new RC_Thread_18_A4("a4"); + RC_Thread_18_A6 a6 = new RC_Thread_18_A6("a6"); + a2 = new RC_Thread_18_A2("a2_0"); + a1.a2_0 = a2; + a1.a2_0.a3_0 = new RC_Thread_18_A3("a3_0"); + a1.a2_0.a3_0.a1_0 = a1; + a1.a2_0.a3_0.a5_0 = new RC_Thread_18_A5("a5_0"); + a1.a2_0.a3_0.a5_0.a6_0 = a6; + a6.a1_0 = a1; + a6.a3_0 = a1.a2_0.a3_0; + a4.a5_0 = a1.a2_0.a3_0.a5_0; + a6.a4_0 = a4; + a1 = null; + a2 = null; + a4 = null; + a6 = null; + Runtime.getRuntime().gc(); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_18_1 t_00010 = new RC_Thread_18_1(); + RC_Thread_18_2 t_00020 = new RC_Thread_18_2(); + RC_Thread_18_3 t_00030 = new RC_Thread_18_3(); + t_00010.start(); + t_00020.start(); + t_00030.start(); + try { + t_00010.join(); + t_00020.join(); + t_00030.join(); + + } catch (InterruptedException e) { + } + + } + + public void checkA3() { + int[] arr = new int[2]; + try { + arr[0] = a1_main.a2_0.a3_0.a; + arr[1] = a1_main.a2_0.a3_0.sum; + } catch (NullPointerException e) { + + } + } + + public void ModifyA3() { + try { + a1_main.a2_0.a3_0 = new RC_Thread_18_A3("new-a3"); + } catch (NullPointerException e) { + + } + } + + public void setA3null() { + RC_Thread_18_A3 a3 = new RC_Thread_18_A3("test"); + try { + a3 = this.a1_main.a2_0.a3_0; + this.a1_main.a2_0.a3_0 = null; + } catch (NullPointerException e) { + + } + + } + + static class RC_Thread_18_A1 { + volatile RC_Thread_18_A2 a2_0; + int a; + int sum; + String strObjectName; + + RC_Thread_18_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a; + } + } + + static class RC_Thread_18_A2 { + volatile RC_Thread_18_A3 a3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_18_A2(String strObjectName) { + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RC_Thread_18_A3 { + volatile RC_Thread_18_A1 a1_0; + volatile RC_Thread_18_A5 a5_0; + int a; + int sum; + String strObjectName; + + RC_Thread_18_A3(String strObjectName) { + a1_0 = null; + a5_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a5_0.a; + } + } + + + static class RC_Thread_18_A4 { + volatile RC_Thread_18_A5 a5_0; + int a; + int sum; + String strObjectName; + + RC_Thread_18_A4(String strObjectName) { + a5_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + a5_0.a; + } + } + + static class RC_Thread_18_A5 { + volatile RC_Thread_18_A6 a6_0; + int a; + int sum; + String strObjectName; + + RC_Thread_18_A5(String strObjectName) { + a6_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + a6_0.a; + } + } + + static class RC_Thread_18_A6 { + volatile RC_Thread_18_A1 a1_0; + volatile RC_Thread_18_A3 a3_0; + volatile RC_Thread_18_A4 a4_0; + int a; + int sum; + String strObjectName; + + RC_Thread_18_A6(String strObjectName) { + a1_0 = null; + a3_0 = null; + a4_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + a1_0.a + a3_0.a + a4_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0246-rc-function-RC_Thread02-RC_Thread_19/RC_Thread_19.java b/test/testsuite/ouroboros/memory_management/Function/RC0246-rc-function-RC_Thread02-RC_Thread_19/RC_Thread_19.java index 8851adc7551358ba6a7028b01f3078571146b425..ec7eb7eacf9af0fdee31de6b74acad7752da07ce 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0246-rc-function-RC_Thread02-RC_Thread_19/RC_Thread_19.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0246-rc-function-RC_Thread02-RC_Thread_19/RC_Thread_19.java @@ -1,305 +1,305 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_19 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00050 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_19.java - *- @ExecuteClass: RC_Thread_19 - *- @ExecuteArgs: - - * - */ -class RC_Thread_19_1 extends Thread { - public void run() { - RC_Thread_19 rcth01 = new RC_Thread_19("rcth01"); - try { - rcth01.addSum(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_19_2 extends Thread { - public void run() { - RC_Thread_19 rcth01 = new RC_Thread_19("rcth01"); - try { - rcth01.ModifyB4(); - } catch (NullPointerException e) { - - } - } -} - -class RC_Thread_19_3 extends Thread { - public void run() { - RC_Thread_19 rcth01 = new RC_Thread_19("rcth01"); - try { - rcth01.deleteA1(); - } catch (NullPointerException e) { - - } - - } -} - -class RC_Thread_19_4 extends Thread { - public void run() { - RC_Thread_19 rcth01 = new RC_Thread_19("rcth01"); - try { - rcth01.setA1(null); - } catch (NullPointerException e) { - - } - } -} - - -public class RC_Thread_19 { - private static RC_Thread_19_A1 a1 = null; - private volatile static RC_Thread_19_B4 b4; - - RC_Thread_19(String str) { - try { - a1 = new RC_Thread_19_A1("a1"); - a1.b1_0 = new RC_Thread_19_B1("b1_0"); - a1.b1_0.c1_0 = new RC_Thread_19_C1("c1_0"); - a1.b1_0.c2_0 = new RC_Thread_19_C2("c2_0"); - a1.b1_0.c3_0 = new RC_Thread_19_C3("c3_0"); - a1.b2_0 = new RC_Thread_19_B2("b2_0"); - a1.b3_0 = new RC_Thread_19_B3("b3_0"); - b4 = new RC_Thread_19_B4("b4_0"); - a1.b4_0 = b4; - } catch (NullPointerException e) { - - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - System.out.println("ExpectResult"); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_19_1 t1 = new RC_Thread_19_1(); - RC_Thread_19_2 t2 = new RC_Thread_19_2(); - RC_Thread_19_3 t3 = new RC_Thread_19_3(); - RC_Thread_19_4 t4 = new RC_Thread_19_4(); - t1.start(); - t2.start(); - t3.start(); - t4.start(); - try { - t1.join(); - t2.join(); - t3.join(); - t4.join(); - - } catch (InterruptedException e) { - } - } - - public void deleteA1() { - a1 = null; - } - - public void ModifyB4() { - try { - a1.b4_0 = new RC_Thread_19_B4("new_b4"); - } catch (NullPointerException e) { - - } - } - - public void addSum() { - try { - a1.add(); - a1.b1_0.add(); - a1.b2_0.add(); - a1.b3_0.add(); - a1.b4_0.add(); - a1.b1_0.c1_0.add(); - a1.b1_0.c2_0.add(); - a1.b1_0.c3_0.add(); - } catch (NullPointerException e) { - - } - } - - public void setA1(RC_Thread_19_A1 a1) { - this.a1 = a1; - } - - class RC_Thread_19_A1 { - RC_Thread_19_B1 b1_0; - RC_Thread_19_B2 b2_0; - RC_Thread_19_B3 b3_0; - RC_Thread_19_B4 b4_0; - int a; - int sum; - String strObjectName; - - RC_Thread_19_A1(String strObjectName) { - b1_0 = null; - b2_0 = null; - b3_0 = null; - b4_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; - } - } - - class RC_Thread_19_B1 { - RC_Thread_19_C1 c1_0; - RC_Thread_19_C2 c2_0; - RC_Thread_19_C3 c3_0; - int a; - int sum; - String strObjectName; - - RC_Thread_19_B1(String strObjectName) { - c1_0 = null; - c2_0 = null; - c3_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + c2_0.a + c3_0.a; - } - } - - class RC_Thread_19_B2 { - int a; - int sum; - String strObjectName; - - RC_Thread_19_B2(String strObjectName) { - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - - class RC_Thread_19_B3 { - int a; - int sum; - String strObjectName; - - RC_Thread_19_B3(String strObjectName) { - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_19_B4 { - int a; - int sum; - String strObjectName; - - RC_Thread_19_B4(String strObjectName) { - a = 204; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B4_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_19_C1 { - int a; - int sum; - String strObjectName; - - RC_Thread_19_C1(String strObjectName) { - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_19_C2 { - int a; - int sum; - String strObjectName; - - RC_Thread_19_C2(String strObjectName) { - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + a; - } - } - - class RC_Thread_19_C3 { - int a; - int sum; - String strObjectName; - - RC_Thread_19_C3(String strObjectName) { - a = 303; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C3_"+strObjectName); - } - - void add() { - sum = a + a; - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_19 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Nocycle_a_00050 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_19.java + *- @ExecuteClass: RC_Thread_19 + *- @ExecuteArgs: + + * + */ +class RC_Thread_19_1 extends Thread { + public void run() { + RC_Thread_19 rcth01 = new RC_Thread_19("rcth01"); + try { + rcth01.addSum(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_19_2 extends Thread { + public void run() { + RC_Thread_19 rcth01 = new RC_Thread_19("rcth01"); + try { + rcth01.ModifyB4(); + } catch (NullPointerException e) { + + } + } +} + +class RC_Thread_19_3 extends Thread { + public void run() { + RC_Thread_19 rcth01 = new RC_Thread_19("rcth01"); + try { + rcth01.deleteA1(); + } catch (NullPointerException e) { + + } + + } +} + +class RC_Thread_19_4 extends Thread { + public void run() { + RC_Thread_19 rcth01 = new RC_Thread_19("rcth01"); + try { + rcth01.setA1(null); + } catch (NullPointerException e) { + + } + } +} + + +public class RC_Thread_19 { + private static RC_Thread_19_A1 a1 = null; + private volatile static RC_Thread_19_B4 b4; + + RC_Thread_19(String str) { + try { + a1 = new RC_Thread_19_A1("a1"); + a1.b1_0 = new RC_Thread_19_B1("b1_0"); + a1.b1_0.c1_0 = new RC_Thread_19_C1("c1_0"); + a1.b1_0.c2_0 = new RC_Thread_19_C2("c2_0"); + a1.b1_0.c3_0 = new RC_Thread_19_C3("c3_0"); + a1.b2_0 = new RC_Thread_19_B2("b2_0"); + a1.b3_0 = new RC_Thread_19_B3("b3_0"); + b4 = new RC_Thread_19_B4("b4_0"); + a1.b4_0 = b4; + } catch (NullPointerException e) { + + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + System.out.println("ExpectResult"); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_19_1 t1 = new RC_Thread_19_1(); + RC_Thread_19_2 t2 = new RC_Thread_19_2(); + RC_Thread_19_3 t3 = new RC_Thread_19_3(); + RC_Thread_19_4 t4 = new RC_Thread_19_4(); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + try { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + + } catch (InterruptedException e) { + } + } + + public void deleteA1() { + a1 = null; + } + + public void ModifyB4() { + try { + a1.b4_0 = new RC_Thread_19_B4("new_b4"); + } catch (NullPointerException e) { + + } + } + + public void addSum() { + try { + a1.add(); + a1.b1_0.add(); + a1.b2_0.add(); + a1.b3_0.add(); + a1.b4_0.add(); + a1.b1_0.c1_0.add(); + a1.b1_0.c2_0.add(); + a1.b1_0.c3_0.add(); + } catch (NullPointerException e) { + + } + } + + public void setA1(RC_Thread_19_A1 a1) { + this.a1 = a1; + } + + class RC_Thread_19_A1 { + RC_Thread_19_B1 b1_0; + RC_Thread_19_B2 b2_0; + RC_Thread_19_B3 b3_0; + RC_Thread_19_B4 b4_0; + int a; + int sum; + String strObjectName; + + RC_Thread_19_A1(String strObjectName) { + b1_0 = null; + b2_0 = null; + b3_0 = null; + b4_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + b2_0.a + b3_0.a + b4_0.a; + } + } + + class RC_Thread_19_B1 { + RC_Thread_19_C1 c1_0; + RC_Thread_19_C2 c2_0; + RC_Thread_19_C3 c3_0; + int a; + int sum; + String strObjectName; + + RC_Thread_19_B1(String strObjectName) { + c1_0 = null; + c2_0 = null; + c3_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + c2_0.a + c3_0.a; + } + } + + class RC_Thread_19_B2 { + int a; + int sum; + String strObjectName; + + RC_Thread_19_B2(String strObjectName) { + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + + class RC_Thread_19_B3 { + int a; + int sum; + String strObjectName; + + RC_Thread_19_B3(String strObjectName) { + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_19_B4 { + int a; + int sum; + String strObjectName; + + RC_Thread_19_B4(String strObjectName) { + a = 204; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B4_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_19_C1 { + int a; + int sum; + String strObjectName; + + RC_Thread_19_C1(String strObjectName) { + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_19_C2 { + int a; + int sum; + String strObjectName; + + RC_Thread_19_C2(String strObjectName) { + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + a; + } + } + + class RC_Thread_19_C3 { + int a; + int sum; + String strObjectName; + + RC_Thread_19_C3(String strObjectName) { + a = 303; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C3_"+strObjectName); + } + + void add() { + sum = a + a; + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0247-rc-function-RC_Thread02-RC_Thread_20/RC_Thread_20.java b/test/testsuite/ouroboros/memory_management/Function/RC0247-rc-function-RC_Thread02-RC_Thread_20/RC_Thread_20.java index 2aedd9713f7bdbf51d6b645a893793c3e3353d94..845ee92edcedd8aa259fe1cb9b885b37c8cbd54f 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0247-rc-function-RC_Thread02-RC_Thread_20/RC_Thread_20.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0247-rc-function-RC_Thread02-RC_Thread_20/RC_Thread_20.java @@ -1,259 +1,259 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_20 - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Thread_20.java - *- @ExecuteClass: RC_Thread_20 - *- @ExecuteArgs: - - * - */ - -import java.lang.Runtime; - -class RC_Thread_20_1 extends Thread { - public void run() { - RC_Thread_20 rcth01 = new RC_Thread_20(); - try { - rcth01.setA1null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - } -} - -class RC_Thread_20_2 extends Thread { - public void run() { - RC_Thread_20 rcth01 = new RC_Thread_20(); - try { - rcth01.setA4null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - } -} - -class RC_Thread_20_3 extends Thread { - public void run() { - RC_Thread_20 rcth01 = new RC_Thread_20(); - try { - rcth01.setA5null(); - } catch (NullPointerException e) { - e.printStackTrace(); - } - - } -} - -public class RC_Thread_20 { - private static RC_Thread_20_A1 a1_main = null; - private static RC_Thread_20_A5 a5_main = null; - private static RC_Thread_20_A4 a4; - - RC_Thread_20() { - try { - RC_Thread_20_A1 a1 = new RC_Thread_20_A1(); - a1.a2_0 = new RC_Thread_20_A2(); - a1.a2_0.a3_0 = new RC_Thread_20_A3(); - RC_Thread_20_A4 a4_temp = new RC_Thread_20_A4(); - a1.a2_0.a3_0.a4_0 = a4_temp; - a1.a2_0.a3_0.a4_0.a1_0 = a1; - RC_Thread_20_A5 a5 = new RC_Thread_20_A5(); - a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_20_A6(); - a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; - a5.a3_0 = a1.a2_0.a3_0; - a1_main = a1; - a4 = a4_temp; - a5_main = a5; - } catch (NullPointerException e) { - } - } - - public static void main(String[] args) { - cycle_pattern_wrapper(); - Runtime.getRuntime().gc(); - - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - Runtime.getRuntime().gc(); - rc_testcase_main_wrapper(); - - System.out.println("ExpectResult"); - } - - private static void cycle_pattern_wrapper() { - a1_main = new RC_Thread_20_A1(); - a1_main.a2_0 = new RC_Thread_20_A2(); - a1_main.a2_0.a3_0 = new RC_Thread_20_A3(); - a4 = new RC_Thread_20_A4(); - a1_main.a2_0.a3_0.a4_0 = a4; - a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; - a5_main = new RC_Thread_20_A5(); - a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_20_A6(); - a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; - a5_main.a3_0 = a1_main.a2_0.a3_0; - a1_main = null; - a4 = null; - a5_main = null; - Runtime.getRuntime().gc(); - } - - private static void rc_testcase_main_wrapper() { - RC_Thread_20_1 t1 = new RC_Thread_20_1(); - RC_Thread_20_2 t2 = new RC_Thread_20_2(); - RC_Thread_20_3 t3 = new RC_Thread_20_3(); - t1.start(); - t2.start(); - t3.start(); - try { - t1.join(); - t2.join(); - t3.join(); - } catch (InterruptedException e) { - } - } - - public void setA1null() { - a1_main = null; - } - - public void setA4null() { - try { - a1_main.a2_0.a3_0.a4_0 = null; - a5_main.a3_0.a4_0 = null; - } catch (NullPointerException e) { - } - } - - public void setA5null() { - a5_main = null; - } - - static class RC_Thread_20_A1 { - RC_Thread_20_A2 a2_0; - RC_Thread_20_A4 a4_0; - int a; - int sum; - - RC_Thread_20_A1() { - a2_0 = null; - a4_0 = null; - a = 1; - sum = 0; - } - - void add() { - sum = a + a2_0.a; - } - } - - - static class RC_Thread_20_A2 { - RC_Thread_20_A3 a3_0; - int a; - int sum; - - RC_Thread_20_A2() { - a3_0 = null; - a = 2; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - - static class RC_Thread_20_A3 { - RC_Thread_20_A4 a4_0; - int a; - int sum; - - RC_Thread_20_A3() { - a4_0 = null; - a = 3; - sum = 0; - } - - void add() { - sum = a + a4_0.a; - } - } - - - static class RC_Thread_20_A4 { - RC_Thread_20_A1 a1_0; - RC_Thread_20_A6 a6_0; - int a; - int sum; - - RC_Thread_20_A4() { - a1_0 = null; - a6_0 = null; - a = 4; - sum = 0; - } - - void add() { - sum = a + a1_0.a + a6_0.a; - } - } - - static class RC_Thread_20_A5 { - RC_Thread_20_A3 a3_0; - int a; - int sum; - - RC_Thread_20_A5() { - a3_0 = null; - a = 5; - sum = 0; - } - - void add() { - sum = a + a3_0.a; - } - } - - static class RC_Thread_20_A6 { - RC_Thread_20_A5 a5_0; - int a; - int sum; - - RC_Thread_20_A6() { - a5_0 = null; - a = 6; - sum = 0; - } - - void add() { - sum = a + a5_0.a; - } - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Thread02/RC_Thread_20 + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination:Multi Thread reads or writes static para.mofidfy from Cycle_B_2_00130 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Thread_20.java + *- @ExecuteClass: RC_Thread_20 + *- @ExecuteArgs: + + * + */ + +import java.lang.Runtime; + +class RC_Thread_20_1 extends Thread { + public void run() { + RC_Thread_20 rcth01 = new RC_Thread_20(); + try { + rcth01.setA1null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + } +} + +class RC_Thread_20_2 extends Thread { + public void run() { + RC_Thread_20 rcth01 = new RC_Thread_20(); + try { + rcth01.setA4null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + } +} + +class RC_Thread_20_3 extends Thread { + public void run() { + RC_Thread_20 rcth01 = new RC_Thread_20(); + try { + rcth01.setA5null(); + } catch (NullPointerException e) { + e.printStackTrace(); + } + + } +} + +public class RC_Thread_20 { + private static RC_Thread_20_A1 a1_main = null; + private static RC_Thread_20_A5 a5_main = null; + private static RC_Thread_20_A4 a4; + + RC_Thread_20() { + try { + RC_Thread_20_A1 a1 = new RC_Thread_20_A1(); + a1.a2_0 = new RC_Thread_20_A2(); + a1.a2_0.a3_0 = new RC_Thread_20_A3(); + RC_Thread_20_A4 a4_temp = new RC_Thread_20_A4(); + a1.a2_0.a3_0.a4_0 = a4_temp; + a1.a2_0.a3_0.a4_0.a1_0 = a1; + RC_Thread_20_A5 a5 = new RC_Thread_20_A5(); + a1.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_20_A6(); + a1.a2_0.a3_0.a4_0.a6_0.a5_0 = a5; + a5.a3_0 = a1.a2_0.a3_0; + a1_main = a1; + a4 = a4_temp; + a5_main = a5; + } catch (NullPointerException e) { + } + } + + public static void main(String[] args) { + cycle_pattern_wrapper(); + Runtime.getRuntime().gc(); + + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + Runtime.getRuntime().gc(); + rc_testcase_main_wrapper(); + + System.out.println("ExpectResult"); + } + + private static void cycle_pattern_wrapper() { + a1_main = new RC_Thread_20_A1(); + a1_main.a2_0 = new RC_Thread_20_A2(); + a1_main.a2_0.a3_0 = new RC_Thread_20_A3(); + a4 = new RC_Thread_20_A4(); + a1_main.a2_0.a3_0.a4_0 = a4; + a1_main.a2_0.a3_0.a4_0.a1_0 = a1_main; + a5_main = new RC_Thread_20_A5(); + a1_main.a2_0.a3_0.a4_0.a6_0 = new RC_Thread_20_A6(); + a1_main.a2_0.a3_0.a4_0.a6_0.a5_0 = a5_main; + a5_main.a3_0 = a1_main.a2_0.a3_0; + a1_main = null; + a4 = null; + a5_main = null; + Runtime.getRuntime().gc(); + } + + private static void rc_testcase_main_wrapper() { + RC_Thread_20_1 t1 = new RC_Thread_20_1(); + RC_Thread_20_2 t2 = new RC_Thread_20_2(); + RC_Thread_20_3 t3 = new RC_Thread_20_3(); + t1.start(); + t2.start(); + t3.start(); + try { + t1.join(); + t2.join(); + t3.join(); + } catch (InterruptedException e) { + } + } + + public void setA1null() { + a1_main = null; + } + + public void setA4null() { + try { + a1_main.a2_0.a3_0.a4_0 = null; + a5_main.a3_0.a4_0 = null; + } catch (NullPointerException e) { + } + } + + public void setA5null() { + a5_main = null; + } + + static class RC_Thread_20_A1 { + RC_Thread_20_A2 a2_0; + RC_Thread_20_A4 a4_0; + int a; + int sum; + + RC_Thread_20_A1() { + a2_0 = null; + a4_0 = null; + a = 1; + sum = 0; + } + + void add() { + sum = a + a2_0.a; + } + } + + + static class RC_Thread_20_A2 { + RC_Thread_20_A3 a3_0; + int a; + int sum; + + RC_Thread_20_A2() { + a3_0 = null; + a = 2; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + + static class RC_Thread_20_A3 { + RC_Thread_20_A4 a4_0; + int a; + int sum; + + RC_Thread_20_A3() { + a4_0 = null; + a = 3; + sum = 0; + } + + void add() { + sum = a + a4_0.a; + } + } + + + static class RC_Thread_20_A4 { + RC_Thread_20_A1 a1_0; + RC_Thread_20_A6 a6_0; + int a; + int sum; + + RC_Thread_20_A4() { + a1_0 = null; + a6_0 = null; + a = 4; + sum = 0; + } + + void add() { + sum = a + a1_0.a + a6_0.a; + } + } + + static class RC_Thread_20_A5 { + RC_Thread_20_A3 a3_0; + int a; + int sum; + + RC_Thread_20_A5() { + a3_0 = null; + a = 5; + sum = 0; + } + + void add() { + sum = a + a3_0.a; + } + } + + static class RC_Thread_20_A6 { + RC_Thread_20_A5 a5_0; + int a; + int sum; + + RC_Thread_20_A6() { + a5_0 = null; + a = 6; + sum = 0; + } + + void add() { + sum = a + a5_0.a; + } + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0248-rc-function-RC_Finalize_02/RC_Finalize_02.java b/test/testsuite/ouroboros/memory_management/Function/RC0248-rc-function-RC_Finalize_02/RC_Finalize_02.java index 40f044418f974628bdab0989f78af5fb683a0ab2..1bbaddbff0387492c8786464bf5dcee20bd3dabe 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0248-rc-function-RC_Finalize_02/RC_Finalize_02.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0248-rc-function-RC_Finalize_02/RC_Finalize_02.java @@ -1,47 +1,47 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_Finalize_02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: test Finalizer for RC . - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_Finalize_02.java - *- @ExecuteClass: RC_Finalize_02 - *- @ExecuteArgs: - */ - -import java.io.PrintStream; - -public class RC_Finalize_02 { - - public void finalize() { - System.out.println("ExpectResult"); - } - - public static int run(String argv[], PrintStream out) { - return 0; - } - - public static void main(String argv[]) { - - System.runFinalizersOnExit(true); - RC_Finalize_02 testClass = new RC_Finalize_02(); - } -} // end RC_Finalize_02 - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_Finalize_02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: test Finalizer for RC . + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_Finalize_02.java + *- @ExecuteClass: RC_Finalize_02 + *- @ExecuteArgs: + */ + +import java.io.PrintStream; + +public class RC_Finalize_02 { + + public void finalize() { + System.out.println("ExpectResult"); + } + + public static int run(String argv[], PrintStream out) { + return 0; + } + + public static void main(String argv[]) { + + System.runFinalizersOnExit(true); + RC_Finalize_02 testClass = new RC_Finalize_02(); + } +} // end RC_Finalize_02 + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0250-rc-function-ROSAlloc-Alloc_11_15x8B/Alloc_11_15x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0250-rc-function-ROSAlloc-Alloc_11_15x8B/Alloc_11_15x8B.java index 9fdf0cad9a148f2fcab284e1d7cf1049ea4a66f5..4a389257bac1b98082e2e5629b0a568b1a190c68 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0250-rc-function-ROSAlloc-Alloc_11_15x8B/Alloc_11_15x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0250-rc-function-ROSAlloc-Alloc_11_15x8B/Alloc_11_15x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_11_15x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 11*8B to 15*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_11_15x8B.java - *- @ExecuteClass: Alloc_11_15x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_11_15x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_11_8B = 11 * 8; - private final static int MAX_12_8B = 12 * 8; - private final static int MAX_13_8B = 13 * 8; - private final static int MAX_14_8B = 14 * 8; - private final static int MAX_15_8B = 15 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 2 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize11 = alloc_test(MAX_11_8B); - int countSize12 = alloc_test(MAX_12_8B); - int countSize13 = alloc_test(MAX_13_8B); - int countSize14 = alloc_test(MAX_14_8B); - int countSize15 = alloc_test(MAX_15_8B); - //System.out.println(countSize11); - //System.out.println(countSize12); - //System.out.println(countSize13); - //System.out.println(countSize14); - //System.out.println(countSize15); - - if (countSize11 == 853 && countSize12 == 788 && countSize13 == 728 && countSize14 == 681 && countSize15 == 639) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_11_15x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 11*8B to 15*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_11_15x8B.java + *- @ExecuteClass: Alloc_11_15x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_11_15x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_11_8B = 11 * 8; + private final static int MAX_12_8B = 12 * 8; + private final static int MAX_13_8B = 13 * 8; + private final static int MAX_14_8B = 14 * 8; + private final static int MAX_15_8B = 15 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 2 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize11 = alloc_test(MAX_11_8B); + int countSize12 = alloc_test(MAX_12_8B); + int countSize13 = alloc_test(MAX_13_8B); + int countSize14 = alloc_test(MAX_14_8B); + int countSize15 = alloc_test(MAX_15_8B); + //System.out.println(countSize11); + //System.out.println(countSize12); + //System.out.println(countSize13); + //System.out.println(countSize14); + //System.out.println(countSize15); + + if (countSize11 == 853 && countSize12 == 788 && countSize13 == 728 && countSize14 == 681 && countSize15 == 639) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0251-rc-function-ROSAlloc-Alloc_128x8B/Alloc_128x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0251-rc-function-ROSAlloc-Alloc_128x8B/Alloc_128x8B.java index 9a57f45104f59ef2d318737f33d741acf14679de..5b8c9400dea9928100487c7c9fc3c81318bd3c39 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0251-rc-function-ROSAlloc-Alloc_128x8B/Alloc_128x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0251-rc-function-ROSAlloc-Alloc_128x8B/Alloc_128x8B.java @@ -1,72 +1,72 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_128x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 64*8B to 128*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_128x8B.java - *- @ExecuteClass: Alloc_128x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_128x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_128_8B = 128 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - int sum = 0; - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i = i + 3) { - for (int j = 0; j < (PAGE_SIZE * 256 / (i + OBJ_HEADSIZE) + 5); j++) { - temp = new byte[i]; - store.add(temp); - } - sum += store.size(); - store = new ArrayList(); - } - return sum; - } - - public static void main(String[] args) { - store = new ArrayList(); - - int result = alloc_test(MAX_128_8B); - //System.out.println(result); - if (result == 243561) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_128x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 64*8B to 128*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_128x8B.java + *- @ExecuteClass: Alloc_128x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_128x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_128_8B = 128 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + int sum = 0; + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i = i + 3) { + for (int j = 0; j < (PAGE_SIZE * 256 / (i + OBJ_HEADSIZE) + 5); j++) { + temp = new byte[i]; + store.add(temp); + } + sum += store.size(); + store = new ArrayList(); + } + return sum; + } + + public static void main(String[] args) { + store = new ArrayList(); + + int result = alloc_test(MAX_128_8B); + //System.out.println(result); + if (result == 243561) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0252-rc-function-ROSAlloc-Alloc_16_20x8B/Alloc_16_20x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0252-rc-function-ROSAlloc-Alloc_16_20x8B/Alloc_16_20x8B.java index e1ea1580afafbd7ffc5fd151a9c71b2ac1135891..fa61efe93d8c7e35680e05d86ea8b941b8e0c3cc 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0252-rc-function-ROSAlloc-Alloc_16_20x8B/Alloc_16_20x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0252-rc-function-ROSAlloc-Alloc_16_20x8B/Alloc_16_20x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_16_20x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 16*8B to 20*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_16_20x8B.java - *- @ExecuteClass: Alloc_16_20x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_16_20x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_16_8B = 16 * 8; - private final static int MAX_17_8B = 17 * 8; - private final static int MAX_18_8B = 18 * 8; - private final static int MAX_19_8B = 19 * 8; - private final static int MAX_20_8B = 20 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 2 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize16 = alloc_test(MAX_16_8B); - int countSize17 = alloc_test(MAX_17_8B); - int countSize18 = alloc_test(MAX_18_8B); - int countSize19 = alloc_test(MAX_19_8B); - int countSize20 = alloc_test(MAX_20_8B); - //System.out.println(countSize16); - //System.out.println(countSize17); - //System.out.println(countSize18); - //System.out.println(countSize19); - //System.out.println(countSize20); - - if (countSize16 == 604 && countSize17 == 572 && countSize18 == 542 && countSize19 == 517 && countSize20 == 495) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_16_20x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 16*8B to 20*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_16_20x8B.java + *- @ExecuteClass: Alloc_16_20x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_16_20x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_16_8B = 16 * 8; + private final static int MAX_17_8B = 17 * 8; + private final static int MAX_18_8B = 18 * 8; + private final static int MAX_19_8B = 19 * 8; + private final static int MAX_20_8B = 20 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 2 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize16 = alloc_test(MAX_16_8B); + int countSize17 = alloc_test(MAX_17_8B); + int countSize18 = alloc_test(MAX_18_8B); + int countSize19 = alloc_test(MAX_19_8B); + int countSize20 = alloc_test(MAX_20_8B); + //System.out.println(countSize16); + //System.out.println(countSize17); + //System.out.println(countSize18); + //System.out.println(countSize19); + //System.out.println(countSize20); + + if (countSize16 == 604 && countSize17 == 572 && countSize18 == 542 && countSize19 == 517 && countSize20 == 495) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0253-rc-function-ROSAlloc-Alloc_192x8B/Alloc_192x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0253-rc-function-ROSAlloc-Alloc_192x8B/Alloc_192x8B.java index 88ad73dde357a503ba9d8ac44edf4a26d017f7ed..d2bf88220cf5a65eb239f94c590d4d71b711187a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0253-rc-function-ROSAlloc-Alloc_192x8B/Alloc_192x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0253-rc-function-ROSAlloc-Alloc_192x8B/Alloc_192x8B.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_192x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing big objects from 128*8B to 192*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_192x8B.java - *- @ExecuteClass: Alloc_192x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_192x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_192_8B = 192 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - int sum = 0; - store = new ArrayList(); - byte[] temp; - - for (int i = 1024 + 1 - OBJ_HEADSIZE; i <= slot_type - OBJ_HEADSIZE; i = i + 6) { - for (int j = 0; j < (PAGE_SIZE * 2560 / (i + OBJ_HEADSIZE) + 5); j++) { - temp = new byte[i]; - store.add(temp); - } - sum += store.size(); - store = new ArrayList(); - } - return sum; - } - - public static void main(String[] args) { - store = new ArrayList(); - int result = alloc_test(MAX_192_8B); - //System.out.println(result); - if (result == 714677) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_192x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing big objects from 128*8B to 192*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_192x8B.java + *- @ExecuteClass: Alloc_192x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_192x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_192_8B = 192 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + int sum = 0; + store = new ArrayList(); + byte[] temp; + + for (int i = 1024 + 1 - OBJ_HEADSIZE; i <= slot_type - OBJ_HEADSIZE; i = i + 6) { + for (int j = 0; j < (PAGE_SIZE * 2560 / (i + OBJ_HEADSIZE) + 5); j++) { + temp = new byte[i]; + store.add(temp); + } + sum += store.size(); + store = new ArrayList(); + } + return sum; + } + + public static void main(String[] args) { + store = new ArrayList(); + int result = alloc_test(MAX_192_8B); + //System.out.println(result); + if (result == 714677) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0254-rc-function-ROSAlloc-Alloc_21_25x8B/Alloc_21_25x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0254-rc-function-ROSAlloc-Alloc_21_25x8B/Alloc_21_25x8B.java index 1086c6f47bc40b77949d75c4242a08131276aaba..628da645e97f8ca5b5a09c0ba7eb6db1646f3588 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0254-rc-function-ROSAlloc-Alloc_21_25x8B/Alloc_21_25x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0254-rc-function-ROSAlloc-Alloc_21_25x8B/Alloc_21_25x8B.java @@ -1,84 +1,84 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_21_25x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 21*8B to 25*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_21_25x8B.java - *- @ExecuteClass: Alloc_21_25x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_21_25x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_21_8B = 21 * 8; - private final static int MAX_22_8B = 22 * 8; - private final static int MAX_23_8B = 23 * 8; - private final static int MAX_24_8B = 24 * 8; - private final static int MAX_25_8B = 25 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 3 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize21 = alloc_test(MAX_21_8B); - int countSize22 = alloc_test(MAX_22_8B); - int countSize23 = alloc_test(MAX_23_8B); - int countSize24 = alloc_test(MAX_24_8B); - int countSize25 = alloc_test(MAX_25_8B); - //System.out.println(countSize21); - //System.out.println(countSize22); - //System.out.println(countSize23); - //System.out.println(countSize24); - //System.out.println(countSize25); - - if (countSize21 == 674 && countSize22 == 646 && countSize23 == 621 && countSize24 == 599 && countSize25 == 577) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_21_25x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 21*8B to 25*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_21_25x8B.java + *- @ExecuteClass: Alloc_21_25x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_21_25x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_21_8B = 21 * 8; + private final static int MAX_22_8B = 22 * 8; + private final static int MAX_23_8B = 23 * 8; + private final static int MAX_24_8B = 24 * 8; + private final static int MAX_25_8B = 25 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 3 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize21 = alloc_test(MAX_21_8B); + int countSize22 = alloc_test(MAX_22_8B); + int countSize23 = alloc_test(MAX_23_8B); + int countSize24 = alloc_test(MAX_24_8B); + int countSize25 = alloc_test(MAX_25_8B); + //System.out.println(countSize21); + //System.out.println(countSize22); + //System.out.println(countSize23); + //System.out.println(countSize24); + //System.out.println(countSize25); + + if (countSize21 == 674 && countSize22 == 646 && countSize23 == 621 && countSize24 == 599 && countSize25 == 577) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0255-rc-function-ROSAlloc-Alloc_256x8B/Alloc_256x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0255-rc-function-ROSAlloc-Alloc_256x8B/Alloc_256x8B.java index 8249eb8bef293228bb9d3744c697c564f45b9cd1..c153c50b6ec027ce05377118d6341fbcc631d314 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0255-rc-function-ROSAlloc-Alloc_256x8B/Alloc_256x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0255-rc-function-ROSAlloc-Alloc_256x8B/Alloc_256x8B.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_256x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing big objects from 192*8B to 256*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_256x8B.java - *- @ExecuteClass: Alloc_256x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_256x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_256_8B = 256 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - int sum = 0; - store = new ArrayList(); - byte[] temp; - - for (int i = 1024 + 1 - OBJ_HEADSIZE; i <= slot_type - OBJ_HEADSIZE; i = i + 256) { - for (int j = 0; j < (PAGE_SIZE * 5120 / (i + OBJ_HEADSIZE) + 5); j++) { - temp = new byte[i]; - store.add(temp); - } - sum += store.size(); - store = new ArrayList(); - } - return sum; - } - - public static void main(String[] args) { - store = new ArrayList(); - int result = alloc_test(MAX_256_8B); - //System.out.println(result); - if (result == 62191) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_256x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing big objects from 192*8B to 256*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_256x8B.java + *- @ExecuteClass: Alloc_256x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_256x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_256_8B = 256 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + int sum = 0; + store = new ArrayList(); + byte[] temp; + + for (int i = 1024 + 1 - OBJ_HEADSIZE; i <= slot_type - OBJ_HEADSIZE; i = i + 256) { + for (int j = 0; j < (PAGE_SIZE * 5120 / (i + OBJ_HEADSIZE) + 5); j++) { + temp = new byte[i]; + store.add(temp); + } + sum += store.size(); + store = new ArrayList(); + } + return sum; + } + + public static void main(String[] args) { + store = new ArrayList(); + int result = alloc_test(MAX_256_8B); + //System.out.println(result); + if (result == 62191) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0256-rc-function-ROSAlloc-Alloc_26_30x8B/Alloc_26_30x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0256-rc-function-ROSAlloc-Alloc_26_30x8B/Alloc_26_30x8B.java index d9c7f7429f5beaffd08764109a742525401e859c..d6d7736be0b10d49b62efed4c7a9f15424c5f74e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0256-rc-function-ROSAlloc-Alloc_26_30x8B/Alloc_26_30x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0256-rc-function-ROSAlloc-Alloc_26_30x8B/Alloc_26_30x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_26_30x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 26*8B to 30*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_26_30x8B.java - *- @ExecuteClass: Alloc_26_30x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_26_30x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_26_8B = 26 * 8; - private final static int MAX_27_8B = 27 * 8; - private final static int MAX_28_8B = 28 * 8; - private final static int MAX_29_8B = 29 * 8; - private final static int MAX_30_8B = 30 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 3 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize26 = alloc_test(MAX_26_8B); - int countSize27 = alloc_test(MAX_27_8B); - int countSize28 = alloc_test(MAX_28_8B); - int countSize29 = alloc_test(MAX_29_8B); - int countSize30 = alloc_test(MAX_30_8B); - //System.out.println(countSize26); - //System.out.println(countSize27); - //System.out.println(countSize28); - //System.out.println(countSize29); - //System.out.println(countSize30); - - if (countSize26 == 557 && countSize27 == 538 && countSize28 == 522 && countSize29 == 506 && countSize30 == 492) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_26_30x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 26*8B to 30*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_26_30x8B.java + *- @ExecuteClass: Alloc_26_30x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_26_30x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_26_8B = 26 * 8; + private final static int MAX_27_8B = 27 * 8; + private final static int MAX_28_8B = 28 * 8; + private final static int MAX_29_8B = 29 * 8; + private final static int MAX_30_8B = 30 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 3 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize26 = alloc_test(MAX_26_8B); + int countSize27 = alloc_test(MAX_27_8B); + int countSize28 = alloc_test(MAX_28_8B); + int countSize29 = alloc_test(MAX_29_8B); + int countSize30 = alloc_test(MAX_30_8B); + //System.out.println(countSize26); + //System.out.println(countSize27); + //System.out.println(countSize28); + //System.out.println(countSize29); + //System.out.println(countSize30); + + if (countSize26 == 557 && countSize27 == 538 && countSize28 == 522 && countSize29 == 506 && countSize30 == 492) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0257-rc-function-ROSAlloc-Alloc_3_10x8B/Alloc_3_10x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0257-rc-function-ROSAlloc-Alloc_3_10x8B/Alloc_3_10x8B.java index 9cfc2882d85075975a47ec11bc24c6e46034f6f8..acb27ce22cbcf6ff9ee29ee3309a868dd39f6f53 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0257-rc-function-ROSAlloc-Alloc_3_10x8B/Alloc_3_10x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0257-rc-function-ROSAlloc-Alloc_3_10x8B/Alloc_3_10x8B.java @@ -1,85 +1,85 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_3_10x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 3*8B to 10*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_3_10x8B.java - *- @ExecuteClass: Alloc_3_10x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_3_10x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_3_8B = 3 * 8; - private final static int MAX_4_8B = 4 * 8; - private final static int MAX_5_8B = 5 * 8; - private final static int MAX_6_8B = 6 * 8; - private final static int MAX_7_8B = 7 * 8; - private final static int MAX_8_8B = 8 * 8; - private final static int MAX_9_8B = 9 * 8; - private final static int MAX_10_8B = 10 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize3 = alloc_test(MAX_3_8B); - int countSize4 = alloc_test(MAX_4_8B); - int countSize5 = alloc_test(MAX_5_8B); - int countSize6 = alloc_test(MAX_6_8B); - int countSize7 = alloc_test(MAX_7_8B); - int countSize8 = alloc_test(MAX_8_8B); - int countSize9 = alloc_test(MAX_9_8B); - int countSize10 = alloc_test(MAX_10_8B); - if (countSize3 == 4488 && countSize4 == 1234 && countSize5 == 978 && countSize6 == 816 && countSize7 == 701 && countSize8 == 620 && countSize9 == 556 && countSize10 == 505) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } - -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_3_10x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 3*8B to 10*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_3_10x8B.java + *- @ExecuteClass: Alloc_3_10x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_3_10x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_3_8B = 3 * 8; + private final static int MAX_4_8B = 4 * 8; + private final static int MAX_5_8B = 5 * 8; + private final static int MAX_6_8B = 6 * 8; + private final static int MAX_7_8B = 7 * 8; + private final static int MAX_8_8B = 8 * 8; + private final static int MAX_9_8B = 9 * 8; + private final static int MAX_10_8B = 10 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize3 = alloc_test(MAX_3_8B); + int countSize4 = alloc_test(MAX_4_8B); + int countSize5 = alloc_test(MAX_5_8B); + int countSize6 = alloc_test(MAX_6_8B); + int countSize7 = alloc_test(MAX_7_8B); + int countSize8 = alloc_test(MAX_8_8B); + int countSize9 = alloc_test(MAX_9_8B); + int countSize10 = alloc_test(MAX_10_8B); + if (countSize3 == 4488 && countSize4 == 1234 && countSize5 == 978 && countSize6 == 816 && countSize7 == 701 && countSize8 == 620 && countSize9 == 556 && countSize10 == 505) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } + +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0258-rc-function-ROSAlloc-Alloc_31_35x8B/Alloc_31_35x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0258-rc-function-ROSAlloc-Alloc_31_35x8B/Alloc_31_35x8B.java index bef1b6536c46cef1be8a043f2d3ef7ec0f527c92..a00a2347ab49667796832a2e1a6ae4df10fef098 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0258-rc-function-ROSAlloc-Alloc_31_35x8B/Alloc_31_35x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0258-rc-function-ROSAlloc-Alloc_31_35x8B/Alloc_31_35x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_31_35x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 31*8B to 35*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_31_35x8B.java - *- @ExecuteClass: Alloc_31_35x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_31_35x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_31_8B = 31 * 8; - private final static int MAX_32_8B = 32 * 8; - private final static int MAX_33_8B = 33 * 8; - private final static int MAX_34_8B = 34 * 8; - private final static int MAX_35_8B = 35 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 4 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize31 = alloc_test(MAX_31_8B); - int countSize32 = alloc_test(MAX_32_8B); - int countSize33 = alloc_test(MAX_33_8B); - int countSize34 = alloc_test(MAX_34_8B); - int countSize35 = alloc_test(MAX_35_8B); - //System.out.println(countSize31); - //System.out.println(countSize32); - //System.out.println(countSize33); - //System.out.println(countSize34); - //System.out.println(countSize35); - - if (countSize31 == 612 && countSize32 == 596 && countSize33 == 580 && countSize34 == 564 && countSize35 == 550) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_31_35x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 31*8B to 35*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_31_35x8B.java + *- @ExecuteClass: Alloc_31_35x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_31_35x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_31_8B = 31 * 8; + private final static int MAX_32_8B = 32 * 8; + private final static int MAX_33_8B = 33 * 8; + private final static int MAX_34_8B = 34 * 8; + private final static int MAX_35_8B = 35 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 4 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize31 = alloc_test(MAX_31_8B); + int countSize32 = alloc_test(MAX_32_8B); + int countSize33 = alloc_test(MAX_33_8B); + int countSize34 = alloc_test(MAX_34_8B); + int countSize35 = alloc_test(MAX_35_8B); + //System.out.println(countSize31); + //System.out.println(countSize32); + //System.out.println(countSize33); + //System.out.println(countSize34); + //System.out.println(countSize35); + + if (countSize31 == 612 && countSize32 == 596 && countSize33 == 580 && countSize34 == 564 && countSize35 == 550) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0259-rc-function-ROSAlloc-Alloc_36_40x8B/Alloc_36_40x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0259-rc-function-ROSAlloc-Alloc_36_40x8B/Alloc_36_40x8B.java index 45a2da0bbd5bf596e38c045f263b370e2a0e75d3..a4a5d1989c42053c5379307cb5c58cf58a0c452e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0259-rc-function-ROSAlloc-Alloc_36_40x8B/Alloc_36_40x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0259-rc-function-ROSAlloc-Alloc_36_40x8B/Alloc_36_40x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_36_40x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 36*8B to 40*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_36_40x8B.java - *- @ExecuteClass: Alloc_36_40x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_36_40x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_36_8B = 36 * 8; - private final static int MAX_37_8B = 37 * 8; - private final static int MAX_38_8B = 38 * 8; - private final static int MAX_39_8B = 39 * 8; - private final static int MAX_40_8B = 40 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 4 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize36 = alloc_test(MAX_36_8B); - int countSize37 = alloc_test(MAX_37_8B); - int countSize38 = alloc_test(MAX_38_8B); - int countSize39 = alloc_test(MAX_39_8B); - int countSize40 = alloc_test(MAX_40_8B); - //System.out.println(countSize36); - //System.out.println(countSize37); - //System.out.println(countSize38); - //System.out.println(countSize39); - //System.out.println(countSize40); - - if (countSize36 == 537 && countSize37 == 524 && countSize38 == 512 && countSize39 == 501 && countSize40 == 491) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_36_40x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 36*8B to 40*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_36_40x8B.java + *- @ExecuteClass: Alloc_36_40x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_36_40x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_36_8B = 36 * 8; + private final static int MAX_37_8B = 37 * 8; + private final static int MAX_38_8B = 38 * 8; + private final static int MAX_39_8B = 39 * 8; + private final static int MAX_40_8B = 40 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 4 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize36 = alloc_test(MAX_36_8B); + int countSize37 = alloc_test(MAX_37_8B); + int countSize38 = alloc_test(MAX_38_8B); + int countSize39 = alloc_test(MAX_39_8B); + int countSize40 = alloc_test(MAX_40_8B); + //System.out.println(countSize36); + //System.out.println(countSize37); + //System.out.println(countSize38); + //System.out.println(countSize39); + //System.out.println(countSize40); + + if (countSize36 == 537 && countSize37 == 524 && countSize38 == 512 && countSize39 == 501 && countSize40 == 491) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0260-rc-function-ROSAlloc-Alloc_41_45x8B/Alloc_41_45x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0260-rc-function-ROSAlloc-Alloc_41_45x8B/Alloc_41_45x8B.java index 20766c9192098f177a4741a88887c57531b44126..9459e9da560209f6a6b22f06fe914cb153d7c65c 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0260-rc-function-ROSAlloc-Alloc_41_45x8B/Alloc_41_45x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0260-rc-function-ROSAlloc-Alloc_41_45x8B/Alloc_41_45x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_41_45x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 41*8B to 45*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_41_45x8B.java - *- @ExecuteClass: Alloc_41_45x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_41_45x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_41_8B = 41 * 8; - private final static int MAX_42_8B = 42 * 8; - private final static int MAX_43_8B = 43 * 8; - private final static int MAX_44_8B = 44 * 8; - private final static int MAX_45_8B = 45 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 5 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize41 = alloc_test(MAX_41_8B); - int countSize42 = alloc_test(MAX_42_8B); - int countSize43 = alloc_test(MAX_43_8B); - int countSize44 = alloc_test(MAX_44_8B); - int countSize45 = alloc_test(MAX_45_8B); - //System.out.println(countSize41); - //System.out.println(countSize42); - //System.out.println(countSize43); - //System.out.println(countSize44); - //System.out.println(countSize45); - - if (countSize41 == 581 && countSize42 == 569 && countSize43 == 557 && countSize44 == 547 && countSize45 == 536) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_41_45x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 41*8B to 45*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_41_45x8B.java + *- @ExecuteClass: Alloc_41_45x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_41_45x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_41_8B = 41 * 8; + private final static int MAX_42_8B = 42 * 8; + private final static int MAX_43_8B = 43 * 8; + private final static int MAX_44_8B = 44 * 8; + private final static int MAX_45_8B = 45 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 5 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize41 = alloc_test(MAX_41_8B); + int countSize42 = alloc_test(MAX_42_8B); + int countSize43 = alloc_test(MAX_43_8B); + int countSize44 = alloc_test(MAX_44_8B); + int countSize45 = alloc_test(MAX_45_8B); + //System.out.println(countSize41); + //System.out.println(countSize42); + //System.out.println(countSize43); + //System.out.println(countSize44); + //System.out.println(countSize45); + + if (countSize41 == 581 && countSize42 == 569 && countSize43 == 557 && countSize44 == 547 && countSize45 == 536) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0261-rc-function-ROSAlloc-Alloc_46_50x8B/Alloc_46_50x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0261-rc-function-ROSAlloc-Alloc_46_50x8B/Alloc_46_50x8B.java index 17827025d223af491798d2cb18eeea3f54edaa41..4333ae9ac5632ec9c5a3c4cf50ad5f46e11aa521 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0261-rc-function-ROSAlloc-Alloc_46_50x8B/Alloc_46_50x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0261-rc-function-ROSAlloc-Alloc_46_50x8B/Alloc_46_50x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_46_50x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 46*8B to 50*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_46_50x8B.java - *- @ExecuteClass: Alloc_46_50x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_46_50x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_46_8B = 46 * 8; - private final static int MAX_47_8B = 47 * 8; - private final static int MAX_48_8B = 48 * 8; - private final static int MAX_49_8B = 49 * 8; - private final static int MAX_50_8B = 50 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 5 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize46 = alloc_test(MAX_46_8B); - int countSize47 = alloc_test(MAX_47_8B); - int countSize48 = alloc_test(MAX_48_8B); - int countSize49 = alloc_test(MAX_49_8B); - int countSize50 = alloc_test(MAX_50_8B); - //System.out.println(countSize46); - //System.out.println(countSize47); - //System.out.println(countSize48); - //System.out.println(countSize49); - //System.out.println(countSize50); - - if (countSize46 == 525 && countSize47 == 516 && countSize48 == 507 && countSize49 == 498 && countSize50 == 489) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_46_50x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 46*8B to 50*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_46_50x8B.java + *- @ExecuteClass: Alloc_46_50x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_46_50x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_46_8B = 46 * 8; + private final static int MAX_47_8B = 47 * 8; + private final static int MAX_48_8B = 48 * 8; + private final static int MAX_49_8B = 49 * 8; + private final static int MAX_50_8B = 50 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 5 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize46 = alloc_test(MAX_46_8B); + int countSize47 = alloc_test(MAX_47_8B); + int countSize48 = alloc_test(MAX_48_8B); + int countSize49 = alloc_test(MAX_49_8B); + int countSize50 = alloc_test(MAX_50_8B); + //System.out.println(countSize46); + //System.out.println(countSize47); + //System.out.println(countSize48); + //System.out.println(countSize49); + //System.out.println(countSize50); + + if (countSize46 == 525 && countSize47 == 516 && countSize48 == 507 && countSize49 == 498 && countSize50 == 489) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0262-rc-function-ROSAlloc-Alloc_51_55x8B/Alloc_51_55x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0262-rc-function-ROSAlloc-Alloc_51_55x8B/Alloc_51_55x8B.java index a38db80ce329cd7cccf28cdef1999501a8041999..a573e64922e3441385d60dd4c93c1e9b8eab5b69 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0262-rc-function-ROSAlloc-Alloc_51_55x8B/Alloc_51_55x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0262-rc-function-ROSAlloc-Alloc_51_55x8B/Alloc_51_55x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_51_55x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 51*8B to 55*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_51_55x8B.java - *- @ExecuteClass: Alloc_51_55x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_51_55x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_51_8B = 51 * 8; - private final static int MAX_52_8B = 52 * 8; - private final static int MAX_53_8B = 53 * 8; - private final static int MAX_54_8B = 54 * 8; - private final static int MAX_55_8B = 55 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 6 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize51 = alloc_test(MAX_51_8B); - int countSize52 = alloc_test(MAX_52_8B); - int countSize53 = alloc_test(MAX_53_8B); - int countSize54 = alloc_test(MAX_54_8B); - int countSize55 = alloc_test(MAX_55_8B); - //System.out.println(countSize51); - //System.out.println(countSize52); - //System.out.println(countSize53); - //System.out.println(countSize54); - //System.out.println(countSize55); - - if (countSize51 == 562 && countSize52 == 553 && countSize53 == 543 && countSize54 == 535 && countSize55 == 526) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_51_55x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 51*8B to 55*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_51_55x8B.java + *- @ExecuteClass: Alloc_51_55x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_51_55x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_51_8B = 51 * 8; + private final static int MAX_52_8B = 52 * 8; + private final static int MAX_53_8B = 53 * 8; + private final static int MAX_54_8B = 54 * 8; + private final static int MAX_55_8B = 55 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 6 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize51 = alloc_test(MAX_51_8B); + int countSize52 = alloc_test(MAX_52_8B); + int countSize53 = alloc_test(MAX_53_8B); + int countSize54 = alloc_test(MAX_54_8B); + int countSize55 = alloc_test(MAX_55_8B); + //System.out.println(countSize51); + //System.out.println(countSize52); + //System.out.println(countSize53); + //System.out.println(countSize54); + //System.out.println(countSize55); + + if (countSize51 == 562 && countSize52 == 553 && countSize53 == 543 && countSize54 == 535 && countSize55 == 526) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0263-rc-function-ROSAlloc-Alloc_56_60x8B/Alloc_56_60x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0263-rc-function-ROSAlloc-Alloc_56_60x8B/Alloc_56_60x8B.java index 4e917d271ecd703a182437fcad351d9b31b3b858..0aa69e1ca75f644ec1de885303c9b24590e38f3a 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0263-rc-function-ROSAlloc-Alloc_56_60x8B/Alloc_56_60x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0263-rc-function-ROSAlloc-Alloc_56_60x8B/Alloc_56_60x8B.java @@ -1,83 +1,83 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_56_60x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 56*8B to 60*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_56_60x8B.java - *- @ExecuteClass: Alloc_56_60x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_56_60x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_56_8B = 56 * 8; - private final static int MAX_57_8B = 57 * 8; - private final static int MAX_58_8B = 58 * 8; - private final static int MAX_59_8B = 59 * 8; - private final static int MAX_60_8B = 60 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 6 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize56 = alloc_test(MAX_56_8B); - int countSize57 = alloc_test(MAX_57_8B); - int countSize58 = alloc_test(MAX_58_8B); - int countSize59 = alloc_test(MAX_59_8B); - int countSize60 = alloc_test(MAX_60_8B); - //System.out.println(countSize56); - //System.out.println(countSize57); - //System.out.println(countSize58); - //System.out.println(countSize59); - //System.out.println(countSize60); - - if (countSize56 == 518 && countSize57 == 511 && countSize58 == 503 && countSize59 == 496 && countSize60 == 488) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_56_60x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 56*8B to 60*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_56_60x8B.java + *- @ExecuteClass: Alloc_56_60x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_56_60x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_56_8B = 56 * 8; + private final static int MAX_57_8B = 57 * 8; + private final static int MAX_58_8B = 58 * 8; + private final static int MAX_59_8B = 59 * 8; + private final static int MAX_60_8B = 60 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 6 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize56 = alloc_test(MAX_56_8B); + int countSize57 = alloc_test(MAX_57_8B); + int countSize58 = alloc_test(MAX_58_8B); + int countSize59 = alloc_test(MAX_59_8B); + int countSize60 = alloc_test(MAX_60_8B); + //System.out.println(countSize56); + //System.out.println(countSize57); + //System.out.println(countSize58); + //System.out.println(countSize59); + //System.out.println(countSize60); + + if (countSize56 == 518 && countSize57 == 511 && countSize58 == 503 && countSize59 == 496 && countSize60 == 488) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0264-rc-function-ROSAlloc-Alloc_61_64x8B/Alloc_61_64x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0264-rc-function-ROSAlloc-Alloc_61_64x8B/Alloc_61_64x8B.java index 2f866fa71b8bca12ed59710dd73dbe00657c4b22..38346e34aa47eb8997a716c05dfaafd4fdcc79c1 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0264-rc-function-ROSAlloc-Alloc_61_64x8B/Alloc_61_64x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0264-rc-function-ROSAlloc-Alloc_61_64x8B/Alloc_61_64x8B.java @@ -1,80 +1,80 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_61_64x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 61*8B to 64*8B(max) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_61_64x8B.java - *- @ExecuteClass: Alloc_61_64x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_61_64x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_61_8B = 61 * 8; - private final static int MAX_62_8B = 62 * 8; - private final static int MAX_63_8B = 63 * 8; - private final static int MAX_64_8B = 64 * 8; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - store = new ArrayList(); - byte[] temp; - int i; - if (slot_type == 24) { - i = 1; - } else if (slot_type == 1024) { - i = 64 * 8 + 1 - OBJ_HEADSIZE; - } else { - i = slot_type - 2 * 8 + 1; - } - - for (; i <= slot_type - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 7 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int check_size = store.size(); - store = new ArrayList(); - return check_size; - } - - public static void main(String[] args) { - store = new ArrayList(); - int countSize61 = alloc_test(MAX_61_8B); - int countSize62 = alloc_test(MAX_62_8B); - int countSize63 = alloc_test(MAX_63_8B); - int countSize64 = alloc_test(MAX_64_8B); - //System.out.println(countSize61); - //System.out.println(countSize62); - //System.out.println(countSize63); - //System.out.println(countSize64); - - if (countSize61 == 549 && countSize62 == 542 && countSize63 == 535 && countSize64 == 528) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_61_64x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing objects from 61*8B to 64*8B(max) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_61_64x8B.java + *- @ExecuteClass: Alloc_61_64x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_61_64x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_61_8B = 61 * 8; + private final static int MAX_62_8B = 62 * 8; + private final static int MAX_63_8B = 63 * 8; + private final static int MAX_64_8B = 64 * 8; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + store = new ArrayList(); + byte[] temp; + int i; + if (slot_type == 24) { + i = 1; + } else if (slot_type == 1024) { + i = 64 * 8 + 1 - OBJ_HEADSIZE; + } else { + i = slot_type - 2 * 8 + 1; + } + + for (; i <= slot_type - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 7 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int check_size = store.size(); + store = new ArrayList(); + return check_size; + } + + public static void main(String[] args) { + store = new ArrayList(); + int countSize61 = alloc_test(MAX_61_8B); + int countSize62 = alloc_test(MAX_62_8B); + int countSize63 = alloc_test(MAX_63_8B); + int countSize64 = alloc_test(MAX_64_8B); + //System.out.println(countSize61); + //System.out.println(countSize62); + //System.out.println(countSize63); + //System.out.println(countSize64); + + if (countSize61 == 549 && countSize62 == 542 && countSize63 == 535 && countSize64 == 528) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0265-rc-function-ROSAlloc-Alloc_B256x8B/Alloc_B256x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0265-rc-function-ROSAlloc-Alloc_B256x8B/Alloc_B256x8B.java index 049553d924473d65eb38e41fd1e8580273ca81aa..d6a31ccdf950c6280efcf634ae802364044e910e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0265-rc-function-ROSAlloc-Alloc_B256x8B/Alloc_B256x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0265-rc-function-ROSAlloc-Alloc_B256x8B/Alloc_B256x8B.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_B256x8B - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing big objects more than 2KB - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: Alloc_B256x8B.java - *- @ExecuteClass: Alloc_B256x8B - *- @ExecuteArgs: - */ - -import java.util.ArrayList; - -public class Alloc_B256x8B { - private final static int PAGE_SIZE = 4 * 1024; - private final static int OBJ_HEADSIZE = 8; - private final static int MAX_B256_8B = 2 * 1024 * 1024; - private static ArrayList store; - - private static int alloc_test(int slot_type) { - int sum = 0; - store = new ArrayList(); - byte[] temp; - - for (int i = 1024 * 1024 - OBJ_HEADSIZE; i <= slot_type - OBJ_HEADSIZE; i = i + 256) { - for (int j = 0; j < (PAGE_SIZE * 2560 / (i + OBJ_HEADSIZE) + 5); j++) { - temp = new byte[i]; - store.add(temp); - } - sum += store.size(); - store = new ArrayList(); - } - return sum; - } - - public static void main(String[] args) { - store = new ArrayList(); - int result = alloc_test(MAX_B256_8B); - //System.out.println(result); - if (result == 46939) - System.out.println("ExpectResult"); - else - System.out.println("Error"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_B256x8B + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title:ROS Allocator is in charge of applying and releasing objects.This testcase is mainly for testing big objects more than 2KB + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: Alloc_B256x8B.java + *- @ExecuteClass: Alloc_B256x8B + *- @ExecuteArgs: + */ + +import java.util.ArrayList; + +public class Alloc_B256x8B { + private final static int PAGE_SIZE = 4 * 1024; + private final static int OBJ_HEADSIZE = 8; + private final static int MAX_B256_8B = 2 * 1024 * 1024; + private static ArrayList store; + + private static int alloc_test(int slot_type) { + int sum = 0; + store = new ArrayList(); + byte[] temp; + + for (int i = 1024 * 1024 - OBJ_HEADSIZE; i <= slot_type - OBJ_HEADSIZE; i = i + 256) { + for (int j = 0; j < (PAGE_SIZE * 2560 / (i + OBJ_HEADSIZE) + 5); j++) { + temp = new byte[i]; + store.add(temp); + } + sum += store.size(); + store = new ArrayList(); + } + return sum; + } + + public static void main(String[] args) { + store = new ArrayList(); + int result = alloc_test(MAX_B256_8B); + //System.out.println(result); + if (result == 46939) + System.out.println("ExpectResult"); + else + System.out.println("Error"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0281-rc-function-ROSAlloc-Alloc_Thread2_64x8B/Alloc_Thread2_64x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0281-rc-function-ROSAlloc-Alloc_Thread2_64x8B/Alloc_Thread2_64x8B.java index 2f3fd647c030c92c8d08cbf71f6706cf6061a39a..ba8dd8cd9624394e7055a650a282450c37ad1e5e 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0281-rc-function-ROSAlloc-Alloc_Thread2_64x8B/Alloc_Thread2_64x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0281-rc-function-ROSAlloc-Alloc_Thread2_64x8B/Alloc_Thread2_64x8B.java @@ -1,78 +1,78 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_Thread2_64x8B - * -@TestCaseName:MyselfClassName - * -@RequirementName:[运行时需求]支持自动内存管理 - * -@Title:ROS Allocator is in charge of applying and releasing objects.This mulit thread testcase is mainly for testing objects from 60*8B to 64*8B(max) - * -@Brief:functionTest - * -@Expect:ExpectResult\n - * -@Priority: High - * -@Source: Alloc_Thread2_64x8B.java - * -@ExecuteClass: Alloc_Thread2_64x8B - * -@ExecuteArgs: - */ - -import java.util.ArrayList; - -class Alloc_Thread2_64x8B_01 extends Thread { - private static final int PAGE_SIZE = 4 * 1024; - private static final int OBJ_HEADSIZE = 8; - private static final int MAX_64_8B = 64 * 8; - private static boolean checkout = false; - - public void run() { - ArrayList store = new ArrayList(); - byte[] temp; - for (int i = 480 - OBJ_HEADSIZE; i <= MAX_64_8B - OBJ_HEADSIZE; i++) { - for (int j = 0; j < (PAGE_SIZE * 128 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - } - } - int checkSize = store.size(); - if (checkSize == 35212) { - checkout = true; - } - } - - public boolean check() { - return checkout; - } -} - -public class Alloc_Thread2_64x8B { - public static void main(String[] args) { - Runtime.getRuntime().gc(); - Alloc_Thread2_64x8B_01 test1 = new Alloc_Thread2_64x8B_01(); - test1.start(); - Alloc_Thread2_64x8B_01 test2 = new Alloc_Thread2_64x8B_01(); - test2.start(); - try { - test1.join(); - test2.join(); - } catch (InterruptedException e) { - // do nothing - } - if (test1.check() && test2.check()) { - System.out.println("ExpectResult"); - } else { - System.out.println("Error"); - } - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_Thread2_64x8B + * -@TestCaseName:MyselfClassName + * -@RequirementName:[运行时需求]支持自动内存管理 + * -@Title:ROS Allocator is in charge of applying and releasing objects.This mulit thread testcase is mainly for testing objects from 60*8B to 64*8B(max) + * -@Brief:functionTest + * -@Expect:ExpectResult\n + * -@Priority: High + * -@Source: Alloc_Thread2_64x8B.java + * -@ExecuteClass: Alloc_Thread2_64x8B + * -@ExecuteArgs: + */ + +import java.util.ArrayList; + +class Alloc_Thread2_64x8B_01 extends Thread { + private static final int PAGE_SIZE = 4 * 1024; + private static final int OBJ_HEADSIZE = 8; + private static final int MAX_64_8B = 64 * 8; + private static boolean checkout = false; + + public void run() { + ArrayList store = new ArrayList(); + byte[] temp; + for (int i = 480 - OBJ_HEADSIZE; i <= MAX_64_8B - OBJ_HEADSIZE; i++) { + for (int j = 0; j < (PAGE_SIZE * 128 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + } + } + int checkSize = store.size(); + if (checkSize == 35212) { + checkout = true; + } + } + + public boolean check() { + return checkout; + } +} + +public class Alloc_Thread2_64x8B { + public static void main(String[] args) { + Runtime.getRuntime().gc(); + Alloc_Thread2_64x8B_01 test1 = new Alloc_Thread2_64x8B_01(); + test1.start(); + Alloc_Thread2_64x8B_01 test2 = new Alloc_Thread2_64x8B_01(); + test2.start(); + try { + test1.join(); + test2.join(); + } catch (InterruptedException e) { + // do nothing + } + if (test1.check() && test2.check()) { + System.out.println("ExpectResult"); + } else { + System.out.println("Error"); + } + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0293-rc-function-ROSAlloc-Alloc_Threadm_192x8B/Alloc_Threadm_192x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0293-rc-function-ROSAlloc-Alloc_Threadm_192x8B/Alloc_Threadm_192x8B.java index 12c63a7668c522c82a894285adce9a1b373e253c..4a7f0244500127689d294a064c38151e81e617f7 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0293-rc-function-ROSAlloc-Alloc_Threadm_192x8B/Alloc_Threadm_192x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0293-rc-function-ROSAlloc-Alloc_Threadm_192x8B/Alloc_Threadm_192x8B.java @@ -1,86 +1,86 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_Threadm_192x8B - * -@TestCaseName:MyselfClassName - * -@RequirementName:[运行时需求]支持自动内存管理 - * -@Title:ROS Allocator is in charge of applying and releasing objects.This mulit thread testcase is mainly for testing - * objects from 128*8B to 192*8B(max) with 6 threads - * -@Brief:functionTest - * -@Expect:ExpectResult\n - * -@Priority: High - * -@Source: Alloc_Threadm_192x8B.java - * -@ExecuteClass: Alloc_Threadm_192x8B - * -@ExecuteArgs: - */ - -import java.util.ArrayList; - -class Alloc_Threadm_192x8B_01 extends Thread { - private static final int PAGE_SIZE = 4 * 1024; - private static final int OBJ_HEADSIZE = 8; - private static final int MAX_192_8B = 192 * 8; - private static boolean checkout = false; - - public void run() { - ArrayList store = new ArrayList(); - byte[] temp; - int checkSize = 0; - for (int i = 1024 - OBJ_HEADSIZE; i <= MAX_192_8B - OBJ_HEADSIZE; i = i + 100) { - for (int j = 0; j < (PAGE_SIZE * 512 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - checkSize++; - store = new ArrayList(); - } - } - if (checkSize == 10117) { - checkout = true; - } - } - - public boolean check() { - return checkout; - } -} - -public class Alloc_Threadm_192x8B { - public static void main(String[] args) { - Runtime.getRuntime().gc(); - Alloc_Threadm_192x8B_01 test1 = new Alloc_Threadm_192x8B_01(); - test1.start(); - Alloc_Threadm_192x8B_01 test2 = new Alloc_Threadm_192x8B_01(); - test2.start(); - Alloc_Threadm_192x8B_01 test3 = new Alloc_Threadm_192x8B_01(); - test3.start(); - Alloc_Threadm_192x8B_01 test4 = new Alloc_Threadm_192x8B_01(); - test4.start(); - try { - test1.join(); - test2.join(); - test3.join(); - test4.join(); - } catch (InterruptedException e) { - // do nothing - } - if (test1.check() && test2.check() && test3.check() && test4.check()) { - System.out.println("ExpectResult"); - } else { - System.out.println("Error"); - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_Threadm_192x8B + * -@TestCaseName:MyselfClassName + * -@RequirementName:[运行时需求]支持自动内存管理 + * -@Title:ROS Allocator is in charge of applying and releasing objects.This mulit thread testcase is mainly for testing + * objects from 128*8B to 192*8B(max) with 6 threads + * -@Brief:functionTest + * -@Expect:ExpectResult\n + * -@Priority: High + * -@Source: Alloc_Threadm_192x8B.java + * -@ExecuteClass: Alloc_Threadm_192x8B + * -@ExecuteArgs: + */ + +import java.util.ArrayList; + +class Alloc_Threadm_192x8B_01 extends Thread { + private static final int PAGE_SIZE = 4 * 1024; + private static final int OBJ_HEADSIZE = 8; + private static final int MAX_192_8B = 192 * 8; + private static boolean checkout = false; + + public void run() { + ArrayList store = new ArrayList(); + byte[] temp; + int checkSize = 0; + for (int i = 1024 - OBJ_HEADSIZE; i <= MAX_192_8B - OBJ_HEADSIZE; i = i + 100) { + for (int j = 0; j < (PAGE_SIZE * 512 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + checkSize++; + store = new ArrayList(); + } + } + if (checkSize == 10117) { + checkout = true; + } + } + + public boolean check() { + return checkout; + } +} + +public class Alloc_Threadm_192x8B { + public static void main(String[] args) { + Runtime.getRuntime().gc(); + Alloc_Threadm_192x8B_01 test1 = new Alloc_Threadm_192x8B_01(); + test1.start(); + Alloc_Threadm_192x8B_01 test2 = new Alloc_Threadm_192x8B_01(); + test2.start(); + Alloc_Threadm_192x8B_01 test3 = new Alloc_Threadm_192x8B_01(); + test3.start(); + Alloc_Threadm_192x8B_01 test4 = new Alloc_Threadm_192x8B_01(); + test4.start(); + try { + test1.join(); + test2.join(); + test3.join(); + test4.join(); + } catch (InterruptedException e) { + // do nothing + } + if (test1.check() && test2.check() && test3.check() && test4.check()) { + System.out.println("ExpectResult"); + } else { + System.out.println("Error"); + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0294-rc-function-ROSAlloc-Alloc_Threadm_256x8B_2/Alloc_Threadm_256x8B_2.java b/test/testsuite/ouroboros/memory_management/Function/RC0294-rc-function-ROSAlloc-Alloc_Threadm_256x8B_2/Alloc_Threadm_256x8B_2.java index fedb1bdcbaf01e265f90e0ea9fa49d43ec45a6b9..7ac51d8d5e5547efbedd7b33b4ba0497d58394a6 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0294-rc-function-ROSAlloc-Alloc_Threadm_256x8B_2/Alloc_Threadm_256x8B_2.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0294-rc-function-ROSAlloc-Alloc_Threadm_256x8B_2/Alloc_Threadm_256x8B_2.java @@ -1,99 +1,99 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_Threadm_256x8B_2 - * -@TestCaseName:MyselfClassName - * -@RequirementName:[运行时需求]支持自动内存管理 - * -@Title:ROS Allocator is in charge of applying and releasing objects.This mulit thread testcase is mainly for testing - * objects from 192*8B to 256*8B(max) with 6 threads and time sleep - * -@Brief:functionTest - * -@Expect:ExpectResult\n - * -@Priority: High - * -@Source: Alloc_Threadm_256x8B_2.java - * -@ExecuteClass: Alloc_Threadm_256x8B_2 - * -@ExecuteArgs: - */ - -import java.util.ArrayList; - -class Alloc_Threadm_256x8B_2_01 extends Thread { - private static final int PAGE_SIZE = 4 * 1024; - private static final int OBJ_HEADSIZE = 8; - private static final int MAX_256_8B = 256 * 8; - private static boolean checkOut = false; - - public void run() { - ArrayList store = new ArrayList(); - byte[] temp; - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // do nothing - } - int check_size = 0; - for (int i = 192 * 8 - OBJ_HEADSIZE; i <= MAX_256_8B - OBJ_HEADSIZE; i = i + 800) { - for (int j = 0; j < (PAGE_SIZE * 1024 / (i + OBJ_HEADSIZE) + 10); j++) { - if (j % 1000 == 0) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // do nothing - } - } - temp = new byte[i]; - store.add(temp); - check_size++; - store = new ArrayList(); - } - } - if (check_size == 2740) { - checkOut = true; - } - } - - public boolean check() { - return checkOut; - } -} - -public class Alloc_Threadm_256x8B_2 { - public static void main(String[] args) { - Runtime.getRuntime().gc(); - Alloc_Threadm_256x8B_2_01 test1 = new Alloc_Threadm_256x8B_2_01(); - test1.start(); - Alloc_Threadm_256x8B_2_01 test2 = new Alloc_Threadm_256x8B_2_01(); - test2.start(); - Alloc_Threadm_256x8B_2_01 test3 = new Alloc_Threadm_256x8B_2_01(); - test3.start(); - Alloc_Threadm_256x8B_2_01 test4 = new Alloc_Threadm_256x8B_2_01(); - test4.start(); - try { - test1.join(); - test2.join(); - test3.join(); - test4.join(); - } catch (InterruptedException e) { - // do nothing - } - if (test1.check() && test2.check() && test3.check() && test4.check()) { - System.out.println("ExpectResult"); - } else { - System.out.println("Error"); - } - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_Threadm_256x8B_2 + * -@TestCaseName:MyselfClassName + * -@RequirementName:[运行时需求]支持自动内存管理 + * -@Title:ROS Allocator is in charge of applying and releasing objects.This mulit thread testcase is mainly for testing + * objects from 192*8B to 256*8B(max) with 6 threads and time sleep + * -@Brief:functionTest + * -@Expect:ExpectResult\n + * -@Priority: High + * -@Source: Alloc_Threadm_256x8B_2.java + * -@ExecuteClass: Alloc_Threadm_256x8B_2 + * -@ExecuteArgs: + */ + +import java.util.ArrayList; + +class Alloc_Threadm_256x8B_2_01 extends Thread { + private static final int PAGE_SIZE = 4 * 1024; + private static final int OBJ_HEADSIZE = 8; + private static final int MAX_256_8B = 256 * 8; + private static boolean checkOut = false; + + public void run() { + ArrayList store = new ArrayList(); + byte[] temp; + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // do nothing + } + int check_size = 0; + for (int i = 192 * 8 - OBJ_HEADSIZE; i <= MAX_256_8B - OBJ_HEADSIZE; i = i + 800) { + for (int j = 0; j < (PAGE_SIZE * 1024 / (i + OBJ_HEADSIZE) + 10); j++) { + if (j % 1000 == 0) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // do nothing + } + } + temp = new byte[i]; + store.add(temp); + check_size++; + store = new ArrayList(); + } + } + if (check_size == 2740) { + checkOut = true; + } + } + + public boolean check() { + return checkOut; + } +} + +public class Alloc_Threadm_256x8B_2 { + public static void main(String[] args) { + Runtime.getRuntime().gc(); + Alloc_Threadm_256x8B_2_01 test1 = new Alloc_Threadm_256x8B_2_01(); + test1.start(); + Alloc_Threadm_256x8B_2_01 test2 = new Alloc_Threadm_256x8B_2_01(); + test2.start(); + Alloc_Threadm_256x8B_2_01 test3 = new Alloc_Threadm_256x8B_2_01(); + test3.start(); + Alloc_Threadm_256x8B_2_01 test4 = new Alloc_Threadm_256x8B_2_01(); + test4.start(); + try { + test1.join(); + test2.join(); + test3.join(); + test4.join(); + } catch (InterruptedException e) { + // do nothing + } + if (test1.check() && test2.check() && test3.check() && test4.check()) { + System.out.println("ExpectResult"); + } else { + System.out.println("Error"); + } + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0295-rc-function-ROSAlloc-Alloc_Threadm_256x8B/Alloc_Threadm_256x8B.java b/test/testsuite/ouroboros/memory_management/Function/RC0295-rc-function-ROSAlloc-Alloc_Threadm_256x8B/Alloc_Threadm_256x8B.java index bc0b90dda26a922b79f7d922c3c77227af3f4b13..58084756047ec1099e133caeab40fad342b90b59 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0295-rc-function-ROSAlloc-Alloc_Threadm_256x8B/Alloc_Threadm_256x8B.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0295-rc-function-ROSAlloc-Alloc_Threadm_256x8B/Alloc_Threadm_256x8B.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:Alloc_Threadm_256x8B - * -@TestCaseName:MyselfClassName - * -@RequirementName:[运行时需求]支持自动内存管理 - * -@Title:ROS Allocator is in charge of applying and releasing objects.This mulit thread testcase is mainly for testing - * objects from 192*8B to 256*8B(max) with 6 threads - * -@Brief:functionTest - * -@Expect:ExpectResult\n - * -@Priority: High - * -@Source: Alloc_Threadm_256x8B.java - * -@ExecuteClass: Alloc_Threadm_256x8B - * -@ExecuteArgs: - */ - -import java.util.ArrayList; - -class Alloc_Threadm_256x8B_01 extends Thread { - private static final int PAGE_SIZE = 4 * 1024; - private static final int OBJ_HEADSIZE = 8; - private static final int MAX_256_8B = 256 * 8; - private static boolean checkOut = false; - - public void run() { - ArrayList store = new ArrayList(); - byte[] temp; - int checkSize = 0; - for (int i = 192 * 8 - OBJ_HEADSIZE; i <= MAX_256_8B - OBJ_HEADSIZE; i = i + 800) { - for (int j = 0; j < (PAGE_SIZE * 512 / (i + OBJ_HEADSIZE) + 10); j++) { - temp = new byte[i]; - store.add(temp); - checkSize++; - store = new ArrayList(); - } - } - if (checkSize == 1375) { - checkOut = true; - } - } - - public boolean check() { - return checkOut; - } - -} - -public class Alloc_Threadm_256x8B { - public static void main(String[] args) { - Runtime.getRuntime().gc(); - Alloc_Threadm_256x8B_01 test1 = new Alloc_Threadm_256x8B_01(); - test1.start(); - Alloc_Threadm_256x8B_01 test2 = new Alloc_Threadm_256x8B_01(); - test2.start(); - Alloc_Threadm_256x8B_01 test3 = new Alloc_Threadm_256x8B_01(); - test3.start(); - Alloc_Threadm_256x8B_01 test4 = new Alloc_Threadm_256x8B_01(); - test4.start(); - try { - test1.join(); - test2.join(); - test3.join(); - test4.join(); - } catch (InterruptedException e) { - // do nothing - } - if (test1.check() && test2.check() && test3.check() && test4.check()) { - System.out.println("ExpectResult"); - } else { - System.out.println("Error"); - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:Alloc_Threadm_256x8B + * -@TestCaseName:MyselfClassName + * -@RequirementName:[运行时需求]支持自动内存管理 + * -@Title:ROS Allocator is in charge of applying and releasing objects.This mulit thread testcase is mainly for testing + * objects from 192*8B to 256*8B(max) with 6 threads + * -@Brief:functionTest + * -@Expect:ExpectResult\n + * -@Priority: High + * -@Source: Alloc_Threadm_256x8B.java + * -@ExecuteClass: Alloc_Threadm_256x8B + * -@ExecuteArgs: + */ + +import java.util.ArrayList; + +class Alloc_Threadm_256x8B_01 extends Thread { + private static final int PAGE_SIZE = 4 * 1024; + private static final int OBJ_HEADSIZE = 8; + private static final int MAX_256_8B = 256 * 8; + private static boolean checkOut = false; + + public void run() { + ArrayList store = new ArrayList(); + byte[] temp; + int checkSize = 0; + for (int i = 192 * 8 - OBJ_HEADSIZE; i <= MAX_256_8B - OBJ_HEADSIZE; i = i + 800) { + for (int j = 0; j < (PAGE_SIZE * 512 / (i + OBJ_HEADSIZE) + 10); j++) { + temp = new byte[i]; + store.add(temp); + checkSize++; + store = new ArrayList(); + } + } + if (checkSize == 1375) { + checkOut = true; + } + } + + public boolean check() { + return checkOut; + } + +} + +public class Alloc_Threadm_256x8B { + public static void main(String[] args) { + Runtime.getRuntime().gc(); + Alloc_Threadm_256x8B_01 test1 = new Alloc_Threadm_256x8B_01(); + test1.start(); + Alloc_Threadm_256x8B_01 test2 = new Alloc_Threadm_256x8B_01(); + test2.start(); + Alloc_Threadm_256x8B_01 test3 = new Alloc_Threadm_256x8B_01(); + test3.start(); + Alloc_Threadm_256x8B_01 test4 = new Alloc_Threadm_256x8B_01(); + test4.start(); + try { + test1.join(); + test2.join(); + test3.join(); + test4.join(); + } catch (InterruptedException e) { + // do nothing + } + if (test1.check() && test2.check() && test3.check() && test4.check()) { + System.out.println("ExpectResult"); + } else { + System.out.println("Error"); + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0309-rc-function-Optimization-RC_newObjectIassign_01/RC_newObjectIassign_01.java b/test/testsuite/ouroboros/memory_management/Function/RC0309-rc-function-Optimization-RC_newObjectIassign_01/RC_newObjectIassign_01.java index a8fa175db4228cdac90978d6260c75020a981564..776c8f5a006064db2b4ffecfcc029ab465b40b79 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0309-rc-function-Optimization-RC_newObjectIassign_01/RC_newObjectIassign_01.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0309-rc-function-Optimization-RC_newObjectIassign_01/RC_newObjectIassign_01.java @@ -1,92 +1,92 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_newObjectIassign_01.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: 针对RC优化new object assign 做场景测试:对象类中的某个域如果在类初始化时没有做赋值,则不会对它的incref(无集成场景) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_newObjectIassign_01.java - *- @ExecuteClass: RC_newObjectIassign_01 - *- @ExecuteArgs: - */ - -import java.util.Arrays; - -public class RC_newObjectIassign_01 { - final static String STR = "MapleTest"; - static int check = 0; - String[] strArray; - static String str1; - volatile String str2; - - private RC_newObjectIassign_01() { - strArray = new String[10]; - str1 = "MapleTest"; - str2 = "FigoTest"; - } - - private RC_newObjectIassign_01(String str) { - str1 = str; - str2 = str; - } - - private RC_newObjectIassign_01(String[] str) { - strArray = str; - } - - public static void main(String[] args) { - for (int i = 1; i <= 100; i++) { - test_new_objct_assign(); - if (check != 5) { - System.out.println("ErrorResult"); - break; - } else { - check = 0; - str1 = null; - } - - } - System.out.println("ExpectResult"); - } - - private static void test_new_objct_assign() { - String[] example = {"a", "b", "c"}; - String[] arrayStr = {"a", "b", "c"}; - RC_newObjectIassign_01 rctest = new RC_newObjectIassign_01(arrayStr); - if (Arrays.equals(rctest.strArray, example) && rctest.str1 == null && rctest.str2 == null) - check += 1; - rctest.str1 = "firstTimeTestStr1"; - rctest.str2 = "firstTimeTestStr2"; - if (Arrays.equals(rctest.strArray, example) && rctest.str1 == "firstTimeTestStr1" && rctest.str2 == "firstTimeTestStr2") - check += 1; - - rctest = new RC_newObjectIassign_01("secondTimeTest"); - if (Arrays.equals(rctest.strArray, null) && rctest.str1 == "secondTimeTest" && rctest.str2 == "secondTimeTest") - check += 1; - rctest.strArray = arrayStr; - if (Arrays.equals(rctest.strArray, example) && rctest.str1 == "secondTimeTest" && rctest.str2 == "secondTimeTest") - check += 1; - - rctest = new RC_newObjectIassign_01(); - if (rctest.strArray.length == 10 && rctest.str1 == "MapleTest" && rctest.str2 == "FigoTest") - check += 1; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_newObjectIassign_01.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: 针对RC优化new object assign 做场景测试:对象类中的某个域如果在类初始化时没有做赋值,则不会对它的incref(无集成场景) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_newObjectIassign_01.java + *- @ExecuteClass: RC_newObjectIassign_01 + *- @ExecuteArgs: + */ + +import java.util.Arrays; + +public class RC_newObjectIassign_01 { + final static String STR = "MapleTest"; + static int check = 0; + String[] strArray; + static String str1; + volatile String str2; + + private RC_newObjectIassign_01() { + strArray = new String[10]; + str1 = "MapleTest"; + str2 = "FigoTest"; + } + + private RC_newObjectIassign_01(String str) { + str1 = str; + str2 = str; + } + + private RC_newObjectIassign_01(String[] str) { + strArray = str; + } + + public static void main(String[] args) { + for (int i = 1; i <= 100; i++) { + test_new_objct_assign(); + if (check != 5) { + System.out.println("ErrorResult"); + break; + } else { + check = 0; + str1 = null; + } + + } + System.out.println("ExpectResult"); + } + + private static void test_new_objct_assign() { + String[] example = {"a", "b", "c"}; + String[] arrayStr = {"a", "b", "c"}; + RC_newObjectIassign_01 rctest = new RC_newObjectIassign_01(arrayStr); + if (Arrays.equals(rctest.strArray, example) && rctest.str1 == null && rctest.str2 == null) + check += 1; + rctest.str1 = "firstTimeTestStr1"; + rctest.str2 = "firstTimeTestStr2"; + if (Arrays.equals(rctest.strArray, example) && rctest.str1 == "firstTimeTestStr1" && rctest.str2 == "firstTimeTestStr2") + check += 1; + + rctest = new RC_newObjectIassign_01("secondTimeTest"); + if (Arrays.equals(rctest.strArray, null) && rctest.str1 == "secondTimeTest" && rctest.str2 == "secondTimeTest") + check += 1; + rctest.strArray = arrayStr; + if (Arrays.equals(rctest.strArray, example) && rctest.str1 == "secondTimeTest" && rctest.str2 == "secondTimeTest") + check += 1; + + rctest = new RC_newObjectIassign_01(); + if (rctest.strArray.length == 10 && rctest.str1 == "MapleTest" && rctest.str2 == "FigoTest") + check += 1; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0310-rc-function-Optimization-RC_newObjectIassign_02/RC_newObjectIassign_02.java b/test/testsuite/ouroboros/memory_management/Function/RC0310-rc-function-Optimization-RC_newObjectIassign_02/RC_newObjectIassign_02.java index c2f9e1b9a62a8c0bc9d49b089b52271fb34fcc62..5058b73d4458df8416f6d1ae5e25776a776ea604 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0310-rc-function-Optimization-RC_newObjectIassign_02/RC_newObjectIassign_02.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0310-rc-function-Optimization-RC_newObjectIassign_02/RC_newObjectIassign_02.java @@ -1,95 +1,95 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_newObjectIassign_02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: 针对RC优化new object assign 做场景测试:对象类中的某个域如果在类初始化时没有做赋值,则不会对它的incref(无集成场景) - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_newObjectIassign_02.java - *- @ExecuteClass: RC_newObjectIassign_02 - *- @ExecuteArgs: - */ - -import java.util.Arrays; - -class Base { - String[] strArray; - volatile String str2; -} - -public class RC_newObjectIassign_02 extends Base { - final static String STR = "MapleTest"; - static int check = 0; - static String str1; - - private RC_newObjectIassign_02() { - strArray = new String[10]; - str1 = "MapleTest"; - str2 = "FigoTest"; - } - - private RC_newObjectIassign_02(String str) { - str1 = str; - str2 = str; - } - - private RC_newObjectIassign_02(String[] str) { - strArray = str; - } - - public static void main(String[] args) { - for (int i = 1; i <= 100; i++) { - test_new_objct_assign(); - if (check != 5) { - System.out.println("ErrorResult"); - break; - } else { - check = 0; - str1 = null; - } - - } - System.out.println("ExpectResult"); - } - - private static void test_new_objct_assign() { - String[] example = {"a", "b", "c"}; - String[] arrayStr = {"a", "b", "c"}; - RC_newObjectIassign_02 rctest = new RC_newObjectIassign_02(arrayStr); - if (Arrays.equals(rctest.strArray, example) && rctest.str1 == null && rctest.str2 == null) - check += 1; - rctest.str1 = "firstTimeTestStr1"; - rctest.str2 = "firstTimeTestStr2"; - if (Arrays.equals(rctest.strArray, example) && rctest.str1 == "firstTimeTestStr1" && rctest.str2 == "firstTimeTestStr2") - check += 1; - - rctest = new RC_newObjectIassign_02("secondTimeTest"); - if (Arrays.equals(rctest.strArray, null) && rctest.str1 == "secondTimeTest" && rctest.str2 == "secondTimeTest") - check += 1; - rctest.strArray = arrayStr; - if (Arrays.equals(rctest.strArray, example) && rctest.str1 == "secondTimeTest" && rctest.str2 == "secondTimeTest") - check += 1; - - rctest = new RC_newObjectIassign_02(); - if (rctest.strArray.length == 10 && rctest.str1 == "MapleTest" && rctest.str2 == "FigoTest") - check += 1; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_newObjectIassign_02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: 针对RC优化new object assign 做场景测试:对象类中的某个域如果在类初始化时没有做赋值,则不会对它的incref(无集成场景) + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_newObjectIassign_02.java + *- @ExecuteClass: RC_newObjectIassign_02 + *- @ExecuteArgs: + */ + +import java.util.Arrays; + +class Base { + String[] strArray; + volatile String str2; +} + +public class RC_newObjectIassign_02 extends Base { + final static String STR = "MapleTest"; + static int check = 0; + static String str1; + + private RC_newObjectIassign_02() { + strArray = new String[10]; + str1 = "MapleTest"; + str2 = "FigoTest"; + } + + private RC_newObjectIassign_02(String str) { + str1 = str; + str2 = str; + } + + private RC_newObjectIassign_02(String[] str) { + strArray = str; + } + + public static void main(String[] args) { + for (int i = 1; i <= 100; i++) { + test_new_objct_assign(); + if (check != 5) { + System.out.println("ErrorResult"); + break; + } else { + check = 0; + str1 = null; + } + + } + System.out.println("ExpectResult"); + } + + private static void test_new_objct_assign() { + String[] example = {"a", "b", "c"}; + String[] arrayStr = {"a", "b", "c"}; + RC_newObjectIassign_02 rctest = new RC_newObjectIassign_02(arrayStr); + if (Arrays.equals(rctest.strArray, example) && rctest.str1 == null && rctest.str2 == null) + check += 1; + rctest.str1 = "firstTimeTestStr1"; + rctest.str2 = "firstTimeTestStr2"; + if (Arrays.equals(rctest.strArray, example) && rctest.str1 == "firstTimeTestStr1" && rctest.str2 == "firstTimeTestStr2") + check += 1; + + rctest = new RC_newObjectIassign_02("secondTimeTest"); + if (Arrays.equals(rctest.strArray, null) && rctest.str1 == "secondTimeTest" && rctest.str2 == "secondTimeTest") + check += 1; + rctest.strArray = arrayStr; + if (Arrays.equals(rctest.strArray, example) && rctest.str1 == "secondTimeTest" && rctest.str2 == "secondTimeTest") + check += 1; + + rctest = new RC_newObjectIassign_02(); + if (rctest.strArray.length == 10 && rctest.str1 == "MapleTest" && rctest.str2 == "FigoTest") + check += 1; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0311-rc-function-Optimization-RC_newObjectToField/RC_newObjectToField.java b/test/testsuite/ouroboros/memory_management/Function/RC0311-rc-function-Optimization-RC_newObjectToField/RC_newObjectToField.java index 1a16c725c0e6e706c47cfdc1d5356512b600f893..6fb59ccf69ae6bcad467469ad62b3b2022f502d4 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0311-rc-function-Optimization-RC_newObjectToField/RC_newObjectToField.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0311-rc-function-Optimization-RC_newObjectToField/RC_newObjectToField.java @@ -1,92 +1,92 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_newObjectToField.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: 对于像mR = new Obj()的语句; 为了分配一个新对象并将其引用分配给一个field,我们正在生成一对冗余的RC Inc / Dec操作 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_newObjectToField.java - *- @ExecuteClass: RC_newObjectToField - *- @ExecuteArgs: - */ - -import java.util.Arrays; - -public class RC_newObjectToField { - final static String STR = "MapleTest"; - static int check = 0; - volatile static String[] strArray; - static String str1; - volatile String str2; - - private RC_newObjectToField() { - strArray = new String[10]; - str1 = new String("str1") + "MapleTest"; - str2 = "FigoTest"; - } - - private RC_newObjectToField(String str) { - str1 = new String("str1") + str; - str2 = new String("str2") + str; - } - - private RC_newObjectToField(String[] str) { - Arrays.sort(str); - Arrays.toString(str); - new Object(); - new String("Just Test"); - Arrays.binarySearch(str, "d"); - strArray = new String[10]; - strArray = str; - } - - - public static void main(String[] args) { - for (int i = 1; i <= 100; i++) { - test_new_objct_assign(); - if (check != 3) { - System.out.println("ErrorResult"); - break; - } else { - check = 0; - str1 = null; - } - - } - System.out.println("ExpectResult"); - } - - private static void test_new_objct_assign() { - String[] example = {"a", "b", "c"}; - String[] arrayStr = {"c", "a", "b"}; - RC_newObjectToField rctest = new RC_newObjectToField(arrayStr); - if (Arrays.equals(rctest.strArray, example) && rctest.str1 == null && rctest.str2 == null) - check += 1; - - rctest = new RC_newObjectToField("secondTimeTest"); - if (Arrays.equals(rctest.strArray, example) && rctest.str1.equals("str1secondTimeTest") && rctest.str2.equals("str2secondTimeTest")) - check += 1; - - rctest = new RC_newObjectToField(); - if (rctest.strArray.length == 10 && rctest.str1.equals("str1MapleTest") && rctest.str2 == "FigoTest") - check += 1; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_newObjectToField.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: 对于像mR = new Obj()的语句; 为了分配一个新对象并将其引用分配给一个field,我们正在生成一对冗余的RC Inc / Dec操作 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_newObjectToField.java + *- @ExecuteClass: RC_newObjectToField + *- @ExecuteArgs: + */ + +import java.util.Arrays; + +public class RC_newObjectToField { + final static String STR = "MapleTest"; + static int check = 0; + volatile static String[] strArray; + static String str1; + volatile String str2; + + private RC_newObjectToField() { + strArray = new String[10]; + str1 = new String("str1") + "MapleTest"; + str2 = "FigoTest"; + } + + private RC_newObjectToField(String str) { + str1 = new String("str1") + str; + str2 = new String("str2") + str; + } + + private RC_newObjectToField(String[] str) { + Arrays.sort(str); + Arrays.toString(str); + new Object(); + new String("Just Test"); + Arrays.binarySearch(str, "d"); + strArray = new String[10]; + strArray = str; + } + + + public static void main(String[] args) { + for (int i = 1; i <= 100; i++) { + test_new_objct_assign(); + if (check != 3) { + System.out.println("ErrorResult"); + break; + } else { + check = 0; + str1 = null; + } + + } + System.out.println("ExpectResult"); + } + + private static void test_new_objct_assign() { + String[] example = {"a", "b", "c"}; + String[] arrayStr = {"c", "a", "b"}; + RC_newObjectToField rctest = new RC_newObjectToField(arrayStr); + if (Arrays.equals(rctest.strArray, example) && rctest.str1 == null && rctest.str2 == null) + check += 1; + + rctest = new RC_newObjectToField("secondTimeTest"); + if (Arrays.equals(rctest.strArray, example) && rctest.str1.equals("str1secondTimeTest") && rctest.str2.equals("str2secondTimeTest")) + check += 1; + + rctest = new RC_newObjectToField(); + if (rctest.strArray.length == 10 && rctest.str1.equals("str1MapleTest") && rctest.str2 == "FigoTest") + check += 1; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0312-rc-function-Optimization-RC_newObjectToField_02/RC_newObjectToField_02.java b/test/testsuite/ouroboros/memory_management/Function/RC0312-rc-function-Optimization-RC_newObjectToField_02/RC_newObjectToField_02.java index ccc4bdd11402efbe57b4cb2952c0b13c5ff21a10..6f61bd5102ff2c5a590597d32c5c9fcd8b6089cb 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0312-rc-function-Optimization-RC_newObjectToField_02/RC_newObjectToField_02.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0312-rc-function-Optimization-RC_newObjectToField_02/RC_newObjectToField_02.java @@ -1,97 +1,97 @@ - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_newObjectToField_02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: 对于像mR = new Obj()的语句; 为了分配一个新对象并将其引用分配给一个field,我们正在生成一对冗余的RC Inc / Dec操作 - *- @Brief:functionTest - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: RC_newObjectToField_02.java - *- @ExecuteClass: RC_newObjectToField_02 - *- @ExecuteArgs: - */ - -import java.util.Arrays; - -public class RC_newObjectToField_02 { - final static String STR = "MapleTest"; - static int check = 0; - volatile static String[] strArray; - int[] intArray; - static String str1; - volatile String str2; - - private RC_newObjectToField_02() throws ArithmeticException { - strArray = new String[10]; - str1 = new String("str1") + "MapleTest"; - str2 = "FigoTest"; - intArray = new int[]{1 / 0}; - } - - private RC_newObjectToField_02(String str) throws StringIndexOutOfBoundsException { - str1 = (new String("str1") + str).substring(-1, -2); - str2 = new String("str2") + str; - } - - private RC_newObjectToField_02(String[] str) throws ArrayIndexOutOfBoundsException { - Arrays.sort(str); - Arrays.toString(str); - new Object(); - new String("Just Test"); - Arrays.binarySearch(str, "d"); - intArray = new int[10]; - strArray = new String[1]; - strArray[2] = new String("IndexOutBounds"); - } - - public static void main(String[] args) { - for (int i = 1; i <= 100; i++) { - test_new_objct_assign(); - if (check != 3) { - System.out.println("ErrorResult"); - break; - } else { - check = 0; - str1 = null; - } - - } - System.out.println("ExpectResult"); - } - - private static void test_new_objct_assign() { - String[] arrayStr = {"c", "a", "b"}; - try { - RC_newObjectToField_02 rctest = new RC_newObjectToField_02(arrayStr); - } catch (ArrayIndexOutOfBoundsException a) { - check += 1; - } - try { - RC_newObjectToField_02 rctest = new RC_newObjectToField_02("secondTimeTest"); - } catch (StringIndexOutOfBoundsException s) { - check += 1; - } - try { - RC_newObjectToField_02 rctest = new RC_newObjectToField_02(); - } catch (ArithmeticException a) { - check += 1; - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan ExpectResult\n + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_newObjectToField_02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: 对于像mR = new Obj()的语句; 为了分配一个新对象并将其引用分配给一个field,我们正在生成一对冗余的RC Inc / Dec操作 + *- @Brief:functionTest + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: RC_newObjectToField_02.java + *- @ExecuteClass: RC_newObjectToField_02 + *- @ExecuteArgs: + */ + +import java.util.Arrays; + +public class RC_newObjectToField_02 { + final static String STR = "MapleTest"; + static int check = 0; + volatile static String[] strArray; + int[] intArray; + static String str1; + volatile String str2; + + private RC_newObjectToField_02() throws ArithmeticException { + strArray = new String[10]; + str1 = new String("str1") + "MapleTest"; + str2 = "FigoTest"; + intArray = new int[]{1 / 0}; + } + + private RC_newObjectToField_02(String str) throws StringIndexOutOfBoundsException { + str1 = (new String("str1") + str).substring(-1, -2); + str2 = new String("str2") + str; + } + + private RC_newObjectToField_02(String[] str) throws ArrayIndexOutOfBoundsException { + Arrays.sort(str); + Arrays.toString(str); + new Object(); + new String("Just Test"); + Arrays.binarySearch(str, "d"); + intArray = new int[10]; + strArray = new String[1]; + strArray[2] = new String("IndexOutBounds"); + } + + public static void main(String[] args) { + for (int i = 1; i <= 100; i++) { + test_new_objct_assign(); + if (check != 3) { + System.out.println("ErrorResult"); + break; + } else { + check = 0; + str1 = null; + } + + } + System.out.println("ExpectResult"); + } + + private static void test_new_objct_assign() { + String[] arrayStr = {"c", "a", "b"}; + try { + RC_newObjectToField_02 rctest = new RC_newObjectToField_02(arrayStr); + } catch (ArrayIndexOutOfBoundsException a) { + check += 1; + } + try { + RC_newObjectToField_02 rctest = new RC_newObjectToField_02("secondTimeTest"); + } catch (StringIndexOutOfBoundsException s) { + check += 1; + } + try { + RC_newObjectToField_02 rctest = new RC_newObjectToField_02(); + } catch (ArithmeticException a) { + check += 1; + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan ExpectResult\n diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0313-rc-function-Optimization-RC_staticInput/RC_staticInput.java b/test/testsuite/ouroboros/memory_management/Function/RC0313-rc-function-Optimization-RC_staticInput/RC_staticInput.java index 3089f777a12351ebd66d39dc1d799d1210bd3b1d..fefaad926eeea7dabd2b5139ef46bfe4688ef091 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0313-rc-function-Optimization-RC_staticInput/RC_staticInput.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0313-rc-function-Optimization-RC_staticInput/RC_staticInput.java @@ -1,51 +1,51 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_staticInput.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: RC_staticInput.java - *- @ExecuteClass: RC_staticInput - *- @ExecuteArgs: - */ -public class RC_staticInput { - static int[] test = {10, 20, 30, 40}; - - public static void main(String[] args) { - if (test.length == 4) - System.out.println("ExpectResult"); - else - System.out.println("ErrorResult"); - test(4, test); - if (test.length == 4) - System.out.println("ExpectResult"); - else - System.out.println("ErrorResult"); - } - - public static void test(int first, int[] second) { - int[] xyz = {23, 24, 25, 26}; - test = xyz; - if (second.length == 4) - System.out.println("ExpectResult"); - else - System.out.println("ErrorResult"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan ExpectResult\nExpectResult\nExpectResult\n +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_staticInput.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: RC_staticInput.java + *- @ExecuteClass: RC_staticInput + *- @ExecuteArgs: + */ +public class RC_staticInput { + static int[] test = {10, 20, 30, 40}; + + public static void main(String[] args) { + if (test.length == 4) + System.out.println("ExpectResult"); + else + System.out.println("ErrorResult"); + test(4, test); + if (test.length == 4) + System.out.println("ExpectResult"); + else + System.out.println("ErrorResult"); + } + + public static void test(int first, int[] second) { + int[] xyz = {23, 24, 25, 26}; + test = xyz; + if (second.length == 4) + System.out.println("ExpectResult"); + else + System.out.println("ErrorResult"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan ExpectResult\nExpectResult\nExpectResult\n diff --git a/test/testsuite/ouroboros/memory_management/Function/RC0314-rc-function-Optimization-RC_staticInput_02/RC_staticInput_02.java b/test/testsuite/ouroboros/memory_management/Function/RC0314-rc-function-Optimization-RC_staticInput_02/RC_staticInput_02.java index 6d2ecc426402dc6ca017094d218fcb3713efd1fd..d57a06fa969dd47a22759e0efd4d03333fc4b659 100644 --- a/test/testsuite/ouroboros/memory_management/Function/RC0314-rc-function-Optimization-RC_staticInput_02/RC_staticInput_02.java +++ b/test/testsuite/ouroboros/memory_management/Function/RC0314-rc-function-Optimization-RC_staticInput_02/RC_staticInput_02.java @@ -1,55 +1,55 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:maple/runtime/rc/function/RC_staticInput_02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Brief:functionTest - *- @Expect:ExpectResult\nExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: RC_staticInput_02.java - *- @ExecuteClass: RC_staticInput_02 - *- @ExecuteArgs: - */ -public class RC_staticInput_02 { - static int[] test = {10, 20, 30, 40}; - - public static void main(String[] args) { - if (test.length == 4) - System.out.println("ExpectResult"); - else - System.out.println("ErrorResult"); - test(4, test); - if (test.length == 4) - System.out.println("ExpectResult"); - else - System.out.println("ErrorResult"); - } - - public static void test(int first, int[] second) { - int[] xyz = {23, 24, 25, 26}; - modify(xyz); - if (second.length == 4) - System.out.println("ExpectResult"); - else - System.out.println("ErrorResult"); - } - - public static void modify(int[] temp) { - test = temp; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan ExpectResult\nExpectResult\nExpectResult\n +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:maple/runtime/rc/function/RC_staticInput_02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Brief:functionTest + *- @Expect:ExpectResult\nExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: RC_staticInput_02.java + *- @ExecuteClass: RC_staticInput_02 + *- @ExecuteArgs: + */ +public class RC_staticInput_02 { + static int[] test = {10, 20, 30, 40}; + + public static void main(String[] args) { + if (test.length == 4) + System.out.println("ExpectResult"); + else + System.out.println("ErrorResult"); + test(4, test); + if (test.length == 4) + System.out.println("ExpectResult"); + else + System.out.println("ErrorResult"); + } + + public static void test(int first, int[] second) { + int[] xyz = {23, 24, 25, 26}; + modify(xyz); + if (second.length == 4) + System.out.println("ExpectResult"); + else + System.out.println("ErrorResult"); + } + + public static void modify(int[] temp) { + test = temp; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan ExpectResult\nExpectResult\nExpectResult\n diff --git a/test/testsuite/ouroboros/memory_management/MemoryTest/RC0360-rc-Memory-leaktestsupplycase-01/BackupTracingAndRefPro.java b/test/testsuite/ouroboros/memory_management/MemoryTest/RC0360-rc-Memory-leaktestsupplycase-01/BackupTracingAndRefPro.java index 2c615e910f3980980d3ff4c4da488098850800f0..f21fbd014b88a01ed0da35a416f9e971a5d11f76 100644 --- a/test/testsuite/ouroboros/memory_management/MemoryTest/RC0360-rc-Memory-leaktestsupplycase-01/BackupTracingAndRefPro.java +++ b/test/testsuite/ouroboros/memory_management/MemoryTest/RC0360-rc-Memory-leaktestsupplycase-01/BackupTracingAndRefPro.java @@ -1,135 +1,135 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: maple/runtime/rc/function/BackupTracingAndRefPro.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Brief:functionTest - * -#step1: 创建弱引用,确认创建成功 - * -#step2: 等待一个时间周期,确认引用和引用队列被释放 - * -#step3: 调用Runtime.getRuntime().gc()进行垃圾回收,重复步骤1~2; - * -#step4: 创建类的引用,并对类的变量进行运算,确认运算结果正确。 - * -#step5: 调用Runtime.getRuntime().gc()进行垃圾回收,重复步骤4; - *- @Expect: - *- @Priority: High - *- @Source: BackupTracingAndRefPro.java - *- @ExecuteClass: BackupTracingAndRefPro - *- @ExecuteArgs: - */ - -import java.lang.ref.Reference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; - -public class BackupTracingAndRefPro { - static int NUM = 2; - - public static void main(String[] args) { - runRefPro(); - Runtime.getRuntime().gc(); - runRefPro(); - - runBackupTracing(); - Runtime.getRuntime().gc(); - runBackupTracing(); - System.out.println("ExpectResult"); - } - - static void runRefPro() { - ThreadRefPro threadRefPro = new ThreadRefPro(); - for (int i = 0; i < NUM; i++) { - threadRefPro.run(); - } - } - - static void runBackupTracing() { - ThreadBackupTracing threadBackupTracing = new ThreadBackupTracing(); - for (int i = 0; i < NUM; i++) { - threadBackupTracing.run(); - } - } -} - -class ThreadBackupTracing implements Runnable { - int result = 0; - - void versify() { - ReferenceOperation ref = new ReferenceOperation(); - ref.referenceOperation = ref; - ref.add(); - result = ref.sum; - } - - @Override - public void run() { - versify(); - if (result != 20) { - System.out.println("error result ==" + result); - } - } -} - -class ReferenceOperation { - ReferenceOperation referenceOperation; - int num; - int sum; - - ReferenceOperation() { - referenceOperation = null; - num = 10; - sum = 0; - } - - void add() { - sum = num + referenceOperation.num; - } -} - -class ThreadRefPro implements Runnable { - static Reference rp; - static ReferenceQueue rq = new ReferenceQueue(); - static StringBuffer obj = new StringBuffer("weak"); - - static void setWeakRef() { - obj = new StringBuffer("weak"); - rp = new WeakReference(obj, rq); - if (rp.get() == null) { - System.out.println("error"); - } - obj = null; - } - - @Override - public void run() { - Reference reference; - setWeakRef(); - - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - if (rp.get() != null) { - System.out.println("error in rp.get()"); - } - while ((reference = rq.poll()) != null) { - if (!reference.getClass().toString().equals("class java.lang.ref.WeakReference")) { - System.out.println("error in rq"); - } - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan ExpectResult +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: maple/runtime/rc/function/BackupTracingAndRefPro.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Brief:functionTest + * -#step1: 创建弱引用,确认创建成功 + * -#step2: 等待一个时间周期,确认引用和引用队列被释放 + * -#step3: 调用Runtime.getRuntime().gc()进行垃圾回收,重复步骤1~2; + * -#step4: 创建类的引用,并对类的变量进行运算,确认运算结果正确。 + * -#step5: 调用Runtime.getRuntime().gc()进行垃圾回收,重复步骤4; + *- @Expect: + *- @Priority: High + *- @Source: BackupTracingAndRefPro.java + *- @ExecuteClass: BackupTracingAndRefPro + *- @ExecuteArgs: + */ + +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; + +public class BackupTracingAndRefPro { + static int NUM = 2; + + public static void main(String[] args) { + runRefPro(); + Runtime.getRuntime().gc(); + runRefPro(); + + runBackupTracing(); + Runtime.getRuntime().gc(); + runBackupTracing(); + System.out.println("ExpectResult"); + } + + static void runRefPro() { + ThreadRefPro threadRefPro = new ThreadRefPro(); + for (int i = 0; i < NUM; i++) { + threadRefPro.run(); + } + } + + static void runBackupTracing() { + ThreadBackupTracing threadBackupTracing = new ThreadBackupTracing(); + for (int i = 0; i < NUM; i++) { + threadBackupTracing.run(); + } + } +} + +class ThreadBackupTracing implements Runnable { + int result = 0; + + void versify() { + ReferenceOperation ref = new ReferenceOperation(); + ref.referenceOperation = ref; + ref.add(); + result = ref.sum; + } + + @Override + public void run() { + versify(); + if (result != 20) { + System.out.println("error result ==" + result); + } + } +} + +class ReferenceOperation { + ReferenceOperation referenceOperation; + int num; + int sum; + + ReferenceOperation() { + referenceOperation = null; + num = 10; + sum = 0; + } + + void add() { + sum = num + referenceOperation.num; + } +} + +class ThreadRefPro implements Runnable { + static Reference rp; + static ReferenceQueue rq = new ReferenceQueue(); + static StringBuffer obj = new StringBuffer("weak"); + + static void setWeakRef() { + obj = new StringBuffer("weak"); + rp = new WeakReference(obj, rq); + if (rp.get() == null) { + System.out.println("error"); + } + obj = null; + } + + @Override + public void run() { + Reference reference; + setWeakRef(); + + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + if (rp.get() != null) { + System.out.println("error in rp.get()"); + } + while ((reference = rq.poll()) != null) { + if (!reference.getClass().toString().equals("class java.lang.ref.WeakReference")) { + System.out.println("error in rq"); + } + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan ExpectResult diff --git a/test/testsuite/ouroboros/memory_management/MemoryTest/RC0364-rc-Memory-leaktestsupplycase-05/RaceInLoadAndWriteWeakRef.java b/test/testsuite/ouroboros/memory_management/MemoryTest/RC0364-rc-Memory-leaktestsupplycase-05/RaceInLoadAndWriteWeakRef.java index 6e4fe5d7656b8130fd86c7b04aa54637fd02db04..303356687208ded1bdb7ba9f7404816132aa2ac6 100644 --- a/test/testsuite/ouroboros/memory_management/MemoryTest/RC0364-rc-Memory-leaktestsupplycase-05/RaceInLoadAndWriteWeakRef.java +++ b/test/testsuite/ouroboros/memory_management/MemoryTest/RC0364-rc-Memory-leaktestsupplycase-05/RaceInLoadAndWriteWeakRef.java @@ -1,116 +1,116 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: maple/runtime/rc/function/RaceInLoadAndWriteWeakRef.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Brief:functionTest - * -#step1: 创建一个WeakReference类的对象并赋值给rp,经判断rp.get()不为null,最后令stringBuffer等于null; - * -#step2: 以setWeakRef为参数,分别创建ThreadLoadWeakRef、ThreadWriteWeakRef类的实例对象threadLoadWeakRef和 - * threadWriteWeakRef; - * -#step3: 调用threadLoadWeakRef的run()方法,即将setWeakRef.rp的值赋值给rp_load; - * -#step4: 调用Runtime.getRuntime().gc()进行垃圾回收; - * -#step5: 重复执行step3~step4一次; - * -#step6: 再次执行step3一次; - * -#step7: 调用threadWriteWeakRef的run()方法,即将rp_write的值赋值给setWeakRef.rp; - * -#step8: 调用Runtime.getRuntime().gc()进行垃圾回收; - * -#step9: 重复执行step7一次; - * -#step10: 调用Runtime.getRuntime().gc()进行垃圾回收; - * -#step11: 重复执行步骤1~9一次; - *- @Expect: - *- @Priority: High - *- @Source: RaceInLoadAndWriteWeakRef.java - *- @ExecuteClass: RaceInLoadAndWriteWeakRef - *- @ExecuteArgs: - */ - -import java.lang.ref.Reference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; - -public class RaceInLoadAndWriteWeakRef { - static int NUM = 100; - - public static void main(String[] args) { - test(); - Runtime.getRuntime().gc(); - test(); - System.out.println("ExpectResult"); - } - - static void test() { - SetWeakRef setWeakRef = new SetWeakRef(); - setWeakRef.setWeakRef(); - ThreadLoadWeakRef threadLoadWeakRef = new ThreadLoadWeakRef(setWeakRef); - ThreadWriteWeakRef threadWriteWeakRef = new ThreadWriteWeakRef(setWeakRef); - for (int i = 0; i < NUM; i++) { - threadLoadWeakRef.run(); - Runtime.getRuntime().gc(); - threadLoadWeakRef.run(); - Runtime.getRuntime().gc(); - threadLoadWeakRef.run(); - - threadWriteWeakRef.run(); - Runtime.getRuntime().gc(); - threadWriteWeakRef.run(); - } - } -} - -class SetWeakRef { - static Reference rp; - static ReferenceQueue rq = new ReferenceQueue(); - static StringBuffer stringBuffer = new StringBuffer("Weak"); - - static void setWeakRef() { - stringBuffer = new StringBuffer("Weak"); - rp = new WeakReference(stringBuffer, rq); - if (rp.get() == null) { - System.out.println("error"); - } - stringBuffer = null; - } -} - -class ThreadLoadWeakRef implements Runnable { - SetWeakRef setWeakRef; - - public ThreadLoadWeakRef(SetWeakRef setWeakRef) { - this.setWeakRef = setWeakRef; - } - - static Reference rp_load; - - @Override - public void run() { - rp_load = setWeakRef.rp; - } -} - -class ThreadWriteWeakRef implements Runnable { - SetWeakRef setWeakRef; - - public ThreadWriteWeakRef(SetWeakRef setWeakRef) { - this.setWeakRef = setWeakRef; - } - - static WeakReference rp_write; - - @Override - public void run() { - setWeakRef.rp = rp_write; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan ExpectResult +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: maple/runtime/rc/function/RaceInLoadAndWriteWeakRef.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Brief:functionTest + * -#step1: 创建一个WeakReference类的对象并赋值给rp,经判断rp.get()不为null,最后令stringBuffer等于null; + * -#step2: 以setWeakRef为参数,分别创建ThreadLoadWeakRef、ThreadWriteWeakRef类的实例对象threadLoadWeakRef和 + * threadWriteWeakRef; + * -#step3: 调用threadLoadWeakRef的run()方法,即将setWeakRef.rp的值赋值给rp_load; + * -#step4: 调用Runtime.getRuntime().gc()进行垃圾回收; + * -#step5: 重复执行step3~step4一次; + * -#step6: 再次执行step3一次; + * -#step7: 调用threadWriteWeakRef的run()方法,即将rp_write的值赋值给setWeakRef.rp; + * -#step8: 调用Runtime.getRuntime().gc()进行垃圾回收; + * -#step9: 重复执行step7一次; + * -#step10: 调用Runtime.getRuntime().gc()进行垃圾回收; + * -#step11: 重复执行步骤1~9一次; + *- @Expect: + *- @Priority: High + *- @Source: RaceInLoadAndWriteWeakRef.java + *- @ExecuteClass: RaceInLoadAndWriteWeakRef + *- @ExecuteArgs: + */ + +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; + +public class RaceInLoadAndWriteWeakRef { + static int NUM = 100; + + public static void main(String[] args) { + test(); + Runtime.getRuntime().gc(); + test(); + System.out.println("ExpectResult"); + } + + static void test() { + SetWeakRef setWeakRef = new SetWeakRef(); + setWeakRef.setWeakRef(); + ThreadLoadWeakRef threadLoadWeakRef = new ThreadLoadWeakRef(setWeakRef); + ThreadWriteWeakRef threadWriteWeakRef = new ThreadWriteWeakRef(setWeakRef); + for (int i = 0; i < NUM; i++) { + threadLoadWeakRef.run(); + Runtime.getRuntime().gc(); + threadLoadWeakRef.run(); + Runtime.getRuntime().gc(); + threadLoadWeakRef.run(); + + threadWriteWeakRef.run(); + Runtime.getRuntime().gc(); + threadWriteWeakRef.run(); + } + } +} + +class SetWeakRef { + static Reference rp; + static ReferenceQueue rq = new ReferenceQueue(); + static StringBuffer stringBuffer = new StringBuffer("Weak"); + + static void setWeakRef() { + stringBuffer = new StringBuffer("Weak"); + rp = new WeakReference(stringBuffer, rq); + if (rp.get() == null) { + System.out.println("error"); + } + stringBuffer = null; + } +} + +class ThreadLoadWeakRef implements Runnable { + SetWeakRef setWeakRef; + + public ThreadLoadWeakRef(SetWeakRef setWeakRef) { + this.setWeakRef = setWeakRef; + } + + static Reference rp_load; + + @Override + public void run() { + rp_load = setWeakRef.rp; + } +} + +class ThreadWriteWeakRef implements Runnable { + SetWeakRef setWeakRef; + + public ThreadWriteWeakRef(SetWeakRef setWeakRef) { + this.setWeakRef = setWeakRef; + } + + static WeakReference rp_write; + + @Override + public void run() { + setWeakRef.rp = rp_write; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan ExpectResult diff --git a/test/testsuite/ouroboros/memory_management/MemoryTest/RC0365-rc-Memory-leaktestsupplycase-06/WeakAndCleanerRef.java b/test/testsuite/ouroboros/memory_management/MemoryTest/RC0365-rc-Memory-leaktestsupplycase-06/WeakAndCleanerRef.java index 04d93656c246129bdffa555b395899d13514a1d1..94ee49e8c6624ee7a013ebf88fa10088d0a1c3cd 100644 --- a/test/testsuite/ouroboros/memory_management/MemoryTest/RC0365-rc-Memory-leaktestsupplycase-06/WeakAndCleanerRef.java +++ b/test/testsuite/ouroboros/memory_management/MemoryTest/RC0365-rc-Memory-leaktestsupplycase-06/WeakAndCleanerRef.java @@ -1,68 +1,68 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: maple/runtime/rc/function/WeakAndCleanerRef.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Brief:functionTest - * -#step1: 创建一个ThreadCleaner类的实例对象threadCleaner,创建一个StringBuffer类的变量stringBuffer并赋值为test; - * -#step2: 以step1中的threadCleaner和stringBuffer为参数,调用Cleaner类的create()方法创建一个实例对象cleaner; - * -#step3: 以ReferenceQueue类的实例对象rq和stringBuffer为参数,创建一个WeakReference类的对象并赋值给rp; - * -#step4: 令stringBuffer等于null, 释放强引用; - * -#step5: 调用cleaner的clean()方法,进行对象的清除和资源的释放; - * -#step6: 让当前线程休眠2000ms; - * -#step7: 重复执行step3一次; - *- @Expect: ExpectResult\n - *- @Priority: High - *- @Source: WeakAndCleanerRef.java - *- @ExecuteClass: WeakAndCleanerRef - *- @ExecuteArgs: - */ - -import sun.misc.Cleaner; - -import java.lang.ref.Reference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; - -public class WeakAndCleanerRef { - static Reference rp; - static ReferenceQueue rq = new ReferenceQueue(); - static StringBuffer stringBuffer = new StringBuffer("test"); - - static void addWeakAndCleanerRef() { - rp = new WeakReference(stringBuffer, rq); - } - - public static void main(String[] args) throws InterruptedException { - ThreadCleaner threadCleaner = new ThreadCleaner(); - Cleaner cleaner = Cleaner.create(stringBuffer, threadCleaner); - addWeakAndCleanerRef(); - stringBuffer = null; - cleaner.clean(); - Thread.sleep(2000); - addWeakAndCleanerRef(); - if (rp.get() == null) { - System.out.println("ExpectResult"); - } - } -} - -class ThreadCleaner implements Runnable { - @Override - public void run() { - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan ExpectResult\n +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: maple/runtime/rc/function/WeakAndCleanerRef.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Brief:functionTest + * -#step1: 创建一个ThreadCleaner类的实例对象threadCleaner,创建一个StringBuffer类的变量stringBuffer并赋值为test; + * -#step2: 以step1中的threadCleaner和stringBuffer为参数,调用Cleaner类的create()方法创建一个实例对象cleaner; + * -#step3: 以ReferenceQueue类的实例对象rq和stringBuffer为参数,创建一个WeakReference类的对象并赋值给rp; + * -#step4: 令stringBuffer等于null, 释放强引用; + * -#step5: 调用cleaner的clean()方法,进行对象的清除和资源的释放; + * -#step6: 让当前线程休眠2000ms; + * -#step7: 重复执行step3一次; + *- @Expect: ExpectResult\n + *- @Priority: High + *- @Source: WeakAndCleanerRef.java + *- @ExecuteClass: WeakAndCleanerRef + *- @ExecuteArgs: + */ + +import sun.misc.Cleaner; + +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; + +public class WeakAndCleanerRef { + static Reference rp; + static ReferenceQueue rq = new ReferenceQueue(); + static StringBuffer stringBuffer = new StringBuffer("test"); + + static void addWeakAndCleanerRef() { + rp = new WeakReference(stringBuffer, rq); + } + + public static void main(String[] args) throws InterruptedException { + ThreadCleaner threadCleaner = new ThreadCleaner(); + Cleaner cleaner = Cleaner.create(stringBuffer, threadCleaner); + addWeakAndCleanerRef(); + stringBuffer = null; + cleaner.clean(); + Thread.sleep(2000); + addWeakAndCleanerRef(); + if (rp.get() == null) { + System.out.println("ExpectResult"); + } + } +} + +class ThreadCleaner implements Runnable { + @Override + public void run() { + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan ExpectResult\n diff --git a/test/testsuite/ouroboros/memory_management/MemoryTest/RC0410-rc-Memory-stressTestCase29/Memory_stressTestCase29.java b/test/testsuite/ouroboros/memory_management/MemoryTest/RC0410-rc-Memory-stressTestCase29/Memory_stressTestCase29.java index 112a4ac76a9c0c89c563a2d7028deba96b6cef59..f6fc3f6bd618988d1a5e32a028b6c2cfd851ba10 100644 --- a/test/testsuite/ouroboros/memory_management/MemoryTest/RC0410-rc-Memory-stressTestCase29/Memory_stressTestCase29.java +++ b/test/testsuite/ouroboros/memory_management/MemoryTest/RC0410-rc-Memory-stressTestCase29/Memory_stressTestCase29.java @@ -1,179 +1,179 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:rc/stress/Memory_stressTestCase29.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: - *- @Brief:functionTest - *- @Expect: - *- @Priority: High - *- @Source: Memory_stressTestCase29.java - *- @ExecuteClass: Memory_stressTestCase29 - *- @ExecuteArgs: - */ - - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - - -import sun.misc.Cleaner; - -public class Memory_stressTestCase29 { - private static final int INIT_DEFAULT_THREAD_NUM = 100; - private static int DEFAULT_THREAD_NUM = INIT_DEFAULT_THREAD_NUM; - static List> mAllThread = new ArrayList>(); - - public static void main(String[] args) { - testCase29(); - Runtime.getRuntime().gc(); - testCase29(); - Runtime.getRuntime().gc(); - testCase29(); - Runtime.getRuntime().gc(); - testCase29(); - Runtime.getRuntime().gc(); - testCase29(); - System.out.println("ExpectResult"); - } - - public static void testCase29() { - ArrayList list = new ArrayList<>(); - for (int i = 0; i < (DEFAULT_THREAD_NUM / 10); i++) { - list.add(new StopAbleThread(() -> { - ArrayList units = new ArrayList<>(); - Random r = new Random(); - for (int j = 0; j < 100; j++) { - units.add(new Memory_stressTestCase29.AllocUnitwithVerifyCleaner(r.nextInt(512))); - } - trySleep(r.nextInt(500)); - for (Memory_stressTestCase29.AllocUnitwithVerifyCleaner unit : units) { - unit.CanbeFree(); - } - units.clear(); - }, "testCase29_alloc_" + (i + 1))); - } - startAllThread(list); - waitAllThreadFinish(list); - } - - public static void waitAllThreadFinish(List list) { - for (Thread s : list) { - try { - s.join(); - } catch (InterruptedException e) { - e.printStackTrace(); - } finally { - removeDeadThread(s); - } - } - } - - public static void removeDeadThread(Thread t) { - if (t == null) { - return; - } - if (!t.isAlive()) { - synchronized (mAllThread) { - mAllThread.remove(t); - } - } - } - - public static void startAllThread(List list) { - for (Thread s : list) { - s.start(); - trySleep(new Random().nextInt(2)); - } - } - - public static void trySleep(long time) { - try { - Thread.sleep(time); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - - public static class StopAbleThread extends Thread { - public static boolean mRuning = true; - static List> mAllThread = new ArrayList>(); - - public StopAbleThread(Runnable r, String name) { - super(r, name); - - - } - } - - public static class AllocUnit { - public byte unit[]; - - public AllocUnit(int arrayLength) { - unit = new byte[arrayLength]; - } - } - - public static class AllocUnitwithVerifyCleaner extends AllocUnit { - static final int FLAG_INUSE = 0x112233; - static final int FLAG_CANBECLEAN = 0xddee; - static final int FLAG_CLEARED = 0xaabb; - public CleanerStatus status; - - public AllocUnitwithVerifyCleaner(int arrayLength) { - super(arrayLength); - status = new CleanerStatus(); - this.cleaner = Cleaner.create(this, new TestCleaner(status)); - } - - private final Cleaner cleaner; - - private static class CleanerStatus { - public int status; - - CleanerStatus() { - status = FLAG_INUSE; - } - } - - public void CanbeFree() { - if (this.status.status != FLAG_INUSE) { - throw new NullPointerException(); - } - this.status.status = FLAG_CANBECLEAN; - } - - private static class TestCleaner implements Runnable { - public CleanerStatus status; - - public TestCleaner(CleanerStatus status) { - this.status = status; - } - - public void run() { - if (this.status.status != FLAG_CANBECLEAN) { - } - this.status.status = FLAG_CLEARED; - } - } - - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan ExpectResult +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:rc/stress/Memory_stressTestCase29.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: + *- @Brief:functionTest + *- @Expect: + *- @Priority: High + *- @Source: Memory_stressTestCase29.java + *- @ExecuteClass: Memory_stressTestCase29 + *- @ExecuteArgs: + */ + + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + + +import sun.misc.Cleaner; + +public class Memory_stressTestCase29 { + private static final int INIT_DEFAULT_THREAD_NUM = 100; + private static int DEFAULT_THREAD_NUM = INIT_DEFAULT_THREAD_NUM; + static List> mAllThread = new ArrayList>(); + + public static void main(String[] args) { + testCase29(); + Runtime.getRuntime().gc(); + testCase29(); + Runtime.getRuntime().gc(); + testCase29(); + Runtime.getRuntime().gc(); + testCase29(); + Runtime.getRuntime().gc(); + testCase29(); + System.out.println("ExpectResult"); + } + + public static void testCase29() { + ArrayList list = new ArrayList<>(); + for (int i = 0; i < (DEFAULT_THREAD_NUM / 10); i++) { + list.add(new StopAbleThread(() -> { + ArrayList units = new ArrayList<>(); + Random r = new Random(); + for (int j = 0; j < 100; j++) { + units.add(new Memory_stressTestCase29.AllocUnitwithVerifyCleaner(r.nextInt(512))); + } + trySleep(r.nextInt(500)); + for (Memory_stressTestCase29.AllocUnitwithVerifyCleaner unit : units) { + unit.CanbeFree(); + } + units.clear(); + }, "testCase29_alloc_" + (i + 1))); + } + startAllThread(list); + waitAllThreadFinish(list); + } + + public static void waitAllThreadFinish(List list) { + for (Thread s : list) { + try { + s.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + removeDeadThread(s); + } + } + } + + public static void removeDeadThread(Thread t) { + if (t == null) { + return; + } + if (!t.isAlive()) { + synchronized (mAllThread) { + mAllThread.remove(t); + } + } + } + + public static void startAllThread(List list) { + for (Thread s : list) { + s.start(); + trySleep(new Random().nextInt(2)); + } + } + + public static void trySleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + + public static class StopAbleThread extends Thread { + public static boolean mRuning = true; + static List> mAllThread = new ArrayList>(); + + public StopAbleThread(Runnable r, String name) { + super(r, name); + + + } + } + + public static class AllocUnit { + public byte unit[]; + + public AllocUnit(int arrayLength) { + unit = new byte[arrayLength]; + } + } + + public static class AllocUnitwithVerifyCleaner extends AllocUnit { + static final int FLAG_INUSE = 0x112233; + static final int FLAG_CANBECLEAN = 0xddee; + static final int FLAG_CLEARED = 0xaabb; + public CleanerStatus status; + + public AllocUnitwithVerifyCleaner(int arrayLength) { + super(arrayLength); + status = new CleanerStatus(); + this.cleaner = Cleaner.create(this, new TestCleaner(status)); + } + + private final Cleaner cleaner; + + private static class CleanerStatus { + public int status; + + CleanerStatus() { + status = FLAG_INUSE; + } + } + + public void CanbeFree() { + if (this.status.status != FLAG_INUSE) { + throw new NullPointerException(); + } + this.status.status = FLAG_CANBECLEAN; + } + + private static class TestCleaner implements Runnable { + public CleanerStatus status; + + public TestCleaner(CleanerStatus status) { + this.status = status; + } + + public void run() { + if (this.status.status != FLAG_CANBECLEAN) { + } + this.status.status = FLAG_CLEARED; + } + } + + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan ExpectResult diff --git a/test/testsuite/ouroboros/memory_management/RP/RC0348-rc-rp-simpleweakref_01/DeadReferenceTest.java b/test/testsuite/ouroboros/memory_management/RP/RC0348-rc-rp-simpleweakref_01/DeadReferenceTest.java index 22b3bf42ad5607859198e52d707c84c35c08ec72..0d74ff7346bf79735bb5f76e6662c6471a65b1e2 100644 --- a/test/testsuite/ouroboros/memory_management/RP/RC0348-rc-rp-simpleweakref_01/DeadReferenceTest.java +++ b/test/testsuite/ouroboros/memory_management/RP/RC0348-rc-rp-simpleweakref_01/DeadReferenceTest.java @@ -1,85 +1,85 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: RefProCase/RefProcessor/src/DeadReferenceTest.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: RefProcessor testcase:处理对象为死对象的弱引用 - *- @Brief:functionTest - * -#step1:创建一个ReferenceQueue类的实例对象rq,并已null和rq为参数创建一个WeakReference的实例对象weakRp; - * -#step2:新建一个ThreadRf线程,并开启此线程; - * -#step3:让当前线程休眠2000ms; - * -#step4:经判断得出weakRp.get()的返回值为null; - * -#step5:判断rq.poll()的返回值为reference,直至全部判断完成; - *- @Expect: ExpectResult\n - *- @Priority: High - *- @Source: DeadReferenceTest.java - *- @ExecuteClass: DeadReferenceTest - *- @ExecuteArgs: - */ - -import java.lang.ref.*; - -public class DeadReferenceTest { - static int TEST_NUM = 1; - static int judgeNum = 0; - static Reference weakRp; - static ReferenceQueue rq = new ReferenceQueue(); - - public static void main(String[] args) throws Exception { - judgeNum = 0; - for (int i = 0; i < TEST_NUM; i++) { - deadReferenceTest(); - } - if (judgeNum == 0) { - System.out.println("ExpectResult"); - } - } - - static void setWeakRef() { - weakRp = new WeakReference(null, rq); - } - - static void deadReferenceTest() throws InterruptedException { - Reference reference; - - setWeakRef(); - new Thread(new ThreadRf()).start(); - Thread.sleep(2000); - if (weakRp.get() != null) { - judgeNum++; - } - while ((reference = rq.poll()) != null) { - if (!reference.getClass().toString().equals("class java.lang.ref.WeakReference")) { - judgeNum++; - } - } - } -} - -class ThreadRf implements Runnable { - public void run() { - for (int i = 0; i < 60; i++) { - WeakReference wr = new WeakReference(new Object()); - try { - Thread.sleep(100); - } catch (Exception e) { - System.out.println(" sleep was Interrupted"); - } - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: RefProCase/RefProcessor/src/DeadReferenceTest.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: RefProcessor testcase:处理对象为死对象的弱引用 + *- @Brief:functionTest + * -#step1:创建一个ReferenceQueue类的实例对象rq,并已null和rq为参数创建一个WeakReference的实例对象weakRp; + * -#step2:新建一个ThreadRf线程,并开启此线程; + * -#step3:让当前线程休眠2000ms; + * -#step4:经判断得出weakRp.get()的返回值为null; + * -#step5:判断rq.poll()的返回值为reference,直至全部判断完成; + *- @Expect: ExpectResult\n + *- @Priority: High + *- @Source: DeadReferenceTest.java + *- @ExecuteClass: DeadReferenceTest + *- @ExecuteArgs: + */ + +import java.lang.ref.*; + +public class DeadReferenceTest { + static int TEST_NUM = 1; + static int judgeNum = 0; + static Reference weakRp; + static ReferenceQueue rq = new ReferenceQueue(); + + public static void main(String[] args) throws Exception { + judgeNum = 0; + for (int i = 0; i < TEST_NUM; i++) { + deadReferenceTest(); + } + if (judgeNum == 0) { + System.out.println("ExpectResult"); + } + } + + static void setWeakRef() { + weakRp = new WeakReference(null, rq); + } + + static void deadReferenceTest() throws InterruptedException { + Reference reference; + + setWeakRef(); + new Thread(new ThreadRf()).start(); + Thread.sleep(2000); + if (weakRp.get() != null) { + judgeNum++; + } + while ((reference = rq.poll()) != null) { + if (!reference.getClass().toString().equals("class java.lang.ref.WeakReference")) { + judgeNum++; + } + } + } +} + +class ThreadRf implements Runnable { + public void run() { + for (int i = 0; i < 60; i++) { + WeakReference wr = new WeakReference(new Object()); + try { + Thread.sleep(100); + } catch (Exception e) { + System.out.println(" sleep was Interrupted"); + } + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/RP/RC0349-rc-rp-simpleweakref_02/IsCleanerInDeadCycle.java b/test/testsuite/ouroboros/memory_management/RP/RC0349-rc-rp-simpleweakref_02/IsCleanerInDeadCycle.java index d64f648f850512ed3b442d344df426bd1a6a1bf7..ed2cbde703ac36e30cf26eb58bd60ccca4f6301a 100644 --- a/test/testsuite/ouroboros/memory_management/RP/RC0349-rc-rp-simpleweakref_02/IsCleanerInDeadCycle.java +++ b/test/testsuite/ouroboros/memory_management/RP/RC0349-rc-rp-simpleweakref_02/IsCleanerInDeadCycle.java @@ -1,152 +1,152 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: RefProCase/RefProcessor/src/IsCleanerInDeadCycle.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: RefProcessor testcase: 处理对象为cleaner对象,且在一个不可达的环中 - *- @Brief:functionTest - * -#step1:分别创建Cycle_BDec_00010_A1_Cleaner类的实例对象cycleBA1,InCycle类的实例对象cycleA; - * -#step2:调用System.gc()进行垃圾回收; - * -#step3:以cycleBA1为参数,执行cycleA的setCleanerCycle()方法,并记其返回值为result; - * -#step4:创建一个Cycle_BDec_00010_A2_Cleaner的实例对象cycleBA2,并令cycleBA1.cycleBA2和cycleBA1均为null; - * -#step5:经判断得知result为true,并令当前线程休眠2000ms,并判断得出cycleBA1.cleaner、cycleBA1.cycleBA2.cleaner、 - * cycleBA1、cycleBA1.cycleBA2至少有一个为null; - * -#step6:调用Runtime.getRuntime().gc()进行垃圾回收; - * -#step7:重复步骤1~5; - *- @Expect: ExpectResult\n - *- @Priority: High - *- @Source: IsCleanerInDeadCycle.java - *- @ExecuteClass: IsCleanerInDeadCycle - *- @ExecuteArgs: - */ - -import sun.misc.Cleaner; - -public class IsCleanerInDeadCycle { - static int TEST_NUM = 1; - static int judgeNum = 0; - - public static void main(String[] args) throws Exception { - judgeNum = 0; - for (int i = 0; i < TEST_NUM; i++) { - isCleanerInDeadCycle(); - Runtime.getRuntime().gc(); - isCleanerInDeadCycle(); - } - if (judgeNum == 0) { - System.out.println("ExpectResult"); - } - } - - static void isCleanerInDeadCycle() throws InterruptedException { - judgeNum = 0; - Cycle_BDec_00010_A1_Cleaner cycleBA1 = new Cycle_BDec_00010_A1_Cleaner(); - InCycle cycleA = new InCycle(); - System.gc(); - boolean result = cycleA.setCleanerCycle(cycleBA1); - cycleBA1.cycleBA2 = null; - cycleBA1 = null; - if (result == true) { - Thread.sleep(2000); - if (cycleBA1.cleaner == null || cycleBA1.cycleBA2.cleaner == null) { - } else { - judgeNum++; - } - } else { - judgeNum++; - } - } -} - -class Cycle_BDec_00010_A1_Cleaner { - static Cleaner cleaner; - Cycle_BDec_00010_A2_Cleaner cycleBA2; - int num; - int sum; - static int value; - - Cycle_BDec_00010_A1_Cleaner() { - cleaner.create(cycleBA2, null); - cycleBA2 = null; - num = 1; - sum = 0; - value = 100; - } - - void add() { - sum = num + cycleBA2.num; - } -} - -class Cycle_BDec_00010_A2_Cleaner { - Cleaner cleaner; - Cycle_BDec_00010_A1_Cleaner cycleBA1Cleaner; - int num; - int sum; - static int value; - - Cycle_BDec_00010_A2_Cleaner() { - cleaner.create(cycleBA1Cleaner, null); - cycleBA1Cleaner = null; - num = 2; - sum = 0; - value = 100; - } - - void add() { - sum = num + cycleBA1Cleaner.num; - } -} - -class InCycle { - /** - * 确认环是正确的 - * - * @param cycleBDA 传入的是带有Referent的类实例 - * @return true:正确;false:错误 - */ - public static boolean ModifyCleanerA1(Cycle_BDec_00010_A1_Cleaner cycleBDA) { - cycleBDA.add(); - cycleBDA.cycleBA2.add(); - int nSum = cycleBDA.sum + cycleBDA.cycleBA2.sum; - if (nSum == 6) { - return true; - } else { - return false; - } - } - - /** - * 设置一个带Cleaner的环 - * - * @param cycleBDA1Cleaner 传入的是带有Referent的类实例 - * @return true:正确;false:错误 - */ - public static boolean setCleanerCycle(Cycle_BDec_00010_A1_Cleaner cycleBDA1Cleaner) { - cycleBDA1Cleaner.cycleBA2 = new Cycle_BDec_00010_A2_Cleaner(); - cycleBDA1Cleaner.cycleBA2.cycleBA1Cleaner = cycleBDA1Cleaner; - boolean ret; - ret = ModifyCleanerA1(cycleBDA1Cleaner); - // 环正确,且reference都没释放 - if (ret == true && cycleBDA1Cleaner.cleaner == null && cycleBDA1Cleaner.cycleBA2.cleaner == null - && cycleBDA1Cleaner != null && cycleBDA1Cleaner.cycleBA2 != null) { - return true; - } else { - return false; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: RefProCase/RefProcessor/src/IsCleanerInDeadCycle.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: RefProcessor testcase: 处理对象为cleaner对象,且在一个不可达的环中 + *- @Brief:functionTest + * -#step1:分别创建Cycle_BDec_00010_A1_Cleaner类的实例对象cycleBA1,InCycle类的实例对象cycleA; + * -#step2:调用System.gc()进行垃圾回收; + * -#step3:以cycleBA1为参数,执行cycleA的setCleanerCycle()方法,并记其返回值为result; + * -#step4:创建一个Cycle_BDec_00010_A2_Cleaner的实例对象cycleBA2,并令cycleBA1.cycleBA2和cycleBA1均为null; + * -#step5:经判断得知result为true,并令当前线程休眠2000ms,并判断得出cycleBA1.cleaner、cycleBA1.cycleBA2.cleaner、 + * cycleBA1、cycleBA1.cycleBA2至少有一个为null; + * -#step6:调用Runtime.getRuntime().gc()进行垃圾回收; + * -#step7:重复步骤1~5; + *- @Expect: ExpectResult\n + *- @Priority: High + *- @Source: IsCleanerInDeadCycle.java + *- @ExecuteClass: IsCleanerInDeadCycle + *- @ExecuteArgs: + */ + +import sun.misc.Cleaner; + +public class IsCleanerInDeadCycle { + static int TEST_NUM = 1; + static int judgeNum = 0; + + public static void main(String[] args) throws Exception { + judgeNum = 0; + for (int i = 0; i < TEST_NUM; i++) { + isCleanerInDeadCycle(); + Runtime.getRuntime().gc(); + isCleanerInDeadCycle(); + } + if (judgeNum == 0) { + System.out.println("ExpectResult"); + } + } + + static void isCleanerInDeadCycle() throws InterruptedException { + judgeNum = 0; + Cycle_BDec_00010_A1_Cleaner cycleBA1 = new Cycle_BDec_00010_A1_Cleaner(); + InCycle cycleA = new InCycle(); + System.gc(); + boolean result = cycleA.setCleanerCycle(cycleBA1); + cycleBA1.cycleBA2 = null; + cycleBA1 = null; + if (result == true) { + Thread.sleep(2000); + if (cycleBA1.cleaner == null || cycleBA1.cycleBA2.cleaner == null) { + } else { + judgeNum++; + } + } else { + judgeNum++; + } + } +} + +class Cycle_BDec_00010_A1_Cleaner { + static Cleaner cleaner; + Cycle_BDec_00010_A2_Cleaner cycleBA2; + int num; + int sum; + static int value; + + Cycle_BDec_00010_A1_Cleaner() { + cleaner.create(cycleBA2, null); + cycleBA2 = null; + num = 1; + sum = 0; + value = 100; + } + + void add() { + sum = num + cycleBA2.num; + } +} + +class Cycle_BDec_00010_A2_Cleaner { + Cleaner cleaner; + Cycle_BDec_00010_A1_Cleaner cycleBA1Cleaner; + int num; + int sum; + static int value; + + Cycle_BDec_00010_A2_Cleaner() { + cleaner.create(cycleBA1Cleaner, null); + cycleBA1Cleaner = null; + num = 2; + sum = 0; + value = 100; + } + + void add() { + sum = num + cycleBA1Cleaner.num; + } +} + +class InCycle { + /** + * 确认环是正确的 + * + * @param cycleBDA 传入的是带有Referent的类实例 + * @return true:正确;false:错误 + */ + public static boolean ModifyCleanerA1(Cycle_BDec_00010_A1_Cleaner cycleBDA) { + cycleBDA.add(); + cycleBDA.cycleBA2.add(); + int nSum = cycleBDA.sum + cycleBDA.cycleBA2.sum; + if (nSum == 6) { + return true; + } else { + return false; + } + } + + /** + * 设置一个带Cleaner的环 + * + * @param cycleBDA1Cleaner 传入的是带有Referent的类实例 + * @return true:正确;false:错误 + */ + public static boolean setCleanerCycle(Cycle_BDec_00010_A1_Cleaner cycleBDA1Cleaner) { + cycleBDA1Cleaner.cycleBA2 = new Cycle_BDec_00010_A2_Cleaner(); + cycleBDA1Cleaner.cycleBA2.cycleBA1Cleaner = cycleBDA1Cleaner; + boolean ret; + ret = ModifyCleanerA1(cycleBDA1Cleaner); + // 环正确,且reference都没释放 + if (ret == true && cycleBDA1Cleaner.cleaner == null && cycleBDA1Cleaner.cycleBA2.cleaner == null + && cycleBDA1Cleaner != null && cycleBDA1Cleaner.cycleBA2 != null) { + return true; + } else { + return false; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/RP/RC0351-rc-rp-simpleweakref_04/IsCleanerNotInDeadCycleFreeRef.java b/test/testsuite/ouroboros/memory_management/RP/RC0351-rc-rp-simpleweakref_04/IsCleanerNotInDeadCycleFreeRef.java index c168259e4f8b4aab85092f0932fc9358e46734ec..16ab7d5f8965d533c2f0cd2c72d4742d2b058859 100644 --- a/test/testsuite/ouroboros/memory_management/RP/RC0351-rc-rp-simpleweakref_04/IsCleanerNotInDeadCycleFreeRef.java +++ b/test/testsuite/ouroboros/memory_management/RP/RC0351-rc-rp-simpleweakref_04/IsCleanerNotInDeadCycleFreeRef.java @@ -1,161 +1,161 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: RefProCase/RefProcessor/src/IsCleanerNotInDeadCycleFreeRef.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: RefProcessor basic testcase:在一个对象是cleaner的环中释放reference - *- @Brief:functionTest - * -#step1: 分别创建Cycle_BDec_00010_A1_Cleaner类的实例对象cycleBDA1Cleaner,InCycle类的实例对象cycleA; - * -#step2: 调用System.gc()进行垃圾回收; - * -#step3: 以cycleBDA1Cleaner为参数,执行cycleA的setCleanerCycle()方法,并记其返回值为result; - * -#step4: 令cycleBDA1Cleaner.cycleBDA2Cleaner的值为null,经判断result为true,并让当前线程休眠2000ms; - * -#step5: 经判断,cycleBDA1Cleaner.cleaner为null、cycleBDA1Cleaner.cycleBDA2Cleaner.cleaner为null、cycleBDA1Cleaner - * 不为null这三个条件至少有一个为真; - * -#step6: 创建一个ReferenceQueue类的实例对象rq,并且通过cycleBDA1Cleaner.rq.poll()方法返回的cleaner对象等于null; - * -#step7: 调用Runtime.getRuntime().gc()进行垃圾回收; - * -#step8: 重复步骤1~6; - *- @Expect: ExpectResult\n - *- @Priority: High - *- @Source: IsCleanerNotInDeadCycleFreeRef.java - *- @ExecuteClass: IsCleanerNotInDeadCycleFreeRef - *- @ExecuteArgs: - */ - -import sun.misc.Cleaner; - -import java.lang.ref.*; - -public class IsCleanerNotInDeadCycleFreeRef { - static int TEST_NUM = 1; - static int judgeNum = 0; - - public static void main(String[] args) throws Exception { - judgeNum = 0; - for (int i = 0; i < TEST_NUM; i++) { - isCleanerNotInDeadCycleFreeRef(); - Runtime.getRuntime().gc(); - isCleanerNotInDeadCycleFreeRef(); - } - if (judgeNum == 0) { - System.out.println("ExpectResult"); - } - } - - static void isCleanerNotInDeadCycleFreeRef() throws InterruptedException { - Cleaner cleaner; - Cycle_BDec_00010_A1_Cleaner cycleBDA1Cleaner = new Cycle_BDec_00010_A1_Cleaner(); - InCycle cycleA = new InCycle(); - System.gc(); - boolean result = cycleA.setCleanerCycle(cycleBDA1Cleaner); - cycleBDA1Cleaner.cycleBDA2Cleaner = null; - if (result == true) { - Thread.sleep(2000); - if ((cycleBDA1Cleaner.cleaner == null) || (cycleBDA1Cleaner.cycleBDA2Cleaner.cleaner == null) - || (cycleBDA1Cleaner != null)) { - while ((cleaner = (Cleaner) cycleBDA1Cleaner.rq.poll()) != null) { - if (!cleaner.getClass().toString().equals("class sun.misc.Cleaner")) { - judgeNum++; - } - } - } else { - judgeNum++; - } - } else { - judgeNum++; - } - } -} - -class Cycle_BDec_00010_A1_Cleaner { - static Cleaner cleaner; - static ReferenceQueue rq = new ReferenceQueue(); - Cycle_BDec_00010_A2_Cleaner cycleBDA2Cleaner; - int num; - int sum; - static int value; - - Cycle_BDec_00010_A1_Cleaner() { - cleaner.create(cycleBDA2Cleaner, null); - cycleBDA2Cleaner = null; - num = 1; - sum = 0; - value = 100; - } - - void add() { - sum = num + cycleBDA2Cleaner.num; - } -} - -class Cycle_BDec_00010_A2_Cleaner { - Cleaner cleaner; - Cycle_BDec_00010_A1_Cleaner cycleBDA1; - int num; - int sum; - static int value; - - Cycle_BDec_00010_A2_Cleaner() { - cleaner.create(cycleBDA1, null); - cycleBDA1 = null; - num = 2; - sum = 0; - value = 100; - } - - void add() { - sum = num + cycleBDA1.num; - } -} - -class InCycle { - /** - * 确认环是正确的 - * - * @param cycleBD 传入的是带有Referent的类实例 - * @return 传入的是带有Referent的类实例 - */ - public static boolean ModifyCleanerA1(Cycle_BDec_00010_A1_Cleaner cycleBD) { - cycleBD.add(); - cycleBD.cycleBDA2Cleaner.add(); - int nSum = cycleBD.sum + cycleBD.cycleBDA2Cleaner.sum; - if (nSum == 6) { - return true; - } else { - return false; - } - } - - /** - * 设置一个带Cleaner的环 - * - * @param cycleB - * @return - */ - public static boolean setCleanerCycle(Cycle_BDec_00010_A1_Cleaner cycleB) { - cycleB.cycleBDA2Cleaner = new Cycle_BDec_00010_A2_Cleaner(); - cycleB.cycleBDA2Cleaner.cycleBDA1 = cycleB; - boolean ret; - ret = ModifyCleanerA1(cycleB); - // 环正确,且reference都没释放 - if (ret == true && cycleB.cleaner == null && cycleB.cycleBDA2Cleaner.cleaner == null && cycleB != null - && cycleB.cycleBDA2Cleaner != null) { - return true; - } else { - return false; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: RefProCase/RefProcessor/src/IsCleanerNotInDeadCycleFreeRef.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: RefProcessor basic testcase:在一个对象是cleaner的环中释放reference + *- @Brief:functionTest + * -#step1: 分别创建Cycle_BDec_00010_A1_Cleaner类的实例对象cycleBDA1Cleaner,InCycle类的实例对象cycleA; + * -#step2: 调用System.gc()进行垃圾回收; + * -#step3: 以cycleBDA1Cleaner为参数,执行cycleA的setCleanerCycle()方法,并记其返回值为result; + * -#step4: 令cycleBDA1Cleaner.cycleBDA2Cleaner的值为null,经判断result为true,并让当前线程休眠2000ms; + * -#step5: 经判断,cycleBDA1Cleaner.cleaner为null、cycleBDA1Cleaner.cycleBDA2Cleaner.cleaner为null、cycleBDA1Cleaner + * 不为null这三个条件至少有一个为真; + * -#step6: 创建一个ReferenceQueue类的实例对象rq,并且通过cycleBDA1Cleaner.rq.poll()方法返回的cleaner对象等于null; + * -#step7: 调用Runtime.getRuntime().gc()进行垃圾回收; + * -#step8: 重复步骤1~6; + *- @Expect: ExpectResult\n + *- @Priority: High + *- @Source: IsCleanerNotInDeadCycleFreeRef.java + *- @ExecuteClass: IsCleanerNotInDeadCycleFreeRef + *- @ExecuteArgs: + */ + +import sun.misc.Cleaner; + +import java.lang.ref.*; + +public class IsCleanerNotInDeadCycleFreeRef { + static int TEST_NUM = 1; + static int judgeNum = 0; + + public static void main(String[] args) throws Exception { + judgeNum = 0; + for (int i = 0; i < TEST_NUM; i++) { + isCleanerNotInDeadCycleFreeRef(); + Runtime.getRuntime().gc(); + isCleanerNotInDeadCycleFreeRef(); + } + if (judgeNum == 0) { + System.out.println("ExpectResult"); + } + } + + static void isCleanerNotInDeadCycleFreeRef() throws InterruptedException { + Cleaner cleaner; + Cycle_BDec_00010_A1_Cleaner cycleBDA1Cleaner = new Cycle_BDec_00010_A1_Cleaner(); + InCycle cycleA = new InCycle(); + System.gc(); + boolean result = cycleA.setCleanerCycle(cycleBDA1Cleaner); + cycleBDA1Cleaner.cycleBDA2Cleaner = null; + if (result == true) { + Thread.sleep(2000); + if ((cycleBDA1Cleaner.cleaner == null) || (cycleBDA1Cleaner.cycleBDA2Cleaner.cleaner == null) + || (cycleBDA1Cleaner != null)) { + while ((cleaner = (Cleaner) cycleBDA1Cleaner.rq.poll()) != null) { + if (!cleaner.getClass().toString().equals("class sun.misc.Cleaner")) { + judgeNum++; + } + } + } else { + judgeNum++; + } + } else { + judgeNum++; + } + } +} + +class Cycle_BDec_00010_A1_Cleaner { + static Cleaner cleaner; + static ReferenceQueue rq = new ReferenceQueue(); + Cycle_BDec_00010_A2_Cleaner cycleBDA2Cleaner; + int num; + int sum; + static int value; + + Cycle_BDec_00010_A1_Cleaner() { + cleaner.create(cycleBDA2Cleaner, null); + cycleBDA2Cleaner = null; + num = 1; + sum = 0; + value = 100; + } + + void add() { + sum = num + cycleBDA2Cleaner.num; + } +} + +class Cycle_BDec_00010_A2_Cleaner { + Cleaner cleaner; + Cycle_BDec_00010_A1_Cleaner cycleBDA1; + int num; + int sum; + static int value; + + Cycle_BDec_00010_A2_Cleaner() { + cleaner.create(cycleBDA1, null); + cycleBDA1 = null; + num = 2; + sum = 0; + value = 100; + } + + void add() { + sum = num + cycleBDA1.num; + } +} + +class InCycle { + /** + * 确认环是正确的 + * + * @param cycleBD 传入的是带有Referent的类实例 + * @return 传入的是带有Referent的类实例 + */ + public static boolean ModifyCleanerA1(Cycle_BDec_00010_A1_Cleaner cycleBD) { + cycleBD.add(); + cycleBD.cycleBDA2Cleaner.add(); + int nSum = cycleBD.sum + cycleBD.cycleBDA2Cleaner.sum; + if (nSum == 6) { + return true; + } else { + return false; + } + } + + /** + * 设置一个带Cleaner的环 + * + * @param cycleB + * @return + */ + public static boolean setCleanerCycle(Cycle_BDec_00010_A1_Cleaner cycleB) { + cycleB.cycleBDA2Cleaner = new Cycle_BDec_00010_A2_Cleaner(); + cycleB.cycleBDA2Cleaner.cycleBDA1 = cycleB; + boolean ret; + ret = ModifyCleanerA1(cycleB); + // 环正确,且reference都没释放 + if (ret == true && cycleB.cleaner == null && cycleB.cycleBDA2Cleaner.cleaner == null && cycleB != null + && cycleB.cycleBDA2Cleaner != null) { + return true; + } else { + return false; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/RP/RC0354-rc-rp-simpleweakref_07/IsCleanerNotInDeadCycleNotSetWCBFailAtomic.java b/test/testsuite/ouroboros/memory_management/RP/RC0354-rc-rp-simpleweakref_07/IsCleanerNotInDeadCycleNotSetWCBFailAtomic.java index d9a010154e21eeac45b5bb5fea56a0b7704e64ee..5ef336531129f7b2f3da82261b8d59dcc6a4f4dc 100644 --- a/test/testsuite/ouroboros/memory_management/RP/RC0354-rc-rp-simpleweakref_07/IsCleanerNotInDeadCycleNotSetWCBFailAtomic.java +++ b/test/testsuite/ouroboros/memory_management/RP/RC0354-rc-rp-simpleweakref_07/IsCleanerNotInDeadCycleNotSetWCBFailAtomic.java @@ -1,150 +1,150 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: RefProCase/RefProcessor/src/IsCleanerNotInDeadCycleNotSetWCBFailAtomic.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: RefProcessor basic testcase:在可达的环中构造cleaner对象,并不设置WCB。 - *- @Brief:functionTest - * -#step1:创建两个带有Cleaner 对象的class,并相互声明了对方作为自己的Field。 - * -#step2:创建第三个类InCycle,将上两个类连成一个可达的环。 - * -#step3:创建InCycle的实例,调用方法一给第一个类对象关于第二个类的Field初始化对象,再将该对象关于第一个类Field赋值为第一个类, - * 从而形成一个带Cleaner的环。 - * -#step4:方法一调用方法二执行前两个类对象的add方法进行Field的运算,相当于对对象进行了引用,判断运算结果是否正确。 - * -#step5:调用System.gc()进行系统回收,重复步骤4,判断环正确且reference都没释放。 - * -#step6:调用System.gc()进行系统回收,重复步骤3~5。 - * -#step7:调用Runtime.getRuntime().gc()进行系统回收,重复步骤1~6。 - *- @Expect: ExpectResult\n - *- @Priority: High - *- @Source:IsCleanerNotInDeadCycleNotSetWCBFailAtomic.java - *- @ExecuteClass: IsCleanerNotInDeadCycleNotSetWCBFailAtomic - *- @ExecuteArgs: - */ - -import sun.misc.Cleaner; - -import java.lang.ref.*; - -public class IsCleanerNotInDeadCycleNotSetWCBFailAtomic { - static int TEST_NUM = 1; - static int judgeNum = 0; - - public static void main(String[] args) throws Exception { - judgeNum = 0; - for (int i = 0; i < TEST_NUM; i++) { - isCleanerNotInDeadCycleNotSetWCBFailAtomic(); - Runtime.getRuntime().gc(); - isCleanerNotInDeadCycleNotSetWCBFailAtomic(); - } - if (judgeNum == 0) { - System.out.println("ExpectResult"); - } - } - - static void isCleanerNotInDeadCycleNotSetWCBFailAtomic() throws InterruptedException { - Cycle_BDec_00010_A1_Cleaner cleanerClass1 = new Cycle_BDec_00010_A1_Cleaner(); - InCycle cycleA = new InCycle(); - cycleA.setCleanerCycle(cleanerClass1); - System.gc(); - boolean result = cycleA.setCleanerCycle(cleanerClass1); - if (result == false) { - judgeNum++; - } - } -} - -class Cycle_BDec_00010_A1_Cleaner { - static Cleaner cleaner; - static ReferenceQueue rq = new ReferenceQueue(); - Cycle_BDec_00010_A2_Cleaner cleanerClass2; - int num; - int sum; - static int value; - - Cycle_BDec_00010_A1_Cleaner() { - cleaner.create(cleanerClass2, null); - cleanerClass2 = null; - num = 1; - sum = 0; - value = 100; - } - - void add() { - sum = num + cleanerClass2.num; - } -} - -class Cycle_BDec_00010_A2_Cleaner { - Cleaner cleaner; - static ReferenceQueue rq = new ReferenceQueue(); - Cycle_BDec_00010_A1_Cleaner cleanerClass1; - int num; - int sum; - static int value; - - Cycle_BDec_00010_A2_Cleaner() { - cleaner.create(cleanerClass1, null); - cleanerClass1 = null; - num = 2; - sum = 0; - value = 100; - } - - void add() { - sum = num + cleanerClass1.num; - } -} - -class InCycle { - /** - * 确认环是正确的 - * - * @param cleaner 传入的是带有Referent的类实例 - * @return 返回布尔值,判断运算的结果正确 - */ - public static boolean ModifyCleanerA1(Cycle_BDec_00010_A1_Cleaner cleaner) { - cleaner.add(); - cleaner.cleanerClass2.add(); - int nSum = cleaner.sum + cleaner.cleanerClass2.sum; - if (nSum == 6) { - return true; - } else { - return false; - } - } - - /** - * 设置一个带Cleaner的环 - * - * @param cleaner 传入的是带有Referent的类实例 - * @return 返回布尔值,判断reference没释放 - */ - public static boolean setCleanerCycle(Cycle_BDec_00010_A1_Cleaner cleaner) { - cleaner.cleanerClass2 = new Cycle_BDec_00010_A2_Cleaner(); - cleaner.cleanerClass2.cleanerClass1 = cleaner; - boolean ret; - ret = ModifyCleanerA1(cleaner); - System.gc(); - ret = ModifyCleanerA1(cleaner); - // 环正确,且reference都没释放 - if (ret == true && cleaner.cleaner == null && cleaner.cleanerClass2.cleaner == null && cleaner != null - && cleaner.cleanerClass2 != null) { - return true; - } else { - return false; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: RefProCase/RefProcessor/src/IsCleanerNotInDeadCycleNotSetWCBFailAtomic.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: RefProcessor basic testcase:在可达的环中构造cleaner对象,并不设置WCB。 + *- @Brief:functionTest + * -#step1:创建两个带有Cleaner 对象的class,并相互声明了对方作为自己的Field。 + * -#step2:创建第三个类InCycle,将上两个类连成一个可达的环。 + * -#step3:创建InCycle的实例,调用方法一给第一个类对象关于第二个类的Field初始化对象,再将该对象关于第一个类Field赋值为第一个类, + * 从而形成一个带Cleaner的环。 + * -#step4:方法一调用方法二执行前两个类对象的add方法进行Field的运算,相当于对对象进行了引用,判断运算结果是否正确。 + * -#step5:调用System.gc()进行系统回收,重复步骤4,判断环正确且reference都没释放。 + * -#step6:调用System.gc()进行系统回收,重复步骤3~5。 + * -#step7:调用Runtime.getRuntime().gc()进行系统回收,重复步骤1~6。 + *- @Expect: ExpectResult\n + *- @Priority: High + *- @Source:IsCleanerNotInDeadCycleNotSetWCBFailAtomic.java + *- @ExecuteClass: IsCleanerNotInDeadCycleNotSetWCBFailAtomic + *- @ExecuteArgs: + */ + +import sun.misc.Cleaner; + +import java.lang.ref.*; + +public class IsCleanerNotInDeadCycleNotSetWCBFailAtomic { + static int TEST_NUM = 1; + static int judgeNum = 0; + + public static void main(String[] args) throws Exception { + judgeNum = 0; + for (int i = 0; i < TEST_NUM; i++) { + isCleanerNotInDeadCycleNotSetWCBFailAtomic(); + Runtime.getRuntime().gc(); + isCleanerNotInDeadCycleNotSetWCBFailAtomic(); + } + if (judgeNum == 0) { + System.out.println("ExpectResult"); + } + } + + static void isCleanerNotInDeadCycleNotSetWCBFailAtomic() throws InterruptedException { + Cycle_BDec_00010_A1_Cleaner cleanerClass1 = new Cycle_BDec_00010_A1_Cleaner(); + InCycle cycleA = new InCycle(); + cycleA.setCleanerCycle(cleanerClass1); + System.gc(); + boolean result = cycleA.setCleanerCycle(cleanerClass1); + if (result == false) { + judgeNum++; + } + } +} + +class Cycle_BDec_00010_A1_Cleaner { + static Cleaner cleaner; + static ReferenceQueue rq = new ReferenceQueue(); + Cycle_BDec_00010_A2_Cleaner cleanerClass2; + int num; + int sum; + static int value; + + Cycle_BDec_00010_A1_Cleaner() { + cleaner.create(cleanerClass2, null); + cleanerClass2 = null; + num = 1; + sum = 0; + value = 100; + } + + void add() { + sum = num + cleanerClass2.num; + } +} + +class Cycle_BDec_00010_A2_Cleaner { + Cleaner cleaner; + static ReferenceQueue rq = new ReferenceQueue(); + Cycle_BDec_00010_A1_Cleaner cleanerClass1; + int num; + int sum; + static int value; + + Cycle_BDec_00010_A2_Cleaner() { + cleaner.create(cleanerClass1, null); + cleanerClass1 = null; + num = 2; + sum = 0; + value = 100; + } + + void add() { + sum = num + cleanerClass1.num; + } +} + +class InCycle { + /** + * 确认环是正确的 + * + * @param cleaner 传入的是带有Referent的类实例 + * @return 返回布尔值,判断运算的结果正确 + */ + public static boolean ModifyCleanerA1(Cycle_BDec_00010_A1_Cleaner cleaner) { + cleaner.add(); + cleaner.cleanerClass2.add(); + int nSum = cleaner.sum + cleaner.cleanerClass2.sum; + if (nSum == 6) { + return true; + } else { + return false; + } + } + + /** + * 设置一个带Cleaner的环 + * + * @param cleaner 传入的是带有Referent的类实例 + * @return 返回布尔值,判断reference没释放 + */ + public static boolean setCleanerCycle(Cycle_BDec_00010_A1_Cleaner cleaner) { + cleaner.cleanerClass2 = new Cycle_BDec_00010_A2_Cleaner(); + cleaner.cleanerClass2.cleanerClass1 = cleaner; + boolean ret; + ret = ModifyCleanerA1(cleaner); + System.gc(); + ret = ModifyCleanerA1(cleaner); + // 环正确,且reference都没释放 + if (ret == true && cleaner.cleaner == null && cleaner.cleanerClass2.cleaner == null && cleaner != null + && cleaner.cleanerClass2 != null) { + return true; + } else { + return false; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/RP/RC0355-rc-rp-simpleweakref_08/NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic.java b/test/testsuite/ouroboros/memory_management/RP/RC0355-rc-rp-simpleweakref_08/NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic.java index eb5675e32f5c785a7f349c401f57a965893b2caa..35dc2ec74750b4ae2191868baa0350c5c868f80e 100644 --- a/test/testsuite/ouroboros/memory_management/RP/RC0355-rc-rp-simpleweakref_08/NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic.java +++ b/test/testsuite/ouroboros/memory_management/RP/RC0355-rc-rp-simpleweakref_08/NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic.java @@ -1,156 +1,156 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: RefProCase/RefProcessor/src/NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: RefProcessor basic testcase: 在可达的环中,构造对象,不设置WCB - *- @Brief:functionTest - * -#step1:创建两个带有弱引用对象的class,弱引用申请后通过get方法判断非空,并相互声明对方类作为自己的Field。 - * -#step2:创建第三个类InCycle,将上两个类连成一个可达的环。 - * -#step3:创建InCycle的实例,调用方法一给第一个类对象关于第二个类的Field初始化对象,再将该对象关于第一个类Field赋值为第一个类, - * 从而形成一个环。 - * -#step4:方法一调用方法二执行前两个类对象的add方法进行Field的运算,相当于对对象进行了引用,判断运算结果是否正确。 - * -#step5:调用System.gc()进行系统回收,重复步骤3~4。 - * -#step6:调用Runtime.getRuntime().gc()进行系统回收,重复步骤1~5。 - *- @Expect: ExpectResult\n - *- @Priority: High - *- @Source:NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic.java - *- @ExecuteClass: NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic - *- @ExecuteArgs: - */ - -import java.lang.ref.*; - -public class NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic { - static int TEST_NUM = 1; - static int judgeNum = 0; - - public static void main(String[] args) throws Exception { - judgeNum = 0; - for (int i = 0; i < TEST_NUM; i++) { - notIsCleanerNotInDeadCycleNotSetWCBFailAtomic(); - Runtime.getRuntime().gc(); - notIsCleanerNotInDeadCycleNotSetWCBFailAtomic(); - } - if (judgeNum == 0) { - System.out.println("ExpectResult"); - } - } - - static void notIsCleanerNotInDeadCycleNotSetWCBFailAtomic() throws InterruptedException { - Cycle_BDec_00010_A1 cycleMember = new Cycle_BDec_00010_A1(); - InCycle cycleA = new InCycle(); - cycleA.setCycle(cycleMember); - System.gc(); - boolean result = cycleA.setCycle(cycleMember); - if (result == false) { - judgeNum++; - } - } -} - -class Cycle_BDec_00010_A1 { - Reference memberRef1; - static ReferenceQueue rq = new ReferenceQueue(); - Cycle_BDec_00010_A2 partner2; - int num; - int sum; - static int value; - static StringBuffer obj = new StringBuffer("weak"); - - Cycle_BDec_00010_A1() { - obj = new StringBuffer("weak"); - memberRef1 = new WeakReference(obj, rq); - if (memberRef1.get() == null) { - assert false; - } - obj = null; - partner2 = null; - num = 1; - sum = 0; - value = 100; - } - - void add() { - sum = num + partner2.num; - } -} - -class Cycle_BDec_00010_A2 { - Reference memberRef2; - static ReferenceQueue rq = new ReferenceQueue(); - Cycle_BDec_00010_A1 partner1; - int num; - int sum; - static int value; - static StringBuffer obj = new StringBuffer("weak"); - - Cycle_BDec_00010_A2() { - obj = new StringBuffer("weak"); - memberRef2 = new WeakReference(obj, rq); - if (memberRef2.get() == null) { - assert false; - } - obj = null; - partner1 = null; - num = 2; - sum = 0; - value = 100; - } - - void add() { - sum = num + partner1.num; - } -} - -class InCycle { - /** - * 确认环是正确的 - * - * @param refInstance 传入的是带有Referent的类实例 - * @return true:正确;false:错误 - */ - public static boolean ModifyA1(Cycle_BDec_00010_A1 refInstance) { - refInstance.add(); - refInstance.partner2.add(); - int nSum = refInstance.sum + refInstance.partner2.sum; - if (nSum == 6) { - return true; - } else { - return false; - } - } - - /** - * 设置一个带Referent的环 - * - * @param refInstance 传入的是带有Referent的类实例 - * @return true:正确;false:错误 - */ - public static boolean setCycle(Cycle_BDec_00010_A1 refInstance) { - refInstance.partner2 = new Cycle_BDec_00010_A2(); - refInstance.partner2.partner1 = refInstance; - boolean ret; - ret = ModifyA1(refInstance); - if (ret == true) { - return true; - } else { - System.out.println(Thread.currentThread().getStackTrace()[2].getClassName() + " ret != true"); - return false; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: RefProCase/RefProcessor/src/NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: RefProcessor basic testcase: 在可达的环中,构造对象,不设置WCB + *- @Brief:functionTest + * -#step1:创建两个带有弱引用对象的class,弱引用申请后通过get方法判断非空,并相互声明对方类作为自己的Field。 + * -#step2:创建第三个类InCycle,将上两个类连成一个可达的环。 + * -#step3:创建InCycle的实例,调用方法一给第一个类对象关于第二个类的Field初始化对象,再将该对象关于第一个类Field赋值为第一个类, + * 从而形成一个环。 + * -#step4:方法一调用方法二执行前两个类对象的add方法进行Field的运算,相当于对对象进行了引用,判断运算结果是否正确。 + * -#step5:调用System.gc()进行系统回收,重复步骤3~4。 + * -#step6:调用Runtime.getRuntime().gc()进行系统回收,重复步骤1~5。 + *- @Expect: ExpectResult\n + *- @Priority: High + *- @Source:NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic.java + *- @ExecuteClass: NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic + *- @ExecuteArgs: + */ + +import java.lang.ref.*; + +public class NotIsCleanerNotInDeadCycleNotSetWCBFailAtomic { + static int TEST_NUM = 1; + static int judgeNum = 0; + + public static void main(String[] args) throws Exception { + judgeNum = 0; + for (int i = 0; i < TEST_NUM; i++) { + notIsCleanerNotInDeadCycleNotSetWCBFailAtomic(); + Runtime.getRuntime().gc(); + notIsCleanerNotInDeadCycleNotSetWCBFailAtomic(); + } + if (judgeNum == 0) { + System.out.println("ExpectResult"); + } + } + + static void notIsCleanerNotInDeadCycleNotSetWCBFailAtomic() throws InterruptedException { + Cycle_BDec_00010_A1 cycleMember = new Cycle_BDec_00010_A1(); + InCycle cycleA = new InCycle(); + cycleA.setCycle(cycleMember); + System.gc(); + boolean result = cycleA.setCycle(cycleMember); + if (result == false) { + judgeNum++; + } + } +} + +class Cycle_BDec_00010_A1 { + Reference memberRef1; + static ReferenceQueue rq = new ReferenceQueue(); + Cycle_BDec_00010_A2 partner2; + int num; + int sum; + static int value; + static StringBuffer obj = new StringBuffer("weak"); + + Cycle_BDec_00010_A1() { + obj = new StringBuffer("weak"); + memberRef1 = new WeakReference(obj, rq); + if (memberRef1.get() == null) { + assert false; + } + obj = null; + partner2 = null; + num = 1; + sum = 0; + value = 100; + } + + void add() { + sum = num + partner2.num; + } +} + +class Cycle_BDec_00010_A2 { + Reference memberRef2; + static ReferenceQueue rq = new ReferenceQueue(); + Cycle_BDec_00010_A1 partner1; + int num; + int sum; + static int value; + static StringBuffer obj = new StringBuffer("weak"); + + Cycle_BDec_00010_A2() { + obj = new StringBuffer("weak"); + memberRef2 = new WeakReference(obj, rq); + if (memberRef2.get() == null) { + assert false; + } + obj = null; + partner1 = null; + num = 2; + sum = 0; + value = 100; + } + + void add() { + sum = num + partner1.num; + } +} + +class InCycle { + /** + * 确认环是正确的 + * + * @param refInstance 传入的是带有Referent的类实例 + * @return true:正确;false:错误 + */ + public static boolean ModifyA1(Cycle_BDec_00010_A1 refInstance) { + refInstance.add(); + refInstance.partner2.add(); + int nSum = refInstance.sum + refInstance.partner2.sum; + if (nSum == 6) { + return true; + } else { + return false; + } + } + + /** + * 设置一个带Referent的环 + * + * @param refInstance 传入的是带有Referent的类实例 + * @return true:正确;false:错误 + */ + public static boolean setCycle(Cycle_BDec_00010_A1 refInstance) { + refInstance.partner2 = new Cycle_BDec_00010_A2(); + refInstance.partner2.partner1 = refInstance; + boolean ret; + ret = ModifyA1(refInstance); + if (ret == true) { + return true; + } else { + System.out.println(Thread.currentThread().getStackTrace()[2].getClassName() + " ret != true"); + return false; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/SoftRef/RC0432-rc-SoftRef-SoftRefTest02/SoftRefTest02.java b/test/testsuite/ouroboros/memory_management/SoftRef/RC0432-rc-SoftRef-SoftRefTest02/SoftRefTest02.java index 4552160a8e44c0c2a0979bf35562dbc1b80c9dfb..492170d828a8920581d54f1b61779d991bbd9c24 100644 --- a/test/testsuite/ouroboros/memory_management/SoftRef/RC0432-rc-SoftRef-SoftRefTest02/SoftRefTest02.java +++ b/test/testsuite/ouroboros/memory_management/SoftRef/RC0432-rc-SoftRef-SoftRefTest02/SoftRefTest02.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:SoftRefTest02.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: 正常情况下通过system.gc()强制gc时,SoftReference对象不会被回收掉 - *- @Brief:functionTest - * -#step1:创建一个SoftReference对象,并将其放到ReferneceQueue中,该对象不应该被释放; - * -#step2:通过System.gc()进行强制GC - * -#step3:再次确认该对象不应该被释放,且它所在的ReferenceQueue中没有即将回收的Reference对象 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: SoftRefTest02.java - *- @ExecuteClass: SoftRefTest02 - *- @ExecuteArgs: - * - */ - -import java.lang.ref.Reference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.SoftReference; - -public class SoftRefTest02 { - static Reference rp; - static ReferenceQueue rq = new ReferenceQueue(); - static int a = 100; - - static void setSoftReference() { - rp = new SoftReference(new Object(), rq); - if (rp.get() == null) { - System.out.println("Error Result when first check "); - a++; - } - } - - public static void main(String[] args) throws Exception { - setSoftReference(); - for (int i = 0; i < 3; i++) { - System.gc(); - if (rp.get() == null) { - System.out.println("Error Result when second check "); - a++; - } - } - Reference r = rq.poll(); - if (r != null) { - System.out.println("Error Result when checking ReferenceQueue"); - a++; - } - if (a == 100) { - System.out.println("ExpectResult"); - } else { - System.out.println("ErrorResult finally"); - } - - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:SoftRefTest02.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: 正常情况下通过system.gc()强制gc时,SoftReference对象不会被回收掉 + *- @Brief:functionTest + * -#step1:创建一个SoftReference对象,并将其放到ReferneceQueue中,该对象不应该被释放; + * -#step2:通过System.gc()进行强制GC + * -#step3:再次确认该对象不应该被释放,且它所在的ReferenceQueue中没有即将回收的Reference对象 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: SoftRefTest02.java + *- @ExecuteClass: SoftRefTest02 + *- @ExecuteArgs: + * + */ + +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.SoftReference; + +public class SoftRefTest02 { + static Reference rp; + static ReferenceQueue rq = new ReferenceQueue(); + static int a = 100; + + static void setSoftReference() { + rp = new SoftReference(new Object(), rq); + if (rp.get() == null) { + System.out.println("Error Result when first check "); + a++; + } + } + + public static void main(String[] args) throws Exception { + setSoftReference(); + for (int i = 0; i < 3; i++) { + System.gc(); + if (rp.get() == null) { + System.out.println("Error Result when second check "); + a++; + } + } + Reference r = rq.poll(); + if (r != null) { + System.out.println("Error Result when checking ReferenceQueue"); + a++; + } + if (a == 100) { + System.out.println("ExpectResult"); + } else { + System.out.println("ErrorResult finally"); + } + + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/SoftRef/RC0435-rc-SoftRef-SoftRefTest05/SoftRefTest05.java b/test/testsuite/ouroboros/memory_management/SoftRef/RC0435-rc-SoftRef-SoftRefTest05/SoftRefTest05.java index 9a90506a5d80100bf59e54d21b8e6e0a4f6c999b..acd9942d8ab70821e6201856b57c83b31c890442 100644 --- a/test/testsuite/ouroboros/memory_management/SoftRef/RC0435-rc-SoftRef-SoftRefTest05/SoftRefTest05.java +++ b/test/testsuite/ouroboros/memory_management/SoftRef/RC0435-rc-SoftRef-SoftRefTest05/SoftRefTest05.java @@ -1,199 +1,199 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID:SoftRefTest05.java - *- @TestCaseName:MyselfClassName - *- @RequirementName:[运行时需求]支持自动内存管理 - *- @Title/Destination: 环上SoftReference对象在正常情况下不会被释放 - *- @Brief:functionTest - * -#step1:创建一个对象环,由四个对象Class_A、Class_B、Class_C和Class_D组成。这四个对象都一个域,关联着一个SoftReference; - * -#step2:执行一次后,进行一遍gc,进行环的自学习; - * -#step3:再执行一次后,判断环关联的软对象不应该被释放。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: SoftRefTest05.java - *- @ExecuteClass: SoftRefTest05 - *- @ExecuteArgs: - * - */ - -import java.lang.ref.Reference; -import java.lang.ref.SoftReference; - -public class SoftRefTest05 { - static final int TEST_NUM = 1; - static int check_count = 0; - static int allSum; - - public static void main(String[] args) { - for (int i = 0; i < TEST_NUM; i++) { - test_01(); - Runtime.getRuntime().gc(); - // resultLine = null; - test_01(); - - if (allSum == 20) { - check_count++; - System.out.println("sum is srong"); - } - - if (check_count == 0) { - System.out.println("ExpectResult"); - } else { - System.out.println(" errorResult ----checkcount" + check_count); - } - - } - } - - private static void test_01() { - Cycle_A a1 = new Cycle_A(); - a1.cyb = new Cycle_B(); - a1.cyb.cyc = new Cycle_C(); - a1.cyb.cyc.cyd = new Cycle_D(); - a1.cyb.cyc.cyd.cya = a1; - allSum = a1.sum + a1.cyb.sum + a1.cyb.cyc.sum + a1.cyb.cyc.cyd.sum; - sleep(4000); - if ((a1.sr.get() == null) || (a1.cyb.sr.get() == null) || (a1.cyb.cyc.pr.get() == null) || (a1.cyb.cyc.cyd.str.get() == null)) { - check_count++; - } - - } - - private static void sleep(int sleepnum) { - try { - Thread.sleep(sleepnum); - } catch (InterruptedException e) { - System.out.println(Thread.currentThread().getStackTrace()[2].getClassName() + " sleep was Interrupted"); - } - } - -} - -class Cycle_A { - static StringBuffer a = new StringBuffer("ref_processor_cycle_A"); - Reference sr; - Cycle_B cyb; - int aNum; - int sum; - - Cycle_A() { - a = new StringBuffer("ref_processor_cycle_A"); - sr = new SoftReference(a); - if (sr.get() == null) { - assert false; - } - a = null; - cyb = null; - aNum = 1; - } - - int joinStr() { - try { - sum = aNum + cyb.bNum; - } catch (Exception e) { - - } - return sum; - } -} - -class Cycle_B { - static StringBuffer b = new StringBuffer("ref_processor_cycle_B"); - Reference sr; - Cycle_C cyc; - int bNum; - int sum; - - Cycle_B() { - b = new StringBuffer("ref_processor_cycle_B"); - sr = new SoftReference<>(b); - if (sr.get() == null) { - assert false; - } - b = null; - cyc = null; - bNum = 2; - } - - - int joinStr() { - try { - sum = bNum + cyc.cNum; - } catch (Exception e) { - - } - return sum; - } - - -} - -class Cycle_C { - Reference pr; - Cycle_D cyd; - StringBuffer c = new StringBuffer("ref_processor_cycle_C"); - int sum; - int cNum; - - Cycle_C() { - c = new StringBuffer("ref_processor_cycle_C"); - pr = new SoftReference<>(c); - if (pr.get() == null) { - assert false; - } - c = null; - cyd = null; - cNum = 3; - } - - int joinStr() { - try { - sum = cNum + cyd.dNum; - } catch (Exception e) { - - } - return sum; - } -} - -class Cycle_D { - Reference str; - Cycle_A cya; - StringBuffer d = new StringBuffer("ref_processor_cycle_D"); - int dNum; - int sum; - - - Cycle_D() { - d = new StringBuffer("ref_processor_cycle_D"); - str = new SoftReference(d); - d = null; - cya = null; - dNum = 4; - - } - - - int joinStr() { - try { - int sum = dNum + cya.aNum; - } catch (Exception e) { - } - return sum; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID:SoftRefTest05.java + *- @TestCaseName:MyselfClassName + *- @RequirementName:[运行时需求]支持自动内存管理 + *- @Title/Destination: 环上SoftReference对象在正常情况下不会被释放 + *- @Brief:functionTest + * -#step1:创建一个对象环,由四个对象Class_A、Class_B、Class_C和Class_D组成。这四个对象都一个域,关联着一个SoftReference; + * -#step2:执行一次后,进行一遍gc,进行环的自学习; + * -#step3:再执行一次后,判断环关联的软对象不应该被释放。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: SoftRefTest05.java + *- @ExecuteClass: SoftRefTest05 + *- @ExecuteArgs: + * + */ + +import java.lang.ref.Reference; +import java.lang.ref.SoftReference; + +public class SoftRefTest05 { + static final int TEST_NUM = 1; + static int check_count = 0; + static int allSum; + + public static void main(String[] args) { + for (int i = 0; i < TEST_NUM; i++) { + test_01(); + Runtime.getRuntime().gc(); + // resultLine = null; + test_01(); + + if (allSum == 20) { + check_count++; + System.out.println("sum is srong"); + } + + if (check_count == 0) { + System.out.println("ExpectResult"); + } else { + System.out.println(" errorResult ----checkcount" + check_count); + } + + } + } + + private static void test_01() { + Cycle_A a1 = new Cycle_A(); + a1.cyb = new Cycle_B(); + a1.cyb.cyc = new Cycle_C(); + a1.cyb.cyc.cyd = new Cycle_D(); + a1.cyb.cyc.cyd.cya = a1; + allSum = a1.sum + a1.cyb.sum + a1.cyb.cyc.sum + a1.cyb.cyc.cyd.sum; + sleep(4000); + if ((a1.sr.get() == null) || (a1.cyb.sr.get() == null) || (a1.cyb.cyc.pr.get() == null) || (a1.cyb.cyc.cyd.str.get() == null)) { + check_count++; + } + + } + + private static void sleep(int sleepnum) { + try { + Thread.sleep(sleepnum); + } catch (InterruptedException e) { + System.out.println(Thread.currentThread().getStackTrace()[2].getClassName() + " sleep was Interrupted"); + } + } + +} + +class Cycle_A { + static StringBuffer a = new StringBuffer("ref_processor_cycle_A"); + Reference sr; + Cycle_B cyb; + int aNum; + int sum; + + Cycle_A() { + a = new StringBuffer("ref_processor_cycle_A"); + sr = new SoftReference(a); + if (sr.get() == null) { + assert false; + } + a = null; + cyb = null; + aNum = 1; + } + + int joinStr() { + try { + sum = aNum + cyb.bNum; + } catch (Exception e) { + + } + return sum; + } +} + +class Cycle_B { + static StringBuffer b = new StringBuffer("ref_processor_cycle_B"); + Reference sr; + Cycle_C cyc; + int bNum; + int sum; + + Cycle_B() { + b = new StringBuffer("ref_processor_cycle_B"); + sr = new SoftReference<>(b); + if (sr.get() == null) { + assert false; + } + b = null; + cyc = null; + bNum = 2; + } + + + int joinStr() { + try { + sum = bNum + cyc.cNum; + } catch (Exception e) { + + } + return sum; + } + + +} + +class Cycle_C { + Reference pr; + Cycle_D cyd; + StringBuffer c = new StringBuffer("ref_processor_cycle_C"); + int sum; + int cNum; + + Cycle_C() { + c = new StringBuffer("ref_processor_cycle_C"); + pr = new SoftReference<>(c); + if (pr.get() == null) { + assert false; + } + c = null; + cyd = null; + cNum = 3; + } + + int joinStr() { + try { + sum = cNum + cyd.dNum; + } catch (Exception e) { + + } + return sum; + } +} + +class Cycle_D { + Reference str; + Cycle_A cya; + StringBuffer d = new StringBuffer("ref_processor_cycle_D"); + int dNum; + int sum; + + + Cycle_D() { + d = new StringBuffer("ref_processor_cycle_D"); + str = new SoftReference(d); + d = null; + cya = null; + dNum = 4; + + } + + + int joinStr() { + try { + int sum = dNum + cya.aNum; + } catch (Exception e) { + } + return sum; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0477-rc-StackScan-CB_01/CB_01.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0477-rc-StackScan-CB_01/CB_01.java index fee735a94a0a4de353253b82277da2ba5ed8a10b..e57447580ec71d7c71492796aebaa9f2b21b9cff 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0477-rc-StackScan-CB_01/CB_01.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0477-rc-StackScan-CB_01/CB_01.java @@ -1,441 +1,441 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB01 - *- @TestCaseName: CB_01 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考Nocycle_00180.java,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_01.java - *- @ExecuteClass: CB_01 - *- @ExecuteArgs: - */ - -import java.util.HashMap; - -class CB_Nolcycle_a_00180_A1 { - CB_Nolcycle_a_00180_B1 b1_0; - CB_Nolcycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_A1(String strObjectName) { - b1_0 = null; - d1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a + d1_0.a; - } -} - - -class CB_Nolcycle_a_00180_A2 { - CB_Nolcycle_a_00180_B2 b2_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_A2(String strObjectName) { - b2_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b2_0.a; - } -} - - -class CB_Nolcycle_a_00180_A3 { - CB_Nolcycle_a_00180_B2 b2_0; - CB_Nolcycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_A3(String strObjectName) { - b2_0 = null; - c2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b2_0.a + c2_0.a; - } -} - -class CB_Nolcycle_a_00180_A4 { - CB_Nolcycle_a_00180_B3 b3_0; - CB_Nolcycle_a_00180_C2 c2_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_A4(String strObjectName) { - b3_0 = null; - c2_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b3_0.a + c2_0.a; - } -} - - -class CB_Nolcycle_a_00180_B1 { - CB_Nolcycle_a_00180_D2 d2_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_B1(String strObjectName) { - d2_0 = null; - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + d2_0.a; - } -} - - -class CB_Nolcycle_a_00180_B2 { - CB_Nolcycle_a_00180_C1 c1_0; - CB_Nolcycle_a_00180_D1 d1_0; - CB_Nolcycle_a_00180_D2 d2_0; - CB_Nolcycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_B2(String strObjectName) { - c1_0 = null; - d1_0 = null; - d2_0 = null; - d3_0 = null; - a = 202; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B2_"+strObjectName); - } - - void add() { - sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; - } -} - - -class CB_Nolcycle_a_00180_B3 { - CB_Nolcycle_a_00180_C1 c1_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_B3(String strObjectName) { - c1_0 = null; - a = 203; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B3_"+strObjectName); - } - - void add() { - sum = a + c1_0.a; - } -} - - -class CB_Nolcycle_a_00180_C1 { - CB_Nolcycle_a_00180_D1 d1_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_C1(String strObjectName) { - d1_0 = null; - a = 301; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C1_"+strObjectName); - } - - void add() { - sum = a + d1_0.a; - } -} - -class CB_Nolcycle_a_00180_C2 { - CB_Nolcycle_a_00180_D2 d2_0; - CB_Nolcycle_a_00180_D3 d3_0; - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_C2(String strObjectName) { - d2_0 = null; - d3_0 = null; - a = 302; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_C2_"+strObjectName); - } - - void add() { - sum = a + d2_0.a + d3_0.a; - } -} - - -class CB_Nolcycle_a_00180_D1 { - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_D1(String strObjectName) { - a = 401; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class CB_Nolcycle_a_00180_D2 { - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_D2(String strObjectName) { - a = 402; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D2_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -//该树有12个节点 -class CB_Nolcycle_a_00180_D3 { - int a; - int sum; - String strObjectName; - - CB_Nolcycle_a_00180_D3(String strObjectName) { - a = 403; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_D3_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class CB_Nolcycle_a_00180 { - public CB_Nolcycle_a_00180() { - CB_Nolcycle_a_00180_A1 a1_main = new CB_Nolcycle_a_00180_A1("a1_main"); - CB_Nolcycle_a_00180_A2 a2_main = new CB_Nolcycle_a_00180_A2("a2_main"); - CB_Nolcycle_a_00180_A3 a3_main = new CB_Nolcycle_a_00180_A3("a3_main"); - CB_Nolcycle_a_00180_A4 a4_main = new CB_Nolcycle_a_00180_A4("a4_main"); - a1_main.b1_0 = new CB_Nolcycle_a_00180_B1("b1_0"); - a1_main.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); - a1_main.b1_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); - - a2_main.b2_0 = new CB_Nolcycle_a_00180_B2("b2_0"); - a2_main.b2_0.c1_0 = new CB_Nolcycle_a_00180_C1("c1_0"); - a2_main.b2_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); - a2_main.b2_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); - a2_main.b2_0.d3_0 = new CB_Nolcycle_a_00180_D3("d3_0"); - a2_main.b2_0.c1_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); - - a3_main.b2_0 = new CB_Nolcycle_a_00180_B2("b2_0"); - a3_main.b2_0.c1_0 = new CB_Nolcycle_a_00180_C1("c1_0"); - a3_main.b2_0.c1_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); - a3_main.b2_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); - a3_main.b2_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); - a3_main.b2_0.d3_0 = new CB_Nolcycle_a_00180_D3("d3_0"); - - a3_main.c2_0 = new CB_Nolcycle_a_00180_C2("c2_0"); - a3_main.c2_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); - a3_main.c2_0.d3_0 = new CB_Nolcycle_a_00180_D3("d3_0"); - - a4_main.b3_0 = new CB_Nolcycle_a_00180_B3("b3_0"); - a4_main.b3_0.c1_0 = new CB_Nolcycle_a_00180_C1("c1_0"); - a4_main.b3_0.c1_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); - a4_main.c2_0 = new CB_Nolcycle_a_00180_C2("c2_0"); - a4_main.c2_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); - a4_main.c2_0.d3_0 = new CB_Nolcycle_a_00180_D3("d3_0"); - } -} - -class CB_01_A1 { - static HashMap test1; - static - int a; - CB_01_A2 a2_0; - CB_01_A3 a3_0; - int sum; - String strObjectName; - - CB_01_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - //System.out.println("A finalize"); - - CB_01.check = this; - - } -} - -class CB_01_A2 { - static CB_01_A1 a1_0; - volatile static HashMap test2; - CB_01_A3 a3_0; - int a; - int sum; - String strObjectName; - - CB_01_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + CB_01_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - } -} - -class CB_01_A3 { - static CB_Nolcycle_a_00180[] test1; - CB_01_A1 a1_0; - CB_01_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_01_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_01_A1.a + a2_0.a; - } -} - - -public class CB_01 { - public static CB_01_A1 check = null; - private static CB_01_A1 a1_main = null; - - private CB_01() { - a1_main = new CB_01_A1("a1_main"); - a1_main.a2_0 = new CB_01_A2("a2_0"); - CB_01_A2.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_01_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - private static void test_CB_01(int times) { - CB_01_A1.test1 = new HashMap(); - CB_01_A2.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - CB_01_A1.test1.put(i, new CB_Nolcycle_a_00180()); - CB_01_A2.test2.put(i, new CB_Nolcycle_a_00180()); - } - } - - private static void rc_testcase_main_wrapper() { - CB_01 cb01 = new CB_01(); - test_CB_01(10000); - check = a1_main; - try { - int result = CB_01.check.sum + CB_01.check.a2_0.sum + CB_01.check.a2_0.a3_0.sum + CB_01_A1.test1.size() + CB_01_A2.test2.size(); - if (result == 20918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB01 + *- @TestCaseName: CB_01 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考Nocycle_00180.java,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_01.java + *- @ExecuteClass: CB_01 + *- @ExecuteArgs: + */ + +import java.util.HashMap; + +class CB_Nolcycle_a_00180_A1 { + CB_Nolcycle_a_00180_B1 b1_0; + CB_Nolcycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_A1(String strObjectName) { + b1_0 = null; + d1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a + d1_0.a; + } +} + + +class CB_Nolcycle_a_00180_A2 { + CB_Nolcycle_a_00180_B2 b2_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_A2(String strObjectName) { + b2_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b2_0.a; + } +} + + +class CB_Nolcycle_a_00180_A3 { + CB_Nolcycle_a_00180_B2 b2_0; + CB_Nolcycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_A3(String strObjectName) { + b2_0 = null; + c2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b2_0.a + c2_0.a; + } +} + +class CB_Nolcycle_a_00180_A4 { + CB_Nolcycle_a_00180_B3 b3_0; + CB_Nolcycle_a_00180_C2 c2_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_A4(String strObjectName) { + b3_0 = null; + c2_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b3_0.a + c2_0.a; + } +} + + +class CB_Nolcycle_a_00180_B1 { + CB_Nolcycle_a_00180_D2 d2_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_B1(String strObjectName) { + d2_0 = null; + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + d2_0.a; + } +} + + +class CB_Nolcycle_a_00180_B2 { + CB_Nolcycle_a_00180_C1 c1_0; + CB_Nolcycle_a_00180_D1 d1_0; + CB_Nolcycle_a_00180_D2 d2_0; + CB_Nolcycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_B2(String strObjectName) { + c1_0 = null; + d1_0 = null; + d2_0 = null; + d3_0 = null; + a = 202; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B2_"+strObjectName); + } + + void add() { + sum = a + c1_0.a + d1_0.a + d2_0.a + d3_0.a; + } +} + + +class CB_Nolcycle_a_00180_B3 { + CB_Nolcycle_a_00180_C1 c1_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_B3(String strObjectName) { + c1_0 = null; + a = 203; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B3_"+strObjectName); + } + + void add() { + sum = a + c1_0.a; + } +} + + +class CB_Nolcycle_a_00180_C1 { + CB_Nolcycle_a_00180_D1 d1_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_C1(String strObjectName) { + d1_0 = null; + a = 301; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C1_"+strObjectName); + } + + void add() { + sum = a + d1_0.a; + } +} + +class CB_Nolcycle_a_00180_C2 { + CB_Nolcycle_a_00180_D2 d2_0; + CB_Nolcycle_a_00180_D3 d3_0; + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_C2(String strObjectName) { + d2_0 = null; + d3_0 = null; + a = 302; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_C2_"+strObjectName); + } + + void add() { + sum = a + d2_0.a + d3_0.a; + } +} + + +class CB_Nolcycle_a_00180_D1 { + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_D1(String strObjectName) { + a = 401; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class CB_Nolcycle_a_00180_D2 { + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_D2(String strObjectName) { + a = 402; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D2_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +//该树有12个节点 +class CB_Nolcycle_a_00180_D3 { + int a; + int sum; + String strObjectName; + + CB_Nolcycle_a_00180_D3(String strObjectName) { + a = 403; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_D3_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class CB_Nolcycle_a_00180 { + public CB_Nolcycle_a_00180() { + CB_Nolcycle_a_00180_A1 a1_main = new CB_Nolcycle_a_00180_A1("a1_main"); + CB_Nolcycle_a_00180_A2 a2_main = new CB_Nolcycle_a_00180_A2("a2_main"); + CB_Nolcycle_a_00180_A3 a3_main = new CB_Nolcycle_a_00180_A3("a3_main"); + CB_Nolcycle_a_00180_A4 a4_main = new CB_Nolcycle_a_00180_A4("a4_main"); + a1_main.b1_0 = new CB_Nolcycle_a_00180_B1("b1_0"); + a1_main.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); + a1_main.b1_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); + + a2_main.b2_0 = new CB_Nolcycle_a_00180_B2("b2_0"); + a2_main.b2_0.c1_0 = new CB_Nolcycle_a_00180_C1("c1_0"); + a2_main.b2_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); + a2_main.b2_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); + a2_main.b2_0.d3_0 = new CB_Nolcycle_a_00180_D3("d3_0"); + a2_main.b2_0.c1_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); + + a3_main.b2_0 = new CB_Nolcycle_a_00180_B2("b2_0"); + a3_main.b2_0.c1_0 = new CB_Nolcycle_a_00180_C1("c1_0"); + a3_main.b2_0.c1_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); + a3_main.b2_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); + a3_main.b2_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); + a3_main.b2_0.d3_0 = new CB_Nolcycle_a_00180_D3("d3_0"); + + a3_main.c2_0 = new CB_Nolcycle_a_00180_C2("c2_0"); + a3_main.c2_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); + a3_main.c2_0.d3_0 = new CB_Nolcycle_a_00180_D3("d3_0"); + + a4_main.b3_0 = new CB_Nolcycle_a_00180_B3("b3_0"); + a4_main.b3_0.c1_0 = new CB_Nolcycle_a_00180_C1("c1_0"); + a4_main.b3_0.c1_0.d1_0 = new CB_Nolcycle_a_00180_D1("d1_0"); + a4_main.c2_0 = new CB_Nolcycle_a_00180_C2("c2_0"); + a4_main.c2_0.d2_0 = new CB_Nolcycle_a_00180_D2("d2_0"); + a4_main.c2_0.d3_0 = new CB_Nolcycle_a_00180_D3("d3_0"); + } +} + +class CB_01_A1 { + static HashMap test1; + static + int a; + CB_01_A2 a2_0; + CB_01_A3 a3_0; + int sum; + String strObjectName; + + CB_01_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + //System.out.println("A finalize"); + + CB_01.check = this; + + } +} + +class CB_01_A2 { + static CB_01_A1 a1_0; + volatile static HashMap test2; + CB_01_A3 a3_0; + int a; + int sum; + String strObjectName; + + CB_01_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + CB_01_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + } +} + +class CB_01_A3 { + static CB_Nolcycle_a_00180[] test1; + CB_01_A1 a1_0; + CB_01_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_01_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_01_A1.a + a2_0.a; + } +} + + +public class CB_01 { + public static CB_01_A1 check = null; + private static CB_01_A1 a1_main = null; + + private CB_01() { + a1_main = new CB_01_A1("a1_main"); + a1_main.a2_0 = new CB_01_A2("a2_0"); + CB_01_A2.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_01_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + private static void test_CB_01(int times) { + CB_01_A1.test1 = new HashMap(); + CB_01_A2.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + CB_01_A1.test1.put(i, new CB_Nolcycle_a_00180()); + CB_01_A2.test2.put(i, new CB_Nolcycle_a_00180()); + } + } + + private static void rc_testcase_main_wrapper() { + CB_01 cb01 = new CB_01(); + test_CB_01(10000); + check = a1_main; + try { + int result = CB_01.check.sum + CB_01.check.a2_0.sum + CB_01.check.a2_0.a3_0.sum + CB_01_A1.test1.size() + CB_01_A2.test2.size(); + if (result == 20918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0478-rc-StackScan-CB_02/CB_02.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0478-rc-StackScan-CB_02/CB_02.java index c58462102a8ac7f2171539f3057928a377df8762..88eca688b803d820a480002ed9aa048976f39771 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0478-rc-StackScan-CB_02/CB_02.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0478-rc-StackScan-CB_02/CB_02.java @@ -1,157 +1,157 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB02 - *- @TestCaseName: CB_02 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式为String类型,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_02.java - *- @ExecuteClass: CB_02 - *- @ExecuteArgs: - */ - -import java.util.HashMap; - -class CB_02_A1 { - static HashMap test1; - static - int a; - CB_02_A2 a2_0; - CB_02_A3 a3_0; - int sum; - String strObjectName; - - CB_02_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - CB_02.check = this; - } -} - -class CB_02_A2 { - volatile static HashMap test2; - CB_02_A1 a1_0; - CB_02_A3 a3_0; - int a; - int sum; - String strObjectName; - - CB_02_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + CB_02_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - } -} - -class CB_02_A3 { - CB_02_A1 a1_0; - CB_02_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_02_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + CB_02_A1.a + a2_0.a; - } -} - - -public class CB_02 { - public volatile static CB_02_A1 check = null; - private static CB_02_A1 a1_main = null; - - private CB_02() { - a1_main = new CB_02_A1("a1_main"); - a1_main.a2_0 = new CB_02_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_02_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - private static void test_CB_02(int times) { - CB_02_A1.test1 = new HashMap(); - CB_02_A2.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - CB_02_A1.test1.put(i, "Maple" + i); - CB_02_A2.test2.put(i, "Figo" + i); - } - } - - private static void rc_testcase_main_wrapper() { - CB_02 cb01 = new CB_02(); - test_CB_02(100000); - check = a1_main; - try { - int result = CB_02.check.sum + CB_02.check.a2_0.sum + CB_02.check.a2_0.a3_0.sum + CB_02_A1.test1.size() + CB_02_A2.test2.size(); - if (result == 200918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB02 + *- @TestCaseName: CB_02 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式为String类型,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_02.java + *- @ExecuteClass: CB_02 + *- @ExecuteArgs: + */ + +import java.util.HashMap; + +class CB_02_A1 { + static HashMap test1; + static + int a; + CB_02_A2 a2_0; + CB_02_A3 a3_0; + int sum; + String strObjectName; + + CB_02_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + CB_02.check = this; + } +} + +class CB_02_A2 { + volatile static HashMap test2; + CB_02_A1 a1_0; + CB_02_A3 a3_0; + int a; + int sum; + String strObjectName; + + CB_02_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + CB_02_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + } +} + +class CB_02_A3 { + CB_02_A1 a1_0; + CB_02_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_02_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + CB_02_A1.a + a2_0.a; + } +} + + +public class CB_02 { + public volatile static CB_02_A1 check = null; + private static CB_02_A1 a1_main = null; + + private CB_02() { + a1_main = new CB_02_A1("a1_main"); + a1_main.a2_0 = new CB_02_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_02_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + private static void test_CB_02(int times) { + CB_02_A1.test1 = new HashMap(); + CB_02_A2.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + CB_02_A1.test1.put(i, "Maple" + i); + CB_02_A2.test2.put(i, "Figo" + i); + } + } + + private static void rc_testcase_main_wrapper() { + CB_02 cb01 = new CB_02(); + test_CB_02(100000); + check = a1_main; + try { + int result = CB_02.check.sum + CB_02.check.a2_0.sum + CB_02.check.a2_0.a3_0.sum + CB_02_A1.test1.size() + CB_02_A2.test2.size(); + if (result == 200918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0479-rc-StackScan-CB_03/CB_03.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0479-rc-StackScan-CB_03/CB_03.java index 23abedde35cc417eab57560afa9297b123e5b2f3..69d29b97684b18f7895a8c2ce11d427dbdfabf32 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0479-rc-StackScan-CB_03/CB_03.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0479-rc-StackScan-CB_03/CB_03.java @@ -1,152 +1,152 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB03 - *- @TestCaseName: CB_03 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式为StringBuffer类型,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_03.java - *- @ExecuteClass: CB_03 - *- @ExecuteArgs: - */ - -import java.util.HashMap; - -class CB_03_A1 { - static HashMap test1; - static - int a; - CB_03_A2 a2_0; - CB_03_A3 a3_0; - int sum; - String strObjectName; - - CB_03_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - CB_03.check = this; - } -} - -class CB_03_A2 { - CB_03_A1 a1_0; - CB_03_A3 a3_0; - volatile HashMap test2; - int a; - int sum; - String strObjectName; - - CB_03_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_03_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - } -} - -class CB_03_A3 { - CB_03_A1 a1_0; - CB_03_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_03_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_03_A1.a + a2_0.a; - } -} - - -public class CB_03 { - public volatile static CB_03_A1 check = null; - private static CB_03_A1 a1_main = null; - - private CB_03() { - a1_main = new CB_03_A1("a1_main"); - a1_main.a2_0 = new CB_03_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_03_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - private static void test_CB_03(int times) { - CB_03_A1.test1 = new HashMap(); - a1_main.a2_0.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - CB_03_A1.test1.put(i, new StringBuffer("Maple test").append(i)); - a1_main.a2_0.test2.put(i, new StringBuffer("Figo test").append(i)); - } - } - - private static void rc_testcase_main_wrapper() { - CB_03 cb01 = new CB_03(); - test_CB_03(100000); - check = a1_main; - try { - int result = CB_03.check.sum + CB_03.check.a2_0.sum + CB_03.check.a2_0.a3_0.sum + CB_03_A1.test1.size() + check.a2_0.test2.size(); - if (result == 200918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB03 + *- @TestCaseName: CB_03 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式为StringBuffer类型,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_03.java + *- @ExecuteClass: CB_03 + *- @ExecuteArgs: + */ + +import java.util.HashMap; + +class CB_03_A1 { + static HashMap test1; + static + int a; + CB_03_A2 a2_0; + CB_03_A3 a3_0; + int sum; + String strObjectName; + + CB_03_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + CB_03.check = this; + } +} + +class CB_03_A2 { + CB_03_A1 a1_0; + CB_03_A3 a3_0; + volatile HashMap test2; + int a; + int sum; + String strObjectName; + + CB_03_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_03_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + } +} + +class CB_03_A3 { + CB_03_A1 a1_0; + CB_03_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_03_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_03_A1.a + a2_0.a; + } +} + + +public class CB_03 { + public volatile static CB_03_A1 check = null; + private static CB_03_A1 a1_main = null; + + private CB_03() { + a1_main = new CB_03_A1("a1_main"); + a1_main.a2_0 = new CB_03_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_03_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + private static void test_CB_03(int times) { + CB_03_A1.test1 = new HashMap(); + a1_main.a2_0.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + CB_03_A1.test1.put(i, new StringBuffer("Maple test").append(i)); + a1_main.a2_0.test2.put(i, new StringBuffer("Figo test").append(i)); + } + } + + private static void rc_testcase_main_wrapper() { + CB_03 cb01 = new CB_03(); + test_CB_03(100000); + check = a1_main; + try { + int result = CB_03.check.sum + CB_03.check.a2_0.sum + CB_03.check.a2_0.a3_0.sum + CB_03_A1.test1.size() + check.a2_0.test2.size(); + if (result == 200918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0480-rc-StackScan-CB_04/CB_04.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0480-rc-StackScan-CB_04/CB_04.java index 79d35119b965b86e7da9fabf0f275d325a93333c..bf8e55f25a7b025cc53a4ae0f9fb24de85aed1a5 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0480-rc-StackScan-CB_04/CB_04.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0480-rc-StackScan-CB_04/CB_04.java @@ -1,162 +1,162 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB04 - *- @TestCaseName: CB_04 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式为StringBuilder类型,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_04.java - *- @ExecuteClass: CB_04 - *- @ExecuteArgs: - */ - -import java.util.HashMap; - -class CB_04_A1 { - static HashMap test1; - static - int a; - CB_04_A2 a2_0; - CB_04_A3 a3_0; - int sum; - String strObjectName; - - CB_04_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); -// System.out.println("A finalize"); - - CB_04.check = this; - - } - -} - -class CB_04_A2 { - volatile static HashMap test2; - CB_04_A1 a1_0; - CB_04_A3 a3_0; - int a; - int sum; - String strObjectName; - - CB_04_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + CB_04_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); -// System.out.println("B finalize"); - } -} - -class CB_04_A3 { - CB_04_A1 a1_0; - CB_04_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_04_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + CB_04_A1.a + a2_0.a; - } -} - - -public class CB_04 { - public static CB_04_A1 a1_main = null; - public volatile static CB_04_A1 check = null; - - public CB_04() { - a1_main = new CB_04_A1("a1_main"); - a1_main.a2_0 = new CB_04_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_04_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - public static void test_CB_04(int times) { - CB_04_A1.test1 = new HashMap(); - CB_04_A2.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - CB_04_A1.test1.put(i, new StringBuilder().append(i)); - CB_04_A2.test2.put(i, new StringBuilder().append(times + i)); - } - } - - public static void rc_testcase_main_wrapper() { - CB_04 cb01 = new CB_04(); - test_CB_04(100000); - check = a1_main; - try { - int result = CB_04.check.sum + CB_04.check.a2_0.sum + CB_04.check.a2_0.a3_0.sum + CB_04_A1.test1.size() + CB_04_A2.test2.size(); - if (result == 200918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB04 + *- @TestCaseName: CB_04 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式为StringBuilder类型,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_04.java + *- @ExecuteClass: CB_04 + *- @ExecuteArgs: + */ + +import java.util.HashMap; + +class CB_04_A1 { + static HashMap test1; + static + int a; + CB_04_A2 a2_0; + CB_04_A3 a3_0; + int sum; + String strObjectName; + + CB_04_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); +// System.out.println("A finalize"); + + CB_04.check = this; + + } + +} + +class CB_04_A2 { + volatile static HashMap test2; + CB_04_A1 a1_0; + CB_04_A3 a3_0; + int a; + int sum; + String strObjectName; + + CB_04_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + CB_04_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); +// System.out.println("B finalize"); + } +} + +class CB_04_A3 { + CB_04_A1 a1_0; + CB_04_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_04_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + CB_04_A1.a + a2_0.a; + } +} + + +public class CB_04 { + public static CB_04_A1 a1_main = null; + public volatile static CB_04_A1 check = null; + + public CB_04() { + a1_main = new CB_04_A1("a1_main"); + a1_main.a2_0 = new CB_04_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_04_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + public static void test_CB_04(int times) { + CB_04_A1.test1 = new HashMap(); + CB_04_A2.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + CB_04_A1.test1.put(i, new StringBuilder().append(i)); + CB_04_A2.test2.put(i, new StringBuilder().append(times + i)); + } + } + + public static void rc_testcase_main_wrapper() { + CB_04 cb01 = new CB_04(); + test_CB_04(100000); + check = a1_main; + try { + int result = CB_04.check.sum + CB_04.check.a2_0.sum + CB_04.check.a2_0.a3_0.sum + CB_04_A1.test1.size() + CB_04_A2.test2.size(); + if (result == 200918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0481-rc-StackScan-CB_05/CB_05.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0481-rc-StackScan-CB_05/CB_05.java index 455b76c139ae3f17777b2c9e429c46a878f349a9..8725da010591b34edfa352ecc4cddc50bee71728 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0481-rc-StackScan-CB_05/CB_05.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0481-rc-StackScan-CB_05/CB_05.java @@ -1,155 +1,155 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB05 - *- @TestCaseName: CB_05 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式为SoftReference类型,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_05.java - *- @ExecuteClass: CB_05 - *- @ExecuteArgs: - */ - -import java.lang.ref.SoftReference; -import java.util.HashMap; - -class CB_05_A1 { - static HashMap test1; - static - int a; - CB_05_A2 a2_0; - CB_05_A3 a3_0; - int sum; - String strObjectName; - - CB_05_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - CB_05.check = this; - - } -} - -class CB_05_A2 { - volatile static HashMap test2; - CB_05_A1 a1_0; - CB_05_A3 a3_0; - int a; - int sum; - String strObjectName; - - CB_05_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_05_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - } -} - -class CB_05_A3 { - CB_05_A1 a1_0; - CB_05_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_05_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_05_A1.a + a2_0.a; - } -} - - -public class CB_05 { - public volatile static CB_05_A1 check = null; - private static CB_05_A1 a1_main = null; - - private CB_05() { - a1_main = new CB_05_A1("a1_main"); - a1_main.a2_0 = new CB_05_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_05_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - private static void test_CB_05(int times) { - CB_05_A1.test1 = new HashMap(); - CB_05_A2.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - CB_05_A1.test1.put(i, new SoftReference<>("maple" + i)); - CB_05_A2.test2.put(i, new SoftReference<>("maple" + times + i)); - } - } - - private static void rc_testcase_main_wrapper() { - CB_05 cb01 = new CB_05(); - test_CB_05(10000); - check = a1_main; - try { - int result = CB_05.check.sum + CB_05.check.a2_0.sum + CB_05.check.a2_0.a3_0.sum + CB_05_A1.test1.size() + CB_05_A2.test2.size(); - if (result == 20918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB05 + *- @TestCaseName: CB_05 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式为SoftReference类型,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_05.java + *- @ExecuteClass: CB_05 + *- @ExecuteArgs: + */ + +import java.lang.ref.SoftReference; +import java.util.HashMap; + +class CB_05_A1 { + static HashMap test1; + static + int a; + CB_05_A2 a2_0; + CB_05_A3 a3_0; + int sum; + String strObjectName; + + CB_05_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + CB_05.check = this; + + } +} + +class CB_05_A2 { + volatile static HashMap test2; + CB_05_A1 a1_0; + CB_05_A3 a3_0; + int a; + int sum; + String strObjectName; + + CB_05_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_05_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + } +} + +class CB_05_A3 { + CB_05_A1 a1_0; + CB_05_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_05_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_05_A1.a + a2_0.a; + } +} + + +public class CB_05 { + public volatile static CB_05_A1 check = null; + private static CB_05_A1 a1_main = null; + + private CB_05() { + a1_main = new CB_05_A1("a1_main"); + a1_main.a2_0 = new CB_05_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_05_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + private static void test_CB_05(int times) { + CB_05_A1.test1 = new HashMap(); + CB_05_A2.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + CB_05_A1.test1.put(i, new SoftReference<>("maple" + i)); + CB_05_A2.test2.put(i, new SoftReference<>("maple" + times + i)); + } + } + + private static void rc_testcase_main_wrapper() { + CB_05 cb01 = new CB_05(); + test_CB_05(10000); + check = a1_main; + try { + int result = CB_05.check.sum + CB_05.check.a2_0.sum + CB_05.check.a2_0.a3_0.sum + CB_05_A1.test1.size() + CB_05_A2.test2.size(); + if (result == 20918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0482-rc-StackScan-CB_06/CB_06.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0482-rc-StackScan-CB_06/CB_06.java index 9d56f91633793a7a4a9cf49c4bc7e7dddc4ca02c..24640a81b2f51f4b8178813e17874b5239fd84a3 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0482-rc-StackScan-CB_06/CB_06.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0482-rc-StackScan-CB_06/CB_06.java @@ -1,155 +1,155 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB06 - *- @TestCaseName: CB_06 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式为WeakReference类型,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_06.java - *- @ExecuteClass: CB_06 - *- @ExecuteArgs: - */ - -import java.lang.ref.WeakReference; -import java.util.HashMap; - -class CB_06_A1 { - static HashMap test1; - static - int a; - CB_06_A2 a2_0; - CB_06_A3 a3_0; - int sum; - String strObjectName; - - CB_06_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - CB_06.check = this; - } -} - -class CB_06_A2 { - volatile static HashMap test2; - CB_06_A1 a1_0; - CB_06_A3 a3_0; - int a; - int sum; - String strObjectName; - - CB_06_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_06_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - } -} - -class CB_06_A3 { - CB_06_A1 a1_0; - CB_06_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_06_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_06_A1.a + a2_0.a; - } -} - - -public class CB_06 { - public volatile static CB_06_A1 check = null; - static String str; - private static CB_06_A1 a1_main = null; - - private CB_06() { - a1_main = new CB_06_A1("a1_main"); - a1_main.a2_0 = new CB_06_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_06_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - private static void test_CB_06(int times) { - CB_06_A1.test1 = new HashMap(); - CB_06_A2.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - CB_06_A1.test1.put(i, new WeakReference("Maple" + i)); - CB_06_A2.test2.put(i, new WeakReference("Figo" + i)); - } - } - - private static void rc_testcase_main_wrapper() { - CB_06 cb01 = new CB_06(); - test_CB_06(100000); - check = a1_main; - try { - int result = CB_06.check.sum + CB_06.check.a2_0.sum + CB_06.check.a2_0.a3_0.sum + CB_06_A1.test1.size() + CB_06_A2.test2.size(); - if (result == 200918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB06 + *- @TestCaseName: CB_06 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式为WeakReference类型,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_06.java + *- @ExecuteClass: CB_06 + *- @ExecuteArgs: + */ + +import java.lang.ref.WeakReference; +import java.util.HashMap; + +class CB_06_A1 { + static HashMap test1; + static + int a; + CB_06_A2 a2_0; + CB_06_A3 a3_0; + int sum; + String strObjectName; + + CB_06_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + CB_06.check = this; + } +} + +class CB_06_A2 { + volatile static HashMap test2; + CB_06_A1 a1_0; + CB_06_A3 a3_0; + int a; + int sum; + String strObjectName; + + CB_06_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_06_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + } +} + +class CB_06_A3 { + CB_06_A1 a1_0; + CB_06_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_06_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_06_A1.a + a2_0.a; + } +} + + +public class CB_06 { + public volatile static CB_06_A1 check = null; + static String str; + private static CB_06_A1 a1_main = null; + + private CB_06() { + a1_main = new CB_06_A1("a1_main"); + a1_main.a2_0 = new CB_06_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_06_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + private static void test_CB_06(int times) { + CB_06_A1.test1 = new HashMap(); + CB_06_A2.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + CB_06_A1.test1.put(i, new WeakReference("Maple" + i)); + CB_06_A2.test2.put(i, new WeakReference("Figo" + i)); + } + } + + private static void rc_testcase_main_wrapper() { + CB_06 cb01 = new CB_06(); + test_CB_06(100000); + check = a1_main; + try { + int result = CB_06.check.sum + CB_06.check.a2_0.sum + CB_06.check.a2_0.a3_0.sum + CB_06_A1.test1.size() + CB_06_A2.test2.size(); + if (result == 200918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0483-rc-StackScan-CB_07/CB_07.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0483-rc-StackScan-CB_07/CB_07.java index dda87ebcc8244ecee9a20a360889c0eb30e883a9..a54576ea9b0341101397313b6e5a285f4b4d801e 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0483-rc-StackScan-CB_07/CB_07.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0483-rc-StackScan-CB_07/CB_07.java @@ -1,157 +1,157 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB07 - *- @TestCaseName: CB_07 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式为PhantomReference类型,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_07.java - *- @ExecuteClass: CB_07 - *- @ExecuteArgs: - */ - -import java.lang.ref.PhantomReference; -import java.lang.ref.ReferenceQueue; -import java.util.HashMap; - -class CB_07_A1 { - static HashMap test1; - static - int a; - CB_07_A2 a2_0; - CB_07_A3 a3_0; - int sum; - String strObjectName; - - CB_07_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - CB_07.check = this; - } -} - -class CB_07_A2 { - volatile static HashMap test2; - CB_07_A1 a1_0; - CB_07_A3 a3_0; - int a; - int sum; - String strObjectName; - - CB_07_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_07_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - } -} - -class CB_07_A3 { - CB_07_A1 a1_0; - CB_07_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_07_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_07_A1.a + a2_0.a; - } -} - - -public class CB_07 { - public volatile static CB_07_A1 check = null; - static ReferenceQueue rq = new ReferenceQueue(); - static String str; - private static CB_07_A1 a1_main = null; - - private CB_07() { - a1_main = new CB_07_A1("a1_main"); - a1_main.a2_0 = new CB_07_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_07_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - private static void test_CB_07(int times) { - CB_07_A1.test1 = new HashMap(); - CB_07_A2.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - CB_07_A1.test1.put(i, new PhantomReference<>("maple" + i, rq)); - CB_07_A2.test2.put(i, new PhantomReference<>("Figo" + times + i, rq)); - } - } - - private static void rc_testcase_main_wrapper() { - CB_07 cb01 = new CB_07(); - test_CB_07(100000); - check = a1_main; - try { - int result = CB_07.check.sum + CB_07.check.a2_0.sum + CB_07.check.a2_0.a3_0.sum + CB_07_A1.test1.size() + CB_07_A2.test2.size(); - if (result == 200918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB07 + *- @TestCaseName: CB_07 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式为PhantomReference类型,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_07.java + *- @ExecuteClass: CB_07 + *- @ExecuteArgs: + */ + +import java.lang.ref.PhantomReference; +import java.lang.ref.ReferenceQueue; +import java.util.HashMap; + +class CB_07_A1 { + static HashMap test1; + static + int a; + CB_07_A2 a2_0; + CB_07_A3 a3_0; + int sum; + String strObjectName; + + CB_07_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + CB_07.check = this; + } +} + +class CB_07_A2 { + volatile static HashMap test2; + CB_07_A1 a1_0; + CB_07_A3 a3_0; + int a; + int sum; + String strObjectName; + + CB_07_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_07_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + } +} + +class CB_07_A3 { + CB_07_A1 a1_0; + CB_07_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_07_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_07_A1.a + a2_0.a; + } +} + + +public class CB_07 { + public volatile static CB_07_A1 check = null; + static ReferenceQueue rq = new ReferenceQueue(); + static String str; + private static CB_07_A1 a1_main = null; + + private CB_07() { + a1_main = new CB_07_A1("a1_main"); + a1_main.a2_0 = new CB_07_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_07_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + private static void test_CB_07(int times) { + CB_07_A1.test1 = new HashMap(); + CB_07_A2.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + CB_07_A1.test1.put(i, new PhantomReference<>("maple" + i, rq)); + CB_07_A2.test2.put(i, new PhantomReference<>("Figo" + times + i, rq)); + } + } + + private static void rc_testcase_main_wrapper() { + CB_07 cb01 = new CB_07(); + test_CB_07(100000); + check = a1_main; + try { + int result = CB_07.check.sum + CB_07.check.a2_0.sum + CB_07.check.a2_0.a3_0.sum + CB_07_A1.test1.size() + CB_07_A2.test2.size(); + if (result == 200918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0484-rc-StackScan-CB_08/CB_08.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0484-rc-StackScan-CB_08/CB_08.java index 1543d6bb652224cdb5f9f251ed502ea34ccea865..567eab77aa4376374f8f04da1904b8e6ba227ab8 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0484-rc-StackScan-CB_08/CB_08.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0484-rc-StackScan-CB_08/CB_08.java @@ -1,158 +1,158 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB08 - *- @TestCaseName: CB_08 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式为OutOfMemoryError类型,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_08.java - *- @ExecuteClass: CB_08 - *- @ExecuteArgs: - */ - -import java.util.HashMap; - -class CB_08_A1 { - static HashMap test1; - static - int a; - CB_08_A2 a2_0; - CB_08_A3 a3_0; - int sum; - String strObjectName; - - CB_08_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - CB_08.check = this; - } - -} - -class CB_08_A2 { - volatile static HashMap test2; - CB_08_A1 a1_0; - CB_08_A3 a3_0; - int a; - int sum; - String strObjectName; - - CB_08_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_08_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - } -} - -class CB_08_A3 { - CB_08_A1 a1_0; - CB_08_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_08_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_08_A1.a + a2_0.a; - } -} - - -public class CB_08 { - public volatile static CB_08_A1 check = null; - private static CB_08_A1 a1_main = null; - private volatile static OutOfMemoryError test1; - private static OutOfMemoryError test2; - - private CB_08() { - a1_main = new CB_08_A1("a1_main"); - a1_main.a2_0 = new CB_08_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_08_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - private static void test_CB_08(int times) { - CB_08_A1.test1 = new HashMap(); - CB_08_A2.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - test1 = new OutOfMemoryError(); - CB_08_A1.test1.put(i, test1); - test2 = new OutOfMemoryError(); - CB_08_A2.test2.put(i, test2); - } - } - - private static void rc_testcase_main_wrapper() { - CB_08 cb01 = new CB_08(); - test_CB_08(100000); - check = a1_main; - try { - int result = CB_08.check.sum + CB_08.check.a2_0.sum + CB_08.check.a2_0.a3_0.sum + CB_08_A1.test1.size() + CB_08_A2.test2.size(); - if (result == 200918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB08 + *- @TestCaseName: CB_08 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式为OutOfMemoryError类型,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_08.java + *- @ExecuteClass: CB_08 + *- @ExecuteArgs: + */ + +import java.util.HashMap; + +class CB_08_A1 { + static HashMap test1; + static + int a; + CB_08_A2 a2_0; + CB_08_A3 a3_0; + int sum; + String strObjectName; + + CB_08_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + CB_08.check = this; + } + +} + +class CB_08_A2 { + volatile static HashMap test2; + CB_08_A1 a1_0; + CB_08_A3 a3_0; + int a; + int sum; + String strObjectName; + + CB_08_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_08_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + } +} + +class CB_08_A3 { + CB_08_A1 a1_0; + CB_08_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_08_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_08_A1.a + a2_0.a; + } +} + + +public class CB_08 { + public volatile static CB_08_A1 check = null; + private static CB_08_A1 a1_main = null; + private volatile static OutOfMemoryError test1; + private static OutOfMemoryError test2; + + private CB_08() { + a1_main = new CB_08_A1("a1_main"); + a1_main.a2_0 = new CB_08_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_08_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + private static void test_CB_08(int times) { + CB_08_A1.test1 = new HashMap(); + CB_08_A2.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + test1 = new OutOfMemoryError(); + CB_08_A1.test1.put(i, test1); + test2 = new OutOfMemoryError(); + CB_08_A2.test2.put(i, test2); + } + } + + private static void rc_testcase_main_wrapper() { + CB_08 cb01 = new CB_08(); + test_CB_08(100000); + check = a1_main; + try { + int result = CB_08.check.sum + CB_08.check.a2_0.sum + CB_08.check.a2_0.a3_0.sum + CB_08_A1.test1.size() + CB_08_A2.test2.size(); + if (result == 200918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0485-rc-StackScan-CB_09/CB_09.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0485-rc-StackScan-CB_09/CB_09.java index 93126be5ac8c950fa4bb6f2d903eb0ecb7481297..7cce6eb6f0bcee53d717d31ccdeff3fcc19bc5e1 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0485-rc-StackScan-CB_09/CB_09.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0485-rc-StackScan-CB_09/CB_09.java @@ -1,156 +1,156 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CB09 - *- @TestCaseName: CB_09 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式为ClassLoader类型,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: CB_09.java - *- @ExecuteClass: CB_09 - *- @ExecuteArgs: - */ - -import java.util.HashMap; - -class CB_09_A1 { - static HashMap test1; - static - int a; - CB_09_A2 a2_0; - CB_09_A3 a3_0; - int sum; - String strObjectName; - - CB_09_A1(String strObjectName) { - a2_0 = null; - a3_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a2_0.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - CB_09.check = this; - } -} - -class CB_09_A2 { - volatile static HashMap test2; - CB_09_A1 a1_0; - CB_09_A3 a3_0; - int a; - int sum; - String strObjectName; - - CB_09_A2(String strObjectName) { - a1_0 = null; - a3_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_09_A1.a + a3_0.a; - } - - @Override - public void finalize() throws Throwable { - super.finalize(); - } -} - -class CB_09_A3 { - CB_09_A1 a1_0; - CB_09_A2 a2_0; - int a; - int sum; - String strObjectName; - - CB_09_A3(String strObjectName) { - a1_0 = null; - a2_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + CB_09_A1.a + a2_0.a; - } -} - -public class CB_09 { - public static CB_09_A1 a1_main = null; - public volatile static CB_09_A1 check = null; - public volatile static ClassLoader test1; - public static ClassLoader test2; - - public CB_09() { - a1_main = new CB_09_A1("a1_main"); - a1_main.a2_0 = new CB_09_A2("a2_0"); - a1_main.a2_0.a1_0 = a1_main; - a1_main.a2_0.a3_0 = new CB_09_A3("a3_0"); - a1_main.a3_0 = a1_main.a2_0.a3_0; - a1_main.a3_0.a1_0 = a1_main; - a1_main.a3_0.a2_0 = a1_main.a2_0; - - a1_main.add(); - a1_main.a2_0.add(); - a1_main.a2_0.a3_0.add(); - } - - public static void test_CB_09(int times) { - CB_09_A1.test1 = new HashMap(); - CB_09_A2.test2 = new HashMap(); - for (int i = 0; i < times; i++) { - test1 = CB_09_A1.class.getClassLoader(); - CB_09_A1.test1.put(i, test1); - test2 = CB_09_A1.class.getClassLoader(); - CB_09_A2.test2.put(i, test2); - } - } - - public static void rc_testcase_main_wrapper() { - CB_09 cb01 = new CB_09(); - test_CB_09(100000); - check = a1_main; - try { - int result = CB_09.check.sum + CB_09.check.a2_0.sum + CB_09.check.a2_0.a3_0.sum; - if (result == 918) - System.out.println("ExpectResult"); - } catch (NullPointerException n) { - System.out.println("ErrorResult"); - } - } - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CB09 + *- @TestCaseName: CB_09 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式为ClassLoader类型,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: CB_09.java + *- @ExecuteClass: CB_09 + *- @ExecuteArgs: + */ + +import java.util.HashMap; + +class CB_09_A1 { + static HashMap test1; + static + int a; + CB_09_A2 a2_0; + CB_09_A3 a3_0; + int sum; + String strObjectName; + + CB_09_A1(String strObjectName) { + a2_0 = null; + a3_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a2_0.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + CB_09.check = this; + } +} + +class CB_09_A2 { + volatile static HashMap test2; + CB_09_A1 a1_0; + CB_09_A3 a3_0; + int a; + int sum; + String strObjectName; + + CB_09_A2(String strObjectName) { + a1_0 = null; + a3_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_09_A1.a + a3_0.a; + } + + @Override + public void finalize() throws Throwable { + super.finalize(); + } +} + +class CB_09_A3 { + CB_09_A1 a1_0; + CB_09_A2 a2_0; + int a; + int sum; + String strObjectName; + + CB_09_A3(String strObjectName) { + a1_0 = null; + a2_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + CB_09_A1.a + a2_0.a; + } +} + +public class CB_09 { + public static CB_09_A1 a1_main = null; + public volatile static CB_09_A1 check = null; + public volatile static ClassLoader test1; + public static ClassLoader test2; + + public CB_09() { + a1_main = new CB_09_A1("a1_main"); + a1_main.a2_0 = new CB_09_A2("a2_0"); + a1_main.a2_0.a1_0 = a1_main; + a1_main.a2_0.a3_0 = new CB_09_A3("a3_0"); + a1_main.a3_0 = a1_main.a2_0.a3_0; + a1_main.a3_0.a1_0 = a1_main; + a1_main.a3_0.a2_0 = a1_main.a2_0; + + a1_main.add(); + a1_main.a2_0.add(); + a1_main.a2_0.a3_0.add(); + } + + public static void test_CB_09(int times) { + CB_09_A1.test1 = new HashMap(); + CB_09_A2.test2 = new HashMap(); + for (int i = 0; i < times; i++) { + test1 = CB_09_A1.class.getClassLoader(); + CB_09_A1.test1.put(i, test1); + test2 = CB_09_A1.class.getClassLoader(); + CB_09_A2.test2.put(i, test2); + } + } + + public static void rc_testcase_main_wrapper() { + CB_09 cb01 = new CB_09(); + test_CB_09(100000); + check = a1_main; + try { + int result = CB_09.check.sum + CB_09.check.a2_0.sum + CB_09.check.a2_0.a3_0.sum; + if (result == 918) + System.out.println("ExpectResult"); + } catch (NullPointerException n) { + System.out.println("ErrorResult"); + } + } + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0488-rc-StackScan-CP_Thread_03/CP_Thread_03.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0488-rc-StackScan-CP_Thread_03/CP_Thread_03.java index f5d50545096acf55a3aab5fe6bb9ea04b1d5b5ed..492994d28907c1f0ce5155cea08d3fe68809559d 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0488-rc-StackScan-CP_Thread_03/CP_Thread_03.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0488-rc-StackScan-CP_Thread_03/CP_Thread_03.java @@ -1,100 +1,100 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_03 - *- @TestCaseName: CP_Thread_03 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考StringBuffer,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: CP_Thread_03.java - *- @ExecuteClass: CP_Thread_03 - *- @ExecuteArgs: - */ - -class CP_Thread_03_A1 { - static StringBuffer[] test1; - static - int a; - CP_Thread_03_A1 a2_0; - int sum; - String strObjectName; - - CP_Thread_03_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -class CP_Thread_03_test extends Thread { - private static CP_Thread_03_A1 a1_main = null; - private volatile static CP_Thread_03_A1 a2 = null; - private volatile static StringBuffer test1; - private static StringBuffer test2; - - private static void test_CP_Thread_03_A1(int times) { - CP_Thread_03_A1.test1 = new StringBuffer[times]; - for (int i = 0; i < times; i++) { - test1 = new StringBuffer("maple" + i); - CP_Thread_03_A1.test1[i] = test1; - } - } - - private static void test_CP_Thread_03_A2(int times) { - CP_Thread_03_A1.test1 = new StringBuffer[times]; - for (int i = 0; i < times; i++) { - test2 = new StringBuffer("maple" + times + i); - CP_Thread_03_A1.test1[i] = test2; - } - } - - public void run() { - a1_main = new CP_Thread_03_A1("a1_main"); - a2 = new CP_Thread_03_A1("a2_0"); - a1_main.a2_0 = a2; - a1_main.a2_0.a2_0 = a2; - a1_main.add(); - a1_main.a2_0.add(); - test_CP_Thread_03_A1(10000); - test_CP_Thread_03_A2(10000); - int result = a1_main.sum + a1_main.a2_0.sum; - if (result == 404) - System.out.println("ExpectResult"); - } -} - -public class CP_Thread_03 { - private static CP_Thread_03_A1 a1_main = null; - private volatile static CP_Thread_03_A1 a2 = null; - - public static void main(String[] args) { - CP_Thread_03_test cptest1 = new CP_Thread_03_test(); - cptest1.run(); - CP_Thread_03_test cptest2 = new CP_Thread_03_test(); - cptest2.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_03 + *- @TestCaseName: CP_Thread_03 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考StringBuffer,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: CP_Thread_03.java + *- @ExecuteClass: CP_Thread_03 + *- @ExecuteArgs: + */ + +class CP_Thread_03_A1 { + static StringBuffer[] test1; + static + int a; + CP_Thread_03_A1 a2_0; + int sum; + String strObjectName; + + CP_Thread_03_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +class CP_Thread_03_test extends Thread { + private static CP_Thread_03_A1 a1_main = null; + private volatile static CP_Thread_03_A1 a2 = null; + private volatile static StringBuffer test1; + private static StringBuffer test2; + + private static void test_CP_Thread_03_A1(int times) { + CP_Thread_03_A1.test1 = new StringBuffer[times]; + for (int i = 0; i < times; i++) { + test1 = new StringBuffer("maple" + i); + CP_Thread_03_A1.test1[i] = test1; + } + } + + private static void test_CP_Thread_03_A2(int times) { + CP_Thread_03_A1.test1 = new StringBuffer[times]; + for (int i = 0; i < times; i++) { + test2 = new StringBuffer("maple" + times + i); + CP_Thread_03_A1.test1[i] = test2; + } + } + + public void run() { + a1_main = new CP_Thread_03_A1("a1_main"); + a2 = new CP_Thread_03_A1("a2_0"); + a1_main.a2_0 = a2; + a1_main.a2_0.a2_0 = a2; + a1_main.add(); + a1_main.a2_0.add(); + test_CP_Thread_03_A1(10000); + test_CP_Thread_03_A2(10000); + int result = a1_main.sum + a1_main.a2_0.sum; + if (result == 404) + System.out.println("ExpectResult"); + } +} + +public class CP_Thread_03 { + private static CP_Thread_03_A1 a1_main = null; + private volatile static CP_Thread_03_A1 a2 = null; + + public static void main(String[] args) { + CP_Thread_03_test cptest1 = new CP_Thread_03_test(); + cptest1.run(); + CP_Thread_03_test cptest2 = new CP_Thread_03_test(); + cptest2.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0489-rc-StackScan-CP_Thread_04/CP_Thread_04.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0489-rc-StackScan-CP_Thread_04/CP_Thread_04.java index 36733afb4806a0d704d59e9e8ff075a62d5a64e3..1264551bf6d6c0fa2035a51f80428bb3a6a59280 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0489-rc-StackScan-CP_Thread_04/CP_Thread_04.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0489-rc-StackScan-CP_Thread_04/CP_Thread_04.java @@ -1,100 +1,100 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_04 - *- @TestCaseName: CP_Thread_04 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考StringBuffer,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: CP_Thread_04.java - *- @ExecuteClass: CP_Thread_04 - *- @ExecuteArgs: - */ - -class CP_Thread_04_A1 { - static StringBuilder[] test1; - static - int a; - CP_Thread_04_A1 a2_0; - int sum; - String strObjectName; - - CP_Thread_04_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -class CP_Thread_04_test extends Thread { - private static CP_Thread_04_A1 a1_main = null; - private volatile static CP_Thread_04_A1 a2 = null; - private volatile static StringBuilder test1; - private static StringBuilder test2; - - private static void test_CP_Thread_04_A1(int times) { - CP_Thread_04_A1.test1 = new StringBuilder[times]; - for (int i = 0; i < times; i++) { - test1 = new StringBuilder("maple" + i); - CP_Thread_04_A1.test1[i] = test1; - } - } - - private static void test_CP_Thread_04_A2(int times) { - CP_Thread_04_A1.test1 = new StringBuilder[times]; - for (int i = 0; i < times; i++) { - test2 = new StringBuilder("maple" + times + i); - CP_Thread_04_A1.test1[i] = test2; - } - } - - public void run() { - a1_main = new CP_Thread_04_A1("a1_main"); - a2 = new CP_Thread_04_A1("a2_0"); - a1_main.a2_0 = a2; - a1_main.a2_0.a2_0 = a2; - a1_main.add(); - a1_main.a2_0.add(); - test_CP_Thread_04_A1(10000); - test_CP_Thread_04_A2(10000); - int result = a1_main.sum + a1_main.a2_0.sum; - if (result == 404) - System.out.println("ExpectResult"); - } -} - -public class CP_Thread_04 { - private static CP_Thread_04_A1 a1_main = null; - private static CP_Thread_04_A1 a2 = null; - - public static void main(String[] args) { - CP_Thread_04_test cptest1 = new CP_Thread_04_test(); - cptest1.run(); - CP_Thread_04_test cptest2 = new CP_Thread_04_test(); - cptest2.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_04 + *- @TestCaseName: CP_Thread_04 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考StringBuffer,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: CP_Thread_04.java + *- @ExecuteClass: CP_Thread_04 + *- @ExecuteArgs: + */ + +class CP_Thread_04_A1 { + static StringBuilder[] test1; + static + int a; + CP_Thread_04_A1 a2_0; + int sum; + String strObjectName; + + CP_Thread_04_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +class CP_Thread_04_test extends Thread { + private static CP_Thread_04_A1 a1_main = null; + private volatile static CP_Thread_04_A1 a2 = null; + private volatile static StringBuilder test1; + private static StringBuilder test2; + + private static void test_CP_Thread_04_A1(int times) { + CP_Thread_04_A1.test1 = new StringBuilder[times]; + for (int i = 0; i < times; i++) { + test1 = new StringBuilder("maple" + i); + CP_Thread_04_A1.test1[i] = test1; + } + } + + private static void test_CP_Thread_04_A2(int times) { + CP_Thread_04_A1.test1 = new StringBuilder[times]; + for (int i = 0; i < times; i++) { + test2 = new StringBuilder("maple" + times + i); + CP_Thread_04_A1.test1[i] = test2; + } + } + + public void run() { + a1_main = new CP_Thread_04_A1("a1_main"); + a2 = new CP_Thread_04_A1("a2_0"); + a1_main.a2_0 = a2; + a1_main.a2_0.a2_0 = a2; + a1_main.add(); + a1_main.a2_0.add(); + test_CP_Thread_04_A1(10000); + test_CP_Thread_04_A2(10000); + int result = a1_main.sum + a1_main.a2_0.sum; + if (result == 404) + System.out.println("ExpectResult"); + } +} + +public class CP_Thread_04 { + private static CP_Thread_04_A1 a1_main = null; + private static CP_Thread_04_A1 a2 = null; + + public static void main(String[] args) { + CP_Thread_04_test cptest1 = new CP_Thread_04_test(); + cptest1.run(); + CP_Thread_04_test cptest2 = new CP_Thread_04_test(); + cptest2.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0490-rc-StackScan-CP_Thread_05/CP_Thread_05.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0490-rc-StackScan-CP_Thread_05/CP_Thread_05.java index f2207414bf364cd11e961e032af1c1c51b788d46..e6b6ba945f06726f6e601022b4c8b72cb807c9b6 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0490-rc-StackScan-CP_Thread_05/CP_Thread_05.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0490-rc-StackScan-CP_Thread_05/CP_Thread_05.java @@ -1,105 +1,105 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_05 - *- @TestCaseName: CP_Thread_05 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考SoftReference,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: CP_Thread_05.java - *- @ExecuteClass: CP_Thread_05 - *- @ExecuteArgs: - */ - -import java.lang.ref.SoftReference; - -class CP_Thread_05_A1 { - static SoftReference[] test1; - static - int a; - CP_Thread_05_A1 a2_0; - int sum; - String strObjectName; - - CP_Thread_05_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -class CP_Thread_05_test extends Thread { - static String str; - private static CP_Thread_05_A1 a1_main = null; - private volatile static CP_Thread_05_A1 a2 = null; - private volatile static SoftReference test1; - private static SoftReference test2; - - private static void test_CP_Thread_05_A1(int times) { - CP_Thread_05_A1.test1 = new SoftReference[times]; - for (int i = 0; i < times; i++) { - str = "maple" + i; - test1 = new SoftReference<>(str); - CP_Thread_05_A1.test1[i] = test1; - } - } - - private static void test_CP_Thread_05_A2(int times) { - CP_Thread_05_A1.test1 = new SoftReference[times]; - for (int i = 0; i < times; i++) { - test2 = new SoftReference<>("maple" + times + i); - CP_Thread_05_A1.test1[i] = test2; - } - } - - public void run() { - a1_main = new CP_Thread_05_A1("a1_main"); - a2 = new CP_Thread_05_A1("a2_0"); - a1_main.a2_0 = a2; - a1_main.a2_0.a2_0 = a2; - - a1_main.add(); - a1_main.a2_0.add(); - test_CP_Thread_05_A1(10000); - test_CP_Thread_05_A2(10000); - int result = a1_main.sum + a1_main.a2_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 404) - System.out.println("ExpectResult"); - } -} - -public class CP_Thread_05 { - private static CP_Thread_05_A1 a1_main = null; - private static CP_Thread_05_A1 a2 = null; - - public static void main(String[] args) { - CP_Thread_05_test cptest1 = new CP_Thread_05_test(); - cptest1.run(); - CP_Thread_05_test cptest2 = new CP_Thread_05_test(); - cptest2.run(); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_05 + *- @TestCaseName: CP_Thread_05 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考SoftReference,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: CP_Thread_05.java + *- @ExecuteClass: CP_Thread_05 + *- @ExecuteArgs: + */ + +import java.lang.ref.SoftReference; + +class CP_Thread_05_A1 { + static SoftReference[] test1; + static + int a; + CP_Thread_05_A1 a2_0; + int sum; + String strObjectName; + + CP_Thread_05_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +class CP_Thread_05_test extends Thread { + static String str; + private static CP_Thread_05_A1 a1_main = null; + private volatile static CP_Thread_05_A1 a2 = null; + private volatile static SoftReference test1; + private static SoftReference test2; + + private static void test_CP_Thread_05_A1(int times) { + CP_Thread_05_A1.test1 = new SoftReference[times]; + for (int i = 0; i < times; i++) { + str = "maple" + i; + test1 = new SoftReference<>(str); + CP_Thread_05_A1.test1[i] = test1; + } + } + + private static void test_CP_Thread_05_A2(int times) { + CP_Thread_05_A1.test1 = new SoftReference[times]; + for (int i = 0; i < times; i++) { + test2 = new SoftReference<>("maple" + times + i); + CP_Thread_05_A1.test1[i] = test2; + } + } + + public void run() { + a1_main = new CP_Thread_05_A1("a1_main"); + a2 = new CP_Thread_05_A1("a2_0"); + a1_main.a2_0 = a2; + a1_main.a2_0.a2_0 = a2; + + a1_main.add(); + a1_main.a2_0.add(); + test_CP_Thread_05_A1(10000); + test_CP_Thread_05_A2(10000); + int result = a1_main.sum + a1_main.a2_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 404) + System.out.println("ExpectResult"); + } +} + +public class CP_Thread_05 { + private static CP_Thread_05_A1 a1_main = null; + private static CP_Thread_05_A1 a2 = null; + + public static void main(String[] args) { + CP_Thread_05_test cptest1 = new CP_Thread_05_test(); + cptest1.run(); + CP_Thread_05_test cptest2 = new CP_Thread_05_test(); + cptest2.run(); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0491-rc-StackScan-CP_Thread_06/CP_Thread_06.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0491-rc-StackScan-CP_Thread_06/CP_Thread_06.java index 67ce087fdc0e84461bc40b6cddfc67fa0daedd20..beca0105ac48ea1f76f9e593ea0752fe8b5666fe 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0491-rc-StackScan-CP_Thread_06/CP_Thread_06.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0491-rc-StackScan-CP_Thread_06/CP_Thread_06.java @@ -1,106 +1,106 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_06 - *- @TestCaseName: CP_Thread_06 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考WeakReference,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: CP_Thread_06.java - *- @ExecuteClass: CP_Thread_06 - *- @ExecuteArgs: - */ - -import java.lang.ref.WeakReference; - -class CP_Thread_06_A1 { - static WeakReference[] test1; - static - int a; - CP_Thread_06_A1 a2_0; - int sum; - String strObjectName; - - CP_Thread_06_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -class CP_Thread_06_test extends Thread { - static String str; - private static CP_Thread_06_A1 a1_main = null; - private volatile static CP_Thread_06_A1 a2 = null; - private volatile static WeakReference test1; - private static WeakReference test2; - - private static void test_CP_Thread_06_A1(int times) { - CP_Thread_06_A1.test1 = new WeakReference[times]; - for (int i = 0; i < times; i++) { - str = "maple" + i; - test1 = new WeakReference<>(str); - CP_Thread_06_A1.test1[i] = test1; - } - } - - private static void test_CP_Thread_06_A2(int times) { - CP_Thread_06_A1.test1 = new WeakReference[times]; - for (int i = 0; i < times; i++) { - test2 = new WeakReference<>("maple" + times + i); - CP_Thread_06_A1.test1[i] = test2; - } - } - - public void run() { - a1_main = new CP_Thread_06_A1("a1_main"); - a2 = new CP_Thread_06_A1("a2_0"); - a1_main.a2_0 = a2; - a1_main.a2_0.a2_0 = a2; - - a1_main.add(); - a1_main.a2_0.add(); - test_CP_Thread_06_A1(10000); - test_CP_Thread_06_A2(10000); - int result = a1_main.sum + a1_main.a2_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 404) - System.out.println("ExpectResult"); - } -} - -public class CP_Thread_06 { - private static CP_Thread_06_A1 a1_main = null; - private static CP_Thread_06_A1 a2 = null; - - public static void main(String[] args) { - CP_Thread_06_test cptest1 = new CP_Thread_06_test(); - cptest1.run(); - CP_Thread_06_test cptest2 = new CP_Thread_06_test(); - cptest2.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_06 + *- @TestCaseName: CP_Thread_06 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考WeakReference,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: CP_Thread_06.java + *- @ExecuteClass: CP_Thread_06 + *- @ExecuteArgs: + */ + +import java.lang.ref.WeakReference; + +class CP_Thread_06_A1 { + static WeakReference[] test1; + static + int a; + CP_Thread_06_A1 a2_0; + int sum; + String strObjectName; + + CP_Thread_06_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +class CP_Thread_06_test extends Thread { + static String str; + private static CP_Thread_06_A1 a1_main = null; + private volatile static CP_Thread_06_A1 a2 = null; + private volatile static WeakReference test1; + private static WeakReference test2; + + private static void test_CP_Thread_06_A1(int times) { + CP_Thread_06_A1.test1 = new WeakReference[times]; + for (int i = 0; i < times; i++) { + str = "maple" + i; + test1 = new WeakReference<>(str); + CP_Thread_06_A1.test1[i] = test1; + } + } + + private static void test_CP_Thread_06_A2(int times) { + CP_Thread_06_A1.test1 = new WeakReference[times]; + for (int i = 0; i < times; i++) { + test2 = new WeakReference<>("maple" + times + i); + CP_Thread_06_A1.test1[i] = test2; + } + } + + public void run() { + a1_main = new CP_Thread_06_A1("a1_main"); + a2 = new CP_Thread_06_A1("a2_0"); + a1_main.a2_0 = a2; + a1_main.a2_0.a2_0 = a2; + + a1_main.add(); + a1_main.a2_0.add(); + test_CP_Thread_06_A1(10000); + test_CP_Thread_06_A2(10000); + int result = a1_main.sum + a1_main.a2_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 404) + System.out.println("ExpectResult"); + } +} + +public class CP_Thread_06 { + private static CP_Thread_06_A1 a1_main = null; + private static CP_Thread_06_A1 a2 = null; + + public static void main(String[] args) { + CP_Thread_06_test cptest1 = new CP_Thread_06_test(); + cptest1.run(); + CP_Thread_06_test cptest2 = new CP_Thread_06_test(); + cptest2.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0492-rc-StackScan-CP_Thread_07/CP_Thread_07.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0492-rc-StackScan-CP_Thread_07/CP_Thread_07.java index a4b609998e7f2eb0c1d6f8cd1d54995aefc9af01..481c15827f2eb513aaf7b5005d4d7c3bc1021b04 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0492-rc-StackScan-CP_Thread_07/CP_Thread_07.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0492-rc-StackScan-CP_Thread_07/CP_Thread_07.java @@ -1,106 +1,106 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_07 - *- @TestCaseName: CP_Thread_07 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考PhantomReference,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: CP_Thread_07.java - *- @ExecuteClass: CP_Thread_07 - *- @ExecuteArgs: - */ - -import java.lang.ref.PhantomReference; -import java.lang.ref.ReferenceQueue; - -class CP_Thread_07_A1 { - static PhantomReference[] test1; - static - int a; - CP_Thread_07_A1 a2_0; - int sum; - String strObjectName; - - CP_Thread_07_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -class CP_Thread_07_test extends Thread { - static ReferenceQueue rq = new ReferenceQueue(); - static String str; - private static CP_Thread_07_A1 a1_main = null; - private volatile static CP_Thread_07_A1 a2 = null; - - private static void test_CP_Thread_07_A1(int times) { - CP_Thread_07_A1.test1 = new PhantomReference[times]; - for (int i = 0; i < times; i++) { - str = "maple" + i; - PhantomReference temp = new PhantomReference<>(str, rq); - CP_Thread_07_A1.test1[i] = temp; - } - } - - private static void test_CP_Thread_07_A2(int times) { - CP_Thread_07_A1.test1 = new PhantomReference[times]; - for (int i = 0; i < times; i++) { - PhantomReference temp = new PhantomReference<>(str + times + i, rq); - CP_Thread_07_A1.test1[i] = temp; - } - } - - public void run() { - a1_main = new CP_Thread_07_A1("a1_main"); - a2 = new CP_Thread_07_A1("a2_0"); - a1_main.a2_0 = a2; - a1_main.a2_0.a2_0 = a2; - - a1_main.add(); - a1_main.a2_0.add(); - test_CP_Thread_07_A1(10000); - test_CP_Thread_07_A2(10000); - int result = a1_main.sum + a1_main.a2_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 404) - System.out.println("ExpectResult"); - } -} - -public class CP_Thread_07 { - private static CP_Thread_07_A1 a1_main = null; - private static CP_Thread_07_A1 a2 = null; - - public static void main(String[] args) { - CP_Thread_07_test cptest1 = new CP_Thread_07_test(); - cptest1.run(); - CP_Thread_07_test cptest2 = new CP_Thread_07_test(); - cptest2.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_07 + *- @TestCaseName: CP_Thread_07 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考PhantomReference,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: CP_Thread_07.java + *- @ExecuteClass: CP_Thread_07 + *- @ExecuteArgs: + */ + +import java.lang.ref.PhantomReference; +import java.lang.ref.ReferenceQueue; + +class CP_Thread_07_A1 { + static PhantomReference[] test1; + static + int a; + CP_Thread_07_A1 a2_0; + int sum; + String strObjectName; + + CP_Thread_07_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +class CP_Thread_07_test extends Thread { + static ReferenceQueue rq = new ReferenceQueue(); + static String str; + private static CP_Thread_07_A1 a1_main = null; + private volatile static CP_Thread_07_A1 a2 = null; + + private static void test_CP_Thread_07_A1(int times) { + CP_Thread_07_A1.test1 = new PhantomReference[times]; + for (int i = 0; i < times; i++) { + str = "maple" + i; + PhantomReference temp = new PhantomReference<>(str, rq); + CP_Thread_07_A1.test1[i] = temp; + } + } + + private static void test_CP_Thread_07_A2(int times) { + CP_Thread_07_A1.test1 = new PhantomReference[times]; + for (int i = 0; i < times; i++) { + PhantomReference temp = new PhantomReference<>(str + times + i, rq); + CP_Thread_07_A1.test1[i] = temp; + } + } + + public void run() { + a1_main = new CP_Thread_07_A1("a1_main"); + a2 = new CP_Thread_07_A1("a2_0"); + a1_main.a2_0 = a2; + a1_main.a2_0.a2_0 = a2; + + a1_main.add(); + a1_main.a2_0.add(); + test_CP_Thread_07_A1(10000); + test_CP_Thread_07_A2(10000); + int result = a1_main.sum + a1_main.a2_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 404) + System.out.println("ExpectResult"); + } +} + +public class CP_Thread_07 { + private static CP_Thread_07_A1 a1_main = null; + private static CP_Thread_07_A1 a2 = null; + + public static void main(String[] args) { + CP_Thread_07_test cptest1 = new CP_Thread_07_test(); + cptest1.run(); + CP_Thread_07_test cptest2 = new CP_Thread_07_test(); + cptest2.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0493-rc-StackScan-CP_Thread_08/CP_Thread_08.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0493-rc-StackScan-CP_Thread_08/CP_Thread_08.java index bc3a3f58f377c3f51fd33e4c58b5dcea56356073..707905535d25f61fe0b997c4bf881461be2aefdb 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0493-rc-StackScan-CP_Thread_08/CP_Thread_08.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0493-rc-StackScan-CP_Thread_08/CP_Thread_08.java @@ -1,103 +1,103 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_08 - *- @TestCaseName: CP_Thread_08 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考OutOfMemoryError,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: CP_Thread_08.java - *- @ExecuteClass: CP_Thread_08 - *- @ExecuteArgs: - */ - -class CP_Thread_08_A1 { - static OutOfMemoryError[] test1; - static - int a; - CP_Thread_08_A1 a2_0; - int sum; - String strObjectName; - - CP_Thread_08_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} - -class CP_Thread_08_test extends Thread { - private static CP_Thread_08_A1 a1_main = null; - private volatile static CP_Thread_08_A1 a2 = null; - private volatile static OutOfMemoryError test1; - private static OutOfMemoryError test2; - - private static void test_CP_Thread_08_A1(int times) { - CP_Thread_08_A1.test1 = new OutOfMemoryError[times]; - for (int i = 0; i < times; i++) { - test1 = new OutOfMemoryError(); - CP_Thread_08_A1.test1[i] = test1; - } - } - - private static void test_CP_Thread_08_A2(int times) { - CP_Thread_08_A1.test1 = new OutOfMemoryError[times]; - for (int i = 0; i < times; i++) { - test2 = new OutOfMemoryError(); - CP_Thread_08_A1.test1[i] = test2; - } - } - - public void run() { - a1_main = new CP_Thread_08_A1("a1_main"); - a2 = new CP_Thread_08_A1("a2_0"); - a1_main.a2_0 = a2; - a1_main.a2_0.a2_0 = a2; - - a1_main.add(); - a1_main.a2_0.add(); - test_CP_Thread_08_A1(10000); - test_CP_Thread_08_A2(10000); - int result = a1_main.sum + a1_main.a2_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 404) - System.out.println("ExpectResult"); - } -} - -public class CP_Thread_08 { - private static CP_Thread_08_A1 a1_main = null; - private volatile static CP_Thread_08_A1 a2 = null; - - public static void main(String[] args) { - CP_Thread_08_test cptest1 = new CP_Thread_08_test(); - cptest1.run(); - CP_Thread_08_test cptest2 = new CP_Thread_08_test(); - cptest2.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_08 + *- @TestCaseName: CP_Thread_08 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考OutOfMemoryError,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: CP_Thread_08.java + *- @ExecuteClass: CP_Thread_08 + *- @ExecuteArgs: + */ + +class CP_Thread_08_A1 { + static OutOfMemoryError[] test1; + static + int a; + CP_Thread_08_A1 a2_0; + int sum; + String strObjectName; + + CP_Thread_08_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} + +class CP_Thread_08_test extends Thread { + private static CP_Thread_08_A1 a1_main = null; + private volatile static CP_Thread_08_A1 a2 = null; + private volatile static OutOfMemoryError test1; + private static OutOfMemoryError test2; + + private static void test_CP_Thread_08_A1(int times) { + CP_Thread_08_A1.test1 = new OutOfMemoryError[times]; + for (int i = 0; i < times; i++) { + test1 = new OutOfMemoryError(); + CP_Thread_08_A1.test1[i] = test1; + } + } + + private static void test_CP_Thread_08_A2(int times) { + CP_Thread_08_A1.test1 = new OutOfMemoryError[times]; + for (int i = 0; i < times; i++) { + test2 = new OutOfMemoryError(); + CP_Thread_08_A1.test1[i] = test2; + } + } + + public void run() { + a1_main = new CP_Thread_08_A1("a1_main"); + a2 = new CP_Thread_08_A1("a2_0"); + a1_main.a2_0 = a2; + a1_main.a2_0.a2_0 = a2; + + a1_main.add(); + a1_main.a2_0.add(); + test_CP_Thread_08_A1(10000); + test_CP_Thread_08_A2(10000); + int result = a1_main.sum + a1_main.a2_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 404) + System.out.println("ExpectResult"); + } +} + +public class CP_Thread_08 { + private static CP_Thread_08_A1 a1_main = null; + private volatile static CP_Thread_08_A1 a2 = null; + + public static void main(String[] args) { + CP_Thread_08_test cptest1 = new CP_Thread_08_test(); + cptest1.run(); + CP_Thread_08_test cptest2 = new CP_Thread_08_test(); + cptest2.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/memory_management/StackScan/RC0494-rc-StackScan-CP_Thread_09/CP_Thread_09.java b/test/testsuite/ouroboros/memory_management/StackScan/RC0494-rc-StackScan-CP_Thread_09/CP_Thread_09.java index 38dacac9888f28960bb0cde6100c8e5a424935d7..2383d8f76a0b54f7663c0fee2ed86234e1783da5 100644 --- a/test/testsuite/ouroboros/memory_management/StackScan/RC0494-rc-StackScan-CP_Thread_09/CP_Thread_09.java +++ b/test/testsuite/ouroboros/memory_management/StackScan/RC0494-rc-StackScan-CP_Thread_09/CP_Thread_09.java @@ -1,102 +1,102 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_09 - *- @TestCaseName: CP_Thread_09 - *- @TestCaseType: Function Testing for placementRCTest - *- @RequirementName: 运行时支持GCOnly - *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 - * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; - * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考ClassLoader,这样就构造了一个大对象。 - * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 - *- @Expect:ExpectResult\nExpectResult\n - *- @Priority: High - *- @Source: CP_Thread_09.java - *- @ExecuteClass: CP_Thread_09 - *- @ExecuteArgs: - */ - -class CP_Thread_09_A1 { - static ClassLoader[] test1; - static - int a; - CP_Thread_09_A1 a2_0; - int sum; - String strObjectName; - - CP_Thread_09_A1(String strObjectName) { - a2_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + a; - } -} - -class CP_Thread_09_test extends Thread { - private static CP_Thread_09_A1 a1_main = null; - private volatile static CP_Thread_09_A1 a2 = null; - private volatile static ClassLoader test1; - private static ClassLoader test2; - - private static void test_CP_Thread_09_A1(int times) { - CP_Thread_09_A1.test1 = new ClassLoader[times]; - for (int i = 0; i < times; i++) { - test1 = CP_Thread_09_A1.class.getClassLoader(); - CP_Thread_09_A1.test1[i] = test1; - } - } - - private static void test_CP_Thread_09_A2(int times) { - CP_Thread_09_A1.test1 = new ClassLoader[times]; - for (int i = 0; i < times; i++) { - test2 = CP_Thread_09_A1.class.getClassLoader(); - CP_Thread_09_A1.test1[i] = test2; - } - } - - public void run() { - a1_main = new CP_Thread_09_A1("a1_main"); - a2 = new CP_Thread_09_A1("a2_0"); - a1_main.a2_0 = a2; - a1_main.a2_0.a2_0 = a2; - - a1_main.add(); - a1_main.a2_0.add(); - test_CP_Thread_09_A1(10000); - test_CP_Thread_09_A2(10000); - int result = a1_main.sum + a1_main.a2_0.sum; - //System.out.println("RC-Testing_Result="+result); - if (result == 404) - System.out.println("ExpectResult"); - } -} - -public class CP_Thread_09 { - private static CP_Thread_09_A1 a1_main = null; - private volatile static CP_Thread_09_A1 a2 = null; - - public static void main(String[] args) { - CP_Thread_09_test cptest1 = new CP_Thread_09_test(); - cptest1.run(); - CP_Thread_09_test cptest2 = new CP_Thread_09_test(); - cptest2.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MemoryManagement2.0_CP_Thread_09 + *- @TestCaseName: CP_Thread_09 + *- @TestCaseType: Function Testing for placementRCTest + *- @RequirementName: 运行时支持GCOnly + *- @Brief:一组有环的对象,他们的field指向一个hashMap,里面装满了对象 + * -#step1: 创建一个环,环的类型参考了Cycle_a_0038.java; + * -#step2: 两个域test1和test2,里面装满了对象,对象格式参考ClassLoader,这样就构造了一个大对象。 + * -#step3: 验证结果正确,再用GCverify验证无内存泄漏。 + *- @Expect:ExpectResult\nExpectResult\n + *- @Priority: High + *- @Source: CP_Thread_09.java + *- @ExecuteClass: CP_Thread_09 + *- @ExecuteArgs: + */ + +class CP_Thread_09_A1 { + static ClassLoader[] test1; + static + int a; + CP_Thread_09_A1 a2_0; + int sum; + String strObjectName; + + CP_Thread_09_A1(String strObjectName) { + a2_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + a; + } +} + +class CP_Thread_09_test extends Thread { + private static CP_Thread_09_A1 a1_main = null; + private volatile static CP_Thread_09_A1 a2 = null; + private volatile static ClassLoader test1; + private static ClassLoader test2; + + private static void test_CP_Thread_09_A1(int times) { + CP_Thread_09_A1.test1 = new ClassLoader[times]; + for (int i = 0; i < times; i++) { + test1 = CP_Thread_09_A1.class.getClassLoader(); + CP_Thread_09_A1.test1[i] = test1; + } + } + + private static void test_CP_Thread_09_A2(int times) { + CP_Thread_09_A1.test1 = new ClassLoader[times]; + for (int i = 0; i < times; i++) { + test2 = CP_Thread_09_A1.class.getClassLoader(); + CP_Thread_09_A1.test1[i] = test2; + } + } + + public void run() { + a1_main = new CP_Thread_09_A1("a1_main"); + a2 = new CP_Thread_09_A1("a2_0"); + a1_main.a2_0 = a2; + a1_main.a2_0.a2_0 = a2; + + a1_main.add(); + a1_main.a2_0.add(); + test_CP_Thread_09_A1(10000); + test_CP_Thread_09_A2(10000); + int result = a1_main.sum + a1_main.a2_0.sum; + //System.out.println("RC-Testing_Result="+result); + if (result == 404) + System.out.println("ExpectResult"); + } +} + +public class CP_Thread_09 { + private static CP_Thread_09_A1 a1_main = null; + private volatile static CP_Thread_09_A1 a2 = null; + + public static void main(String[] args) { + CP_Thread_09_test cptest1 = new CP_Thread_09_test(); + cptest1.run(); + CP_Thread_09_test cptest2 = new CP_Thread_09_test(); + cptest2.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/other_test/RT0001-rt-other-CharacterNativeUncover/CharacterNativeUncover.java b/test/testsuite/ouroboros/other_test/RT0001-rt-other-CharacterNativeUncover/CharacterNativeUncover.java index 46990760bcba1c05bf4e8498dc8567b7c7c81d07..b99e6ba23a55c480b257e3c62c8988a57ee1a751 100644 --- a/test/testsuite/ouroboros/other_test/RT0001-rt-other-CharacterNativeUncover/CharacterNativeUncover.java +++ b/test/testsuite/ouroboros/other_test/RT0001-rt-other-CharacterNativeUncover/CharacterNativeUncover.java @@ -1,586 +1,586 @@ -/** - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: natives/CharacterNativeUncover.java - * -@Title/Destination: Character Methods - * -@Brief: - * -@Expect:0\n - * -@Priority: High - * -@Source: CharacterNativeUncover.java - * -@ExecuteClass: CharacterNativeUncover - * -@ExecuteArgs: - */ - -public class CharacterNativeUncover { - private static int res = 99; - - public static void main(String[] args) { - int result = 2; - CharacterDemo1(); - if (result == 2 && res == 53) { - res = 0; - } - System.out.println(res); - } - - - public static void CharacterDemo1() { - Character character = new Character('a'); - test1(character); - test2(character); - test3(character); - test4(character); - test5(character); - test6(character); - test7(character); - test8(character); - test9(character); - test10(character); - test11(character); - test12(character); - test13(character); - test14(character); - test15(character); - test16(character); - test17(character); - test18(character); - test19(character); - test20(character); - test21(character); - test22(character); - test23(character); - } - - - /** - * static native boolean isLowerCaseImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test1(Character character) { - try { - boolean flag = Character.isLowerCase(97);//isLowerCaseImpl() called by isLowerCase(); - // System.out.println(flag); - if (flag) { - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isUpperCaseImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test2(Character character) { - try { - boolean flag = Character.isUpperCase(65);//isUpperCaseImpl() called by isUpperCase(); - //System.out.println(flag); - if (flag) { - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isTitleCaseImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test3(Character character) { - try { - boolean flag = Character.isTitleCase(0x01c8);//isTitleCaseImpl() called by isTitleCase(); - //System.out.println(flag); - if (flag) { - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isDigitImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test4(Character character) { - try { - boolean flag = Character.isDigit(0x06f8);//isDigitImpl() called by isDigit();judge if it`s number; - //System.out.println(flag); - if (flag) { - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isDefinedImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test5(Character character) { - try { - boolean flag = Character.isDefined(0x012345);//isDefinedImpl() called by isDefined(); - //System.out.println(flag); - if (flag) { - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - /** - * static native boolean isLetterImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test6(Character character) { - try { - boolean flag = Character.isLetter(0x0065);//isLetterImpl() called by isLetter();tell if it`s char type; - //System.out.println(flag); - if (flag) { - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isLetterOrDigitImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test7(Character character) { - try { - boolean flag = Character.isLetterOrDigit(0x0033);//isLetterOrDigitImpl() called by isLetterOrDigit();tell if it`s char type; - //System.out.println(flag); - if (flag) { - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isAlphabeticImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test8(Character character) { - try { - boolean flag = Character.isAlphabetic(0x0065);//isAlphabeticImpl() called by isAlphabetic(); tell if it`s char type; - //System.out.println(flag); - if (flag) { - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isIdeographicImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test9(Character character) { - try { - boolean flag = Character.isIdeographic(0x0065);//isIdeographicImpl() called by isIdeographic(); - - if (!flag) { - //System.out.println(flag); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isUnicodeIdentifierStartImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test10(Character character) { - try { - boolean flag = Character.isUnicodeIdentifierStart(0x0065);//isUnicodeIdentifierStartImpl() called by isUnicodeIdentifierStart(); - - if (flag) { - //System.out.println(flag); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isUnicodeIdentifierPartImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test11(Character character) { - try { - boolean flag = Character.isUnicodeIdentifierPart(0x053e);//isUnicodeIdentifierPartImpl() called by isUnicodeIdentifierPart(); - - if (flag) { - //System.out.println(flag); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * ensure the char should be a ignoreable char in java or unicode identifier - * static native boolean isIdentifierIgnorableImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test12(Character character) { - try { - boolean flag = Character.isIdentifierIgnorable(0x053e);//isIdentifierIgnorableImpl() called by isIdentifierIgnorable(); - - if (!flag) { - //System.out.println(flag); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native int toLowerCaseImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test13(Character character) { - try { - int num = Character.toLowerCase(0x053e);//toLowerCaseImpl() called by toLowerCase(); - - if (num == 1390) { - //System.out.println(num); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - /** - * static native int toUpperCaseImpl(int codePoint) - * - * @param character - * @return - */ - public static boolean test14(Character character) { - try { - int num = Character.toUpperCase(0x053e);//toUpperCaseImpl() called by toUpperCase(); - - if (num == 1342) { - //System.out.println(num); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native int toTitleCaseImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test15(Character character) { - try { - int num = Character.toTitleCase(0x053e);//toTitleCaseImpl() called by toTitleCase(); - - if (num == 1342) { - //System.out.println(num); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - /** - * native static int digitImpl(int codePoint, int radix); - * - * @param character - * @return - */ - public static boolean test16(Character character) { - try { - int num = Character.digit(9, 2);//digitImpl() called by digit(); - - if (num == -1) { - //System.out.println(num); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * native static int getNumericValueImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test17(Character character) { - try { - int num = Character.getNumericValue(9);//getNumericValueImpl() called by getNumericValue(); - - if (num == -1) { - //System.out.println(num); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native boolean isSpaceCharImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test18(Character character) { - try { - boolean flag = Character.isSpaceChar(9);//isSpaceCharImpl() called by isSpaceChar(); - - if (!flag) { - //System.out.println(flag); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * native static boolean isWhitespaceImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test19(Character character) { - try { - boolean flag = Character.isWhitespace(9);//isWhitespaceImpl() called by isWhitespace(); - - if (flag) { - //System.out.println(flag); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * static native int getTypeImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test20(Character character) { - try { - int num = Character.getType(9);//getTypeImpl() called by getType(); - - if (num == 15) { - //System.out.println(num); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - /** - * native static byte getDirectionalityImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test21(Character character) { - try { - int num = Character.getDirectionality(9);//getDirectionalityImpl() called by getDirectionality(); - - if (num == 11) { - //System.out.println(num); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * native static boolean isMirroredImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test22(Character character) { - try { - boolean flag = Character.isMirrored(9);//isMirroredImpl() called by isMirrored(); - - if (!flag) { - //System.out.println(flag); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } - - - /** - * private static native String getNameImpl(int codePoint); - * - * @param character - * @return - */ - public static boolean test23(Character character) { - try { - String string = Character.getName(9);//getNameImpl() called by getName(); - - //if (string.equals("CHARACTER TABULATION")) { - if (string.equals("")) { - //System.out.println(string); - CharacterNativeUncover.res = CharacterNativeUncover.res - 2; - } else { - return false; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/** + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: natives/CharacterNativeUncover.java + * -@Title/Destination: Character Methods + * -@Brief: + * -@Expect:0\n + * -@Priority: High + * -@Source: CharacterNativeUncover.java + * -@ExecuteClass: CharacterNativeUncover + * -@ExecuteArgs: + */ + +public class CharacterNativeUncover { + private static int res = 99; + + public static void main(String[] args) { + int result = 2; + CharacterDemo1(); + if (result == 2 && res == 53) { + res = 0; + } + System.out.println(res); + } + + + public static void CharacterDemo1() { + Character character = new Character('a'); + test1(character); + test2(character); + test3(character); + test4(character); + test5(character); + test6(character); + test7(character); + test8(character); + test9(character); + test10(character); + test11(character); + test12(character); + test13(character); + test14(character); + test15(character); + test16(character); + test17(character); + test18(character); + test19(character); + test20(character); + test21(character); + test22(character); + test23(character); + } + + + /** + * static native boolean isLowerCaseImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test1(Character character) { + try { + boolean flag = Character.isLowerCase(97);//isLowerCaseImpl() called by isLowerCase(); + // System.out.println(flag); + if (flag) { + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isUpperCaseImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test2(Character character) { + try { + boolean flag = Character.isUpperCase(65);//isUpperCaseImpl() called by isUpperCase(); + //System.out.println(flag); + if (flag) { + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isTitleCaseImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test3(Character character) { + try { + boolean flag = Character.isTitleCase(0x01c8);//isTitleCaseImpl() called by isTitleCase(); + //System.out.println(flag); + if (flag) { + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isDigitImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test4(Character character) { + try { + boolean flag = Character.isDigit(0x06f8);//isDigitImpl() called by isDigit();judge if it`s number; + //System.out.println(flag); + if (flag) { + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isDefinedImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test5(Character character) { + try { + boolean flag = Character.isDefined(0x012345);//isDefinedImpl() called by isDefined(); + //System.out.println(flag); + if (flag) { + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + /** + * static native boolean isLetterImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test6(Character character) { + try { + boolean flag = Character.isLetter(0x0065);//isLetterImpl() called by isLetter();tell if it`s char type; + //System.out.println(flag); + if (flag) { + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isLetterOrDigitImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test7(Character character) { + try { + boolean flag = Character.isLetterOrDigit(0x0033);//isLetterOrDigitImpl() called by isLetterOrDigit();tell if it`s char type; + //System.out.println(flag); + if (flag) { + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isAlphabeticImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test8(Character character) { + try { + boolean flag = Character.isAlphabetic(0x0065);//isAlphabeticImpl() called by isAlphabetic(); tell if it`s char type; + //System.out.println(flag); + if (flag) { + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isIdeographicImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test9(Character character) { + try { + boolean flag = Character.isIdeographic(0x0065);//isIdeographicImpl() called by isIdeographic(); + + if (!flag) { + //System.out.println(flag); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isUnicodeIdentifierStartImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test10(Character character) { + try { + boolean flag = Character.isUnicodeIdentifierStart(0x0065);//isUnicodeIdentifierStartImpl() called by isUnicodeIdentifierStart(); + + if (flag) { + //System.out.println(flag); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isUnicodeIdentifierPartImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test11(Character character) { + try { + boolean flag = Character.isUnicodeIdentifierPart(0x053e);//isUnicodeIdentifierPartImpl() called by isUnicodeIdentifierPart(); + + if (flag) { + //System.out.println(flag); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * ensure the char should be a ignoreable char in java or unicode identifier + * static native boolean isIdentifierIgnorableImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test12(Character character) { + try { + boolean flag = Character.isIdentifierIgnorable(0x053e);//isIdentifierIgnorableImpl() called by isIdentifierIgnorable(); + + if (!flag) { + //System.out.println(flag); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native int toLowerCaseImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test13(Character character) { + try { + int num = Character.toLowerCase(0x053e);//toLowerCaseImpl() called by toLowerCase(); + + if (num == 1390) { + //System.out.println(num); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + /** + * static native int toUpperCaseImpl(int codePoint) + * + * @param character + * @return + */ + public static boolean test14(Character character) { + try { + int num = Character.toUpperCase(0x053e);//toUpperCaseImpl() called by toUpperCase(); + + if (num == 1342) { + //System.out.println(num); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native int toTitleCaseImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test15(Character character) { + try { + int num = Character.toTitleCase(0x053e);//toTitleCaseImpl() called by toTitleCase(); + + if (num == 1342) { + //System.out.println(num); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + /** + * native static int digitImpl(int codePoint, int radix); + * + * @param character + * @return + */ + public static boolean test16(Character character) { + try { + int num = Character.digit(9, 2);//digitImpl() called by digit(); + + if (num == -1) { + //System.out.println(num); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * native static int getNumericValueImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test17(Character character) { + try { + int num = Character.getNumericValue(9);//getNumericValueImpl() called by getNumericValue(); + + if (num == -1) { + //System.out.println(num); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native boolean isSpaceCharImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test18(Character character) { + try { + boolean flag = Character.isSpaceChar(9);//isSpaceCharImpl() called by isSpaceChar(); + + if (!flag) { + //System.out.println(flag); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * native static boolean isWhitespaceImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test19(Character character) { + try { + boolean flag = Character.isWhitespace(9);//isWhitespaceImpl() called by isWhitespace(); + + if (flag) { + //System.out.println(flag); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * static native int getTypeImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test20(Character character) { + try { + int num = Character.getType(9);//getTypeImpl() called by getType(); + + if (num == 15) { + //System.out.println(num); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + /** + * native static byte getDirectionalityImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test21(Character character) { + try { + int num = Character.getDirectionality(9);//getDirectionalityImpl() called by getDirectionality(); + + if (num == 11) { + //System.out.println(num); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * native static boolean isMirroredImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test22(Character character) { + try { + boolean flag = Character.isMirrored(9);//isMirroredImpl() called by isMirrored(); + + if (!flag) { + //System.out.println(flag); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + + /** + * private static native String getNameImpl(int codePoint); + * + * @param character + * @return + */ + public static boolean test23(Character character) { + try { + String string = Character.getName(9);//getNameImpl() called by getName(); + + //if (string.equals("CHARACTER TABULATION")) { + if (string.equals("")) { + //System.out.println(string); + CharacterNativeUncover.res = CharacterNativeUncover.res - 2; + } else { + return false; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/other_test/RT0002-rt-other-ClassNativeUncover/ClassNativeUncover.java b/test/testsuite/ouroboros/other_test/RT0002-rt-other-ClassNativeUncover/ClassNativeUncover.java index 849c5b24b1a9a410e2d46f9dd0eeca26614817bc..9c2386a4e9b540235e202d96be1d08c399cf1a3a 100644 --- a/test/testsuite/ouroboros/other_test/RT0002-rt-other-ClassNativeUncover/ClassNativeUncover.java +++ b/test/testsuite/ouroboros/other_test/RT0002-rt-other-ClassNativeUncover/ClassNativeUncover.java @@ -1,381 +1,381 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: natives/ClassNativeUncover.java - * -@Title/Destination: ClassNativeUncover Methods - * -@Brief: - * -@Expect: 0\n - * -@Priority: High - * -@Source: ClassNativeUncover.java - * -@ExecuteClass: ClassNativeUncover - * -@ExecuteArgs: - */ - -import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -import java.lang.reflect.TypeVariable; - -public class ClassNativeUncover { - private static int res = 99; - public String name; - - public ClassNativeUncover() { - super(); - - } - - public ClassNativeUncover(String name) { - super(); - this.name = name; - } - - public static void main(String[] args) { - int result = 2; - ClassDemo1(); - - if (result == 2 && res == 65) { - res = 0; - } - System.out.println(res); - } - - - public static void ClassDemo1() { - Class class1 = ClassNativeUncover.class; - test1(class1); - test2(class1); - test3(class1); - test4(class1); - test5(class1); - test6(class1); - test7(class1); - test8(class1); - test9(class1); - test10(class1); - test11(class1); - test12(class1); - test13(class1); - test14(class1); - test15(class1); - test16(class1); - test17(class1); - } - - /** - * public native Class getDeclaringClass(); - * - * @param class1 - */ - public static void test1(Class class1) { - try { - boolean flag = class1.isMemberClass();//getDeclaringClass() called by isMemberClass(); - if (!flag) { - //System.out.println(flag); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } - - - /** - * public native Class getEnclosingClass(); - * - * @param class1 - */ - public static void test2(Class class1) { - try { - String string = class1.getCanonicalName();//getEnclosingClass() called by getCanonicalName(); - if (string.equals("ClassNativeUncover")) { - //System.out.println(string); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * public native boolean isAnonymousClass(); - * - * @param class1 - */ - public static void test3(Class class1) { - try { - boolean flag = class1.isAnonymousClass(); - if (!flag) { - //System.out.println(flag); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * private native Field getPublicFieldRecursive(String name); - * - * @param class1 - */ - public static void test4(Class class1) { - try { - Field field = class1.getField("name");//get the whole attributes which named "public" and inherited from parent class;getPublicFieldRecursive() called by getField(); - if (field.toString().equals("public java.lang.String ClassNativeUncover.name")) { - //System.out.println(field.toString()); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * public native Field[] getDeclaredFields(); - * - * @param class1 - */ - public static void test5(Class class1) { - try { - Field[] fields = class1.getDeclaredFields();//get all declarative attributes; - if (fields != null && fields.length > 0) { -// for(Field field:fields ) { -// System.out.println(field); -// } - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * public native Method[] MethodsUnchecked(boolean publicOnly); - * - * @param class1 - */ - public static void test6(Class class1) { - try { - Method[] methods = class1.getDeclaredMethods();//get declarative methods;getDeclaredMethodsUnchecked() called by getDeclaredMethods(); - if (methods != null && methods.length > 0) { -// for(Method method:methods ) { -// System.out.println(method); -// } - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * private native Constructor[] getDeclaredConstructorsInternal(boolean publicOnly); - * - * @param class1 - */ - public static void test7(Class class1) { - try { - Constructor[] constructors = class1.getConstructors();//get public constructions and inherited from parent class;getDeclaredConstructorsInternal()called bygetConstructors(); - if (constructors != null && constructors.length > 0) { -// for(Constructor constructor:constructors ) { -// System.out.println(constructor); -// } - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * dcons - * private native Constructor[] getDeclaredConstructorsInternal(boolean publicOnly); - * - * @param class1 - */ - public static void test8(Class class1) { - try { - Constructor[] constructors = class1.getDeclaredConstructors();//get all of declarative construcors;getDeclaredConstructorsInternal() called by getDeclaredConstructors; - if (constructors != null && constructors.length > 0) { -// for(Constructor constructor:constructors ) { -// System.out.println(constructor); -// } - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * public native Field getDeclaredField(String name) throws NoSuchFieldException; - * - * @param class1 - */ - public static void test9(Class class1) { - try { - Field field = class1.getDeclaredField("res"); - if (field.toString().equals("private static int ClassNativeUncover.res")) { - //System.out.println(field); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (NoSuchFieldException e) { - e.printStackTrace(); - } - } - - - /** - * private native Constructor getDeclaredConstructorInternal(Class[] args); - * - * @param class1 - */ - public static void test10(Class class1) { - try { - Constructor constructor = class1.getConstructor(new Class[]{String.class});//getDeclaredConstructorInternal() called by getConstructor; - if (constructor.toString().equals("public ClassNativeUncover(java.lang.String)")) { - //System.out.println(constructor); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - } - - /** - * private native Constructor getDeclaredConstructorInternal(Class[] args); - * - * @param class1 - */ - public static void test11(Class class1) { - try { - Constructor constructor = class1.getDeclaredConstructor(new Class[]{String.class});//getDeclaredConstructorInternal() called by getDeclaredConstructor(); - if (constructor.toString().equals("public ClassNativeUncover(java.lang.String)")) { - //System.out.println(constructor); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - } - - - /** - * private native String getInnerClassName(); - * - * @param class1 - */ - public static void test12(Class class1) { - try { - String string = class1.getSimpleName();//getInnerClassName() called by getSimpleName(); - if (string.equals("ClassNativeUncover")) { - ClassNativeUncover.res = ClassNativeUncover.res - 2; - //System.out.println(string); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * private native String[] getSignatureAnnotation(); - * - * @param class1 - */ - public static void test13(Class class1) { - try { - TypeVariable[] typeVariables = class1.getTypeParameters();//return a array length 0;getSignatureAnnotation() called by getTypeParameters(); - if (typeVariables.getClass().toString().equals("class [Ljava.lang.reflect.TypeVariable;") && typeVariables.length == 0) { - //System.out.println(typeVariables.length); - //System.out.println(typeVariables.getClass().toString()); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * private native String[] getSignatureAnnotation(); - * - * @param class1 - */ - public static void test14(Class class1) { - try { - Type type = class1.getGenericSuperclass();//getSignatureAnnotation()called by getGenericSuperclass; - if (type.toString().equals("class java.lang.Object")) { - //System.out.println(type); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * private native String[] getSignatureAnnotation(); - * - * @param class1 - */ - public static void test15(Class class1) { - - Type[] type = class1.getGenericInterfaces();//getSignatureAnnotation() called by getGenericInterfaces; - if (type.length == 0 && type.getClass().toString().equals("class [Ljava.lang.Class;")) { - //System.out.println(type.length); - //System.out.println(type.getClass().toString()); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } - - /** - * private native Method getDeclaredMethodInternal(String name, Class[] args); - * - * @param class1 - */ - public static void test16(Class class1) { - try { - Method method = class1.getMethod("ClassDemo1");//getDeclaredMethodInternal() called by getMethod() - if (method.toString().equals("public static void ClassNativeUncover.ClassDemo1()")) { - //System.out.println(method); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - } - - public static void test17(Class class1) { - try { - Annotation[] a = class1.getAnnotations(); //getDeclaredAnnotations() called by getAnnotations() - if (a.length == 0 && a.getClass().toString().equals("class [Ljava.lang.annotation.Annotation;")) { - //System.out.println(a.length); - //System.out.println(a.getClass().toString()); - ClassNativeUncover.res = ClassNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: natives/ClassNativeUncover.java + * -@Title/Destination: ClassNativeUncover Methods + * -@Brief: + * -@Expect: 0\n + * -@Priority: High + * -@Source: ClassNativeUncover.java + * -@ExecuteClass: ClassNativeUncover + * -@ExecuteArgs: + */ + +import java.lang.annotation.Annotation; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.lang.reflect.TypeVariable; + +public class ClassNativeUncover { + private static int res = 99; + public String name; + + public ClassNativeUncover() { + super(); + + } + + public ClassNativeUncover(String name) { + super(); + this.name = name; + } + + public static void main(String[] args) { + int result = 2; + ClassDemo1(); + + if (result == 2 && res == 65) { + res = 0; + } + System.out.println(res); + } + + + public static void ClassDemo1() { + Class class1 = ClassNativeUncover.class; + test1(class1); + test2(class1); + test3(class1); + test4(class1); + test5(class1); + test6(class1); + test7(class1); + test8(class1); + test9(class1); + test10(class1); + test11(class1); + test12(class1); + test13(class1); + test14(class1); + test15(class1); + test16(class1); + test17(class1); + } + + /** + * public native Class getDeclaringClass(); + * + * @param class1 + */ + public static void test1(Class class1) { + try { + boolean flag = class1.isMemberClass();//getDeclaringClass() called by isMemberClass(); + if (!flag) { + //System.out.println(flag); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } + + + /** + * public native Class getEnclosingClass(); + * + * @param class1 + */ + public static void test2(Class class1) { + try { + String string = class1.getCanonicalName();//getEnclosingClass() called by getCanonicalName(); + if (string.equals("ClassNativeUncover")) { + //System.out.println(string); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * public native boolean isAnonymousClass(); + * + * @param class1 + */ + public static void test3(Class class1) { + try { + boolean flag = class1.isAnonymousClass(); + if (!flag) { + //System.out.println(flag); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * private native Field getPublicFieldRecursive(String name); + * + * @param class1 + */ + public static void test4(Class class1) { + try { + Field field = class1.getField("name");//get the whole attributes which named "public" and inherited from parent class;getPublicFieldRecursive() called by getField(); + if (field.toString().equals("public java.lang.String ClassNativeUncover.name")) { + //System.out.println(field.toString()); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + + /** + * public native Field[] getDeclaredFields(); + * + * @param class1 + */ + public static void test5(Class class1) { + try { + Field[] fields = class1.getDeclaredFields();//get all declarative attributes; + if (fields != null && fields.length > 0) { +// for(Field field:fields ) { +// System.out.println(field); +// } + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + + /** + * public native Method[] MethodsUnchecked(boolean publicOnly); + * + * @param class1 + */ + public static void test6(Class class1) { + try { + Method[] methods = class1.getDeclaredMethods();//get declarative methods;getDeclaredMethodsUnchecked() called by getDeclaredMethods(); + if (methods != null && methods.length > 0) { +// for(Method method:methods ) { +// System.out.println(method); +// } + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + + /** + * private native Constructor[] getDeclaredConstructorsInternal(boolean publicOnly); + * + * @param class1 + */ + public static void test7(Class class1) { + try { + Constructor[] constructors = class1.getConstructors();//get public constructions and inherited from parent class;getDeclaredConstructorsInternal()called bygetConstructors(); + if (constructors != null && constructors.length > 0) { +// for(Constructor constructor:constructors ) { +// System.out.println(constructor); +// } + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * dcons + * private native Constructor[] getDeclaredConstructorsInternal(boolean publicOnly); + * + * @param class1 + */ + public static void test8(Class class1) { + try { + Constructor[] constructors = class1.getDeclaredConstructors();//get all of declarative construcors;getDeclaredConstructorsInternal() called by getDeclaredConstructors; + if (constructors != null && constructors.length > 0) { +// for(Constructor constructor:constructors ) { +// System.out.println(constructor); +// } + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + + /** + * public native Field getDeclaredField(String name) throws NoSuchFieldException; + * + * @param class1 + */ + public static void test9(Class class1) { + try { + Field field = class1.getDeclaredField("res"); + if (field.toString().equals("private static int ClassNativeUncover.res")) { + //System.out.println(field); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + + + /** + * private native Constructor getDeclaredConstructorInternal(Class[] args); + * + * @param class1 + */ + public static void test10(Class class1) { + try { + Constructor constructor = class1.getConstructor(new Class[]{String.class});//getDeclaredConstructorInternal() called by getConstructor; + if (constructor.toString().equals("public ClassNativeUncover(java.lang.String)")) { + //System.out.println(constructor); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + } + + /** + * private native Constructor getDeclaredConstructorInternal(Class[] args); + * + * @param class1 + */ + public static void test11(Class class1) { + try { + Constructor constructor = class1.getDeclaredConstructor(new Class[]{String.class});//getDeclaredConstructorInternal() called by getDeclaredConstructor(); + if (constructor.toString().equals("public ClassNativeUncover(java.lang.String)")) { + //System.out.println(constructor); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + } + + + /** + * private native String getInnerClassName(); + * + * @param class1 + */ + public static void test12(Class class1) { + try { + String string = class1.getSimpleName();//getInnerClassName() called by getSimpleName(); + if (string.equals("ClassNativeUncover")) { + ClassNativeUncover.res = ClassNativeUncover.res - 2; + //System.out.println(string); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * private native String[] getSignatureAnnotation(); + * + * @param class1 + */ + public static void test13(Class class1) { + try { + TypeVariable[] typeVariables = class1.getTypeParameters();//return a array length 0;getSignatureAnnotation() called by getTypeParameters(); + if (typeVariables.getClass().toString().equals("class [Ljava.lang.reflect.TypeVariable;") && typeVariables.length == 0) { + //System.out.println(typeVariables.length); + //System.out.println(typeVariables.getClass().toString()); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * private native String[] getSignatureAnnotation(); + * + * @param class1 + */ + public static void test14(Class class1) { + try { + Type type = class1.getGenericSuperclass();//getSignatureAnnotation()called by getGenericSuperclass; + if (type.toString().equals("class java.lang.Object")) { + //System.out.println(type); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * private native String[] getSignatureAnnotation(); + * + * @param class1 + */ + public static void test15(Class class1) { + + Type[] type = class1.getGenericInterfaces();//getSignatureAnnotation() called by getGenericInterfaces; + if (type.length == 0 && type.getClass().toString().equals("class [Ljava.lang.Class;")) { + //System.out.println(type.length); + //System.out.println(type.getClass().toString()); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } + + /** + * private native Method getDeclaredMethodInternal(String name, Class[] args); + * + * @param class1 + */ + public static void test16(Class class1) { + try { + Method method = class1.getMethod("ClassDemo1");//getDeclaredMethodInternal() called by getMethod() + if (method.toString().equals("public static void ClassNativeUncover.ClassDemo1()")) { + //System.out.println(method); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + } + + public static void test17(Class class1) { + try { + Annotation[] a = class1.getAnnotations(); //getDeclaredAnnotations() called by getAnnotations() + if (a.length == 0 && a.getClass().toString().equals("class [Ljava.lang.annotation.Annotation;")) { + //System.out.println(a.length); + //System.out.println(a.getClass().toString()); + ClassNativeUncover.res = ClassNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/other_test/RT0003-rt-other-ConstructorNativeUncover/ConstructorNativeUncover.java b/test/testsuite/ouroboros/other_test/RT0003-rt-other-ConstructorNativeUncover/ConstructorNativeUncover.java index c386a45bf7070d0545f98711cef56c42f6b3c850..4c0f02f4a18fd8899d139740b2120539d86f6b9a 100644 --- a/test/testsuite/ouroboros/other_test/RT0003-rt-other-ConstructorNativeUncover/ConstructorNativeUncover.java +++ b/test/testsuite/ouroboros/other_test/RT0003-rt-other-ConstructorNativeUncover/ConstructorNativeUncover.java @@ -1,77 +1,77 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: reflect.natives/ConstructorNativeUncover.java - * -@Title/Destination: ConstructorNativeUncover Methods - * -@Brief: - * -@Expect: 0\n - * -@Priority: High - * -@Source: ConstructorNativeUncover.java - * -@ExecuteClass: ConstructorNativeUncover - * -@ExecuteArgs: - */ - -import java.lang.reflect.Constructor; -import java.util.Arrays; - -public class ConstructorNativeUncover { - - private static int res = 99; - - public ConstructorNativeUncover() { - super(); - // TODO Auto-generated constructor stub - } - - public static void main(String[] args) { - int result = 2; - ConstructorDemo1(); - if (result == 2 && res == 97) { - res = 0; - } - System.out.println(res); - } - - - public static void ConstructorDemo1() { - ConstructorNativeUncover constructorNativeUncover = new ConstructorNativeUncover(); - test(constructorNativeUncover); - } - - - /** - * public native Class[] getExceptionTypes(); - * @param constructorNativeUncover - * @return - */ - public static boolean test(ConstructorNativeUncover constructorNativeUncover) { - try { - Class class1 = constructorNativeUncover.getClass(); - Constructor constructor = class1.getConstructor(new Class[] {}); - Class[] classes = constructor.getExceptionTypes(); - if (classes.length == 0 && classes.getClass().toString().equals("class [Ljava.lang.Class;")) { -// System.out.println(classes.getClass().toString()); -// System.out.println(classes.length); - ConstructorNativeUncover.res = ConstructorNativeUncover.res - 2; - } - } catch(NoSuchMethodException e) { - e.printStackTrace(); - return false; - } - return true; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: reflect.natives/ConstructorNativeUncover.java + * -@Title/Destination: ConstructorNativeUncover Methods + * -@Brief: + * -@Expect: 0\n + * -@Priority: High + * -@Source: ConstructorNativeUncover.java + * -@ExecuteClass: ConstructorNativeUncover + * -@ExecuteArgs: + */ + +import java.lang.reflect.Constructor; +import java.util.Arrays; + +public class ConstructorNativeUncover { + + private static int res = 99; + + public ConstructorNativeUncover() { + super(); + // TODO Auto-generated constructor stub + } + + public static void main(String[] args) { + int result = 2; + ConstructorDemo1(); + if (result == 2 && res == 97) { + res = 0; + } + System.out.println(res); + } + + + public static void ConstructorDemo1() { + ConstructorNativeUncover constructorNativeUncover = new ConstructorNativeUncover(); + test(constructorNativeUncover); + } + + + /** + * public native Class[] getExceptionTypes(); + * @param constructorNativeUncover + * @return + */ + public static boolean test(ConstructorNativeUncover constructorNativeUncover) { + try { + Class class1 = constructorNativeUncover.getClass(); + Constructor constructor = class1.getConstructor(new Class[] {}); + Class[] classes = constructor.getExceptionTypes(); + if (classes.length == 0 && classes.getClass().toString().equals("class [Ljava.lang.Class;")) { +// System.out.println(classes.getClass().toString()); +// System.out.println(classes.length); + ConstructorNativeUncover.res = ConstructorNativeUncover.res - 2; + } + } catch(NoSuchMethodException e) { + e.printStackTrace(); + return false; + } + return true; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/other_test/RT0005-rt-other-MethodNativeUncover/MethodNativeUncover.java b/test/testsuite/ouroboros/other_test/RT0005-rt-other-MethodNativeUncover/MethodNativeUncover.java index d41619803a01e62c116fa161d0bf778a8c5be0de..898c79ab52f4749a801d9d1ff3eb4b0f1de24b25 100644 --- a/test/testsuite/ouroboros/other_test/RT0005-rt-other-MethodNativeUncover/MethodNativeUncover.java +++ b/test/testsuite/ouroboros/other_test/RT0005-rt-other-MethodNativeUncover/MethodNativeUncover.java @@ -1,104 +1,104 @@ - - -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: reflect.natives/MethodNativeUncover.java - * -@Title/Destination: MethodNativeUncover Methods - * -@Brief: - * -@Expect:0\n - * -@Priority: High - * -@Source: MethodNativeUncover.java - * -@ExecuteClass: MethodNativeUncover - * -@ExecuteArgs: - */ - -import java.lang.reflect.Method; - -public class MethodNativeUncover { - -private static int res = 99; - - public static void sayHello() { - String hello = "halo"; - } - - - public static void main(String[] args) { - int result = 2; - MethodDemo1(); - if (result == 2 && res == 95) { - res = 0; - } - System.out.println(res); - } - - - public static void MethodDemo1(){ - MethodNativeUncover methodNativeUncover = new MethodNativeUncover(); - test(methodNativeUncover); - test1(methodNativeUncover); - - } - - /** - * public native Class[] getExceptionTypes(); - * @param methodNativeUncover - */ - public static void test(MethodNativeUncover methodNativeUncover) { - Class class1 = methodNativeUncover.getClass(); - try { - Method method = class1.getMethod("sayHello"); - Class[] newClass = method.getExceptionTypes(); - if (newClass.length == 0 && newClass.getClass().toString().equals("class [Ljava.lang.Class;")) { - //System.out.println(newClass.length); - //System.out.println(newClass.getClass()); - MethodNativeUncover.res = MethodNativeUncover.res - 2; - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } - - } - - - /** - * public native Object getDefaultValue(); - * @param methodNativeUncover - */ - public static void test1(MethodNativeUncover methodNativeUncover) { - Class class1 = methodNativeUncover.getClass(); - try { - Method method = class1.getMethod("sayHello"); - Object object = method.getDefaultValue(); - if (object == null) { - //System.out.println(object); - MethodNativeUncover.res = MethodNativeUncover.res - 2; - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } - - } - - - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f + + +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: reflect.natives/MethodNativeUncover.java + * -@Title/Destination: MethodNativeUncover Methods + * -@Brief: + * -@Expect:0\n + * -@Priority: High + * -@Source: MethodNativeUncover.java + * -@ExecuteClass: MethodNativeUncover + * -@ExecuteArgs: + */ + +import java.lang.reflect.Method; + +public class MethodNativeUncover { + +private static int res = 99; + + public static void sayHello() { + String hello = "halo"; + } + + + public static void main(String[] args) { + int result = 2; + MethodDemo1(); + if (result == 2 && res == 95) { + res = 0; + } + System.out.println(res); + } + + + public static void MethodDemo1(){ + MethodNativeUncover methodNativeUncover = new MethodNativeUncover(); + test(methodNativeUncover); + test1(methodNativeUncover); + + } + + /** + * public native Class[] getExceptionTypes(); + * @param methodNativeUncover + */ + public static void test(MethodNativeUncover methodNativeUncover) { + Class class1 = methodNativeUncover.getClass(); + try { + Method method = class1.getMethod("sayHello"); + Class[] newClass = method.getExceptionTypes(); + if (newClass.length == 0 && newClass.getClass().toString().equals("class [Ljava.lang.Class;")) { + //System.out.println(newClass.length); + //System.out.println(newClass.getClass()); + MethodNativeUncover.res = MethodNativeUncover.res - 2; + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (SecurityException e) { + e.printStackTrace(); + } + + } + + + /** + * public native Object getDefaultValue(); + * @param methodNativeUncover + */ + public static void test1(MethodNativeUncover methodNativeUncover) { + Class class1 = methodNativeUncover.getClass(); + try { + Method method = class1.getMethod("sayHello"); + Object object = method.getDefaultValue(); + if (object == null) { + //System.out.println(object); + MethodNativeUncover.res = MethodNativeUncover.res - 2; + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (SecurityException e) { + e.printStackTrace(); + } + + } + + + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/other_test/RT0006-rt-other-ThreadNativeUncover/ThreadNativeUncover.java b/test/testsuite/ouroboros/other_test/RT0006-rt-other-ThreadNativeUncover/ThreadNativeUncover.java index 8c27d02eab6373f7f6d0cd5f52cb148a46fc2a89..bc83964ef69eaa831dce8535e8ab5ac43a5dc755 100644 --- a/test/testsuite/ouroboros/other_test/RT0006-rt-other-ThreadNativeUncover/ThreadNativeUncover.java +++ b/test/testsuite/ouroboros/other_test/RT0006-rt-other-ThreadNativeUncover/ThreadNativeUncover.java @@ -1,60 +1,60 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Ouroboros/rt_test/ThreadNativeUncover.java - * - @Title/Destination: ThreadNativeUncover Methods getState() - * - @Brief: - * - @Expect:expected.txt - * - @Priority: High - * - @Source: ThreadNativeUncover.java - * - @ExecuteClass: ThreadNativeUncover - * - @ExecuteArgs: - */ - -import java.lang.Thread.State; - -public class ThreadNativeUncover { - private static int res = 99; - - public static void main(String[] args) { - int result = 2; - ThreadDemo1(); - if (result == 2 && res == 97) { - res = 0; - } - System.out.println(res); - } - - public static void ThreadDemo1() { - Thread thread = new Thread(); - test(thread); - } - - /** - * private native int nativeGetStatus(boolean hasBeenStarted); - * @param thread - */ - public static void test(Thread thread) { - try { - State state = thread.getState();//nativeGetStatus() called by getState(); - if (state.toString().equals("NEW")) { - ThreadNativeUncover.res = ThreadNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Ouroboros/rt_test/ThreadNativeUncover.java + * - @Title/Destination: ThreadNativeUncover Methods getState() + * - @Brief: + * - @Expect:expected.txt + * - @Priority: High + * - @Source: ThreadNativeUncover.java + * - @ExecuteClass: ThreadNativeUncover + * - @ExecuteArgs: + */ + +import java.lang.Thread.State; + +public class ThreadNativeUncover { + private static int res = 99; + + public static void main(String[] args) { + int result = 2; + ThreadDemo1(); + if (result == 2 && res == 97) { + res = 0; + } + System.out.println(res); + } + + public static void ThreadDemo1() { + Thread thread = new Thread(); + test(thread); + } + + /** + * private native int nativeGetStatus(boolean hasBeenStarted); + * @param thread + */ + public static void test(Thread thread) { + try { + State state = thread.getState();//nativeGetStatus() called by getState(); + if (state.toString().equals("NEW")) { + ThreadNativeUncover.res = ThreadNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/other_test/RT0007-rt-other-ThrowableNativeUncover/ThrowableNativeUncover.java b/test/testsuite/ouroboros/other_test/RT0007-rt-other-ThrowableNativeUncover/ThrowableNativeUncover.java index 348cdd746346b61568adc3144a4b8b1202bc4671..cd55c97c4912c5b70f4d1878e8085f60197b61a7 100644 --- a/test/testsuite/ouroboros/other_test/RT0007-rt-other-ThrowableNativeUncover/ThrowableNativeUncover.java +++ b/test/testsuite/ouroboros/other_test/RT0007-rt-other-ThrowableNativeUncover/ThrowableNativeUncover.java @@ -1,89 +1,89 @@ -/** - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: natives/ThrowableNativeUncover.java - * -@Title/Destination: ThrowableNativeUncover Methods - * -@Brief: - * -@Expect: 0\n - * -@Priority: High - * -@Source: ThrowableNativeUncover.java - * -@ExecuteClass: ThrowableNativeUncover - * -@ExecuteArgs: - */ - -public class ThrowableNativeUncover { - private static int res = 99; - - public static void main(String[] args) { - ThrowableDemo1(); - } - - - - public static void ThrowableDemo1() { - int result = 2; - Throwable throwable = new Throwable(); - test(throwable); - test1(throwable); - if (result == 2 && res == 95) { - res = 0; - } - System.out.println(res); - } - - /** - * private static native Object nativeFillInStackTrace(); - * @param throwable - * @return - */ - public static boolean test(Throwable throwable) { - - try { - Throwable throwable2 = throwable.fillInStackTrace();//nativeFillInStackTrace() called by fillInStackTrace(); - if (throwable2.toString().equals("java.lang.Throwable")) { - //System.out.println(throwable2.toString()); - ThrowableNativeUncover.res = ThrowableNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - - } - return true; - } - - - /** - * private static native StackTraceElement[] nativeGetStackTrace(Object stackState); - * @param throwable - * @return - */ - public static boolean test1(Throwable throwable) { - try { - StackTraceElement[] stackTraceElements = throwable.getStackTrace();//nativeGetStackTrace() called by getStackTrace(); - if (stackTraceElements.length == 3 && stackTraceElements.getClass().toString().equals("class [Ljava.lang.StackTraceElement;")) { - //System.out.println(stackTraceElements.length); - //System.out.println(stackTraceElements.getClass().toString()); - ThrowableNativeUncover.res = ThrowableNativeUncover.res - 2; - } - } catch (Exception e) { - e.printStackTrace(); - } - - return true; - - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/** + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: natives/ThrowableNativeUncover.java + * -@Title/Destination: ThrowableNativeUncover Methods + * -@Brief: + * -@Expect: 0\n + * -@Priority: High + * -@Source: ThrowableNativeUncover.java + * -@ExecuteClass: ThrowableNativeUncover + * -@ExecuteArgs: + */ + +public class ThrowableNativeUncover { + private static int res = 99; + + public static void main(String[] args) { + ThrowableDemo1(); + } + + + + public static void ThrowableDemo1() { + int result = 2; + Throwable throwable = new Throwable(); + test(throwable); + test1(throwable); + if (result == 2 && res == 95) { + res = 0; + } + System.out.println(res); + } + + /** + * private static native Object nativeFillInStackTrace(); + * @param throwable + * @return + */ + public static boolean test(Throwable throwable) { + + try { + Throwable throwable2 = throwable.fillInStackTrace();//nativeFillInStackTrace() called by fillInStackTrace(); + if (throwable2.toString().equals("java.lang.Throwable")) { + //System.out.println(throwable2.toString()); + ThrowableNativeUncover.res = ThrowableNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + + } + return true; + } + + + /** + * private static native StackTraceElement[] nativeGetStackTrace(Object stackState); + * @param throwable + * @return + */ + public static boolean test1(Throwable throwable) { + try { + StackTraceElement[] stackTraceElements = throwable.getStackTrace();//nativeGetStackTrace() called by getStackTrace(); + if (stackTraceElements.length == 3 && stackTraceElements.getClass().toString().equals("class [Ljava.lang.StackTraceElement;")) { + //System.out.println(stackTraceElements.length); + //System.out.println(stackTraceElements.getClass().toString()); + ThrowableNativeUncover.res = ThrowableNativeUncover.res - 2; + } + } catch (Exception e) { + e.printStackTrace(); + } + + return true; + + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/other_test/issue-RT0630-rt-other-ArrayNativeUncover/ArrayNativeUncover.java b/test/testsuite/ouroboros/other_test/issue-RT0630-rt-other-ArrayNativeUncover/ArrayNativeUncover.java index caebba5bb96c495fd03f4a8c606e0ced6ea0de94..74c66f8c7accf58821d65ea3e82565b725e5bf0d 100644 --- a/test/testsuite/ouroboros/other_test/issue-RT0630-rt-other-ArrayNativeUncover/ArrayNativeUncover.java +++ b/test/testsuite/ouroboros/other_test/issue-RT0630-rt-other-ArrayNativeUncover/ArrayNativeUncover.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: reflect.natives/ArrayNativeUncover.java - * -@Title/Destination: ArrayNativeUncover Methods - * -@Brief: - * -@Expect: 0\n - * -@Priority: High - * -@Source: ArrayNativeUncover.java - * -@ExecuteClass: ArrayNativeUncover - * -@ExecuteArgs: - */ -import java.lang.reflect.Array; - -public class ArrayNativeUncover { - private static int res = 99; - - public static void main(String[] args) { - int result = 2; - ArrayDemo1(); - if (result == 2 && ArrayNativeUncover.res == 97) { - result = 0; - System.out.println(result); - } - } - - public static void ArrayDemo1() { - test1(); - } - - - /** - * private static native Object createObjectArray(Class componentType, int length) throws NegativeArraySizeException; - * - * @return - */ - public static boolean test1() { - try { - Object object = Array.newInstance(String.class, 5);//createObjectArray() called by newInstance(); - if (object.getClass().toString().equals("class [Ljava.lang.String;")) { - ArrayNativeUncover.res = ArrayNativeUncover.res - 2; - return true; - } - } catch (Exception e) { - e.printStackTrace(); - } - return true; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: reflect.natives/ArrayNativeUncover.java + * -@Title/Destination: ArrayNativeUncover Methods + * -@Brief: + * -@Expect: 0\n + * -@Priority: High + * -@Source: ArrayNativeUncover.java + * -@ExecuteClass: ArrayNativeUncover + * -@ExecuteArgs: + */ +import java.lang.reflect.Array; + +public class ArrayNativeUncover { + private static int res = 99; + + public static void main(String[] args) { + int result = 2; + ArrayDemo1(); + if (result == 2 && ArrayNativeUncover.res == 97) { + result = 0; + System.out.println(result); + } + } + + public static void ArrayDemo1() { + test1(); + } + + + /** + * private static native Object createObjectArray(Class componentType, int length) throws NegativeArraySizeException; + * + * @return + */ + public static boolean test1() { + try { + Object object = Array.newInstance(String.class, 5);//createObjectArray() called by newInstance(); + if (object.getClass().toString().equals("class [Ljava.lang.String;")) { + ArrayNativeUncover.res = ArrayNativeUncover.res - 2; + return true; + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0112-rt-reflection-ClassGetAnnotationsByType/ClassGetAnnotationsByType.java b/test/testsuite/ouroboros/reflection_test/RT0112-rt-reflection-ClassGetAnnotationsByType/ClassGetAnnotationsByType.java index f3f43ce9cee8d218b70a5a540ac1428bed4cd2b1..cec5b0c6e8086aa7411c61d58fdc4de60b2197ee 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0112-rt-reflection-ClassGetAnnotationsByType/ClassGetAnnotationsByType.java +++ b/test/testsuite/ouroboros/reflection_test/RT0112-rt-reflection-ClassGetAnnotationsByType/ClassGetAnnotationsByType.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassGetAnnotationsByType - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassGetAnnotationsByType.java - * - @Title/Destination: Class have no Annotation and method have annotation, Class.getAnnotationsByType() return an - * array of length 0. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest0。 - * -#step2:获取class MyTargetTest0。 - * -#step3:调用getAnnotationsByType(Class annotationClass)获取类型为MyTarget的注解数组。 - * -#step4:确认获取的注解数组个数大于0。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: ClassGetAnnotationsByType.java - * - @ExecuteClass: ClassGetAnnotationsByType - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -public class ClassGetAnnotationsByType { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = ClassGetAnnotationsByType1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int ClassGetAnnotationsByType1() { - Class m; - try { - m = MyTargetTest0.class; - MyTarget[] Target = m.getAnnotationsByType(MyTarget.class); - if (Target.length == 0) { - return 0; - } - } catch (SecurityException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest0 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest0(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassGetAnnotationsByType + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassGetAnnotationsByType.java + * - @Title/Destination: Class have no Annotation and method have annotation, Class.getAnnotationsByType() return an + * array of length 0. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest0。 + * -#step2:获取class MyTargetTest0。 + * -#step3:调用getAnnotationsByType(Class annotationClass)获取类型为MyTarget的注解数组。 + * -#step4:确认获取的注解数组个数大于0。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: ClassGetAnnotationsByType.java + * - @ExecuteClass: ClassGetAnnotationsByType + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +public class ClassGetAnnotationsByType { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = ClassGetAnnotationsByType1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int ClassGetAnnotationsByType1() { + Class m; + try { + m = MyTargetTest0.class; + MyTarget[] Target = m.getAnnotationsByType(MyTarget.class); + if (Target.length == 0) { + return 0; + } + } catch (SecurityException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest0 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest0(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0115-rt-reflection-ClassGetEnumConstants/ClassGetEnumConstants.java b/test/testsuite/ouroboros/reflection_test/RT0115-rt-reflection-ClassGetEnumConstants/ClassGetEnumConstants.java index 76bba4215768b969d76a07d2be4e40414e26bf5c..2c3c8265c38580b4bd355d138490b3fcb79adbc2 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0115-rt-reflection-ClassGetEnumConstants/ClassGetEnumConstants.java +++ b/test/testsuite/ouroboros/reflection_test/RT0115-rt-reflection-ClassGetEnumConstants/ClassGetEnumConstants.java @@ -1,86 +1,86 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassGetEnumConstants - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassGetEnumConstants.java - * - @Title/Destination: Class getEnumConstants() return null when there is no enum in the class。 - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest3。 - * -#step2:获取class MyTargetTest3。 - * -#step3:调用getEnumConstants()获取枚举类的元素。 - * -#step4:确认返回为空。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: ClassGetEnumConstants.java - * - @ExecuteClass: ClassGetEnumConstants - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -public class ClassGetEnumConstants { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = ClassGetEnumConstants1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int ClassGetEnumConstants1() { - Class m; - try { - m = MyTargetTest3.class; - MyTargetTest3[] target = m.getEnumConstants(); - if (target == null) { - return 0; - } - } catch (SecurityException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest3 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest3(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassGetEnumConstants + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassGetEnumConstants.java + * - @Title/Destination: Class getEnumConstants() return null when there is no enum in the class。 + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest3。 + * -#step2:获取class MyTargetTest3。 + * -#step3:调用getEnumConstants()获取枚举类的元素。 + * -#step4:确认返回为空。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: ClassGetEnumConstants.java + * - @ExecuteClass: ClassGetEnumConstants + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +public class ClassGetEnumConstants { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = ClassGetEnumConstants1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int ClassGetEnumConstants1() { + Class m; + try { + m = MyTargetTest3.class; + MyTargetTest3[] target = m.getEnumConstants(); + if (target == null) { + return 0; + } + } catch (SecurityException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest3 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest3(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0117-rt-reflection-ClassGetTypeParameters/ClassGetTypeParameters.java b/test/testsuite/ouroboros/reflection_test/RT0117-rt-reflection-ClassGetTypeParameters/ClassGetTypeParameters.java index 625b73249bf7388a7b4328cdab846ef8254a2f7a..3b3cd39b7d10e8d6998dcd07a3272e3654514c72 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0117-rt-reflection-ClassGetTypeParameters/ClassGetTypeParameters.java +++ b/test/testsuite/ouroboros/reflection_test/RT0117-rt-reflection-ClassGetTypeParameters/ClassGetTypeParameters.java @@ -1,89 +1,89 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassGetTypeParameters - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassGetTypeParameters.java - * - @Title/Destination: Class.getTypeParameters() return an array of TypeVariable objects that represent the type - * variables declared by the generic declaration represented by this GenericDeclaration object, - * in declaration order. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest5。 - * -#step2:获取class MyTargetTest5。 - * -#step3:调用getTypeParameters()获取TypeVariable对象的一个数组。 - * -#step4:确认返回的数组的长度为0。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: ClassGetTypeParameters.java - * - @ExecuteClass: ClassGetTypeParameters - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.TypeVariable; - -public class ClassGetTypeParameters { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = ClassGetTypeParameters1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int ClassGetTypeParameters1() { - Class m; - try { - m = MyTargetTest5.class; - TypeVariable>[] target = m.getTypeParameters(); - if (target.length == 0) { - return 0; - } - } catch (SecurityException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest5 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest5(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassGetTypeParameters + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassGetTypeParameters.java + * - @Title/Destination: Class.getTypeParameters() return an array of TypeVariable objects that represent the type + * variables declared by the generic declaration represented by this GenericDeclaration object, + * in declaration order. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest5。 + * -#step2:获取class MyTargetTest5。 + * -#step3:调用getTypeParameters()获取TypeVariable对象的一个数组。 + * -#step4:确认返回的数组的长度为0。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: ClassGetTypeParameters.java + * - @ExecuteClass: ClassGetTypeParameters + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.TypeVariable; + +public class ClassGetTypeParameters { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = ClassGetTypeParameters1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int ClassGetTypeParameters1() { + Class m; + try { + m = MyTargetTest5.class; + TypeVariable>[] target = m.getTypeParameters(); + if (target.length == 0) { + return 0; + } + } catch (SecurityException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest5 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest5(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0118-rt-reflection-ClassToGenericString/ClassToGenericString.java b/test/testsuite/ouroboros/reflection_test/RT0118-rt-reflection-ClassToGenericString/ClassToGenericString.java index 50d7818cf1e69ad566383058d9cf87f5820265ab..40b8feb068e904302392663b5a81644c9ea8a76e 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0118-rt-reflection-ClassToGenericString/ClassToGenericString.java +++ b/test/testsuite/ouroboros/reflection_test/RT0118-rt-reflection-ClassToGenericString/ClassToGenericString.java @@ -1,88 +1,88 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassToGenericString - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassToGenericString.java - * - @Title/Destination: Class.toGenericString() returns a string describing this Class, including information about - * modifiers and type parameters. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest5。 - * -#step2:获取class MyTargetTest5。 - * -#step3:调用toGenericString()获取描述此class的字符串。 - * -#step4:确认返回的描述正确。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: ClassToGenericString.java - * - @ExecuteClass: ClassToGenericString - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -public class ClassToGenericString { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - - try { - result = ClassToGenericString1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int ClassToGenericString1() { - Class m; - try { - m = MyTargetTest6.class; - String str = m.toGenericString(); - if ("class ClassToGenericString$MyTargetTest6".equals(str)) { - return 0; - } - } catch (SecurityException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest6 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest6(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassToGenericString + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassToGenericString.java + * - @Title/Destination: Class.toGenericString() returns a string describing this Class, including information about + * modifiers and type parameters. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest5。 + * -#step2:获取class MyTargetTest5。 + * -#step3:调用toGenericString()获取描述此class的字符串。 + * -#step4:确认返回的描述正确。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: ClassToGenericString.java + * - @ExecuteClass: ClassToGenericString + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +public class ClassToGenericString { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + + try { + result = ClassToGenericString1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int ClassToGenericString1() { + Class m; + try { + m = MyTargetTest6.class; + String str = m.toGenericString(); + if ("class ClassToGenericString$MyTargetTest6".equals(str)) { + return 0; + } + } catch (SecurityException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest6 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest6(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0121-rt-reflection-ConstructorGetExceptionTypes/ConstructorGetExceptionTypes.java b/test/testsuite/ouroboros/reflection_test/RT0121-rt-reflection-ConstructorGetExceptionTypes/ConstructorGetExceptionTypes.java index ff151d735934f20e502a2e802b1d776fa1dbbadf..dbce556b75bef0b9fbf23ad8dcc47645bbcf7ba1 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0121-rt-reflection-ConstructorGetExceptionTypes/ConstructorGetExceptionTypes.java +++ b/test/testsuite/ouroboros/reflection_test/RT0121-rt-reflection-ConstructorGetExceptionTypes/ConstructorGetExceptionTypes.java @@ -1,90 +1,90 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ConstructorGetExceptionTypes.java - *- @RequirementName: Java Reflection - *- @TestCaseName:ConstructorGetExceptionTypes.java - * - @Title/Destination: Constructor.getExceptionTypes() returns an array of length 0 if the executable declares no - * exceptions in its throws clause. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest02。 - * -#step2:通过调用getConstructor(Class[])从内部类MyTargetTest02中获取对应的构造方法。 - * -#step3:调用getExceptionTypes()获取抛出的异常类型的Class对象的数组。 - * -#step4:确认返回的数组长度是0。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: ConstructorGetExceptionTypes.java - * - @ExecuteClass: ConstructorGetExceptionTypes - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.Constructor; - -public class ConstructorGetExceptionTypes { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = ConstructorGetExceptionTypes1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int ConstructorGetExceptionTypes1() { - Constructor m; - try { - m = MyTargetTest02.class.getConstructor(new Class[]{ConstructorGetExceptionTypes.class, String.class}); - Class[] Target = m.getExceptionTypes(); - if (Target.length == 0) { - return 0; - } - } catch (SecurityException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest02 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest02(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ConstructorGetExceptionTypes.java + *- @RequirementName: Java Reflection + *- @TestCaseName:ConstructorGetExceptionTypes.java + * - @Title/Destination: Constructor.getExceptionTypes() returns an array of length 0 if the executable declares no + * exceptions in its throws clause. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest02。 + * -#step2:通过调用getConstructor(Class[])从内部类MyTargetTest02中获取对应的构造方法。 + * -#step3:调用getExceptionTypes()获取抛出的异常类型的Class对象的数组。 + * -#step4:确认返回的数组长度是0。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: ConstructorGetExceptionTypes.java + * - @ExecuteClass: ConstructorGetExceptionTypes + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Constructor; + +public class ConstructorGetExceptionTypes { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = ConstructorGetExceptionTypes1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int ConstructorGetExceptionTypes1() { + Constructor m; + try { + m = MyTargetTest02.class.getConstructor(new Class[]{ConstructorGetExceptionTypes.class, String.class}); + Class[] Target = m.getExceptionTypes(); + if (Target.length == 0) { + return 0; + } + } catch (SecurityException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest02 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest02(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0122-rt-reflection-ConstructorGetTypeParameters/ConstructorGetTypeParameters.java b/test/testsuite/ouroboros/reflection_test/RT0122-rt-reflection-ConstructorGetTypeParameters/ConstructorGetTypeParameters.java index cdd295731b5070303921d72af565ce7c58135b23..95bd3727c8cef3becdcd9ca3a316f714fc15f27c 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0122-rt-reflection-ConstructorGetTypeParameters/ConstructorGetTypeParameters.java +++ b/test/testsuite/ouroboros/reflection_test/RT0122-rt-reflection-ConstructorGetTypeParameters/ConstructorGetTypeParameters.java @@ -1,91 +1,91 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ConstructorGetTypeParameters.java - *- @RequirementName: Java Reflection - *- @TestCaseName:ConstructorGetTypeParameters.java - * - @Title/Destination: Constructor.getTypeParameters() returns an array of length 0 if the underlying generic - * declaration declares no type variables. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest03。 - * -#step2:通过调用getConstructor(Class[])从内部类MyTargetTest03中获取对应的构造方法。 - * -#step3:调用getTypeParameters()获取TypeVariable对象的数组。 - * -#step4:确认返回的数组长度是0。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: ConstructorGetTypeParameters.java - * - @ExecuteClass: ConstructorGetTypeParameters - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.Constructor; -import java.lang.reflect.TypeVariable; - -public class ConstructorGetTypeParameters { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = ConstructorGetTypeParameters1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int ConstructorGetTypeParameters1() { - Constructor m; - try { - m = MyTargetTest03.class.getConstructor(new Class[]{ConstructorGetTypeParameters.class, String.class}); - TypeVariable>[] Target = m.getTypeParameters(); - if (Target.length == 0) { - return 0; - } - } catch (SecurityException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest03 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest03(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ConstructorGetTypeParameters.java + *- @RequirementName: Java Reflection + *- @TestCaseName:ConstructorGetTypeParameters.java + * - @Title/Destination: Constructor.getTypeParameters() returns an array of length 0 if the underlying generic + * declaration declares no type variables. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest03。 + * -#step2:通过调用getConstructor(Class[])从内部类MyTargetTest03中获取对应的构造方法。 + * -#step3:调用getTypeParameters()获取TypeVariable对象的数组。 + * -#step4:确认返回的数组长度是0。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: ConstructorGetTypeParameters.java + * - @ExecuteClass: ConstructorGetTypeParameters + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Constructor; +import java.lang.reflect.TypeVariable; + +public class ConstructorGetTypeParameters { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = ConstructorGetTypeParameters1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int ConstructorGetTypeParameters1() { + Constructor m; + try { + m = MyTargetTest03.class.getConstructor(new Class[]{ConstructorGetTypeParameters.class, String.class}); + TypeVariable>[] Target = m.getTypeParameters(); + if (Target.length == 0) { + return 0; + } + } catch (SecurityException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest03 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest03(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0123-rt-reflection-ConstructorToGenericString/ConstructorToGenericString.java b/test/testsuite/ouroboros/reflection_test/RT0123-rt-reflection-ConstructorToGenericString/ConstructorToGenericString.java index 6697fa5fb2585fefd1ea9f5b24de6926a3b97007..cd459b5a967be3acd5b9ad7c037d9f86b6eafba7 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0123-rt-reflection-ConstructorToGenericString/ConstructorToGenericString.java +++ b/test/testsuite/ouroboros/reflection_test/RT0123-rt-reflection-ConstructorToGenericString/ConstructorToGenericString.java @@ -1,91 +1,91 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ConstructorToGenericString.java - *- @RequirementName: Java Reflection - *- @TestCaseName:ConstructorToGenericString.java - * - @Title/Destination: Constructor.toGenericString() returns a string describing this Constructor, including type - * parameters. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest04。 - * -#step2:通过调用getConstructor(Class[])从内部类MyTargetTest04中获取对应的构造方法。 - * -#step3:调用toGenericString()获取描述此Field的字符串。 - * -#step4:确认返回的描述正确。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: ConstructorToGenericString.java - * - @ExecuteClass: ConstructorToGenericString - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.Constructor; - -public class ConstructorToGenericString { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = ConstructorToGenericString1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int ConstructorToGenericString1() { - Constructor m; - try { - m = MyTargetTest04.class.getConstructor(new Class[]{ConstructorToGenericString.class, String.class}); - String str = m.toGenericString(); - if ("public ConstructorToGenericString$MyTargetTest04(ConstructorToGenericString,java.lang.String)" - .equals(str)) { - return 0; - } - } catch (SecurityException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest04 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest04(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ConstructorToGenericString.java + *- @RequirementName: Java Reflection + *- @TestCaseName:ConstructorToGenericString.java + * - @Title/Destination: Constructor.toGenericString() returns a string describing this Constructor, including type + * parameters. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest04。 + * -#step2:通过调用getConstructor(Class[])从内部类MyTargetTest04中获取对应的构造方法。 + * -#step3:调用toGenericString()获取描述此Field的字符串。 + * -#step4:确认返回的描述正确。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: ConstructorToGenericString.java + * - @ExecuteClass: ConstructorToGenericString + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Constructor; + +public class ConstructorToGenericString { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = ConstructorToGenericString1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int ConstructorToGenericString1() { + Constructor m; + try { + m = MyTargetTest04.class.getConstructor(new Class[]{ConstructorToGenericString.class, String.class}); + String str = m.toGenericString(); + if ("public ConstructorToGenericString$MyTargetTest04(ConstructorToGenericString,java.lang.String)" + .equals(str)) { + return 0; + } + } catch (SecurityException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest04 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest04(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0128-rt-reflection-FieldToGenericString/FieldToGenericString.java b/test/testsuite/ouroboros/reflection_test/RT0128-rt-reflection-FieldToGenericString/FieldToGenericString.java index 3626fdce8ceb33eb8d438da598137a4e99a1d579..4bc87c08c59a13b68658f83ae9ed12ef94db6d44 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0128-rt-reflection-FieldToGenericString/FieldToGenericString.java +++ b/test/testsuite/ouroboros/reflection_test/RT0128-rt-reflection-FieldToGenericString/FieldToGenericString.java @@ -1,89 +1,89 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: FieldToGenericString - *- @RequirementName: Java Reflection - *- @TestCaseName:FieldToGenericString.java - * - @Title/Destination: Field.toGenericString() returns a string describing this Field, including its generic type. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest10。 - * -#step2:通过调用getField()从内部类MyTargetTest10中获取home。 - * -#step3:调用toGenericString()获取描述此Field的字符串。 - * -#step4:确认返回的描述正确。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: FieldToGenericString.java - * - @ExecuteClass: FieldToGenericString - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.Field; - -public class FieldToGenericString { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = FieldToGenericString1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int FieldToGenericString1() { - Field m; - try { - m = MyTargetTest10.class.getField("home"); - String str = m.toGenericString(); - if ("public java.lang.String FieldToGenericString$MyTargetTest10.home".equals(str)) { - return 0; - } - } catch (SecurityException e) { - e.printStackTrace(); - } catch (NoSuchFieldException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest10 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest10(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: FieldToGenericString + *- @RequirementName: Java Reflection + *- @TestCaseName:FieldToGenericString.java + * - @Title/Destination: Field.toGenericString() returns a string describing this Field, including its generic type. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest10。 + * -#step2:通过调用getField()从内部类MyTargetTest10中获取home。 + * -#step3:调用toGenericString()获取描述此Field的字符串。 + * -#step4:确认返回的描述正确。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: FieldToGenericString.java + * - @ExecuteClass: FieldToGenericString + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Field; + +public class FieldToGenericString { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = FieldToGenericString1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int FieldToGenericString1() { + Field m; + try { + m = MyTargetTest10.class.getField("home"); + String str = m.toGenericString(); + if ("public java.lang.String FieldToGenericString$MyTargetTest10.home".equals(str)) { + return 0; + } + } catch (SecurityException e) { + e.printStackTrace(); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest10 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest10(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0131-rt-reflection-MethodgetDefaultValue/MethodGetDefaultValue.java b/test/testsuite/ouroboros/reflection_test/RT0131-rt-reflection-MethodgetDefaultValue/MethodGetDefaultValue.java index bd05e1f36f26cac9c9210f690a9af7d57d66867b..d46b6f4a6f62e8c76e5a905d9faf1ac0fed3f648 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0131-rt-reflection-MethodgetDefaultValue/MethodGetDefaultValue.java +++ b/test/testsuite/ouroboros/reflection_test/RT0131-rt-reflection-MethodgetDefaultValue/MethodGetDefaultValue.java @@ -1,72 +1,72 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MethodGetDefaultValue - *- @RequirementName: Java Reflection - *- @TestCaseName:MethodGetDefaultValue.java - * - @Title/Destination: Method.getDefaultValue returns the default value for the annotation member represented by this - * Method instance. Returns null if no default is associated with the member。 - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest13。 - * -#step2:通过调用getMethod()从内部类MyTargetTest13中获取MyTargetTest_1。 - * -#step3:调用getDefaultValue()获取注解成员的默认值。 - * -#step4:确认获取为null,无异常抛出。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: MethodGetDefaultValue.java - * - @ExecuteClass: MethodGetDefaultValue - * - @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Method; - -public class MethodGetDefaultValue { - public static void main(String[] argv) { - int result = 2/* STATUS_FAILED */; - try { - result = MethodGetDefaultValueTypeNotPresent_1(); - } catch (Exception e) { - result = 3; - } - System.out.println(result); - } - - public static int MethodGetDefaultValueTypeNotPresent_1() { - try { - Method m = MyTargetTest13.class.getMethod("MyTargetTest_1"); - Object a = m.getDefaultValue(); - } catch (TypeNotPresentException e) { - return 3; - } catch (NoSuchMethodException e) { - return 4; - } - return 0; - } - - @Target(ElementType.TYPE) - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - Class style() default String.class; - } - - @MyTarget() - class MyTargetTest13 { - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MethodGetDefaultValue + *- @RequirementName: Java Reflection + *- @TestCaseName:MethodGetDefaultValue.java + * - @Title/Destination: Method.getDefaultValue returns the default value for the annotation member represented by this + * Method instance. Returns null if no default is associated with the member。 + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest13。 + * -#step2:通过调用getMethod()从内部类MyTargetTest13中获取MyTargetTest_1。 + * -#step3:调用getDefaultValue()获取注解成员的默认值。 + * -#step4:确认获取为null,无异常抛出。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: MethodGetDefaultValue.java + * - @ExecuteClass: MethodGetDefaultValue + * - @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Method; + +public class MethodGetDefaultValue { + public static void main(String[] argv) { + int result = 2/* STATUS_FAILED */; + try { + result = MethodGetDefaultValueTypeNotPresent_1(); + } catch (Exception e) { + result = 3; + } + System.out.println(result); + } + + public static int MethodGetDefaultValueTypeNotPresent_1() { + try { + Method m = MyTargetTest13.class.getMethod("MyTargetTest_1"); + Object a = m.getDefaultValue(); + } catch (TypeNotPresentException e) { + return 3; + } catch (NoSuchMethodException e) { + return 4; + } + return 0; + } + + @Target(ElementType.TYPE) + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + Class style() default String.class; + } + + @MyTarget() + class MyTargetTest13 { + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0132-rt-reflection-MethodGetParameterCount/MethodGetParameterCount.java b/test/testsuite/ouroboros/reflection_test/RT0132-rt-reflection-MethodGetParameterCount/MethodGetParameterCount.java index 5d2c635045069bda1890223f6931ca422c633d6e..12bc68db78363d4414fd844187fffa46c3833b90 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0132-rt-reflection-MethodGetParameterCount/MethodGetParameterCount.java +++ b/test/testsuite/ouroboros/reflection_test/RT0132-rt-reflection-MethodGetParameterCount/MethodGetParameterCount.java @@ -1,88 +1,88 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MethodGetParameterCount - *- @RequirementName: Java Reflection - *- @TestCaseName:MethodGetParameterCount.java - * - @Title/Destination: Method.getParameterCount() returns the number of formal parameters. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest14。 - * -#step2:通过调用getMethod()从内部类MyTargetTest14中获取MyTargetTest_1。 - * -#step3:调用getParameterCount()获取参数个数。 - * -#step4:确认返回的参数个数是0。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: MethodGetParameterCount.java - * - @ExecuteClass: MethodGetParameterCount - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.Method; - -public class MethodGetParameterCount { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - - try { - result = MethodGetParameterCount1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int MethodGetParameterCount1() { - Method m; - try { - m = MyTargetTest14.class.getMethod("MyTargetTest_1"); - int num = m.getParameterCount(); - if (num == 0) { - return 0; - } - } catch (NoSuchMethodException | SecurityException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest14 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest14(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MethodGetParameterCount + *- @RequirementName: Java Reflection + *- @TestCaseName:MethodGetParameterCount.java + * - @Title/Destination: Method.getParameterCount() returns the number of formal parameters. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest14。 + * -#step2:通过调用getMethod()从内部类MyTargetTest14中获取MyTargetTest_1。 + * -#step3:调用getParameterCount()获取参数个数。 + * -#step4:确认返回的参数个数是0。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: MethodGetParameterCount.java + * - @ExecuteClass: MethodGetParameterCount + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Method; + +public class MethodGetParameterCount { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + + try { + result = MethodGetParameterCount1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int MethodGetParameterCount1() { + Method m; + try { + m = MyTargetTest14.class.getMethod("MyTargetTest_1"); + int num = m.getParameterCount(); + if (num == 0) { + return 0; + } + } catch (NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest14 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest14(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0133-rt-reflection-MethodGetTypeParameters/MethodGetTypeParameters.java b/test/testsuite/ouroboros/reflection_test/RT0133-rt-reflection-MethodGetTypeParameters/MethodGetTypeParameters.java index 59eebfd5cc5ef10a8ead4452c88ad6ef877e1559..228dff066ac654d98b4f5cd22356f67d9cb91cbb 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0133-rt-reflection-MethodGetTypeParameters/MethodGetTypeParameters.java +++ b/test/testsuite/ouroboros/reflection_test/RT0133-rt-reflection-MethodGetTypeParameters/MethodGetTypeParameters.java @@ -1,88 +1,88 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MethodGetTypeParameters - *- @RequirementName: Java Reflection - *- @TestCaseName:MethodGetTypeParameters.java - * - @Title/Destination: Method.getTypeParameters() returns an array of TypeVariable objects. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest15。 - * -#step2:通过调用getMethod()从内部类MyTargetTest15中获取MyTargetTest_1。 - * -#step3:调用getTypeParameters()获取TypeVariable对象的数组。 - * -#step4:确认返回的数组长度是0。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: MethodGetTypeParameters.java - * - @ExecuteClass: MethodGetTypeParameters - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.Method; -import java.lang.reflect.TypeVariable; - -public class MethodGetTypeParameters { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = MethodGetTypeParameters1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int MethodGetTypeParameters1() { - Method m; - try { - m = MyTargetTest15.class.getMethod("MyTargetTest_1"); - TypeVariable[] Target = m.getTypeParameters(); - if (Target.length == 0) { - return 0; - } - } catch (NoSuchMethodException | SecurityException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest15 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest15(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MethodGetTypeParameters + *- @RequirementName: Java Reflection + *- @TestCaseName:MethodGetTypeParameters.java + * - @Title/Destination: Method.getTypeParameters() returns an array of TypeVariable objects. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest15。 + * -#step2:通过调用getMethod()从内部类MyTargetTest15中获取MyTargetTest_1。 + * -#step3:调用getTypeParameters()获取TypeVariable对象的数组。 + * -#step4:确认返回的数组长度是0。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: MethodGetTypeParameters.java + * - @ExecuteClass: MethodGetTypeParameters + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Method; +import java.lang.reflect.TypeVariable; + +public class MethodGetTypeParameters { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = MethodGetTypeParameters1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int MethodGetTypeParameters1() { + Method m; + try { + m = MyTargetTest15.class.getMethod("MyTargetTest_1"); + TypeVariable[] Target = m.getTypeParameters(); + if (Target.length == 0) { + return 0; + } + } catch (NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest15 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest15(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0134-rt-reflection-MethodIsDefault/MethodIsDefault.java b/test/testsuite/ouroboros/reflection_test/RT0134-rt-reflection-MethodIsDefault/MethodIsDefault.java index 5e78591e36824b924e905e276c8b6beb45dc5027..bf489d2f464f7eee4882203c68755c658802fb9d 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0134-rt-reflection-MethodIsDefault/MethodIsDefault.java +++ b/test/testsuite/ouroboros/reflection_test/RT0134-rt-reflection-MethodIsDefault/MethodIsDefault.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MethodIsDefault - *- @RequirementName: Java Reflection - *- @TestCaseName:MethodIsDefault.java - * - @Title/Destination: Method.isDefault() Returns true if this method is a default method。 - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest16。 - * -#step2:通过调用getMethod()从内部类MyTargetTest16中获取MyTargetTest_1。 - * -#step3:调用isDefault()判断是否是default method。 - * -#step4:确认返回false。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: MethodIsDefault.java - * - @ExecuteClass: MethodIsDefault - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.Method; - -public class MethodIsDefault { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = MethodIsDefault1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int MethodIsDefault1() { - Method m; - try { - m = MyTargetTest16.class.getMethod("MyTargetTest_1"); - boolean flag = m.isDefault(); - if (!flag) { - return 0; - } - } catch (NoSuchMethodException | SecurityException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest16 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest16(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MethodIsDefault + *- @RequirementName: Java Reflection + *- @TestCaseName:MethodIsDefault.java + * - @Title/Destination: Method.isDefault() Returns true if this method is a default method。 + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest16。 + * -#step2:通过调用getMethod()从内部类MyTargetTest16中获取MyTargetTest_1。 + * -#step3:调用isDefault()判断是否是default method。 + * -#step4:确认返回false。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: MethodIsDefault.java + * - @ExecuteClass: MethodIsDefault + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Method; + +public class MethodIsDefault { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = MethodIsDefault1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int MethodIsDefault1() { + Method m; + try { + m = MyTargetTest16.class.getMethod("MyTargetTest_1"); + boolean flag = m.isDefault(); + if (!flag) { + return 0; + } + } catch (NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest16 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest16(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0135-rt-reflection-MethodToGenericString/MethodToGenericString.java b/test/testsuite/ouroboros/reflection_test/RT0135-rt-reflection-MethodToGenericString/MethodToGenericString.java index b6f858327a34c4dc2b02ab89e3afa70396dbb1ff..00c8200bf423bac07f99f2a99e2ab5301d7aea67 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0135-rt-reflection-MethodToGenericString/MethodToGenericString.java +++ b/test/testsuite/ouroboros/reflection_test/RT0135-rt-reflection-MethodToGenericString/MethodToGenericString.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MethodToGenericString - *- @RequirementName: Java Reflection - *- @TestCaseName:MethodToGenericString.java - * - @Title/Destination: Method.toGenericString() Returns a string describing this Method, including type parameters. - * - @Brief:no: - * -#step1: 定义含注解的内部类MyTargetTest15。 - * -#step2:通过调用getMethod()从内部类MyTargetTest15中获取MyTargetTest_1。 - * -#step3:调用toGenericString()获取描述此Method的字符串。 - * -#step4:确认返回的描述正确。 - * - @Expect: 0\n - * - @Priority: High - * - @Source: MethodToGenericString.java - * - @ExecuteClass: MethodToGenericString - * - @ExecuteArgs: - */ - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.reflect.Method; - -public class MethodToGenericString { - @Retention(RetentionPolicy.RUNTIME) - public @interface MyTarget { - public String name(); - public String value(); - } - - public static void main(String[] args) { - int result = 2; - try { - result = MethodToGenericString1(); - } catch (Exception e) { - e.printStackTrace(); - result = 3; - } - System.out.println(result); - } - - public static int MethodToGenericString1() { - Method m; - try { - m = MyTargetTest17.class.getMethod("MyTargetTest_1"); - String str = m.toGenericString(); - if ("public void MethodToGenericString$MyTargetTest17.MyTargetTest_1()".equals(str)) { - return 0; - } - } catch (NoSuchMethodException | SecurityException e) { - e.printStackTrace(); - } - return 2; - } - - class MyTargetTest17 { - @MyTarget(name = "newName", value = "newValue") - public String home; - - @MyTarget(name = "name", value = "value") - public void MyTargetTest_1() { - System.out.println("This is Example:hello world"); - } - - public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { - System.out.println("my home at:" + home); - } - - @MyTarget(name = "cons", value = "constructor") - public MyTargetTest17(String home) { - this.home = home; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MethodToGenericString + *- @RequirementName: Java Reflection + *- @TestCaseName:MethodToGenericString.java + * - @Title/Destination: Method.toGenericString() Returns a string describing this Method, including type parameters. + * - @Brief:no: + * -#step1: 定义含注解的内部类MyTargetTest15。 + * -#step2:通过调用getMethod()从内部类MyTargetTest15中获取MyTargetTest_1。 + * -#step3:调用toGenericString()获取描述此Method的字符串。 + * -#step4:确认返回的描述正确。 + * - @Expect: 0\n + * - @Priority: High + * - @Source: MethodToGenericString.java + * - @ExecuteClass: MethodToGenericString + * - @ExecuteArgs: + */ + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Method; + +public class MethodToGenericString { + @Retention(RetentionPolicy.RUNTIME) + public @interface MyTarget { + public String name(); + public String value(); + } + + public static void main(String[] args) { + int result = 2; + try { + result = MethodToGenericString1(); + } catch (Exception e) { + e.printStackTrace(); + result = 3; + } + System.out.println(result); + } + + public static int MethodToGenericString1() { + Method m; + try { + m = MyTargetTest17.class.getMethod("MyTargetTest_1"); + String str = m.toGenericString(); + if ("public void MethodToGenericString$MyTargetTest17.MyTargetTest_1()".equals(str)) { + return 0; + } + } catch (NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + } + return 2; + } + + class MyTargetTest17 { + @MyTarget(name = "newName", value = "newValue") + public String home; + + @MyTarget(name = "name", value = "value") + public void MyTargetTest_1() { + System.out.println("This is Example:hello world"); + } + + public void newMethod(@MyTarget(name = "name1", value = "value1") String home) { + System.out.println("my home at:" + home); + } + + @MyTarget(name = "cons", value = "constructor") + public MyTargetTest17(String home) { + this.home = home; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0143-rt-reflection-ClinitClassNewInstance/ClassInitClassNewInstance.java b/test/testsuite/ouroboros/reflection_test/RT0143-rt-reflection-ClinitClassNewInstance/ClassInitClassNewInstance.java index 74a9c124c5ed36b6396c474432a7f0a1af4561c5..d7dd159379cd95988759f261aedba8a127f2f47c 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0143-rt-reflection-ClinitClassNewInstance/ClassInitClassNewInstance.java +++ b/test/testsuite/ouroboros/reflection_test/RT0143-rt-reflection-ClinitClassNewInstance/ClassInitClassNewInstance.java @@ -1,164 +1,164 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitClassNewInstance - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitClassNewInstance.java - *- @Title/Destination: When call Class.newInstance, class is initialized; when call other methods of Class, class is - * not initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) to get the class One. - * -#step2: Call methods of Class except newInstance() and forName(), class One is not initialized. - * -#step3: call method newInstance(), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitClassNewInstance.java - *- @ExecuteClass: ClassInitClassNewInstance - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; - -public class ClassInitClassNewInstance { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - - /* Check point 1: no class initialization when calling following methods of Class - * not test clazz.cast(Object obj) because it success only when obj is an instance of One or Two, - * and need to call new One(), which result in Class initialization. */ - clazz.asSubclass(clazz); - clazz.desiredAssertionStatus(); - clazz.getAnnotation(A.class); - clazz.getAnnotations(); - clazz.getAnnotationsByType(A.class); - clazz.getCanonicalName(); - clazz.getClasses(); - clazz.getClassLoader(); - clazz.getComponentType(); - clazz.getConstructor(String.class); - clazz.getConstructors(); - clazz.getDeclaredAnnotation(A.class); - clazz.getDeclaredAnnotations(); - clazz.getDeclaredAnnotationsByType(A.class); - clazz.getDeclaredClasses(); - clazz.getDeclaredConstructor(String.class); - clazz.getDeclaredConstructors(); - clazz.getDeclaredField("what"); - clazz.getDeclaredFields(); - clazz.getDeclaredMethod("testOne", String.class); - clazz.getDeclaredMethods(); - clazz.getDeclaringClass(); - clazz.getEnclosingClass(); - clazz.getEnclosingConstructor(); - clazz.getEnclosingMethod(); - clazz.getEnumConstants(); - clazz.getField("hi"); - clazz.getFields(); - clazz.getGenericInterfaces(); - clazz.getGenericSuperclass(); - clazz.getInterfaces(); - clazz.getMethod("testOne", String.class); - clazz.getMethods(); - clazz.getModifiers(); - clazz.getName(); - clazz.getPackage(); - clazz.getProtectionDomain(); - clazz.getSigners(); - clazz.getSimpleName(); - clazz.getSuperclass(); - clazz.getTypeName(); - clazz.getTypeParameters(); - clazz.isAnnotation(); - clazz.isAnnotationPresent(A.class); - clazz.isAnonymousClass(); - clazz.isArray(); - clazz.isAssignableFrom(clazz); - clazz.isEnum(); - clazz.isInstance(new Object()); - clazz.isInterface(); - clazz.isLocalClass(); - clazz.isMemberClass(); - clazz.isPrimitive(); - clazz.isSynthetic(); - clazz.toString(); - clazz.toGenericString(); - clazz.getResource("hi"); - clazz.getResourceAsStream("hi"); - - // Check point 2: when call newInstance, start class initialization - if (result.toString().compareTo("") == 0) { - clazz.newInstance(); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitClassNewInstance.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitClassNewInstance.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitClassNewInstance.result.append("One"); - } - - String what = "lala"; - public String hi = ""; - One() { - } - - public One(String s) { - what = s; - System.out.println(s); - } - - public int testOne(String a) { - System.out.println(a); - return 0; - } -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitClassNewInstance.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitClassNewInstance.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitClassNewInstance + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitClassNewInstance.java + *- @Title/Destination: When call Class.newInstance, class is initialized; when call other methods of Class, class is + * not initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) to get the class One. + * -#step2: Call methods of Class except newInstance() and forName(), class One is not initialized. + * -#step3: call method newInstance(), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitClassNewInstance.java + *- @ExecuteClass: ClassInitClassNewInstance + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; + +public class ClassInitClassNewInstance { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + + /* Check point 1: no class initialization when calling following methods of Class + * not test clazz.cast(Object obj) because it success only when obj is an instance of One or Two, + * and need to call new One(), which result in Class initialization. */ + clazz.asSubclass(clazz); + clazz.desiredAssertionStatus(); + clazz.getAnnotation(A.class); + clazz.getAnnotations(); + clazz.getAnnotationsByType(A.class); + clazz.getCanonicalName(); + clazz.getClasses(); + clazz.getClassLoader(); + clazz.getComponentType(); + clazz.getConstructor(String.class); + clazz.getConstructors(); + clazz.getDeclaredAnnotation(A.class); + clazz.getDeclaredAnnotations(); + clazz.getDeclaredAnnotationsByType(A.class); + clazz.getDeclaredClasses(); + clazz.getDeclaredConstructor(String.class); + clazz.getDeclaredConstructors(); + clazz.getDeclaredField("what"); + clazz.getDeclaredFields(); + clazz.getDeclaredMethod("testOne", String.class); + clazz.getDeclaredMethods(); + clazz.getDeclaringClass(); + clazz.getEnclosingClass(); + clazz.getEnclosingConstructor(); + clazz.getEnclosingMethod(); + clazz.getEnumConstants(); + clazz.getField("hi"); + clazz.getFields(); + clazz.getGenericInterfaces(); + clazz.getGenericSuperclass(); + clazz.getInterfaces(); + clazz.getMethod("testOne", String.class); + clazz.getMethods(); + clazz.getModifiers(); + clazz.getName(); + clazz.getPackage(); + clazz.getProtectionDomain(); + clazz.getSigners(); + clazz.getSimpleName(); + clazz.getSuperclass(); + clazz.getTypeName(); + clazz.getTypeParameters(); + clazz.isAnnotation(); + clazz.isAnnotationPresent(A.class); + clazz.isAnonymousClass(); + clazz.isArray(); + clazz.isAssignableFrom(clazz); + clazz.isEnum(); + clazz.isInstance(new Object()); + clazz.isInterface(); + clazz.isLocalClass(); + clazz.isMemberClass(); + clazz.isPrimitive(); + clazz.isSynthetic(); + clazz.toString(); + clazz.toGenericString(); + clazz.getResource("hi"); + clazz.getResourceAsStream("hi"); + + // Check point 2: when call newInstance, start class initialization + if (result.toString().compareTo("") == 0) { + clazz.newInstance(); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitClassNewInstance.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitClassNewInstance.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitClassNewInstance.result.append("One"); + } + + String what = "lala"; + public String hi = ""; + One() { + } + + public One(String s) { + what = s; + System.out.println(s); + } + + public int testOne(String a) { + System.out.println(a); + return 0; + } +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitClassNewInstance.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitClassNewInstance.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0144-rt-reflection-ClinitConstructorNewInstance/ClassInitConstructorNewInstance.java b/test/testsuite/ouroboros/reflection_test/RT0144-rt-reflection-ClinitConstructorNewInstance/ClassInitConstructorNewInstance.java index d4b0b61a435ff33792382e98d96a514c3b8c452d..7e046623bda7ab166833264cf467b38efc2b8f0e 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0144-rt-reflection-ClinitConstructorNewInstance/ClassInitConstructorNewInstance.java +++ b/test/testsuite/ouroboros/reflection_test/RT0144-rt-reflection-ClinitConstructorNewInstance/ClassInitConstructorNewInstance.java @@ -1,117 +1,117 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitConstructorNewInstance - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitConstructorNewInstance.java - *- @Title/Destination: When call Constructor.newInstance, class is initialized; when call other methods of Constructor, - * class is not initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getConstructor to get Constructor of - * class One. - * -#step2: Call methods of Class except newInstance(), class One is not initialized. - * -#step3: call method newInstance(), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitConstructorNewInstance.java - *- @ExecuteClass: ClassInitConstructorNewInstance - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Constructor; - -public class ClassInitConstructorNewInstance { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Constructor constructor = clazz.getConstructor(String.class); - //check point 1: calling following methods, class not initialized - constructor.equals(constructor); - constructor.getAnnotation(A.class); - constructor.getDeclaredAnnotations(); - constructor.getDeclaringClass(); - constructor.getExceptionTypes(); - constructor.getGenericExceptionTypes(); - constructor.getGenericParameterTypes(); - constructor.getModifiers(); - constructor.getName(); - constructor.getParameterAnnotations(); - constructor.getParameterCount(); - constructor.getParameterTypes(); - constructor.hashCode(); - constructor.isSynthetic(); - constructor.isVarArgs(); - constructor.toString(); - constructor.toGenericString(); - - //check point 2: after call newInstance(), class initialized - if (result.toString().compareTo("") == 0) { - constructor.newInstance("newInstance"); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitConstructorNewInstance.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitConstructorNewInstance.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitConstructorNewInstance.result.append("One"); - } - - String what = "lala"; - - One() { - } - - public One(String s) { - what = s; - } -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitConstructorNewInstance.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitConstructorNewInstance.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitConstructorNewInstance + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitConstructorNewInstance.java + *- @Title/Destination: When call Constructor.newInstance, class is initialized; when call other methods of Constructor, + * class is not initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getConstructor to get Constructor of + * class One. + * -#step2: Call methods of Class except newInstance(), class One is not initialized. + * -#step3: call method newInstance(), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitConstructorNewInstance.java + *- @ExecuteClass: ClassInitConstructorNewInstance + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Constructor; + +public class ClassInitConstructorNewInstance { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Constructor constructor = clazz.getConstructor(String.class); + //check point 1: calling following methods, class not initialized + constructor.equals(constructor); + constructor.getAnnotation(A.class); + constructor.getDeclaredAnnotations(); + constructor.getDeclaringClass(); + constructor.getExceptionTypes(); + constructor.getGenericExceptionTypes(); + constructor.getGenericParameterTypes(); + constructor.getModifiers(); + constructor.getName(); + constructor.getParameterAnnotations(); + constructor.getParameterCount(); + constructor.getParameterTypes(); + constructor.hashCode(); + constructor.isSynthetic(); + constructor.isVarArgs(); + constructor.toString(); + constructor.toGenericString(); + + //check point 2: after call newInstance(), class initialized + if (result.toString().compareTo("") == 0) { + constructor.newInstance("newInstance"); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitConstructorNewInstance.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitConstructorNewInstance.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitConstructorNewInstance.result.append("One"); + } + + String what = "lala"; + + One() { + } + + public One(String s) { + what = s; + } +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitConstructorNewInstance.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitConstructorNewInstance.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0145-rt-reflection-ClinitFieldGetBooleanStatic/ClassInitFieldGetBooleanStatic.java b/test/testsuite/ouroboros/reflection_test/RT0145-rt-reflection-ClinitFieldGetBooleanStatic/ClassInitFieldGetBooleanStatic.java index 1b0e61f18d431a214e5b7d01eab2dcc797a2654b..8847bd88b08f3609086cc55c2e4a2f1bff2db3b3 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0145-rt-reflection-ClinitFieldGetBooleanStatic/ClassInitFieldGetBooleanStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0145-rt-reflection-ClinitFieldGetBooleanStatic/ClassInitFieldGetBooleanStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetBooleanStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetBooleanStatic.java - *- @Title/Destination: When f is a static field of class One and call f.getBoolean(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.getBoolean(null), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetBooleanStatic.java - *- @ExecuteClass: ClassInitFieldGetBooleanStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldGetBooleanStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiBoolean"); - if (result.toString().compareTo("") == 0) { - f.getBoolean(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetBooleanStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetBooleanStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetBooleanStatic.result.append("One"); - } - - public static boolean hiBoolean = false; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetBooleanStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetBooleanStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetBooleanStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetBooleanStatic.java + *- @Title/Destination: When f is a static field of class One and call f.getBoolean(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.getBoolean(null), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetBooleanStatic.java + *- @ExecuteClass: ClassInitFieldGetBooleanStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldGetBooleanStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiBoolean"); + if (result.toString().compareTo("") == 0) { + f.getBoolean(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetBooleanStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetBooleanStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetBooleanStatic.result.append("One"); + } + + public static boolean hiBoolean = false; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetBooleanStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetBooleanStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0146-rt-reflection-ClinitFieldGetByteStatic/ClassInitFieldGetByteStatic.java b/test/testsuite/ouroboros/reflection_test/RT0146-rt-reflection-ClinitFieldGetByteStatic/ClassInitFieldGetByteStatic.java index 69a48757c3c7ba7c7258fc6c1f33c5f2c285ee28..092437d1302c3c2378689034a1e6d8f65faf6734 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0146-rt-reflection-ClinitFieldGetByteStatic/ClassInitFieldGetByteStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0146-rt-reflection-ClinitFieldGetByteStatic/ClassInitFieldGetByteStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetByteStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetByteStatic.java - *- @Title/Destination: When f is a static field of class One and call f.getByte(), class One is initialized - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.getByte(null), class One is initialized - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetByteStatic.java - *- @ExecuteClass: ClassInitFieldGetByteStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldGetByteStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiByte"); - if (result.toString().compareTo("") == 0) { - f.getByte(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetByteStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetByteStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetByteStatic.result.append("One"); - } - - public static byte hiByte = (byte) 0; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetByteStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetByteStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetByteStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetByteStatic.java + *- @Title/Destination: When f is a static field of class One and call f.getByte(), class One is initialized + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.getByte(null), class One is initialized + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetByteStatic.java + *- @ExecuteClass: ClassInitFieldGetByteStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldGetByteStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiByte"); + if (result.toString().compareTo("") == 0) { + f.getByte(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetByteStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetByteStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetByteStatic.result.append("One"); + } + + public static byte hiByte = (byte) 0; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetByteStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetByteStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0147-rt-reflection-ClinitFieldGetCharStatic/ClassInitFieldGetCharStatic.java b/test/testsuite/ouroboros/reflection_test/RT0147-rt-reflection-ClinitFieldGetCharStatic/ClassInitFieldGetCharStatic.java index 05da220c258cb99dcbc225b424bde799f2bd1cde..f83a148a8a0b0286cccaa0f9fadb58178986cd06 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0147-rt-reflection-ClinitFieldGetCharStatic/ClassInitFieldGetCharStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0147-rt-reflection-ClinitFieldGetCharStatic/ClassInitFieldGetCharStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetCharStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetCharStatic.java - *- @Title/Destination: When f is a static field of class One and call f.getChar(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.getChar(null), class One is initialized - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetCharStatic.java - *- @ExecuteClass: ClassInitFieldGetCharStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldGetCharStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiChar"); - if (result.toString().compareTo("") == 0) { - f.getChar(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetCharStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetCharStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetCharStatic.result.append("One"); - } - - public static char hiChar = (char) 45; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetCharStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetCharStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetCharStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetCharStatic.java + *- @Title/Destination: When f is a static field of class One and call f.getChar(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.getChar(null), class One is initialized + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetCharStatic.java + *- @ExecuteClass: ClassInitFieldGetCharStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldGetCharStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiChar"); + if (result.toString().compareTo("") == 0) { + f.getChar(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetCharStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetCharStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetCharStatic.result.append("One"); + } + + public static char hiChar = (char) 45; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetCharStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetCharStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0148-rt-reflection-ClinitFieldGetDoubleStatic/ClassInitFieldGetDoubleStatic.java b/test/testsuite/ouroboros/reflection_test/RT0148-rt-reflection-ClinitFieldGetDoubleStatic/ClassInitFieldGetDoubleStatic.java index 007aa3a5be4bcec373ccfe3a60061607ef4dc3b1..c04c180da59e4c2c3636c75bb30dfa882ad4a86d 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0148-rt-reflection-ClinitFieldGetDoubleStatic/ClassInitFieldGetDoubleStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0148-rt-reflection-ClinitFieldGetDoubleStatic/ClassInitFieldGetDoubleStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetDoubleStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetDoubleStatic.java - *- @Title/Destination: When f is a static field of class One and call f.getDouble(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.getDouble(null), class One is initialized - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetDoubleStatic.java - *- @ExecuteClass: ClassInitFieldGetDoubleStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldGetDoubleStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiDouble"); - if (result.toString().compareTo("") == 0) { - f.getDouble(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetDoubleStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetDoubleStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetDoubleStatic.result.append("One"); - } - - public static double hiDouble = 4.5; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetDoubleStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetDoubleStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetDoubleStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetDoubleStatic.java + *- @Title/Destination: When f is a static field of class One and call f.getDouble(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.getDouble(null), class One is initialized + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetDoubleStatic.java + *- @ExecuteClass: ClassInitFieldGetDoubleStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldGetDoubleStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiDouble"); + if (result.toString().compareTo("") == 0) { + f.getDouble(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetDoubleStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetDoubleStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetDoubleStatic.result.append("One"); + } + + public static double hiDouble = 4.5; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetDoubleStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetDoubleStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0149-rt-reflection-ClinitFieldGetFloatStatic/ClassInitFieldGetFloatStatic.java b/test/testsuite/ouroboros/reflection_test/RT0149-rt-reflection-ClinitFieldGetFloatStatic/ClassInitFieldGetFloatStatic.java index 942673f3385b17a2365a3e4573483a86bf4d7ca7..63b765449e45f885a923b20769802691a44d7cb6 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0149-rt-reflection-ClinitFieldGetFloatStatic/ClassInitFieldGetFloatStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0149-rt-reflection-ClinitFieldGetFloatStatic/ClassInitFieldGetFloatStatic.java @@ -1,86 +1,86 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetFloatStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetFloatStatic.java - *- @Title/Destination: When f is a static field of class One and call f.getFloat(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.getFloat(null), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetFloatStatic.java - *- @ExecuteClass: ClassInitFieldGetFloatStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldGetFloatStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiFloat"); - if (result.toString().compareTo("") == 0) { - f.getFloat(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetFloatStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetFloatStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetFloatStatic.result.append("One"); - } - public static float hiFloat = 0.25f; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetFloatStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetFloatStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetFloatStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetFloatStatic.java + *- @Title/Destination: When f is a static field of class One and call f.getFloat(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.getFloat(null), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetFloatStatic.java + *- @ExecuteClass: ClassInitFieldGetFloatStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldGetFloatStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiFloat"); + if (result.toString().compareTo("") == 0) { + f.getFloat(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetFloatStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetFloatStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetFloatStatic.result.append("One"); + } + public static float hiFloat = 0.25f; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetFloatStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetFloatStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0150-rt-reflection-ClinitFieldGetIntStatic/ClassInitFieldGetIntStatic.java b/test/testsuite/ouroboros/reflection_test/RT0150-rt-reflection-ClinitFieldGetIntStatic/ClassInitFieldGetIntStatic.java index c4ffc17d5a781c17a710fe760a130576515da351..8eaa53fc930b1caf1764dbd9abd53f0242c87ec8 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0150-rt-reflection-ClinitFieldGetIntStatic/ClassInitFieldGetIntStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0150-rt-reflection-ClinitFieldGetIntStatic/ClassInitFieldGetIntStatic.java @@ -1,86 +1,86 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetIntStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetIntStatic.java - *- @Title/Destination: When f is a static field of class One and call f.getInt(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.getInt(null), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetIntStatic.java - *- @ExecuteClass: ClassInitFieldGetIntStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldGetIntStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiInt"); - if (result.toString().compareTo("") == 0) { - f.getInt(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetIntStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetIntStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetIntStatic.result.append("One"); - } - public static int hiInt = 0; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetIntStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetIntStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetIntStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetIntStatic.java + *- @Title/Destination: When f is a static field of class One and call f.getInt(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.getInt(null), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetIntStatic.java + *- @ExecuteClass: ClassInitFieldGetIntStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldGetIntStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiInt"); + if (result.toString().compareTo("") == 0) { + f.getInt(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetIntStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetIntStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetIntStatic.result.append("One"); + } + public static int hiInt = 0; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetIntStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetIntStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0151-rt-reflection-ClinitFieldGetLongStatic/ClassInitFieldGetLongStatic.java b/test/testsuite/ouroboros/reflection_test/RT0151-rt-reflection-ClinitFieldGetLongStatic/ClassInitFieldGetLongStatic.java index 48e3bbc2ba66d833c5bddf94854956c0a6b691f3..c61b813626774be32a3d8437194dbad642597785 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0151-rt-reflection-ClinitFieldGetLongStatic/ClassInitFieldGetLongStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0151-rt-reflection-ClinitFieldGetLongStatic/ClassInitFieldGetLongStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetLongStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetLongStatic.java - *- @Title/Destination: When f is a static field of class One and call f.getLong(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.getLong(null), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetLongStatic.java - *- @ExecuteClass: ClassInitFieldGetLongStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldGetLongStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiLong"); - if (result.toString().compareTo("") == 0) { - f.getLong(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetLongStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetLongStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetLongStatic.result.append("One"); - } - - public static long hiLong = 4859l; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetLongStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetLongStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetLongStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetLongStatic.java + *- @Title/Destination: When f is a static field of class One and call f.getLong(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.getLong(null), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetLongStatic.java + *- @ExecuteClass: ClassInitFieldGetLongStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldGetLongStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiLong"); + if (result.toString().compareTo("") == 0) { + f.getLong(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetLongStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetLongStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetLongStatic.result.append("One"); + } + + public static long hiLong = 4859l; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetLongStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetLongStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0152-rt-reflection-ClinitFieldGetShortStatic/ClassInitFieldGetShortStatic.java b/test/testsuite/ouroboros/reflection_test/RT0152-rt-reflection-ClinitFieldGetShortStatic/ClassInitFieldGetShortStatic.java index 5306c4924be0947404b56f4b581f23f08f2f55e1..5aeae4e1ac6eda2f9aa4998011da694a30e840f2 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0152-rt-reflection-ClinitFieldGetShortStatic/ClassInitFieldGetShortStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0152-rt-reflection-ClinitFieldGetShortStatic/ClassInitFieldGetShortStatic.java @@ -1,86 +1,86 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetShortStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetShortStatic.java - *- @Title/Destination: When f is a static field of class One and call f.getShort(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class. - * -#step2: Call method f.getShort(null), class One is initialized - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetShortStatic.java - *- @ExecuteClass: ClassInitFieldGetShortStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldGetShortStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiShort"); - if (result.toString().compareTo("") == 0) { - f.getShort(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetShortStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetShortStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetShortStatic.result.append("One"); - } - - public static short hiShort = 48; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetShortStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetShortStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetShortStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetShortStatic.java + *- @Title/Destination: When f is a static field of class One and call f.getShort(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class. + * -#step2: Call method f.getShort(null), class One is initialized + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetShortStatic.java + *- @ExecuteClass: ClassInitFieldGetShortStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldGetShortStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiShort"); + if (result.toString().compareTo("") == 0) { + f.getShort(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetShortStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetShortStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetShortStatic.result.append("One"); + } + + public static short hiShort = 48; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetShortStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetShortStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0153-rt-reflection-ClinitFieldGetStatic/ClassInitFieldGetStatic.java b/test/testsuite/ouroboros/reflection_test/RT0153-rt-reflection-ClinitFieldGetStatic/ClassInitFieldGetStatic.java index 5d642295a49f609e5b32ba252ac812992e5317f5..19fee7dd0dfc22116de49ea92438fae1ac30002b 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0153-rt-reflection-ClinitFieldGetStatic/ClassInitFieldGetStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0153-rt-reflection-ClinitFieldGetStatic/ClassInitFieldGetStatic.java @@ -1,91 +1,91 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetStatic.java - *- @Title/Destination: When f is a static field of class One and call f.get(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class. - * -#step2: Call method f.get(null), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetStatic.java - *- @ExecuteClass: ClassInitFieldGetStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.lang.reflect.Field; - -public class ClassInitFieldGetStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - String fValue = ""; - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hi"); - if (result.toString().compareTo("") == 0) { - fValue = (String)f.get(null); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0 && fValue.compareTo("hi") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldGetStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldGetStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldGetStatic.result.append("One"); - } - - public static String hi = "hi"; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldGetStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldGetStatic.result.append("Two"); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetStatic.java + *- @Title/Destination: When f is a static field of class One and call f.get(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class. + * -#step2: Call method f.get(null), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetStatic.java + *- @ExecuteClass: ClassInitFieldGetStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.Field; + +public class ClassInitFieldGetStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + String fValue = ""; + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hi"); + if (result.toString().compareTo("") == 0) { + fValue = (String)f.get(null); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0 && fValue.compareTo("hi") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldGetStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldGetStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldGetStatic.result.append("One"); + } + + public static String hi = "hi"; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldGetStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldGetStatic.result.append("Two"); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0154-rt-reflection-ClinitFieldOtherMethod/ClassInitFieldOtherMethod.java b/test/testsuite/ouroboros/reflection_test/RT0154-rt-reflection-ClinitFieldOtherMethod/ClassInitFieldOtherMethod.java index 6afe197010dc8646ca3e434765d552e1d779fad0..2819d324094794254a08c9fca66f7899c4bbc388 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0154-rt-reflection-ClinitFieldOtherMethod/ClassInitFieldOtherMethod.java +++ b/test/testsuite/ouroboros/reflection_test/RT0154-rt-reflection-ClinitFieldOtherMethod/ClassInitFieldOtherMethod.java @@ -1,107 +1,107 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldOtherMethod - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldOtherMethod.java - *- @Title/Destination: When f is a static field of class One and call method except setXX/getXX, class is not - * initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class. - * -#step2: Call method of Field except setXX/getXX, class One is not initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldOtherMethod.java - *- @ExecuteClass: ClassInitFieldOtherMethod - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldOtherMethod { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hi"); - - f.equals(f); - f.getAnnotation(B.class); - f.getAnnotationsByType(B.class); - f.getDeclaredAnnotations(); - f.getDeclaringClass(); - f.getGenericType(); - f.getModifiers(); - f.getName(); - f.getType(); - f.hashCode(); - f.isEnumConstant(); - f.isSynthetic(); - f.toGenericString(); - f.toString(); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldOtherMethod.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldOtherMethod.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldOtherMethod.result.append("One"); - } - - @B("hello") - public static String hi = "value"; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldOtherMethod.result.append("|InterfaceA|").toString(); -} - -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.RUNTIME) -@interface B { - String value() default "hi"; -} - -class Two extends One { - static { - ClassInitFieldOtherMethod.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldOtherMethod + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldOtherMethod.java + *- @Title/Destination: When f is a static field of class One and call method except setXX/getXX, class is not + * initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class. + * -#step2: Call method of Field except setXX/getXX, class One is not initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldOtherMethod.java + *- @ExecuteClass: ClassInitFieldOtherMethod + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldOtherMethod { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hi"); + + f.equals(f); + f.getAnnotation(B.class); + f.getAnnotationsByType(B.class); + f.getDeclaredAnnotations(); + f.getDeclaringClass(); + f.getGenericType(); + f.getModifiers(); + f.getName(); + f.getType(); + f.hashCode(); + f.isEnumConstant(); + f.isSynthetic(); + f.toGenericString(); + f.toString(); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldOtherMethod.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldOtherMethod.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldOtherMethod.result.append("One"); + } + + @B("hello") + public static String hi = "value"; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldOtherMethod.result.append("|InterfaceA|").toString(); +} + +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@interface B { + String value() default "hi"; +} + +class Two extends One { + static { + ClassInitFieldOtherMethod.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0155-rt-reflection-ClinitFieldSetBooleanStatic/ClassInitFieldSetBooleanStatic.java b/test/testsuite/ouroboros/reflection_test/RT0155-rt-reflection-ClinitFieldSetBooleanStatic/ClassInitFieldSetBooleanStatic.java index 9f85facd838f130bbd23f8514bd3e1bcc20e970e..879cafa5fdef3a199620df864b58e4231a0c0f1f 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0155-rt-reflection-ClinitFieldSetBooleanStatic/ClassInitFieldSetBooleanStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0155-rt-reflection-ClinitFieldSetBooleanStatic/ClassInitFieldSetBooleanStatic.java @@ -1,101 +1,101 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetBooleanStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetBooleanStatic.java - *- @Title/Destination: When f is a static field of class One and call f.setBoolean(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.setBoolean(null, newValue), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetBooleanStatic.java - *- @ExecuteClass: ClassInitFieldSetBooleanStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetBooleanStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiBoolean"); - if (result.toString().compareTo("") == 0) { - f.setBoolean(null, false); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - - -@A -class Super { - static { - ClassInitFieldSetBooleanStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetBooleanStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetBooleanStatic.result.append("One"); - } - - String what = "lala"; - public static boolean hiBoolean = false; - One() { - } - - public One(String s) { - what = s; - System.out.println(s); - } - - public int testOne(String a) { - System.out.println(a); - return 0; - } -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetBooleanStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetBooleanStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetBooleanStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetBooleanStatic.java + *- @Title/Destination: When f is a static field of class One and call f.setBoolean(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.setBoolean(null, newValue), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetBooleanStatic.java + *- @ExecuteClass: ClassInitFieldSetBooleanStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetBooleanStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiBoolean"); + if (result.toString().compareTo("") == 0) { + f.setBoolean(null, false); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + + +@A +class Super { + static { + ClassInitFieldSetBooleanStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetBooleanStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetBooleanStatic.result.append("One"); + } + + String what = "lala"; + public static boolean hiBoolean = false; + One() { + } + + public One(String s) { + what = s; + System.out.println(s); + } + + public int testOne(String a) { + System.out.println(a); + return 0; + } +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetBooleanStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetBooleanStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0156-rt-reflection-ClinitFieldSetByteStatic/ClassInitFieldSetByteStatic.java b/test/testsuite/ouroboros/reflection_test/RT0156-rt-reflection-ClinitFieldSetByteStatic/ClassInitFieldSetByteStatic.java index 7ce54a5cdb24593fb0c9c6d1b9d1760d84acf278..5791e643ed5e6de3122e01593bbbbdc36c85e119 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0156-rt-reflection-ClinitFieldSetByteStatic/ClassInitFieldSetByteStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0156-rt-reflection-ClinitFieldSetByteStatic/ClassInitFieldSetByteStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetByteStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetByteStatic.java - *- @Title/Destination: When f is a static field of class One and call f.setByte(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.setByte(null, newValue), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetByteStatic.java - *- @ExecuteClass: ClassInitFieldSetByteStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetByteStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiByte"); - if (result.toString().compareTo("") == 0) { - f.setByte(null, (byte) 1); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldSetByteStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetByteStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetByteStatic.result.append("One"); - } - - public static byte hiByte = (byte) 0; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetByteStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetByteStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetByteStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetByteStatic.java + *- @Title/Destination: When f is a static field of class One and call f.setByte(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.setByte(null, newValue), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetByteStatic.java + *- @ExecuteClass: ClassInitFieldSetByteStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetByteStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiByte"); + if (result.toString().compareTo("") == 0) { + f.setByte(null, (byte) 1); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldSetByteStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetByteStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetByteStatic.result.append("One"); + } + + public static byte hiByte = (byte) 0; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetByteStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetByteStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0157-rt-reflection-ClinitFieldSetCharStatic/ClassInitFieldSetCharStatic.java b/test/testsuite/ouroboros/reflection_test/RT0157-rt-reflection-ClinitFieldSetCharStatic/ClassInitFieldSetCharStatic.java index eece6d331dfbcd4ac74ab7a48d081501c7a0864a..11575a287b0d1d8b3e33b2f48573513411bf3728 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0157-rt-reflection-ClinitFieldSetCharStatic/ClassInitFieldSetCharStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0157-rt-reflection-ClinitFieldSetCharStatic/ClassInitFieldSetCharStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetCharStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetCharStatic.java - *- @Title/Destination: When f is a static field of class One and call f.setChar(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.setChar(null, newValue), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetCharStatic.java - *- @ExecuteClass: ClassInitFieldSetCharStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetCharStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiChar"); - if (result.toString().compareTo("") == 0) { - f.setChar(null, (char) 1); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldSetCharStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetCharStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetCharStatic.result.append("One"); - } - - public static char hiChar = (char) 45; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetCharStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetCharStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetCharStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetCharStatic.java + *- @Title/Destination: When f is a static field of class One and call f.setChar(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.setChar(null, newValue), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetCharStatic.java + *- @ExecuteClass: ClassInitFieldSetCharStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetCharStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiChar"); + if (result.toString().compareTo("") == 0) { + f.setChar(null, (char) 1); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldSetCharStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetCharStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetCharStatic.result.append("One"); + } + + public static char hiChar = (char) 45; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetCharStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetCharStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0158-rt-reflection-ClinitFieldSetDoubleStatic/ClassInitFieldSetDoubleStatic.java b/test/testsuite/ouroboros/reflection_test/RT0158-rt-reflection-ClinitFieldSetDoubleStatic/ClassInitFieldSetDoubleStatic.java index 16c16abf3b88dcf030f4518b47cba19efb9b46d0..1532a823ec0a9c53e15b450de2f21fcf8aaff984 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0158-rt-reflection-ClinitFieldSetDoubleStatic/ClassInitFieldSetDoubleStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0158-rt-reflection-ClinitFieldSetDoubleStatic/ClassInitFieldSetDoubleStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetDoubleStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetDoubleStatic.java - *- @Title/Destination: When f is a static field of class One and call f.setDouble(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.setDouble(null, newValue), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetDoubleStatic.java - *- @ExecuteClass: ClassInitFieldSetDoubleStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetDoubleStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiDouble"); - if (result.toString().compareTo("") == 0) { - f.setDouble(null, 0.2589); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldSetDoubleStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetDoubleStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetDoubleStatic.result.append("One"); - } - - public static double hiDouble = 4.5; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetDoubleStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetDoubleStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetDoubleStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetDoubleStatic.java + *- @Title/Destination: When f is a static field of class One and call f.setDouble(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.setDouble(null, newValue), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetDoubleStatic.java + *- @ExecuteClass: ClassInitFieldSetDoubleStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetDoubleStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiDouble"); + if (result.toString().compareTo("") == 0) { + f.setDouble(null, 0.2589); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldSetDoubleStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetDoubleStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetDoubleStatic.result.append("One"); + } + + public static double hiDouble = 4.5; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetDoubleStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetDoubleStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0159-rt-reflection-ClinitFieldSetFloatStatic/ClassInitFieldSetFloatStatic.java b/test/testsuite/ouroboros/reflection_test/RT0159-rt-reflection-ClinitFieldSetFloatStatic/ClassInitFieldSetFloatStatic.java index 99523c0ee23ac9ad9b9234b3a8aff8d4886ba854..6e594cc1f2aaf1a18badc8ca572857caf83424df 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0159-rt-reflection-ClinitFieldSetFloatStatic/ClassInitFieldSetFloatStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0159-rt-reflection-ClinitFieldSetFloatStatic/ClassInitFieldSetFloatStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetFloatStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetFloatStatic.java - *- @Title/Destination: When f is a static field of class One and call f.setFloat(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.setFloat(null, newValue), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetFloatStatic.java - *- @ExecuteClass: ClassInitFieldSetFloatStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetFloatStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiFloat"); - if (result.toString().compareTo("") == 0) { - f.setFloat(null, 0.2589f); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldSetFloatStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetFloatStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetFloatStatic.result.append("One"); - } - - public static float hiFloat = 0.25f; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetFloatStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetFloatStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetFloatStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetFloatStatic.java + *- @Title/Destination: When f is a static field of class One and call f.setFloat(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.setFloat(null, newValue), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetFloatStatic.java + *- @ExecuteClass: ClassInitFieldSetFloatStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetFloatStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiFloat"); + if (result.toString().compareTo("") == 0) { + f.setFloat(null, 0.2589f); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldSetFloatStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetFloatStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetFloatStatic.result.append("One"); + } + + public static float hiFloat = 0.25f; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetFloatStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetFloatStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0160-rt-reflection-ClinitFieldSetIntStatic/ClassInitFieldSetIntStatic.java b/test/testsuite/ouroboros/reflection_test/RT0160-rt-reflection-ClinitFieldSetIntStatic/ClassInitFieldSetIntStatic.java index c9d8db69deab1d7f370d5a7168952876d36b1832..17ffae2d707267de6f391e528ce1c162e982aa94 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0160-rt-reflection-ClinitFieldSetIntStatic/ClassInitFieldSetIntStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0160-rt-reflection-ClinitFieldSetIntStatic/ClassInitFieldSetIntStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetIntStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetIntStatic.java - *- @Title/Destination: When f is a static field of class One and call f.setInt(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.setInt(null, newValue), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetIntStatic.java - *- @ExecuteClass: ClassInitFieldSetIntStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetIntStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiInt"); - if (result.toString().compareTo("") == 0) { - f.setInt(null, 25); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldSetIntStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetIntStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetIntStatic.result.append("One"); - } - - public static int hiInt = 0; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetIntStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetIntStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetIntStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetIntStatic.java + *- @Title/Destination: When f is a static field of class One and call f.setInt(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.setInt(null, newValue), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetIntStatic.java + *- @ExecuteClass: ClassInitFieldSetIntStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetIntStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiInt"); + if (result.toString().compareTo("") == 0) { + f.setInt(null, 25); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldSetIntStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetIntStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetIntStatic.result.append("One"); + } + + public static int hiInt = 0; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetIntStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetIntStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0161-rt-reflection-ClinitFieldSetLongStatic/ClassInitFieldSetLongStatic.java b/test/testsuite/ouroboros/reflection_test/RT0161-rt-reflection-ClinitFieldSetLongStatic/ClassInitFieldSetLongStatic.java index c7aed800d67fbe8b5da8962d7fdde379dfa46ce2..03fb1145ceedb02d0618dd6aca21b7f685986b38 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0161-rt-reflection-ClinitFieldSetLongStatic/ClassInitFieldSetLongStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0161-rt-reflection-ClinitFieldSetLongStatic/ClassInitFieldSetLongStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetLongStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetLongStatic.java - *- @Title/Destination: When f is a static field of class One and call f.setLong(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.setLong(null, newValue), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetLongStatic.java - *- @ExecuteClass: ClassInitFieldSetLongStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetLongStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiLong"); - if (result.toString().compareTo("") == 0) { - f.setLong(null, 25l); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldSetLongStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetLongStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetLongStatic.result.append("One"); - } - - public static long hiLong = 4859l; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetLongStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetLongStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetLongStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetLongStatic.java + *- @Title/Destination: When f is a static field of class One and call f.setLong(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.setLong(null, newValue), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetLongStatic.java + *- @ExecuteClass: ClassInitFieldSetLongStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetLongStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiLong"); + if (result.toString().compareTo("") == 0) { + f.setLong(null, 25l); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldSetLongStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetLongStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetLongStatic.result.append("One"); + } + + public static long hiLong = 4859l; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetLongStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetLongStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0162-rt-reflection-ClinitFieldSetShortStatic/ClassInitFieldSetShortStatic.java b/test/testsuite/ouroboros/reflection_test/RT0162-rt-reflection-ClinitFieldSetShortStatic/ClassInitFieldSetShortStatic.java index 3de0ef53fd717e0cc129c3a7cebafb89dc6b5cbd..5590ced3ae2e609841491f197b973d45c7b871e8 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0162-rt-reflection-ClinitFieldSetShortStatic/ClassInitFieldSetShortStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0162-rt-reflection-ClinitFieldSetShortStatic/ClassInitFieldSetShortStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetShortStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetShortStatic.java - *- @Title/Destination: When f is a static field of class One and call f.setShort(), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One. - * -#step2: Call method f.setShort(null, newValue), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetShortStatic.java - *- @ExecuteClass: ClassInitFieldSetShortStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetShortStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hiShort"); - if (result.toString().compareTo("") == 0) { - f.setShort(null, (short) 25); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldSetShortStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetShortStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetShortStatic.result.append("One"); - } - - public static short hiShort = 48; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetShortStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetShortStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetShortStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetShortStatic.java + *- @Title/Destination: When f is a static field of class One and call f.setShort(), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One. + * -#step2: Call method f.setShort(null, newValue), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetShortStatic.java + *- @ExecuteClass: ClassInitFieldSetShortStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetShortStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hiShort"); + if (result.toString().compareTo("") == 0) { + f.setShort(null, (short) 25); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldSetShortStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetShortStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetShortStatic.result.append("One"); + } + + public static short hiShort = 48; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetShortStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetShortStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0163-rt-reflection-ClinitFieldSetStatic/ClassInitFieldSetStatic.java b/test/testsuite/ouroboros/reflection_test/RT0163-rt-reflection-ClinitFieldSetStatic/ClassInitFieldSetStatic.java index 90e18c78074adad416c8840b6e232e7afee6791c..4fb46c8bc98bdc181ff4cd32c988d13c4670b640 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0163-rt-reflection-ClinitFieldSetStatic/ClassInitFieldSetStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0163-rt-reflection-ClinitFieldSetStatic/ClassInitFieldSetStatic.java @@ -1,87 +1,87 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetStatic.java - *- @Title/Destination: When f is a static field of class One and call f.set(), class One is initialized - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class - * One - * -#step2: Call method f.set(null, newValue), class One is initialized - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetStatic.java - *- @ExecuteClass: ClassInitFieldSetStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Field; - -public class ClassInitFieldSetStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Field f = clazz.getField("hi"); - if (result.toString().compareTo("") == 0) { - f.set(null, "what"); - } - } catch (Exception e) { - System.out.println(e); - } - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitFieldSetStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitFieldSetStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitFieldSetStatic.result.append("One"); - } - - public static String hi = "hi"; -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitFieldSetStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitFieldSetStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetStatic.java + *- @Title/Destination: When f is a static field of class One and call f.set(), class One is initialized + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getField to get a static field f of class + * One + * -#step2: Call method f.set(null, newValue), class One is initialized + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetStatic.java + *- @ExecuteClass: ClassInitFieldSetStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +public class ClassInitFieldSetStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Field f = clazz.getField("hi"); + if (result.toString().compareTo("") == 0) { + f.set(null, "what"); + } + } catch (Exception e) { + System.out.println(e); + } + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitFieldSetStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitFieldSetStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitFieldSetStatic.result.append("One"); + } + + public static String hi = "hi"; +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitFieldSetStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitFieldSetStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0164-rt-reflection-ClinitMethodInvokeStatic/ClassInitMethodInvokeStatic.java b/test/testsuite/ouroboros/reflection_test/RT0164-rt-reflection-ClinitMethodInvokeStatic/ClassInitMethodInvokeStatic.java index ea11a2971a16f7e0a7e5bebcb20ce1fd699834e0..7d390332ad9ec8dc8b4e10bcfdfe1aab3ffe81dd 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0164-rt-reflection-ClinitMethodInvokeStatic/ClassInitMethodInvokeStatic.java +++ b/test/testsuite/ouroboros/reflection_test/RT0164-rt-reflection-ClinitMethodInvokeStatic/ClassInitMethodInvokeStatic.java @@ -1,117 +1,117 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitMethodInvokeStatic - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitMethodInvokeStatic.java - *- @Title/Destination: When m is a static method of class One and call m.invoke(null, args), class One is initialized. - *- @Brief:no: - * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getDeclaredMethod to get a static method - * m of class One. - * -#step2: Call methods of Method except invoke(), class One is not initialized. - * -#step3: Call method invoke(), class One is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitMethodInvokeStatic.java - *- @ExecuteClass: ClassInitMethodInvokeStatic - *- @ExecuteArgs: - */ - -import java.lang.annotation.*; -import java.lang.reflect.Method; - -public class ClassInitMethodInvokeStatic { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("One", false, One.class.getClassLoader()); - Method m = clazz.getDeclaredMethod("testOne", String.class); - // Check point 1: calling following methods, class not initialized. - m.equals(m); - m.getAnnotation(A.class); - m.getDeclaredAnnotations(); - m.getDeclaringClass(); - m.getDefaultValue(); - m.getExceptionTypes(); - m.getGenericExceptionTypes(); - m.getGenericParameterTypes(); - m.getGenericReturnType(); - m.getModifiers(); - m.getName(); - m.getParameterAnnotations(); - m.getParameterCount(); - m.getParameterTypes(); - m.getReturnType(); - m.getTypeParameters(); - m.hashCode(); - m.isBridge(); - m.isDefault(); - m.isSynthetic(); - m.isVarArgs(); - m.toString(); - m.toGenericString(); - - // Check point 2: after newInstance, class initialized. - if (result.toString().compareTo("") == 0) { - m.invoke(null, "hi"); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("SuperOne") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -@A -class Super { - static { - ClassInitMethodInvokeStatic.result.append("Super"); - } -} - -interface InterfaceSuper { - String a = ClassInitMethodInvokeStatic.result.append("|InterfaceSuper|").toString(); -} - -@A(i = 1) -class One extends Super implements InterfaceSuper { - static { - ClassInitMethodInvokeStatic.result.append("One"); - } - - public static int testOne(String a) { - return 0; - } -} - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@interface A { - int i() default 0; - String a = ClassInitMethodInvokeStatic.result.append("|InterfaceA|").toString(); -} - -class Two extends One { - static { - ClassInitMethodInvokeStatic.result.append("Two"); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitMethodInvokeStatic + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitMethodInvokeStatic.java + *- @Title/Destination: When m is a static method of class One and call m.invoke(null, args), class One is initialized. + *- @Brief:no: + * -#step1: Class.forName("One" , false, One.class.getClassLoader()) and clazz.getDeclaredMethod to get a static method + * m of class One. + * -#step2: Call methods of Method except invoke(), class One is not initialized. + * -#step3: Call method invoke(), class One is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitMethodInvokeStatic.java + *- @ExecuteClass: ClassInitMethodInvokeStatic + *- @ExecuteArgs: + */ + +import java.lang.annotation.*; +import java.lang.reflect.Method; + +public class ClassInitMethodInvokeStatic { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("One", false, One.class.getClassLoader()); + Method m = clazz.getDeclaredMethod("testOne", String.class); + // Check point 1: calling following methods, class not initialized. + m.equals(m); + m.getAnnotation(A.class); + m.getDeclaredAnnotations(); + m.getDeclaringClass(); + m.getDefaultValue(); + m.getExceptionTypes(); + m.getGenericExceptionTypes(); + m.getGenericParameterTypes(); + m.getGenericReturnType(); + m.getModifiers(); + m.getName(); + m.getParameterAnnotations(); + m.getParameterCount(); + m.getParameterTypes(); + m.getReturnType(); + m.getTypeParameters(); + m.hashCode(); + m.isBridge(); + m.isDefault(); + m.isSynthetic(); + m.isVarArgs(); + m.toString(); + m.toGenericString(); + + // Check point 2: after newInstance, class initialized. + if (result.toString().compareTo("") == 0) { + m.invoke(null, "hi"); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("SuperOne") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +@A +class Super { + static { + ClassInitMethodInvokeStatic.result.append("Super"); + } +} + +interface InterfaceSuper { + String a = ClassInitMethodInvokeStatic.result.append("|InterfaceSuper|").toString(); +} + +@A(i = 1) +class One extends Super implements InterfaceSuper { + static { + ClassInitMethodInvokeStatic.result.append("One"); + } + + public static int testOne(String a) { + return 0; + } +} + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@interface A { + int i() default 0; + String a = ClassInitMethodInvokeStatic.result.append("|InterfaceA|").toString(); +} + +class Two extends One { + static { + ClassInitMethodInvokeStatic.result.append("Two"); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0165-rt-reflection-ClinitFieldGetBooleanInterface/ClassInitFieldGetBooleanInterface.java b/test/testsuite/ouroboros/reflection_test/RT0165-rt-reflection-ClinitFieldGetBooleanInterface/ClassInitFieldGetBooleanInterface.java index 53a5707339b45b61ac2098e19f91da84b28d5e12..41fc7248b7b685625a9db65658ea971ba5c30613 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0165-rt-reflection-ClinitFieldGetBooleanInterface/ClassInitFieldGetBooleanInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0165-rt-reflection-ClinitFieldGetBooleanInterface/ClassInitFieldGetBooleanInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetBooleanInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetBooleanInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.getBoolean(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.getBoolean(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetBooleanInterface.java - *- @ExecuteClass: ClassInitFieldGetBooleanInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetBooleanInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiBoolean"); - if (result.toString().compareTo("") == 0) { - f.getBoolean(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetBooleanInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetBooleanInterface.result.append("One").toString(); - boolean hiBoolean = false; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetBooleanInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetBooleanInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetBooleanInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetBooleanInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.getBoolean(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.getBoolean(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetBooleanInterface.java + *- @ExecuteClass: ClassInitFieldGetBooleanInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetBooleanInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiBoolean"); + if (result.toString().compareTo("") == 0) { + f.getBoolean(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetBooleanInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetBooleanInterface.result.append("One").toString(); + boolean hiBoolean = false; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetBooleanInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetBooleanInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0166-rt-reflection-ClinitFieldGetByteInterface/ClassInitFieldGetByteInterface.java b/test/testsuite/ouroboros/reflection_test/RT0166-rt-reflection-ClinitFieldGetByteInterface/ClassInitFieldGetByteInterface.java index ad8cc58211174ea49e71364e2073a0bb547b1dae..2ad55a148ea88bd47753ab37cfd81d0dea6da24a 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0166-rt-reflection-ClinitFieldGetByteInterface/ClassInitFieldGetByteInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0166-rt-reflection-ClinitFieldGetByteInterface/ClassInitFieldGetByteInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetByteInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetByteInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.getByte(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.getByte(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetByteInterface.java - *- @ExecuteClass: ClassInitFieldGetByteInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetByteInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiByte"); - if (result.toString().compareTo("") == 0) { - f.getByte(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetByteInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetByteInterface.result.append("One").toString(); - byte hiByte = (byte) 1; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetByteInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetByteInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetByteInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetByteInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.getByte(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.getByte(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetByteInterface.java + *- @ExecuteClass: ClassInitFieldGetByteInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetByteInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiByte"); + if (result.toString().compareTo("") == 0) { + f.getByte(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetByteInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetByteInterface.result.append("One").toString(); + byte hiByte = (byte) 1; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetByteInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetByteInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0167-rt-reflection-ClinitFieldGetCharInterface/ClassInitFieldGetCharInterface.java b/test/testsuite/ouroboros/reflection_test/RT0167-rt-reflection-ClinitFieldGetCharInterface/ClassInitFieldGetCharInterface.java index ffb84c35fc67309034173cdc9b43ead26130464c..b0a0af9e06af8b69d76e530267db1437df74f864 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0167-rt-reflection-ClinitFieldGetCharInterface/ClassInitFieldGetCharInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0167-rt-reflection-ClinitFieldGetCharInterface/ClassInitFieldGetCharInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetCharInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetCharInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.getChar(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.getChar(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetCharInterface.java - *- @ExecuteClass: ClassInitFieldGetCharInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetCharInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiChar"); - if (result.toString().compareTo("") == 0) { - f.getChar(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetCharInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetCharInterface.result.append("One").toString(); - char hiChar = (char) 45; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetCharInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetCharInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetCharInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetCharInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.getChar(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.getChar(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetCharInterface.java + *- @ExecuteClass: ClassInitFieldGetCharInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetCharInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiChar"); + if (result.toString().compareTo("") == 0) { + f.getChar(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetCharInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetCharInterface.result.append("One").toString(); + char hiChar = (char) 45; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetCharInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetCharInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0168-rt-reflection-ClinitFieldGetDoubleInterface/ClassInitFieldGetDoubleInterface.java b/test/testsuite/ouroboros/reflection_test/RT0168-rt-reflection-ClinitFieldGetDoubleInterface/ClassInitFieldGetDoubleInterface.java index 7189c79e26b3483249e03dbf1f9e3e9c3b413fe3..19a0bee545f53b2f435e4f29b7e3e7079488b7f1 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0168-rt-reflection-ClinitFieldGetDoubleInterface/ClassInitFieldGetDoubleInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0168-rt-reflection-ClinitFieldGetDoubleInterface/ClassInitFieldGetDoubleInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetDoubleInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetDoubleInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.getDouble(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.getDouble(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetDoubleInterface.java - *- @ExecuteClass: ClassInitFieldGetDoubleInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetDoubleInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiDouble"); - if (result.toString().compareTo("") == 0) { - f.getDouble(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetDoubleInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetDoubleInterface.result.append("One").toString(); - double hiDouble = 0.1532; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetDoubleInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetDoubleInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetDoubleInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetDoubleInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.getDouble(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.getDouble(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetDoubleInterface.java + *- @ExecuteClass: ClassInitFieldGetDoubleInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetDoubleInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiDouble"); + if (result.toString().compareTo("") == 0) { + f.getDouble(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetDoubleInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetDoubleInterface.result.append("One").toString(); + double hiDouble = 0.1532; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetDoubleInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetDoubleInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0169-rt-reflection-ClinitFieldGetFloatInterface/ClassInitFieldGetFloatInterface.java b/test/testsuite/ouroboros/reflection_test/RT0169-rt-reflection-ClinitFieldGetFloatInterface/ClassInitFieldGetFloatInterface.java index ab69302a82be5842e446722afdd45e3dfe4a4a1b..bf02f4c001cba5435a4ea32e53b12bbbac66050f 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0169-rt-reflection-ClinitFieldGetFloatInterface/ClassInitFieldGetFloatInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0169-rt-reflection-ClinitFieldGetFloatInterface/ClassInitFieldGetFloatInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetFloatInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetFloatInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.getFloat(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.getFloat(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetFloatInterface.java - *- @ExecuteClass: ClassInitFieldGetFloatInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetFloatInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiFloat"); - if (result.toString().compareTo("") == 0) { - f.getFloat(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetFloatInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetFloatInterface.result.append("One").toString(); - float hiFloat = 0.25f; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetFloatInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetFloatInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetFloatInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetFloatInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.getFloat(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.getFloat(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetFloatInterface.java + *- @ExecuteClass: ClassInitFieldGetFloatInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetFloatInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiFloat"); + if (result.toString().compareTo("") == 0) { + f.getFloat(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetFloatInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetFloatInterface.result.append("One").toString(); + float hiFloat = 0.25f; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetFloatInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetFloatInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0170-rt-reflection-ClinitFieldGetInterface/ClassInitFieldGetInterface.java b/test/testsuite/ouroboros/reflection_test/RT0170-rt-reflection-ClinitFieldGetInterface/ClassInitFieldGetInterface.java index 5ae54cc2caf754da04a592f7dcb1c554bc2f8de3..05f5160fb757ce0bddb797b15ac703f789557f09 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0170-rt-reflection-ClinitFieldGetInterface/ClassInitFieldGetInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0170-rt-reflection-ClinitFieldGetInterface/ClassInitFieldGetInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.get(), OneInterface is initialized, it's - * parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.get(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetInterface.java - *- @ExecuteClass: ClassInitFieldGetInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hi"); - if (result.toString().compareTo("") == 0) { - f.get(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetInterface.result.append("One").toString(); - String hi = "hiField"; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.get(), OneInterface is initialized, it's + * parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.get(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetInterface.java + *- @ExecuteClass: ClassInitFieldGetInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hi"); + if (result.toString().compareTo("") == 0) { + f.get(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetInterface.result.append("One").toString(); + String hi = "hiField"; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0171-rt-reflection-ClinitFieldGetIntInterface/ClassInitFieldGetIntInterface.java b/test/testsuite/ouroboros/reflection_test/RT0171-rt-reflection-ClinitFieldGetIntInterface/ClassInitFieldGetIntInterface.java index a6d14346c92812c915c5b0cbb645d15c0359c649..f49314336f77d951cfdb404c5fd0760ec8189858 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0171-rt-reflection-ClinitFieldGetIntInterface/ClassInitFieldGetIntInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0171-rt-reflection-ClinitFieldGetIntInterface/ClassInitFieldGetIntInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetIntInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetIntInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.getInt(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.getInt(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetIntInterface.java - *- @ExecuteClass: ClassInitFieldGetIntInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetIntInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiInt"); - if (result.toString().compareTo("") == 0) { - f.getInt(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetIntInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetIntInterface.result.append("One").toString(); - int hiInt = 125; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetIntInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetIntInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetIntInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetIntInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.getInt(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.getInt(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetIntInterface.java + *- @ExecuteClass: ClassInitFieldGetIntInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetIntInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiInt"); + if (result.toString().compareTo("") == 0) { + f.getInt(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetIntInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetIntInterface.result.append("One").toString(); + int hiInt = 125; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetIntInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetIntInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0172-rt-reflection-ClinitFieldGetLongInterface/ClassInitFieldGetLongInterface.java b/test/testsuite/ouroboros/reflection_test/RT0172-rt-reflection-ClinitFieldGetLongInterface/ClassInitFieldGetLongInterface.java index 8d78ce4c60bd00b5f0b75bd154bc7a4c073b12f7..17f3ea5813884a3b1a8e5ada2173c68d6286b7b7 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0172-rt-reflection-ClinitFieldGetLongInterface/ClassInitFieldGetLongInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0172-rt-reflection-ClinitFieldGetLongInterface/ClassInitFieldGetLongInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetLongInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetLongInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.getLong(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.getLong(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetLongInterface.java - *- @ExecuteClass: ClassInitFieldGetLongInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetLongInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiLong"); - if (result.toString().compareTo("") == 0) { - f.getLong(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetLongInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetLongInterface.result.append("One").toString(); - long hiLong = 4859l; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetLongInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetLongInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetLongInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetLongInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.getLong(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.getLong(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetLongInterface.java + *- @ExecuteClass: ClassInitFieldGetLongInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetLongInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiLong"); + if (result.toString().compareTo("") == 0) { + f.getLong(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetLongInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetLongInterface.result.append("One").toString(); + long hiLong = 4859l; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetLongInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetLongInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0173-rt-reflection-ClinitFieldGetShortInterface/ClassInitFieldGetShortInterface.java b/test/testsuite/ouroboros/reflection_test/RT0173-rt-reflection-ClinitFieldGetShortInterface/ClassInitFieldGetShortInterface.java index 1d63d192135da94a97d71201c373617594dee924..54ee2c03793e29b7eacd8292f9fef030d774caf5 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0173-rt-reflection-ClinitFieldGetShortInterface/ClassInitFieldGetShortInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0173-rt-reflection-ClinitFieldGetShortInterface/ClassInitFieldGetShortInterface.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldGetShortInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldGetShortInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.getShort(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.getShort(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldGetShortInterface.java - *- @ExecuteClass: ClassInitFieldGetShortInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldGetShortInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiShort"); - if (result.toString().compareTo("") == 0) { - f.getShort(null); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("One") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldGetShortInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldGetShortInterface.result.append("One").toString(); - short hiShort = 14; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldGetShortInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldGetShortInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldGetShortInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldGetShortInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.getShort(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.getShort(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldGetShortInterface.java + *- @ExecuteClass: ClassInitFieldGetShortInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldGetShortInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiShort"); + if (result.toString().compareTo("") == 0) { + f.getShort(null); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("One") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldGetShortInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldGetShortInterface.result.append("One").toString(); + short hiShort = 14; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldGetShortInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldGetShortInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0174-rt-reflection-ClinitFieldOtherMethodInterface/ClassInitFieldOtherMethodInterface.java b/test/testsuite/ouroboros/reflection_test/RT0174-rt-reflection-ClinitFieldOtherMethodInterface/ClassInitFieldOtherMethodInterface.java index ec276a32ca57fa45a6f13ff381402fa75445c946..0300aeceeb33596377f136c9abd37b77f9f6348d 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0174-rt-reflection-ClinitFieldOtherMethodInterface/ClassInitFieldOtherMethodInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0174-rt-reflection-ClinitFieldOtherMethodInterface/ClassInitFieldOtherMethodInterface.java @@ -1,85 +1,85 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldOtherMethodInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldOtherMethodInterface.java - *- @Title/Destination: When f is a field of of interface OneInterface and call method except setXX/getXX, class is not - * initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method of Field except setXX/getXX, class One is not initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldOtherMethodInterface.java - *- @ExecuteClass: ClassInitFieldOtherMethodInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldOtherMethodInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hi"); - - f.equals(f); - f.getAnnotation(A.class); - f.getAnnotationsByType(A.class); - f.getDeclaredAnnotations(); - f.getDeclaringClass(); - f.getGenericType(); - f.getModifiers(); - f.getName(); - f.getType(); - f.hashCode(); - f.isEnumConstant(); - f.isSynthetic(); - f.toGenericString(); - f.toString(); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldOtherMethodInterface.result.append("Super").toString(); -} - -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldOtherMethodInterface.result.append("One").toString(); - @A - short hi = 14; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldOtherMethodInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldOtherMethodInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldOtherMethodInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldOtherMethodInterface.java + *- @Title/Destination: When f is a field of of interface OneInterface and call method except setXX/getXX, class is not + * initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method of Field except setXX/getXX, class One is not initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldOtherMethodInterface.java + *- @ExecuteClass: ClassInitFieldOtherMethodInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldOtherMethodInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hi"); + + f.equals(f); + f.getAnnotation(A.class); + f.getAnnotationsByType(A.class); + f.getDeclaredAnnotations(); + f.getDeclaringClass(); + f.getGenericType(); + f.getModifiers(); + f.getName(); + f.getType(); + f.hashCode(); + f.isEnumConstant(); + f.isSynthetic(); + f.toGenericString(); + f.toString(); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldOtherMethodInterface.result.append("Super").toString(); +} + +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldOtherMethodInterface.result.append("One").toString(); + @A + short hi = 14; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldOtherMethodInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldOtherMethodInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0175-rt-reflection-ClinitFieldSetBooleanInterface/ClassInitFieldSetBooleanInterface.java b/test/testsuite/ouroboros/reflection_test/RT0175-rt-reflection-ClinitFieldSetBooleanInterface/ClassInitFieldSetBooleanInterface.java index 02d5b05f9049309005fc02bf1d90e644ea68eec0..0a19e219795e76dec5b4e823ad74d227cb09a007 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0175-rt-reflection-ClinitFieldSetBooleanInterface/ClassInitFieldSetBooleanInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0175-rt-reflection-ClinitFieldSetBooleanInterface/ClassInitFieldSetBooleanInterface.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetBooleanInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetBooleanInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.setBoolean(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.setBoolean(null, true), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetBooleanInterface.java - *- @ExecuteClass: ClassInitFieldSetBooleanInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetBooleanInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiBoolean"); - if (result.toString().compareTo("") == 0) { - f.setBoolean(null, true); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetBooleanInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetBooleanInterface.result.append("One").toString(); - boolean hiBoolean = false; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetBooleanInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetBooleanInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetBooleanInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetBooleanInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.setBoolean(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.setBoolean(null, true), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetBooleanInterface.java + *- @ExecuteClass: ClassInitFieldSetBooleanInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetBooleanInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiBoolean"); + if (result.toString().compareTo("") == 0) { + f.setBoolean(null, true); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetBooleanInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetBooleanInterface.result.append("One").toString(); + boolean hiBoolean = false; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetBooleanInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetBooleanInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0176-rt-reflection-ClinitFieldSetByteInterface/ClassInitFieldSetByteInterface.java b/test/testsuite/ouroboros/reflection_test/RT0176-rt-reflection-ClinitFieldSetByteInterface/ClassInitFieldSetByteInterface.java index a8230d388cd88483f71d8e47195af89ea06252fe..daf923cd77f83a5ff861ee1ee0d35b869d575977 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0176-rt-reflection-ClinitFieldSetByteInterface/ClassInitFieldSetByteInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0176-rt-reflection-ClinitFieldSetByteInterface/ClassInitFieldSetByteInterface.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetByteInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetByteInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.setByte(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.setByte(null, (byte)0), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetByteInterface.java - *- @ExecuteClass: ClassInitFieldSetByteInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetByteInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiByte"); - if (result.toString().compareTo("") == 0) { - f.setByte(null, (byte) 0); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetByteInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetByteInterface.result.append("One").toString(); - byte hiByte = (byte) 1; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetByteInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetByteInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetByteInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetByteInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.setByte(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.setByte(null, (byte)0), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetByteInterface.java + *- @ExecuteClass: ClassInitFieldSetByteInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetByteInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiByte"); + if (result.toString().compareTo("") == 0) { + f.setByte(null, (byte) 0); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetByteInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetByteInterface.result.append("One").toString(); + byte hiByte = (byte) 1; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetByteInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetByteInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0177-rt-reflection-ClinitFieldSetFloatInterface/ClassInitFieldSetFloatInterface.java b/test/testsuite/ouroboros/reflection_test/RT0177-rt-reflection-ClinitFieldSetFloatInterface/ClassInitFieldSetFloatInterface.java index 1fddfaa357a014aa04bf22a427fcc6278ef1260d..886a4568921bdbb8e84b9b87696db775754d7de6 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0177-rt-reflection-ClinitFieldSetFloatInterface/ClassInitFieldSetFloatInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0177-rt-reflection-ClinitFieldSetFloatInterface/ClassInitFieldSetFloatInterface.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetFloatInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetFloatInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.setFloat(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.setFloat(null, 0.654f), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetFloatInterface.java - *- @ExecuteClass: ClassInitFieldSetFloatInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetFloatInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiFloat"); - if (result.toString().compareTo("") == 0) { - f.setFloat(null, 0.654f); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetFloatInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetFloatInterface.result.append("One").toString(); - float hiFloat = 0.25f; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetFloatInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetFloatInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetFloatInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetFloatInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.setFloat(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.setFloat(null, 0.654f), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetFloatInterface.java + *- @ExecuteClass: ClassInitFieldSetFloatInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetFloatInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiFloat"); + if (result.toString().compareTo("") == 0) { + f.setFloat(null, 0.654f); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetFloatInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetFloatInterface.result.append("One").toString(); + float hiFloat = 0.25f; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetFloatInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetFloatInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0178-rt-reflection-ClinitFieldSetInterface/ClassInitFieldSetInterface.java b/test/testsuite/ouroboros/reflection_test/RT0178-rt-reflection-ClinitFieldSetInterface/ClassInitFieldSetInterface.java index 51c21e2bf3ee5a39c4fa9fc7eaf77df43460e574..8676b785dc396a3e41a7dcd521f8bf8e414ed897 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0178-rt-reflection-ClinitFieldSetInterface/ClassInitFieldSetInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0178-rt-reflection-ClinitFieldSetInterface/ClassInitFieldSetInterface.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.set(), OneInterface is initialized, it's - * parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.set(null, newValue), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetInterface.java - *- @ExecuteClass: ClassInitFieldSetInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hi"); - if (result.toString().compareTo("") == 0) { - f.set(null, "newString"); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetInterface.result.append("One").toString(); - String hi = "hiField"; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.set(), OneInterface is initialized, it's + * parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.set(null, newValue), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetInterface.java + *- @ExecuteClass: ClassInitFieldSetInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hi"); + if (result.toString().compareTo("") == 0) { + f.set(null, "newString"); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetInterface.result.append("One").toString(); + String hi = "hiField"; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0179-rt-reflection-ClinitFieldSetIntInterface/ClassInitFieldSetIntInterface.java b/test/testsuite/ouroboros/reflection_test/RT0179-rt-reflection-ClinitFieldSetIntInterface/ClassInitFieldSetIntInterface.java index 608251d78d83b5c22489061761a9d7b3d084273c..1116ee02dbf85b9b69dd1205e7961fda182371a5 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0179-rt-reflection-ClinitFieldSetIntInterface/ClassInitFieldSetIntInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0179-rt-reflection-ClinitFieldSetIntInterface/ClassInitFieldSetIntInterface.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetIntInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetIntInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.setInt(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.setInt(null, 98), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetIntInterface.java - *- @ExecuteClass: ClassInitFieldSetIntInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetIntInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiInt"); - if (result.toString().compareTo("") == 0) { - f.setInt(null, 98); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetIntInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetIntInterface.result.append("One").toString(); - int hiInt = 125; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetIntInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetIntInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetIntInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetIntInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.setInt(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.setInt(null, 98), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetIntInterface.java + *- @ExecuteClass: ClassInitFieldSetIntInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetIntInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiInt"); + if (result.toString().compareTo("") == 0) { + f.setInt(null, 98); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetIntInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetIntInterface.result.append("One").toString(); + int hiInt = 125; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetIntInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetIntInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0180-rt-reflection-ClinitFieldSetLongInterface/ClassInitFieldSetLongInterface.java b/test/testsuite/ouroboros/reflection_test/RT0180-rt-reflection-ClinitFieldSetLongInterface/ClassInitFieldSetLongInterface.java index b2f09eb63ae529a3ef1ec86bbd370fcd818e9db0..2b583debd36d74b9624af7625b4a87142d863b31 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0180-rt-reflection-ClinitFieldSetLongInterface/ClassInitFieldSetLongInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0180-rt-reflection-ClinitFieldSetLongInterface/ClassInitFieldSetLongInterface.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetLongInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetLongInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.setLong(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.setLong(null, 7456l), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetLongInterface.java - *- @ExecuteClass: ClassInitFieldSetLongInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetLongInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiLong"); - if (result.toString().compareTo("") == 0) { - f.setLong(null, 7456l); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetLongInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetLongInterface.result.append("One").toString(); - long hiLong = 4859l; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetLongInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetLongInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetLongInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetLongInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.setLong(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.setLong(null, 7456l), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetLongInterface.java + *- @ExecuteClass: ClassInitFieldSetLongInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetLongInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiLong"); + if (result.toString().compareTo("") == 0) { + f.setLong(null, 7456l); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetLongInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetLongInterface.result.append("One").toString(); + long hiLong = 4859l; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetLongInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetLongInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0181-rt-reflection-ClinitFieldSetShortInterface/ClassInitFieldSetShortInterface.java b/test/testsuite/ouroboros/reflection_test/RT0181-rt-reflection-ClinitFieldSetShortInterface/ClassInitFieldSetShortInterface.java index 1841166852fa0d633c7a3ab7fb53e19b0bee1c93..4b8a52c2035f6293cd855281edf9c64313a18755 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0181-rt-reflection-ClinitFieldSetShortInterface/ClassInitFieldSetShortInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0181-rt-reflection-ClinitFieldSetShortInterface/ClassInitFieldSetShortInterface.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetShortInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetShortInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.setShort(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.setShort(null, 124), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetShortInterface.java - *- @ExecuteClass: ClassInitFieldSetShortInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetShortInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiShort"); - if (result.toString().compareTo("") == 0) { - f.setShort(null, (short) 124); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetShortInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetShortInterface.result.append("One").toString(); - short hiShort = 14; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetShortInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetShortInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetShortInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetShortInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.setShort(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.setShort(null, 124), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetShortInterface.java + *- @ExecuteClass: ClassInitFieldSetShortInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetShortInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiShort"); + if (result.toString().compareTo("") == 0) { + f.setShort(null, (short) 124); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetShortInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetShortInterface.result.append("One").toString(); + short hiShort = 14; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetShortInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetShortInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0182-rt-reflection-ClinitMethodInvokeInterface/ClassInitMethodInvokeInterface.java b/test/testsuite/ouroboros/reflection_test/RT0182-rt-reflection-ClinitMethodInvokeInterface/ClassInitMethodInvokeInterface.java index 73bc2326a4355db291022464a645219fbf72c5bf..af3e6473191a476344fc54e89ae03b2f6906fe5d 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0182-rt-reflection-ClinitMethodInvokeInterface/ClassInitMethodInvokeInterface.java +++ b/test/testsuite/ouroboros/reflection_test/RT0182-rt-reflection-ClinitMethodInvokeInterface/ClassInitMethodInvokeInterface.java @@ -1,102 +1,102 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitMethodInvokeInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitMethodInvokeInterface.java - *- @Title/Destination: When m is a static method of interface OneInterface and call m.invoke(), OneInterface is - * initialized, it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getDeclaredMethod to get - * a static method m of OneInterface. - * -#step2: Call methods of Method except invoke(), class One is not initialized. - * -#step3: Call method invoke(), class One is initialized - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitMethodInvokeInterface.java - *- @ExecuteClass: ClassInitMethodInvokeInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Method; - -public class ClassInitMethodInvokeInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Method m = clazz.getDeclaredMethod("runInterface", String.class); - //check point 1: calling following methods, class not initialized - m.equals(m); - m.getAnnotation(A.class); - m.getDeclaredAnnotations(); - m.getDeclaringClass(); - m.getDefaultValue(); - m.getExceptionTypes(); - m.getGenericExceptionTypes(); - m.getGenericParameterTypes(); - m.getGenericReturnType(); - m.getModifiers(); - m.getName(); - m.getParameterAnnotations(); - m.getParameterCount(); - m.getParameterTypes(); - m.getReturnType(); - m.getTypeParameters(); - m.hashCode(); - m.isBridge(); - m.isDefault(); - m.isSynthetic(); - m.isVarArgs(); - m.toString(); - m.toGenericString(); - - //check point 2: after newInstance, class initialized - if (result.toString().compareTo("") == 0) { - m.invoke(null, "hi"); - } - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneRunInterface") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitMethodInvokeInterface.result.append("Super").toString(); -} - -interface OneInterface extends SuperInterface { - String aOne = ClassInitMethodInvokeInterface.result.append("One").toString(); - @A - static void runInterface(String a) { - ClassInitMethodInvokeInterface.result.append("RunInterface"); - } -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitMethodInvokeInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitMethodInvokeInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitMethodInvokeInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitMethodInvokeInterface.java + *- @Title/Destination: When m is a static method of interface OneInterface and call m.invoke(), OneInterface is + * initialized, it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getDeclaredMethod to get + * a static method m of OneInterface. + * -#step2: Call methods of Method except invoke(), class One is not initialized. + * -#step3: Call method invoke(), class One is initialized + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitMethodInvokeInterface.java + *- @ExecuteClass: ClassInitMethodInvokeInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Method; + +public class ClassInitMethodInvokeInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Method m = clazz.getDeclaredMethod("runInterface", String.class); + //check point 1: calling following methods, class not initialized + m.equals(m); + m.getAnnotation(A.class); + m.getDeclaredAnnotations(); + m.getDeclaringClass(); + m.getDefaultValue(); + m.getExceptionTypes(); + m.getGenericExceptionTypes(); + m.getGenericParameterTypes(); + m.getGenericReturnType(); + m.getModifiers(); + m.getName(); + m.getParameterAnnotations(); + m.getParameterCount(); + m.getParameterTypes(); + m.getReturnType(); + m.getTypeParameters(); + m.hashCode(); + m.isBridge(); + m.isDefault(); + m.isSynthetic(); + m.isVarArgs(); + m.toString(); + m.toGenericString(); + + //check point 2: after newInstance, class initialized + if (result.toString().compareTo("") == 0) { + m.invoke(null, "hi"); + } + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneRunInterface") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitMethodInvokeInterface.result.append("Super").toString(); +} + +interface OneInterface extends SuperInterface { + String aOne = ClassInitMethodInvokeInterface.result.append("One").toString(); + @A + static void runInterface(String a) { + ClassInitMethodInvokeInterface.result.append("RunInterface"); + } +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitMethodInvokeInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitMethodInvokeInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnoA.java b/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnoA.java index 583e01db087fbe43fd94dd2c1688ee87594b34c1..ab8464d6b64077f5ccb0dfed4431a8ef3ead95f0 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnoA.java +++ b/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnoA.java @@ -1,46 +1,46 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -import java.lang.annotation.*; - -@Target(ElementType.TYPE_PARAMETER) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -public @interface AnnoA { - int intA(); - byte byteA(); - char charA(); - double doubleA(); - boolean booleanA(); - long longA(); - float floatA(); - short shortA(); - int[] intAA(); - byte[] byteAA(); - char[] charAA(); - double[] doubleAA(); - boolean[] booleanAA(); - long[] longAA(); - float[] floatAA(); - short[] shortAA(); - String stringA(); - String[] stringAA(); - Class classA(); - Class[] classAA(); - Thread.State stateA(); - Thread.State[] stateAA(); - AnnoB annoBA(); - AnnoB[] annoBAA(); -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +import java.lang.annotation.*; + +@Target(ElementType.TYPE_PARAMETER) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface AnnoA { + int intA(); + byte byteA(); + char charA(); + double doubleA(); + boolean booleanA(); + long longA(); + float floatA(); + short shortA(); + int[] intAA(); + byte[] byteAA(); + char[] charAA(); + double[] doubleAA(); + boolean[] booleanAA(); + long[] longAA(); + float[] floatAA(); + short[] shortAA(); + String stringA(); + String[] stringAA(); + Class classA(); + Class[] classAA(); + Thread.State stateA(); + Thread.State[] stateAA(); + AnnoB annoBA(); + AnnoB[] annoBAA(); +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnoB.java b/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnoB.java index 27c5d3ec6a53d2c77244192c86bb5eeab6ef947c..52d38f1f9f688a76538762fda3b39dcbe7548b4a 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnoB.java +++ b/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnoB.java @@ -1,23 +1,23 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -import java.lang.annotation.*; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -public @interface AnnoB { - int intB() default 999; -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +import java.lang.annotation.*; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface AnnoB { + int intB() default 999; +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnotationTypeParameterSetTest.java b/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnotationTypeParameterSetTest.java index c540d20397c874a35aab9ed296b7da5543f60d3e..4b254ccc38868b9a262aee45dd93dbc9ca60de65 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnotationTypeParameterSetTest.java +++ b/test/testsuite/ouroboros/reflection_test/RT0200-rt-reflection-AnnotationTypeParameterSetTest/AnnotationTypeParameterSetTest.java @@ -1,88 +1,88 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_Annotation_invoke_AnnotationSetTest - *- @RequirementName: Java Reflection - *- @TestCaseName:AnnotationTypeParameterSetTest.java - *- @TestCaseName: AnnotationTypeParameterSetTest - *- @TestCaseType: Function Testing - *- @RequirementName: annotation - *- @Title/Destination: positive test for User-defined Annotation with @Target(ElementType.TYPE_PARAMETER) - *- @Brief:no: - * -#step1. User-defined Annotation with @Target(ElementType.TYPE_PARAMETER) has field with primitive type, String, ENUM, annotation, class and their array - * -#step2. verify able to set and get value - *- @Expect:0\n - *- @Priority: Level 1 - *- @Source: AnnotationTypeParameterSetTest.java AnnoA.java AnnoB.java - *- @ExecuteClass: AnnotationTypeParameterSetTest - *- @ExecuteArgs: - */ - -import java.util.Arrays; - -public class AnnotationTypeParameterSetTest { - static int[] passCnt; - public static void main(String[] args) { - - System.out.println(Test.class.getAnnotations().length); -// TypeVeriable.getAnnotation not supported in ART -/* AnnoA anno = Test.class.getTypeParameters()[0].getAnnotation(AnnoA.class); - passCnt = new int[24]; - // 基本数据类型 - int i = 0; - passCnt[i++] = anno.intA() == Integer.MAX_VALUE ? 1: 0; - passCnt[i++] += anno.byteA() == Byte.MAX_VALUE ? 1: 0; - passCnt[i++] += anno.charA() == Character.MAX_VALUE ? 1: 0; - passCnt[i++] += Double.isNaN(anno.doubleA()) ? 1: 0; - passCnt[i++] += anno.booleanA() ? 1: 0; - passCnt[i++] += anno.longA() == Long.MAX_VALUE ? 1: 0; - passCnt[i++] += Float.isNaN(anno.floatA())? 1: 0; - passCnt[i++] += anno.shortA() == Short.MAX_VALUE ? 1: 0; - - //enum, string, annotation, class - passCnt[i++] += anno.stateA() == Thread.State.BLOCKED ? 1: 0; - passCnt[i++] += anno.stringA().compareTo("") == 0 ? 1: 0; - passCnt[i++] += anno.classA() == Thread.class ? 1: 0; - passCnt[i++] += Arrays.toString(anno.intAA()).compareTo("[1, 2]") == 0 ? 1: 0; - - //基本类型数组 - passCnt[i++] += (anno.byteAA().length == 1 && anno.byteAA()[0] == 0) ? 1: 0; - passCnt[i++] += (anno.charAA().length == 1 && anno.charAA()[0] == ' ') ? 1: 0; - passCnt[i++] += (anno.doubleAA().length == 3 && Double.isNaN(anno.doubleAA()[0]) && Double.isInfinite(anno.doubleAA()[1]) && Double.isInfinite(anno.doubleAA()[2]))? 1: 0; - passCnt[i++] += (anno.booleanAA().length == 1 && anno.booleanAA()[0]) ? 1: 0; - passCnt[i++] += (anno.longAA().length == 1 && anno.longAA()[0] == Long.MAX_VALUE) ? 1: 0; - passCnt[i++] += (anno.floatAA().length == 3 && Float.isNaN(anno.floatAA()[0]) && Float.isInfinite(anno.floatAA()[1]) && Float.isInfinite(anno.floatAA()[2])) ? 1: 0; - passCnt[i++] += (anno.shortAA().length == 1 && anno.shortAA()[0] == 0) ? 1: 0; - passCnt[i++] += (anno.stringAA().length == 1 && anno.stringAA()[0].compareTo("")==0) ? 1: 0; - passCnt[i++] += (anno.classAA().length == 1 && anno.classAA()[0] == Thread.class)? 1: 0; - passCnt[i++] += (anno.stateAA().length == 1 && anno.stateAA()[0] == Thread.State.NEW) ? 1: 0; - passCnt[i++] += anno.annoBA().toString().compareTo("@AnnoB(intB=999)")==0 ? 1: 0; - passCnt[i++] += Arrays.toString(anno.annoBAA()).compareTo("[@AnnoB(intB=999), @AnnoB(intB=999)]") == 0 ? 1: 0; - System.out.println(Arrays.toString(passCnt).compareTo("[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]"));*/ - } -} - -class Test<@AnnoA(intA = Integer.MAX_VALUE, byteA = Byte.MAX_VALUE, charA = Character.MAX_VALUE, doubleA = Double.NaN, - booleanA = true, longA = Long.MAX_VALUE, floatA = Float.NaN, shortA = Short.MAX_VALUE, - intAA = {1,2}, byteAA = {0}, charAA = {' '}, doubleAA = {Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY}, - booleanAA = {true}, longAA = {Long.MAX_VALUE}, floatAA = {Float.NaN, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY}, shortAA = {0}, - stringA = "", stringAA = "", classA = Thread.class, classAA = Thread.class, stateA = Thread.State.BLOCKED, - stateAA = Thread.State.NEW, annoBA = @AnnoB, annoBAA = {@AnnoB, @AnnoB}) T> { - -} - - -// DEPENDENCE: AnnoB.java AnnoA.java -// EXEC:%maple %f AnnoA.java AnnoB.java %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_Annotation_invoke_AnnotationSetTest + *- @RequirementName: Java Reflection + *- @TestCaseName:AnnotationTypeParameterSetTest.java + *- @TestCaseName: AnnotationTypeParameterSetTest + *- @TestCaseType: Function Testing + *- @RequirementName: annotation + *- @Title/Destination: positive test for User-defined Annotation with @Target(ElementType.TYPE_PARAMETER) + *- @Brief:no: + * -#step1. User-defined Annotation with @Target(ElementType.TYPE_PARAMETER) has field with primitive type, String, ENUM, annotation, class and their array + * -#step2. verify able to set and get value + *- @Expect:0\n + *- @Priority: Level 1 + *- @Source: AnnotationTypeParameterSetTest.java AnnoA.java AnnoB.java + *- @ExecuteClass: AnnotationTypeParameterSetTest + *- @ExecuteArgs: + */ + +import java.util.Arrays; + +public class AnnotationTypeParameterSetTest { + static int[] passCnt; + public static void main(String[] args) { + + System.out.println(Test.class.getAnnotations().length); +// TypeVeriable.getAnnotation not supported in ART +/* AnnoA anno = Test.class.getTypeParameters()[0].getAnnotation(AnnoA.class); + passCnt = new int[24]; + // 基本数据类型 + int i = 0; + passCnt[i++] = anno.intA() == Integer.MAX_VALUE ? 1: 0; + passCnt[i++] += anno.byteA() == Byte.MAX_VALUE ? 1: 0; + passCnt[i++] += anno.charA() == Character.MAX_VALUE ? 1: 0; + passCnt[i++] += Double.isNaN(anno.doubleA()) ? 1: 0; + passCnt[i++] += anno.booleanA() ? 1: 0; + passCnt[i++] += anno.longA() == Long.MAX_VALUE ? 1: 0; + passCnt[i++] += Float.isNaN(anno.floatA())? 1: 0; + passCnt[i++] += anno.shortA() == Short.MAX_VALUE ? 1: 0; + + //enum, string, annotation, class + passCnt[i++] += anno.stateA() == Thread.State.BLOCKED ? 1: 0; + passCnt[i++] += anno.stringA().compareTo("") == 0 ? 1: 0; + passCnt[i++] += anno.classA() == Thread.class ? 1: 0; + passCnt[i++] += Arrays.toString(anno.intAA()).compareTo("[1, 2]") == 0 ? 1: 0; + + //基本类型数组 + passCnt[i++] += (anno.byteAA().length == 1 && anno.byteAA()[0] == 0) ? 1: 0; + passCnt[i++] += (anno.charAA().length == 1 && anno.charAA()[0] == ' ') ? 1: 0; + passCnt[i++] += (anno.doubleAA().length == 3 && Double.isNaN(anno.doubleAA()[0]) && Double.isInfinite(anno.doubleAA()[1]) && Double.isInfinite(anno.doubleAA()[2]))? 1: 0; + passCnt[i++] += (anno.booleanAA().length == 1 && anno.booleanAA()[0]) ? 1: 0; + passCnt[i++] += (anno.longAA().length == 1 && anno.longAA()[0] == Long.MAX_VALUE) ? 1: 0; + passCnt[i++] += (anno.floatAA().length == 3 && Float.isNaN(anno.floatAA()[0]) && Float.isInfinite(anno.floatAA()[1]) && Float.isInfinite(anno.floatAA()[2])) ? 1: 0; + passCnt[i++] += (anno.shortAA().length == 1 && anno.shortAA()[0] == 0) ? 1: 0; + passCnt[i++] += (anno.stringAA().length == 1 && anno.stringAA()[0].compareTo("")==0) ? 1: 0; + passCnt[i++] += (anno.classAA().length == 1 && anno.classAA()[0] == Thread.class)? 1: 0; + passCnt[i++] += (anno.stateAA().length == 1 && anno.stateAA()[0] == Thread.State.NEW) ? 1: 0; + passCnt[i++] += anno.annoBA().toString().compareTo("@AnnoB(intB=999)")==0 ? 1: 0; + passCnt[i++] += Arrays.toString(anno.annoBAA()).compareTo("[@AnnoB(intB=999), @AnnoB(intB=999)]") == 0 ? 1: 0; + System.out.println(Arrays.toString(passCnt).compareTo("[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]"));*/ + } +} + +class Test<@AnnoA(intA = Integer.MAX_VALUE, byteA = Byte.MAX_VALUE, charA = Character.MAX_VALUE, doubleA = Double.NaN, + booleanA = true, longA = Long.MAX_VALUE, floatA = Float.NaN, shortA = Short.MAX_VALUE, + intAA = {1,2}, byteAA = {0}, charAA = {' '}, doubleAA = {Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY}, + booleanAA = {true}, longAA = {Long.MAX_VALUE}, floatAA = {Float.NaN, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY}, shortAA = {0}, + stringA = "", stringAA = "", classA = Thread.class, classAA = Thread.class, stateA = Thread.State.BLOCKED, + stateAA = Thread.State.NEW, annoBA = @AnnoB, annoBAA = {@AnnoB, @AnnoB}) T> { + +} + + +// DEPENDENCE: AnnoB.java AnnoA.java +// EXEC:%maple %f AnnoA.java AnnoB.java %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnoA.java b/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnoA.java index 6587bdaed69112561dbaaff8db8c1bfba8e1dcf2..9e0ea89e60e3c50181aabbb4e9bdee3d9fb484a2 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnoA.java +++ b/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnoA.java @@ -1,46 +1,46 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -import java.lang.annotation.*; - -@Target(ElementType.TYPE_USE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -public @interface AnnoA { - int intA(); - byte byteA(); - char charA(); - double doubleA(); - boolean booleanA(); - long longA(); - float floatA(); - short shortA(); - int[] intAA(); - byte[] byteAA(); - char[] charAA(); - double[] doubleAA(); - boolean[] booleanAA(); - long[] longAA(); - float[] floatAA(); - short[] shortAA(); - String stringA(); - String[] stringAA(); - Class classA(); - Class[] classAA(); - Thread.State stateA(); - Thread.State[] stateAA(); - AnnoB annoBA(); - AnnoB[] annoBAA(); -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +import java.lang.annotation.*; + +@Target(ElementType.TYPE_USE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface AnnoA { + int intA(); + byte byteA(); + char charA(); + double doubleA(); + boolean booleanA(); + long longA(); + float floatA(); + short shortA(); + int[] intAA(); + byte[] byteAA(); + char[] charAA(); + double[] doubleAA(); + boolean[] booleanAA(); + long[] longAA(); + float[] floatAA(); + short[] shortAA(); + String stringA(); + String[] stringAA(); + Class classA(); + Class[] classAA(); + Thread.State stateA(); + Thread.State[] stateAA(); + AnnoB annoBA(); + AnnoB[] annoBAA(); +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnoB.java b/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnoB.java index 27c5d3ec6a53d2c77244192c86bb5eeab6ef947c..52d38f1f9f688a76538762fda3b39dcbe7548b4a 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnoB.java +++ b/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnoB.java @@ -1,23 +1,23 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -import java.lang.annotation.*; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -public @interface AnnoB { - int intB() default 999; -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +import java.lang.annotation.*; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface AnnoB { + int intB() default 999; +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnotationTypeUseSetTest.java b/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnotationTypeUseSetTest.java index 2344a79ed30b8b9355868e2d04c44dae0352fb38..0a343ce6dde801528c231af6ee7ef3a5f3fa4103 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnotationTypeUseSetTest.java +++ b/test/testsuite/ouroboros/reflection_test/RT0201-rt-reflection-AnnotationTypeUseSetTest/AnnotationTypeUseSetTest.java @@ -1,86 +1,86 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_Annotation_invoke_AnnotationSetTest - *- @RequirementName: Java Reflection - *- @TestCaseName:AnnotationTypeUseSetTest.java - *- @TestCaseName: AnnotationTypeUseSetTest - *- @TestCaseType: Function Testing - *- @RequirementName: annotation - *- @Title/Destination: positive test for User-defined Annotation with @Target(ElementType.TYPE_USE) - *- @Brief:no: - * -#step1. User-defined Annotation with @Target(ElementType.TYPE_USE) has field with primitive type, String, ENUM, annotation, class and their array - * -#step2. verify able to set and get value - *- @Expect:0\n - *- @Priority: Level 1 - *- @Source: AnnotationTypeUseSetTest.java AnnoA.java AnnoB.java - *- @ExecuteClass: AnnotationTypeUseSetTest - *- @ExecuteArgs: - */ - -import java.util.Arrays; - -public class AnnotationTypeUseSetTest { - static int[] passCnt; - public static void main(String[] args) { - System.out.println(Test.class.getAnnotations().length); -/* AnnoA anno = Test.class.getTypeParameters()[0].getAnnotation(AnnoA.class); - passCnt = new int[24]; - // 基本数据类型 - int i = 0; - passCnt[i++] = anno.intA() == Integer.MAX_VALUE ? 1: 0; - passCnt[i++] += anno.byteA() == Byte.MAX_VALUE ? 1: 0; - passCnt[i++] += anno.charA() == Character.MAX_VALUE ? 1: 0; - passCnt[i++] += Double.isNaN(anno.doubleA()) ? 1: 0; - passCnt[i++] += anno.booleanA() ? 1: 0; - passCnt[i++] += anno.longA() == Long.MAX_VALUE ? 1: 0; - passCnt[i++] += Float.isNaN(anno.floatA())? 1: 0; - passCnt[i++] += anno.shortA() == Short.MAX_VALUE ? 1: 0; - - //enum, string, annotation, class - passCnt[i++] += anno.stateA() == Thread.State.BLOCKED ? 1: 0; - passCnt[i++] += anno.stringA().compareTo("") == 0 ? 1: 0; - passCnt[i++] += anno.classA() == Thread.class ? 1: 0; - passCnt[i++] += Arrays.toString(anno.intAA()).compareTo("[1, 2]") == 0 ? 1: 0; - - //基本类型数组 - passCnt[i++] += (anno.byteAA().length == 1 && anno.byteAA()[0] == 0) ? 1: 0; - passCnt[i++] += (anno.charAA().length == 1 && anno.charAA()[0] == ' ') ? 1: 0; - passCnt[i++] += (anno.doubleAA().length == 3 && Double.isNaN(anno.doubleAA()[0]) && Double.isInfinite(anno.doubleAA()[1]) && Double.isInfinite(anno.doubleAA()[2]))? 1: 0; - passCnt[i++] += (anno.booleanAA().length == 1 && anno.booleanAA()[0]) ? 1: 0; - passCnt[i++] += (anno.longAA().length == 1 && anno.longAA()[0] == Long.MAX_VALUE) ? 1: 0; - passCnt[i++] += (anno.floatAA().length == 3 && Float.isNaN(anno.floatAA()[0]) && Float.isInfinite(anno.floatAA()[1]) && Float.isInfinite(anno.floatAA()[2])) ? 1: 0; - passCnt[i++] += (anno.shortAA().length == 1 && anno.shortAA()[0] == 0) ? 1: 0; - passCnt[i++] += (anno.stringAA().length == 1 && anno.stringAA()[0].compareTo("")==0) ? 1: 0; - passCnt[i++] += (anno.classAA().length == 1 && anno.classAA()[0] == Thread.class)? 1: 0; - passCnt[i++] += (anno.stateAA().length == 1 && anno.stateAA()[0] == Thread.State.NEW) ? 1: 0; - passCnt[i++] += anno.annoBA().toString().compareTo("@AnnoB(intB=999)")==0 ? 1: 0; - passCnt[i++] += Arrays.toString(anno.annoBAA()).compareTo("[@AnnoB(intB=999), @AnnoB(intB=999)]") == 0 ? 1: 0; - System.out.println(Arrays.toString(passCnt).compareTo("[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]"));*/ - } -} - -class Test<@AnnoA(intA = Integer.MAX_VALUE, byteA = Byte.MAX_VALUE, charA = Character.MAX_VALUE, doubleA = Double.NaN, - booleanA = true, longA = Long.MAX_VALUE, floatA = Float.NaN, shortA = Short.MAX_VALUE, - intAA = {1,2}, byteAA = {0}, charAA = {' '}, doubleAA = {Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY}, - booleanAA = {true}, longAA = {Long.MAX_VALUE}, floatAA = {Float.NaN, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY}, shortAA = {0}, - stringA = "", stringAA = "", classA = Thread.class, classAA = Thread.class, stateA = Thread.State.BLOCKED, - stateAA = Thread.State.NEW, annoBA = @AnnoB, annoBAA = {@AnnoB, @AnnoB}) T> { - -} - - -// DEPENDENCE: AnnoB.java AnnoA.java -// EXEC:%maple %f AnnoA.java AnnoB.java %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_Annotation_invoke_AnnotationSetTest + *- @RequirementName: Java Reflection + *- @TestCaseName:AnnotationTypeUseSetTest.java + *- @TestCaseName: AnnotationTypeUseSetTest + *- @TestCaseType: Function Testing + *- @RequirementName: annotation + *- @Title/Destination: positive test for User-defined Annotation with @Target(ElementType.TYPE_USE) + *- @Brief:no: + * -#step1. User-defined Annotation with @Target(ElementType.TYPE_USE) has field with primitive type, String, ENUM, annotation, class and their array + * -#step2. verify able to set and get value + *- @Expect:0\n + *- @Priority: Level 1 + *- @Source: AnnotationTypeUseSetTest.java AnnoA.java AnnoB.java + *- @ExecuteClass: AnnotationTypeUseSetTest + *- @ExecuteArgs: + */ + +import java.util.Arrays; + +public class AnnotationTypeUseSetTest { + static int[] passCnt; + public static void main(String[] args) { + System.out.println(Test.class.getAnnotations().length); +/* AnnoA anno = Test.class.getTypeParameters()[0].getAnnotation(AnnoA.class); + passCnt = new int[24]; + // 基本数据类型 + int i = 0; + passCnt[i++] = anno.intA() == Integer.MAX_VALUE ? 1: 0; + passCnt[i++] += anno.byteA() == Byte.MAX_VALUE ? 1: 0; + passCnt[i++] += anno.charA() == Character.MAX_VALUE ? 1: 0; + passCnt[i++] += Double.isNaN(anno.doubleA()) ? 1: 0; + passCnt[i++] += anno.booleanA() ? 1: 0; + passCnt[i++] += anno.longA() == Long.MAX_VALUE ? 1: 0; + passCnt[i++] += Float.isNaN(anno.floatA())? 1: 0; + passCnt[i++] += anno.shortA() == Short.MAX_VALUE ? 1: 0; + + //enum, string, annotation, class + passCnt[i++] += anno.stateA() == Thread.State.BLOCKED ? 1: 0; + passCnt[i++] += anno.stringA().compareTo("") == 0 ? 1: 0; + passCnt[i++] += anno.classA() == Thread.class ? 1: 0; + passCnt[i++] += Arrays.toString(anno.intAA()).compareTo("[1, 2]") == 0 ? 1: 0; + + //基本类型数组 + passCnt[i++] += (anno.byteAA().length == 1 && anno.byteAA()[0] == 0) ? 1: 0; + passCnt[i++] += (anno.charAA().length == 1 && anno.charAA()[0] == ' ') ? 1: 0; + passCnt[i++] += (anno.doubleAA().length == 3 && Double.isNaN(anno.doubleAA()[0]) && Double.isInfinite(anno.doubleAA()[1]) && Double.isInfinite(anno.doubleAA()[2]))? 1: 0; + passCnt[i++] += (anno.booleanAA().length == 1 && anno.booleanAA()[0]) ? 1: 0; + passCnt[i++] += (anno.longAA().length == 1 && anno.longAA()[0] == Long.MAX_VALUE) ? 1: 0; + passCnt[i++] += (anno.floatAA().length == 3 && Float.isNaN(anno.floatAA()[0]) && Float.isInfinite(anno.floatAA()[1]) && Float.isInfinite(anno.floatAA()[2])) ? 1: 0; + passCnt[i++] += (anno.shortAA().length == 1 && anno.shortAA()[0] == 0) ? 1: 0; + passCnt[i++] += (anno.stringAA().length == 1 && anno.stringAA()[0].compareTo("")==0) ? 1: 0; + passCnt[i++] += (anno.classAA().length == 1 && anno.classAA()[0] == Thread.class)? 1: 0; + passCnt[i++] += (anno.stateAA().length == 1 && anno.stateAA()[0] == Thread.State.NEW) ? 1: 0; + passCnt[i++] += anno.annoBA().toString().compareTo("@AnnoB(intB=999)")==0 ? 1: 0; + passCnt[i++] += Arrays.toString(anno.annoBAA()).compareTo("[@AnnoB(intB=999), @AnnoB(intB=999)]") == 0 ? 1: 0; + System.out.println(Arrays.toString(passCnt).compareTo("[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]"));*/ + } +} + +class Test<@AnnoA(intA = Integer.MAX_VALUE, byteA = Byte.MAX_VALUE, charA = Character.MAX_VALUE, doubleA = Double.NaN, + booleanA = true, longA = Long.MAX_VALUE, floatA = Float.NaN, shortA = Short.MAX_VALUE, + intAA = {1,2}, byteAA = {0}, charAA = {' '}, doubleAA = {Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY}, + booleanAA = {true}, longAA = {Long.MAX_VALUE}, floatAA = {Float.NaN, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY}, shortAA = {0}, + stringA = "", stringAA = "", classA = Thread.class, classAA = Thread.class, stateA = Thread.State.BLOCKED, + stateAA = Thread.State.NEW, annoBA = @AnnoB, annoBAA = {@AnnoB, @AnnoB}) T> { + +} + + +// DEPENDENCE: AnnoB.java AnnoA.java +// EXEC:%maple %f AnnoA.java AnnoB.java %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoA.java b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoA.java index 8fb09d151e758eace1cdaf82bfa6464ba5c88470..d41eb52d387462557343668f03627fe5d4bfe505 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoA.java +++ b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoA.java @@ -1,31 +1,31 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -import java.lang.annotation.*; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -public @interface AnnoA { - int intA() default Integer.MAX_VALUE; - - double doubleA() default Double.MIN_VALUE; - - String stringA() default ""; - - AnnoB annoBA(); - - ENUMA enumA() default ENUMA.A; -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +import java.lang.annotation.*; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface AnnoA { + int intA() default Integer.MAX_VALUE; + + double doubleA() default Double.MIN_VALUE; + + String stringA() default ""; + + AnnoB annoBA(); + + ENUMA enumA() default ENUMA.A; +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoB.java b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoB.java index 27c5d3ec6a53d2c77244192c86bb5eeab6ef947c..52d38f1f9f688a76538762fda3b39dcbe7548b4a 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoB.java +++ b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoB.java @@ -1,23 +1,23 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -import java.lang.annotation.*; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -public @interface AnnoB { - int intB() default 999; -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +import java.lang.annotation.*; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface AnnoB { + int intB() default 999; +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoC.java b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoC.java index 4ec1b9d62cdea9c97dbcef5cf9673d10e7645e16..898985c4d429eeb182e78a6e89c21bcc93c6a7a3 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoC.java +++ b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoC.java @@ -1,31 +1,31 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -import java.lang.annotation.*; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -public @interface AnnoC { - int[] intA() default Integer.MAX_VALUE; - - double[] doubleA() default Double.MIN_VALUE; - - String[] stringA() default ""; - - AnnoB[] annoBA() default @AnnoB; - - ENUMA[] enumA() default ENUMA.A; -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +import java.lang.annotation.*; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface AnnoC { + int[] intA() default Integer.MAX_VALUE; + + double[] doubleA() default Double.MIN_VALUE; + + String[] stringA() default ""; + + AnnoB[] annoBA() default @AnnoB; + + ENUMA[] enumA() default ENUMA.A; +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoD.java b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoD.java index 4b9c2e3686c75ce78e4ef1cc3be73f0094c7e392..6160990bc3bf5d8f7a1257999cb414170f04cf6f 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoD.java +++ b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnoD.java @@ -1,31 +1,31 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -import java.lang.annotation.*; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -public @interface AnnoD { - int intA() default Integer.MAX_VALUE; - - double doubleA() default Double.MIN_VALUE; - - String stringA() default ""; - - AnnoB annoBA(); - - ENUMA enumA() default ENUMA.A; -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +import java.lang.annotation.*; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface AnnoD { + int intA() default Integer.MAX_VALUE; + + double doubleA() default Double.MIN_VALUE; + + String stringA() default ""; + + AnnoB annoBA(); + + ENUMA enumA() default ENUMA.A; +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnotationMultiThread.java b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnotationMultiThread.java index 4fa951ea6a21bef704df1551ee1415f0b76f808a..e49d6488f2a4e210ae73c8291bbca942fefaf03c 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnotationMultiThread.java +++ b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/AnnotationMultiThread.java @@ -1,193 +1,193 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_MethodHandle_invoke_AnnotationMultiThread - *- @RequirementName: Java Reflection - *- @TestCaseName:AnnotationMultiThread.java - *- @TestCaseName: AnnotationMultiThread - *- @TestCaseType: Function Testing - *- @RequirementName: annotation - *- @Title/Destination: positive test for User-defined Annotation, verify when multiple thread try to use annotations, working fine - *- @Brief:no: - * -#step1. User-defined Annotation has field with primitive type, String, ENUM, annotation, class and their array - * -#step2. verify able to set and get value under multithread - *- @Expect:0\n - *- @Priority: Level 1 - *- @Source: AnnotationMultiThread.java AnnoA.java AnnoB.java AnnoC.java AnnoD.java ENUMA.java - *- @ExecuteClass: AnnotationMultiThread - *- @ExecuteArgs: - */ - -import java.lang.annotation.Annotation; -import java.util.Arrays; -import java.util.concurrent.atomic.AtomicInteger; - -public class AnnotationMultiThread { - static AtomicInteger passCnt = new AtomicInteger(); - public static void main(String[] args) throws ClassNotFoundException { - ThreadGroup threadGroup = new ThreadGroup("myGroup"); - - String[][] expectedGF = new String[][]{ - {"@AnnoA", "enumA=A", "intA=2147483647", "stringA=", "doubleA=4.9E-324", "annoBA=@AnnoB(intB=999)"}, - {"@AnnoB(intB=999)"}, - {"@AnnoC", "annoBA=[@AnnoB(intB=999)]", "intA=[2147483647]", "enumA=[A]", "stringA=[]", "doubleA=[4.9E-324]"} - }; - - String[][] expectedF = new String[][]{ - {"@AnnoA", "enumA=A", "intA=2147483647", "stringA=", "doubleA=4.9E-324", "annoBA=@AnnoB(intB=999)"}, - {"@AnnoB(intB=999)"}, - {"@AnnoC", "annoBA=[@AnnoB(intB=999)]", "intA=[2147483647]", "enumA=[A]", "stringA=[]", "doubleA=[4.9E-324]"}, - {"@AnnoD", "enumA=A", "intA=2147483647", "stringA=", "doubleA=4.9E-324", "annoBA=@AnnoB(intB=999)"}, - }; - - new AnnotationGetter("GrandFather", expectedGF, expectedGF, threadGroup, "threadGF").start(); - new AnnotationGetter("Father", expectedF, expectedF, threadGroup, "threadF").start(); - new AnnotationGetter("Interface", expectedF, expectedF, threadGroup, "threadI").start(); - new AnnotationGetter("Son", expectedF, new String[][]{}, threadGroup, "threadS").start(); - new AnnotationGetter("Son2", expectedF, new String[][]{}, threadGroup, "threadS2").start(); - new AnnotationGetter("GrandFather", expectedGF, expectedGF, threadGroup, "threadGF").start(); - new AnnotationGetter("Father", expectedF, expectedF, threadGroup, "threadF").start(); - new AnnotationGetter("Interface", expectedF, expectedF, threadGroup, "threadI").start(); - new AnnotationGetter("Son", expectedF, new String[][]{}, threadGroup, "threadI").start(); - new AnnotationGetter("Son2", expectedF, new String[][]{}, threadGroup, "threadI").start(); - - int i = 0; - while (threadGroup.activeCount() > 0) { - i++; - try { - Thread.sleep(100); - } catch (InterruptedException e) { - System.out.println(e); - } - if (i > 1000) { - break; - } - } - - System.out.println(passCnt.get() - 200); - } - - - public static boolean checkAllAnnotations(Annotation[] annotations, String[][] expected) { - String[] actual = new String[annotations.length]; - - for (int i = 0; i < annotations.length; i++) { - actual[i] = annotations[i].toString(); - } - Arrays.sort(actual); - if (actual.length != expected.length) { - return false; - } -// System.out.println(Arrays.toString(actual)); - for (int i = 0; i < annotations.length; i++) { - if (expected[i].length == 1) { - if (actual[i].compareTo(expected[i][0]) != 0) { - System.out.println(actual[i]); - System.out.println(expected[i][0]); - return false; - } - } else { - for (int j = 0; j < expected[i].length; j++) { - if (!actual[i].contains(expected[i][j])) { - System.out.println(actual[i]); - System.out.println(expected[i][j]); - return false; - } - } - } - } - return true; - } - -} - -class AnnotationGetter extends Thread { - String name; - String[][] expected; - String[][] expectedD; - - AnnotationGetter(String nameI, String[][] expectedI, String[][] expectedDI, ThreadGroup threadGroup, String thread_name) { - super(threadGroup, thread_name); - name = nameI; - expected = expectedI; - expectedD = expectedDI; - } - - @Override - public void run() { - try { - for (int i = 0; i < 10; i++) { - if (AnnotationMultiThread.checkAllAnnotations(Class.forName(this.name).getAnnotations(), this.expected)) { - AnnotationMultiThread.passCnt.incrementAndGet(); - } - if (AnnotationMultiThread.checkAllAnnotations(Class.forName(this.name).getDeclaredAnnotations(), this.expectedD)) { - AnnotationMultiThread.passCnt.incrementAndGet(); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - } -} - -@AnnoB -@AnnoA(annoBA = @AnnoB) -@AnnoC() -class GrandFather { - public void method1(int a, double b, Object... objects) { - } -} - -@SuppressWarnings("all") -@AnnoB -@AnnoA(annoBA = @AnnoB) -@AnnoC() -@AnnoD(annoBA = @AnnoB) -class Father extends GrandFather implements Interface { - @Override - public void method1(int a, double b, Object... objects) { - } - - @Deprecated - public void method2() { - } -} - -class Son extends Father { - @Override - @Deprecated - public void method2() { - } -} - -class Son2 extends Father { - @Override - @Deprecated - public void method2() { - } -} - -@SuppressWarnings("all") -@AnnoB -@AnnoA(annoBA = @AnnoB) -@AnnoC() -@AnnoD(annoBA = @AnnoB) -interface Interface { - -} - -// DEPENDENCE: AnnoB.java AnnoC.java AnnoA.java ENUMA.java AnnoD.java -// EXEC:%maple %f AnnoA.java AnnoB.java AnnoC.java AnnoD.java ENUMA.java %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_MethodHandle_invoke_AnnotationMultiThread + *- @RequirementName: Java Reflection + *- @TestCaseName:AnnotationMultiThread.java + *- @TestCaseName: AnnotationMultiThread + *- @TestCaseType: Function Testing + *- @RequirementName: annotation + *- @Title/Destination: positive test for User-defined Annotation, verify when multiple thread try to use annotations, working fine + *- @Brief:no: + * -#step1. User-defined Annotation has field with primitive type, String, ENUM, annotation, class and their array + * -#step2. verify able to set and get value under multithread + *- @Expect:0\n + *- @Priority: Level 1 + *- @Source: AnnotationMultiThread.java AnnoA.java AnnoB.java AnnoC.java AnnoD.java ENUMA.java + *- @ExecuteClass: AnnotationMultiThread + *- @ExecuteArgs: + */ + +import java.lang.annotation.Annotation; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicInteger; + +public class AnnotationMultiThread { + static AtomicInteger passCnt = new AtomicInteger(); + public static void main(String[] args) throws ClassNotFoundException { + ThreadGroup threadGroup = new ThreadGroup("myGroup"); + + String[][] expectedGF = new String[][]{ + {"@AnnoA", "enumA=A", "intA=2147483647", "stringA=", "doubleA=4.9E-324", "annoBA=@AnnoB(intB=999)"}, + {"@AnnoB(intB=999)"}, + {"@AnnoC", "annoBA=[@AnnoB(intB=999)]", "intA=[2147483647]", "enumA=[A]", "stringA=[]", "doubleA=[4.9E-324]"} + }; + + String[][] expectedF = new String[][]{ + {"@AnnoA", "enumA=A", "intA=2147483647", "stringA=", "doubleA=4.9E-324", "annoBA=@AnnoB(intB=999)"}, + {"@AnnoB(intB=999)"}, + {"@AnnoC", "annoBA=[@AnnoB(intB=999)]", "intA=[2147483647]", "enumA=[A]", "stringA=[]", "doubleA=[4.9E-324]"}, + {"@AnnoD", "enumA=A", "intA=2147483647", "stringA=", "doubleA=4.9E-324", "annoBA=@AnnoB(intB=999)"}, + }; + + new AnnotationGetter("GrandFather", expectedGF, expectedGF, threadGroup, "threadGF").start(); + new AnnotationGetter("Father", expectedF, expectedF, threadGroup, "threadF").start(); + new AnnotationGetter("Interface", expectedF, expectedF, threadGroup, "threadI").start(); + new AnnotationGetter("Son", expectedF, new String[][]{}, threadGroup, "threadS").start(); + new AnnotationGetter("Son2", expectedF, new String[][]{}, threadGroup, "threadS2").start(); + new AnnotationGetter("GrandFather", expectedGF, expectedGF, threadGroup, "threadGF").start(); + new AnnotationGetter("Father", expectedF, expectedF, threadGroup, "threadF").start(); + new AnnotationGetter("Interface", expectedF, expectedF, threadGroup, "threadI").start(); + new AnnotationGetter("Son", expectedF, new String[][]{}, threadGroup, "threadI").start(); + new AnnotationGetter("Son2", expectedF, new String[][]{}, threadGroup, "threadI").start(); + + int i = 0; + while (threadGroup.activeCount() > 0) { + i++; + try { + Thread.sleep(100); + } catch (InterruptedException e) { + System.out.println(e); + } + if (i > 1000) { + break; + } + } + + System.out.println(passCnt.get() - 200); + } + + + public static boolean checkAllAnnotations(Annotation[] annotations, String[][] expected) { + String[] actual = new String[annotations.length]; + + for (int i = 0; i < annotations.length; i++) { + actual[i] = annotations[i].toString(); + } + Arrays.sort(actual); + if (actual.length != expected.length) { + return false; + } +// System.out.println(Arrays.toString(actual)); + for (int i = 0; i < annotations.length; i++) { + if (expected[i].length == 1) { + if (actual[i].compareTo(expected[i][0]) != 0) { + System.out.println(actual[i]); + System.out.println(expected[i][0]); + return false; + } + } else { + for (int j = 0; j < expected[i].length; j++) { + if (!actual[i].contains(expected[i][j])) { + System.out.println(actual[i]); + System.out.println(expected[i][j]); + return false; + } + } + } + } + return true; + } + +} + +class AnnotationGetter extends Thread { + String name; + String[][] expected; + String[][] expectedD; + + AnnotationGetter(String nameI, String[][] expectedI, String[][] expectedDI, ThreadGroup threadGroup, String thread_name) { + super(threadGroup, thread_name); + name = nameI; + expected = expectedI; + expectedD = expectedDI; + } + + @Override + public void run() { + try { + for (int i = 0; i < 10; i++) { + if (AnnotationMultiThread.checkAllAnnotations(Class.forName(this.name).getAnnotations(), this.expected)) { + AnnotationMultiThread.passCnt.incrementAndGet(); + } + if (AnnotationMultiThread.checkAllAnnotations(Class.forName(this.name).getDeclaredAnnotations(), this.expectedD)) { + AnnotationMultiThread.passCnt.incrementAndGet(); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + } +} + +@AnnoB +@AnnoA(annoBA = @AnnoB) +@AnnoC() +class GrandFather { + public void method1(int a, double b, Object... objects) { + } +} + +@SuppressWarnings("all") +@AnnoB +@AnnoA(annoBA = @AnnoB) +@AnnoC() +@AnnoD(annoBA = @AnnoB) +class Father extends GrandFather implements Interface { + @Override + public void method1(int a, double b, Object... objects) { + } + + @Deprecated + public void method2() { + } +} + +class Son extends Father { + @Override + @Deprecated + public void method2() { + } +} + +class Son2 extends Father { + @Override + @Deprecated + public void method2() { + } +} + +@SuppressWarnings("all") +@AnnoB +@AnnoA(annoBA = @AnnoB) +@AnnoC() +@AnnoD(annoBA = @AnnoB) +interface Interface { + +} + +// DEPENDENCE: AnnoB.java AnnoC.java AnnoA.java ENUMA.java AnnoD.java +// EXEC:%maple %f AnnoA.java AnnoB.java AnnoC.java AnnoD.java ENUMA.java %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/ENUMA.java b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/ENUMA.java index 65a040f83b87c094f495701b1966a1d64dd17fdf..6118fa06adfc9effd83e1418d2da5b684f2364de 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/ENUMA.java +++ b/test/testsuite/ouroboros/reflection_test/RT0202-rt-reflection-AnnotationMultiThread/ENUMA.java @@ -1,19 +1,19 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -public enum ENUMA { - A, - B, - C -} +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + */ +public enum ENUMA { + A, + B, + C +} diff --git a/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/FieldTest.java b/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/FieldTest.java index 2c6071c0bcd88bf53e23bbcbc08e4904fcdd5fcf..0f7d75c944e4e6ac0d88a9cb9f4777047b0f377a 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/FieldTest.java +++ b/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/FieldTest.java @@ -380,7 +380,7 @@ interface TestField12 { char[] chars10 = new char[] {'a', 'b', 'c'}; String string10 = "I'm only happy when it rains"; } -// DEPENDENCE: MethodTest.java check_s.py +// DEPENDENCE: MethodTest.java // EXEC:%maple %f %build_option -o %n.so // EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan 0\n \ No newline at end of file +// ASSERT: scan 0\n diff --git a/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/MethodTest.java b/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/MethodTest.java index 06f367db501065bbc8c98ad5f28aacd672846588..1ceb3b3eaf6d13256dfb55d5f0939c12be631ab7 100644 --- a/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/MethodTest.java +++ b/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/MethodTest.java @@ -444,7 +444,7 @@ interface TestMethod11 { String string09Method(); } -// DEPENDENCE: check_s.py FieldTest.java +// DEPENDENCE: FieldTest.java // EXEC:%maple %f %build_option -o %n.so // EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan 0\n \ No newline at end of file +// ASSERT: scan 0\n diff --git a/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/check_s.py b/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/check_s.py deleted file mode 100644 index 9dab058366fb9d936639495ac169e40e7220a594..0000000000000000000000000000000000000000 --- a/test/testsuite/ouroboros/reflection_test/RT0208-rt-reflection-MetadataCheck/check_s.py +++ /dev/null @@ -1,52 +0,0 @@ -import sys - -def check_vtableimpl_s(filename): - f = open(filename, 'r') - result = list() - check_cnt = 0 - pass_cnt = 0 - fail_cnt = 0 - for line in f.readlines(): - line = line.strip() - if line.startswith(".type"): - result = list() - result.append(line) - if line.startswith(".size"): - if result[0].find("methods_info") != -1: - check_cnt += 1 - for i in result: - if i.find(".section") != -1: - if i == '.section .rometadata.method,"a",%progbits': - pass_cnt += 1 - else: - fail_cnt += 1 - elif i.find(".data") != -1: - fail_cnt += 1 - elif result[0].find("fields_info") != -1: - check_cnt += 1 - for i in result: - if i.find(".section") != -1: - if i == '.section .rometadata.field,"a",%progbits': - pass_cnt += 1 - else: - fail_cnt += 1 - elif i.find(".data") != -1: - fail_cnt += 1 - elif result[0].find("fieldOffsetData") != -1: - check_cnt += 1 - for i in result: - if i.find(".section") != -1: - fail_cnt += 1 - elif i.find(".data") != -1: - pass_cnt += 1 - else: - continue - if check_cnt == pass_cnt and fail_cnt == 0: - print(0) - else: - print(2) - - -if __name__ == '__main__': - check_vtableimpl_s(sys.argv[1]) - diff --git a/test/testsuite/ouroboros/reflection_test/issue-RT0893-rt-Reflection-ClinitFieldSetCharInterface/ClassInitFieldSetCharInterface.java b/test/testsuite/ouroboros/reflection_test/issue-RT0893-rt-Reflection-ClinitFieldSetCharInterface/ClassInitFieldSetCharInterface.java index 25a7a09c6836ee379c33e3415d5d38b0159c0414..4d6a91ea6c0f7efdf0a366ae4d3c6fc82a9968df 100644 --- a/test/testsuite/ouroboros/reflection_test/issue-RT0893-rt-Reflection-ClinitFieldSetCharInterface/ClassInitFieldSetCharInterface.java +++ b/test/testsuite/ouroboros/reflection_test/issue-RT0893-rt-Reflection-ClinitFieldSetCharInterface/ClassInitFieldSetCharInterface.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetCharInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetCharInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.setChar(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.setChar(null, (char)46), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetCharInterface.java - *- @ExecuteClass: ClassInitFieldSetCharInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetCharInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiChar"); - if (result.toString().compareTo("") == 0) { - f.setChar(null, (char) 46); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - } else { - System.out.println(2); - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetCharInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetCharInterface.result.append("One").toString(); - char hiChar = (char) 45; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetCharInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetCharInterface.result.append("Annotation").toString(); -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetCharInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetCharInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.setChar(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.setChar(null, (char)46), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetCharInterface.java + *- @ExecuteClass: ClassInitFieldSetCharInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetCharInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiChar"); + if (result.toString().compareTo("") == 0) { + f.setChar(null, (char) 46); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + } else { + System.out.println(2); + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetCharInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetCharInterface.result.append("One").toString(); + char hiChar = (char) 45; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetCharInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetCharInterface.result.append("Annotation").toString(); +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/reflection_test/issue-RT0894-rt-Reflection-ClinitFieldSetDoubleInterface/ClassInitFieldSetDoubleInterface.java b/test/testsuite/ouroboros/reflection_test/issue-RT0894-rt-Reflection-ClinitFieldSetDoubleInterface/ClassInitFieldSetDoubleInterface.java index 8bc2565d92d2ab925157b1b97824e02fbbd8ae58..36128a9b1eb6f7ab9ba9420b02a19d3d7a481778 100644 --- a/test/testsuite/ouroboros/reflection_test/issue-RT0894-rt-Reflection-ClinitFieldSetDoubleInterface/ClassInitFieldSetDoubleInterface.java +++ b/test/testsuite/ouroboros/reflection_test/issue-RT0894-rt-Reflection-ClinitFieldSetDoubleInterface/ClassInitFieldSetDoubleInterface.java @@ -1,78 +1,78 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ClassInitFieldSetDoubleInterface - *- @RequirementName: Java Reflection - *- @TestCaseName:ClassInitFieldSetDoubleInterface.java - *- @Title/Destination: When f is a field of interface OneInterface and call f.setDouble(), OneInterface is initialized, - * it's parent interface is not initialized. - *- @Brief:no: - * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f - * of OneInterface. - * -#step2: Call method f.setDouble(null), OneInterface is initialized. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ClassInitFieldSetDoubleInterface.java - *- @ExecuteClass: ClassInitFieldSetDoubleInterface - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ClassInitFieldSetDoubleInterface { - static StringBuffer result = new StringBuffer(""); - - public static void main(String[] args) { - try { - Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); - Field f = clazz.getField("hiDouble"); - if (result.toString().compareTo("") == 0) { - f.setDouble(null, 0.265874); - } - } catch (IllegalAccessException e) { - result.append("IllegalAccessException"); - } catch (Exception e) { - System.out.println(e); - } - - if (result.toString().compareTo("OneIllegalAccessException") == 0) { - System.out.println(0); - return; - } else { - System.out.println(2); - return; - } - } -} - -interface SuperInterface { - String aSuper = ClassInitFieldSetDoubleInterface.result.append("Super").toString(); -} - -@A -interface OneInterface extends SuperInterface { - String aOne = ClassInitFieldSetDoubleInterface.result.append("One").toString(); - double hiDouble = 0.1532; -} - -interface TwoInterface extends OneInterface { - String aTwo = ClassInitFieldSetDoubleInterface.result.append("Two").toString(); -} - -@interface A { - String aA = ClassInitFieldSetDoubleInterface.result.append("Annotation").toString(); -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ClassInitFieldSetDoubleInterface + *- @RequirementName: Java Reflection + *- @TestCaseName:ClassInitFieldSetDoubleInterface.java + *- @Title/Destination: When f is a field of interface OneInterface and call f.setDouble(), OneInterface is initialized, + * it's parent interface is not initialized. + *- @Brief:no: + * -#step1: Class.forName("OneInterface", false, OneInterface.class.getClassLoader()) and clazz.getField to get field f + * of OneInterface. + * -#step2: Call method f.setDouble(null), OneInterface is initialized. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ClassInitFieldSetDoubleInterface.java + *- @ExecuteClass: ClassInitFieldSetDoubleInterface + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ClassInitFieldSetDoubleInterface { + static StringBuffer result = new StringBuffer(""); + + public static void main(String[] args) { + try { + Class clazz = Class.forName("OneInterface", false, OneInterface.class.getClassLoader()); + Field f = clazz.getField("hiDouble"); + if (result.toString().compareTo("") == 0) { + f.setDouble(null, 0.265874); + } + } catch (IllegalAccessException e) { + result.append("IllegalAccessException"); + } catch (Exception e) { + System.out.println(e); + } + + if (result.toString().compareTo("OneIllegalAccessException") == 0) { + System.out.println(0); + return; + } else { + System.out.println(2); + return; + } + } +} + +interface SuperInterface { + String aSuper = ClassInitFieldSetDoubleInterface.result.append("Super").toString(); +} + +@A +interface OneInterface extends SuperInterface { + String aOne = ClassInitFieldSetDoubleInterface.result.append("One").toString(); + double hiDouble = 0.1532; +} + +interface TwoInterface extends OneInterface { + String aTwo = ClassInitFieldSetDoubleInterface.result.append("Two").toString(); +} + +@interface A { + String aA = ClassInitFieldSetDoubleInterface.result.append("Annotation").toString(); +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0001-rt-String-StmtTest01/StmtTest01.java b/test/testsuite/ouroboros/stmtpre_test/RT0001-rt-String-StmtTest01/StmtTest01.java index ac4990fcb1a83d4c39593ee85e984a73e43652ed..882dc283de4d090d64f367e53c528ac252f58964 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0001-rt-String-StmtTest01/StmtTest01.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0001-rt-String-StmtTest01/StmtTest01.java @@ -1,51 +1,51 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest01 - *- @TestCaseName: StmtTest01 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief:在同一个函数统一分支中出现的字符串常量冗余时,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 - * -#step1: 创建一个函数,在该函数中反复调用一个特定的字符串常量做相关操作; - * -#step2: 在main行数用if-else创造两个互斥分支。 - * -#step3: 校验中间文件SmtmTest01.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:3次。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: StmtTest01.java - *- @ExecuteClass: StmtTest01 - *- @ExecuteArgs: - */ - -public class StmtTest01 { - public static void main(String[] args) { - if (test()) { - System.out.println("ExpectResult"); // 1 - } else { - String string = "ExpectResult" + "ExpectResult"; // 2 - System.out.println(string); - } - } - - // 基础的测试 - private static boolean test() { - String string = "A"; // 3 - for (int ii = 0; ii < 100; ii++) { - string += "A"; - } - return string.length() == 101; //true; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest01 + *- @TestCaseName: StmtTest01 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief:在同一个函数统一分支中出现的字符串常量冗余时,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 + * -#step1: 创建一个函数,在该函数中反复调用一个特定的字符串常量做相关操作; + * -#step2: 在main行数用if-else创造两个互斥分支。 + * -#step3: 校验中间文件SmtmTest01.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:3次。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: StmtTest01.java + *- @ExecuteClass: StmtTest01 + *- @ExecuteArgs: + */ + +public class StmtTest01 { + public static void main(String[] args) { + if (test()) { + System.out.println("ExpectResult"); // 1 + } else { + String string = "ExpectResult" + "ExpectResult"; // 2 + System.out.println(string); + } + } + + // 基础的测试 + private static boolean test() { + String string = "A"; // 3 + for (int ii = 0; ii < 100; ii++) { + string += "A"; + } + return string.length() == 101; //true; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0002-rt-String-StmtTest02/StmtTest02.java b/test/testsuite/ouroboros/stmtpre_test/RT0002-rt-String-StmtTest02/StmtTest02.java index a7681216ede194cc0f22207e291cf3462a81e416..a203b479ce6afd5ce0f9607db1f525be0b752366 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0002-rt-String-StmtTest02/StmtTest02.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0002-rt-String-StmtTest02/StmtTest02.java @@ -1,60 +1,60 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest02 - *- @TestCaseName: StmtTest02 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief:在同一个函数同一个分支中出现的字符串常量冗余,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。涉及到另外函数调用时,不会做该优化 - * -#step1: 创建一个函数,在该函数中反复调用一个特定的字符串常量做相关操作;再起另一个函数调用该函数,在这个函数中也有该常量字符串的操作。 - * -#step2: 在main行数用if-else创造两个互斥分支。 - * -#step3: 校验中间文件SmtmTest02.VtableImpl.mpl中callassigned &MCC_GetOrInsertLiteral出现的次数:4次。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: StmtTest02.java - *- @ExecuteClass: StmtTest02 - *- @ExecuteArgs: - */ - -public class StmtTest02 { - public static void main(String[] args) { - if (test1()) { - System.out.println("ExpectResult"); // 1 - } else { - System.out.println("ExpectResult " + "ExpectResult"); // 2 - } - } - - // 基础的测试 - private static boolean test() { - String string = "A"; // 3 - for (int ii = 0; ii < 100; ii++) { - string += "A"; - } - return string.length() == 101; //true; - } - - // 有函数调用,确认 - private static boolean test1() { - String str1 = "A" + "A"; // 4 - String str2 = "A" + "A"; - if (test() == true) { - str2 = str1; - } - return str1 == str1; //true - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest02 + *- @TestCaseName: StmtTest02 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief:在同一个函数同一个分支中出现的字符串常量冗余,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。涉及到另外函数调用时,不会做该优化 + * -#step1: 创建一个函数,在该函数中反复调用一个特定的字符串常量做相关操作;再起另一个函数调用该函数,在这个函数中也有该常量字符串的操作。 + * -#step2: 在main行数用if-else创造两个互斥分支。 + * -#step3: 校验中间文件SmtmTest02.VtableImpl.mpl中callassigned &MCC_GetOrInsertLiteral出现的次数:4次。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: StmtTest02.java + *- @ExecuteClass: StmtTest02 + *- @ExecuteArgs: + */ + +public class StmtTest02 { + public static void main(String[] args) { + if (test1()) { + System.out.println("ExpectResult"); // 1 + } else { + System.out.println("ExpectResult " + "ExpectResult"); // 2 + } + } + + // 基础的测试 + private static boolean test() { + String string = "A"; // 3 + for (int ii = 0; ii < 100; ii++) { + string += "A"; + } + return string.length() == 101; //true; + } + + // 有函数调用,确认 + private static boolean test1() { + String str1 = "A" + "A"; // 4 + String str2 = "A" + "A"; + if (test() == true) { + str2 = str1; + } + return str1 == str1; //true + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0003-rt-String-StmtTest03/StmtTest03.java b/test/testsuite/ouroboros/stmtpre_test/RT0003-rt-String-StmtTest03/StmtTest03.java index ac72f648aacba61190b31022a25d563ab04264de..fb3704345bf69b1c73b9caf1d86e77efe8e1be28 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0003-rt-String-StmtTest03/StmtTest03.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0003-rt-String-StmtTest03/StmtTest03.java @@ -1,52 +1,52 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest03 - *- @TestCaseName: StmtTest03 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief:涉及接口实现的场景下,在同一个函数同一分支中出现的字符串常量,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 - * -#step1: 创建一个实现接口的类,在该类中实现接口中的函数test(),在该函数中反复调用一个特定的字符串常量做相关操作; - * -#step2: 在main行数用if-else创造两个互斥分支。 - * -#step3: 校验中间文件SmtmTest03.VtableImpl.s中callassigned &MCC_GetOrInsertLiteral出现的次数:3次。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: StmtTest03.java - *- @ExecuteClass: StmtTest03 - *- @ExecuteArgs: - */ - -interface Interface { - boolean test(); -} - -public class StmtTest03 implements Interface { - public static void main(String[] args) { - if (new StmtTest03().test()) { - System.out.println("ExpectResult"); // 1 - } else { - System.out.println("ExpectResult " + "ExpectResult"); // 2 - } - } - - // 实现接口 - public boolean test() { - String str1 = "A" + "A"; // 3 - String str2 = "A" + "A"; - return str1 == str2; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest03 + *- @TestCaseName: StmtTest03 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief:涉及接口实现的场景下,在同一个函数同一分支中出现的字符串常量,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 + * -#step1: 创建一个实现接口的类,在该类中实现接口中的函数test(),在该函数中反复调用一个特定的字符串常量做相关操作; + * -#step2: 在main行数用if-else创造两个互斥分支。 + * -#step3: 校验中间文件SmtmTest03.VtableImpl.s中callassigned &MCC_GetOrInsertLiteral出现的次数:3次。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: StmtTest03.java + *- @ExecuteClass: StmtTest03 + *- @ExecuteArgs: + */ + +interface Interface { + boolean test(); +} + +public class StmtTest03 implements Interface { + public static void main(String[] args) { + if (new StmtTest03().test()) { + System.out.println("ExpectResult"); // 1 + } else { + System.out.println("ExpectResult " + "ExpectResult"); // 2 + } + } + + // 实现接口 + public boolean test() { + String str1 = "A" + "A"; // 3 + String str2 = "A" + "A"; + return str1 == str2; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0004-rt-String-StmtTest04/StmtTest04.java b/test/testsuite/ouroboros/stmtpre_test/RT0004-rt-String-StmtTest04/StmtTest04.java index 48007205e7fcbe0a2d602ca619c3262515e411c7..7adf6d7cd2f405b7bfe44a03229c1ebfe997385a 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0004-rt-String-StmtTest04/StmtTest04.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0004-rt-String-StmtTest04/StmtTest04.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest04 - *- @TestCaseName: StmtTest04 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief:在继承的场景下,在同一个函数中出现的字符串常量,只需要调用runtime的MCC_GetOrInsertLiteral函数只会为该字符串常量调用一次。 - * -#step1: 创建一个有父类的类,在该类中父类中的函数test1(),在该函数中调用一个特定的字符串常量做相关操作; - * -#step2: 在main行数用if-else创造两个互斥分支。 - * -#step3: 校验中间文件SmtmTest04.VtableImpl.s中callassigned &MCC_GetOrInsertLiteral出现的次数:4次。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: StmtTest04.java - *- @ExecuteClass: StmtTest04 - *- @ExecuteArgs: - */ - -class Father { - public String name; - - public boolean test1() { - String str1 = "A" + "A"; // 1 - String str2 = "A" + "A"; - return str1 == str2; // false; - } -} - -public class StmtTest04 extends Father { - public String name; - - public static void main(String[] args) { - Father father = new StmtTest04(); - father.name = "ExpectResult"; // 2 - if (father.test1()) { - System.out.println("ExpectResult"); - } else { - System.out.println("ExpectResult" + " " + "ExpectResult"); // 4 - } - } - - // 集成父类 - @Override - public boolean test1() { - String str1 = "A" + "A"; // 3 - String str2 = "A" + "A"; - return str1.equals(str2); // true; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest04 + *- @TestCaseName: StmtTest04 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief:在继承的场景下,在同一个函数中出现的字符串常量,只需要调用runtime的MCC_GetOrInsertLiteral函数只会为该字符串常量调用一次。 + * -#step1: 创建一个有父类的类,在该类中父类中的函数test1(),在该函数中调用一个特定的字符串常量做相关操作; + * -#step2: 在main行数用if-else创造两个互斥分支。 + * -#step3: 校验中间文件SmtmTest04.VtableImpl.s中callassigned &MCC_GetOrInsertLiteral出现的次数:4次。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: StmtTest04.java + *- @ExecuteClass: StmtTest04 + *- @ExecuteArgs: + */ + +class Father { + public String name; + + public boolean test1() { + String str1 = "A" + "A"; // 1 + String str2 = "A" + "A"; + return str1 == str2; // false; + } +} + +public class StmtTest04 extends Father { + public String name; + + public static void main(String[] args) { + Father father = new StmtTest04(); + father.name = "ExpectResult"; // 2 + if (father.test1()) { + System.out.println("ExpectResult"); + } else { + System.out.println("ExpectResult" + " " + "ExpectResult"); // 4 + } + } + + // 集成父类 + @Override + public boolean test1() { + String str1 = "A" + "A"; // 3 + String str2 = "A" + "A"; + return str1.equals(str2); // true; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0005-rt-String-StmtTest05/StmtTest05.java b/test/testsuite/ouroboros/stmtpre_test/RT0005-rt-String-StmtTest05/StmtTest05.java index ec84880051cebac210af9a379fd687900cdf8fdc..ef3ebdb0ff92b06f84759817a5ff16ba47454266 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0005-rt-String-StmtTest05/StmtTest05.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0005-rt-String-StmtTest05/StmtTest05.java @@ -1,54 +1,54 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest05 - *- @TestCaseName: StmtTest05 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief:在同一个函数中,有Switch-多case分支时,在同一个数据流中出现的冗余字符串常量,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 - * -#step1: 在main行数用switch - case创造两个互斥分支。 - * -#step2: 校验中间文件StmtTest05.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:6次。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: StmtTest05.java - *- @ExecuteClass: StmtTest05 - *- @ExecuteArgs: - */ - -public class StmtTest05 { - public static void main(String[] args) { - String test = "TestStringForStmt"; // 1 - switch (test) { - case "TestStringForStmt33": // 6 - test = "TestStringForStmt01"; // 2 - break; - case "TestStringForStmt55": // 3 - test += "TestStringForStmt01"; // 4 - break; - default: - test = "TestStringForStmt"; - break; - } - - String output = "ExpectResult"; // 5 - if (test == "TestStringForStmt") { - System.out.println(output); - } else { - System.out.print("ExpectResult"); - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest05 + *- @TestCaseName: StmtTest05 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief:在同一个函数中,有Switch-多case分支时,在同一个数据流中出现的冗余字符串常量,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 + * -#step1: 在main行数用switch - case创造两个互斥分支。 + * -#step2: 校验中间文件StmtTest05.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:6次。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: StmtTest05.java + *- @ExecuteClass: StmtTest05 + *- @ExecuteArgs: + */ + +public class StmtTest05 { + public static void main(String[] args) { + String test = "TestStringForStmt"; // 1 + switch (test) { + case "TestStringForStmt33": // 6 + test = "TestStringForStmt01"; // 2 + break; + case "TestStringForStmt55": // 3 + test += "TestStringForStmt01"; // 4 + break; + default: + test = "TestStringForStmt"; + break; + } + + String output = "ExpectResult"; // 5 + if (test == "TestStringForStmt") { + System.out.println(output); + } else { + System.out.print("ExpectResult"); + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0006-rt-String-StmtTest06/StmtTest06.java b/test/testsuite/ouroboros/stmtpre_test/RT0006-rt-String-StmtTest06/StmtTest06.java index e5590640b78be22842a23ef3c1bdd17d75824943..053eccda2541734589e52b244c7c8808de3343a0 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0006-rt-String-StmtTest06/StmtTest06.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0006-rt-String-StmtTest06/StmtTest06.java @@ -1,57 +1,57 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest06 - *- @TestCaseName: StmtTest06 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief:在同一个函数中,有try-多catch分支时,在同一个数据流中出现的冗余字符串常量,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 - * -#step1: 在main行数用stry-多catch创造两个互斥分支 - * -#step2: 校验中间文件StmtTest06.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:3次。 - *- @Expect:123#\n - *- @Priority: High - *- @Source: StmtTest06.java - *- @ExecuteClass: StmtTest06 - *- @ExecuteArgs: - */ - -public class StmtTest06 { - public static void main(String[] argv) { - int result = 2; - boolean check; - String str = "123#"; // 1 - try { - Integer.parseInt(str); - } catch (NumberFormatException e) { - str = "123#456"; // 2 - result--; - } catch (NullPointerException e) { - str = "123456"; // 3 - result = 2; - } catch (OutOfMemoryError e) { - str += "123#456"; // 被外提 - result = 2; - } finally { - check = str == "123#456"; - result--; - } - if (check == true && result == 0) { - System.out.println("123#"); - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest06 + *- @TestCaseName: StmtTest06 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief:在同一个函数中,有try-多catch分支时,在同一个数据流中出现的冗余字符串常量,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 + * -#step1: 在main行数用stry-多catch创造两个互斥分支 + * -#step2: 校验中间文件StmtTest06.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:3次。 + *- @Expect:123#\n + *- @Priority: High + *- @Source: StmtTest06.java + *- @ExecuteClass: StmtTest06 + *- @ExecuteArgs: + */ + +public class StmtTest06 { + public static void main(String[] argv) { + int result = 2; + boolean check; + String str = "123#"; // 1 + try { + Integer.parseInt(str); + } catch (NumberFormatException e) { + str = "123#456"; // 2 + result--; + } catch (NullPointerException e) { + str = "123456"; // 3 + result = 2; + } catch (OutOfMemoryError e) { + str += "123#456"; // 被外提 + result = 2; + } finally { + check = str == "123#456"; + result--; + } + if (check == true && result == 0) { + System.out.println("123#"); + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 123#\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0007-rt-String-StmtTest07/StmtTest07.java b/test/testsuite/ouroboros/stmtpre_test/RT0007-rt-String-StmtTest07/StmtTest07.java index 74e166c34aed1d6ead4eb3ef2ac6df60c95970b8..4e0fcbee3175153c79479873d54829b5b1bd4aca 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0007-rt-String-StmtTest07/StmtTest07.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0007-rt-String-StmtTest07/StmtTest07.java @@ -1,69 +1,69 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest07 - *- @TestCaseName: StmtTest07 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief: 在同一个函数统一分支(try{For循环嵌套}catch{})中出现的字符串常量冗余时,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 - * -#step1: 在test()函数用for多层嵌套、try-多catch创造for嵌套和互斥分支,并冗余使用字符串常量 - * -#step2: 校验中间文件SmtmTest07.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:4次。 - *- @Expect:AA\nExpectResult\n - *- @Priority: High - *- @Source: StmtTest07.java - *- @ExecuteClass: StmtTest07 - *- @ExecuteArgs: - */ - -public class StmtTest07 { - public static void main(String[] args) { - if (test()) { - System.out.println("ExpectResult"); // 1 - } else { - String string = "ExpectResult" + "ExpectResult"; // 2 - System.out.println(string); - } - } - - // 基础的测试for循环嵌套 - private static boolean test() { - String string = "AA"; // 3 - for (int ii = 0; ii < 10; ii++) { - string = "AA"; - for (int jj = 0; jj < 10; jj++) { - for (int kk = 0; kk < 2; kk++) { - string += "AA"; - } - } - } - try { - string = "AA"; - for (int jj = 0; jj < 10; jj++) { - for (int ii = 0; ii < getInt(); ii++) { - string += "123"; // 4 - } - } - } catch (ArithmeticException a) { - System.out.println(string); - } - return string.length() == 2; //true; - } - - private static int getInt() { - return 1 / 0; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest07 + *- @TestCaseName: StmtTest07 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief: 在同一个函数统一分支(try{For循环嵌套}catch{})中出现的字符串常量冗余时,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 + * -#step1: 在test()函数用for多层嵌套、try-多catch创造for嵌套和互斥分支,并冗余使用字符串常量 + * -#step2: 校验中间文件SmtmTest07.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:4次。 + *- @Expect:AA\nExpectResult\n + *- @Priority: High + *- @Source: StmtTest07.java + *- @ExecuteClass: StmtTest07 + *- @ExecuteArgs: + */ + +public class StmtTest07 { + public static void main(String[] args) { + if (test()) { + System.out.println("ExpectResult"); // 1 + } else { + String string = "ExpectResult" + "ExpectResult"; // 2 + System.out.println(string); + } + } + + // 基础的测试for循环嵌套 + private static boolean test() { + String string = "AA"; // 3 + for (int ii = 0; ii < 10; ii++) { + string = "AA"; + for (int jj = 0; jj < 10; jj++) { + for (int kk = 0; kk < 2; kk++) { + string += "AA"; + } + } + } + try { + string = "AA"; + for (int jj = 0; jj < 10; jj++) { + for (int ii = 0; ii < getInt(); ii++) { + string += "123"; // 4 + } + } + } catch (ArithmeticException a) { + System.out.println(string); + } + return string.length() == 2; //true; + } + + private static int getInt() { + return 1 / 0; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan AA\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0008-rt-String-StmtTest08/StmtTest08.java b/test/testsuite/ouroboros/stmtpre_test/RT0008-rt-String-StmtTest08/StmtTest08.java index 613f9b30450734d64af518e6e9aef0cfb5c1546f..456241a7e35e237976c1dddda6c1acf3e769d95d 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0008-rt-String-StmtTest08/StmtTest08.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0008-rt-String-StmtTest08/StmtTest08.java @@ -1,71 +1,71 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest08 - *- @TestCaseName: StmtTest08 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief: 在同一个函数统一分支if-else多分支中出现的字符串常量冗余时,同一数据流里的冗余字符串常量只需要为该字符串常量才会调用一次runtime的MCC_GetOrInsertLiteral函数。 - * -#step1: 在test1()函数有多层if-else分支,并冗余使用字符串常量 - * -#step2: 校验中间文件StmtTest08.VtableImpl.mpl中callassigned &MCC_GetOrInsertLiteral出现的次数:7次。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: StmtTest08.java - *- @ExecuteClass: StmtTest08 - *- @ExecuteArgs: - */ - -public class StmtTest08 { - public static void main(String[] args) { - if (test1() == false) { - System.out.println("ExpectResult"); // 1 - } else { - System.out.println("ExpectResult " + "ExpectResult"); // 2 - } - } - - // 基础的测试 - private static boolean test() { - String string = "A"; // 3 - for (int ii = 0; ii < 100; ii++) { - string += "A"; - } - return string.length() == 101; //true; - } - - // 有函数调用,确认 - private static boolean test1() { - String str1 = "AA"; // 4 - String str2; - if (test() == true) { - str2 = str1; - if (str2 == "AA") { - str2 = str2.substring(0, 1); - } else { - str1 = "AAA"; // 5 - } - } else { - str2 = "A"; // 6 - if (str2.equals("AA")) { - str2 = str2.substring(0, 1); - } else { - str1 = "AAA"; // 7 - } - } - return str2 == str1; //true - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest08 + *- @TestCaseName: StmtTest08 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief: 在同一个函数统一分支if-else多分支中出现的字符串常量冗余时,同一数据流里的冗余字符串常量只需要为该字符串常量才会调用一次runtime的MCC_GetOrInsertLiteral函数。 + * -#step1: 在test1()函数有多层if-else分支,并冗余使用字符串常量 + * -#step2: 校验中间文件StmtTest08.VtableImpl.mpl中callassigned &MCC_GetOrInsertLiteral出现的次数:7次。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: StmtTest08.java + *- @ExecuteClass: StmtTest08 + *- @ExecuteArgs: + */ + +public class StmtTest08 { + public static void main(String[] args) { + if (test1() == false) { + System.out.println("ExpectResult"); // 1 + } else { + System.out.println("ExpectResult " + "ExpectResult"); // 2 + } + } + + // 基础的测试 + private static boolean test() { + String string = "A"; // 3 + for (int ii = 0; ii < 100; ii++) { + string += "A"; + } + return string.length() == 101; //true; + } + + // 有函数调用,确认 + private static boolean test1() { + String str1 = "AA"; // 4 + String str2; + if (test() == true) { + str2 = str1; + if (str2 == "AA") { + str2 = str2.substring(0, 1); + } else { + str1 = "AAA"; // 5 + } + } else { + str2 = "A"; // 6 + if (str2.equals("AA")) { + str2 = str2.substring(0, 1); + } else { + str1 = "AAA"; // 7 + } + } + return str2 == str1; //true + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0009-rt-String-StmtTest09/StmtTest09.java b/test/testsuite/ouroboros/stmtpre_test/RT0009-rt-String-StmtTest09/StmtTest09.java index d20a858e977786bef2bc38c524998e63c4a1eb62..a0b41d851a73411fc2bf808e93c90162313c1449 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0009-rt-String-StmtTest09/StmtTest09.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0009-rt-String-StmtTest09/StmtTest09.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest09 - *- @TestCaseName: StmtTest09 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief: 在同一个函数同一个分支(多层switch嵌套)中出现的字符串常量冗余,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。涉及到函数调用时,不会做该优化 - * -#step1: 在main方法中函数有switch-多case分支,并冗余使用字符串常量 - * -#step2: 校验中间文件StmtTest09.VtableImpl.mpl中callassigned &MCC_GetOrInsertLiteral出现的次数:8次。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: StmtTest09.java - *- @ExecuteClass: StmtTest09 - *- @ExecuteArgs: - */ - -public class StmtTest09 { - public static void main(String[] args) { - String test = "TestStringForStmt"; // 1 - switch (test) { - case "TestStringForStmt33": // 2 - test = "TestStringForStmt01"; // 3 - break; - case "TestStringForStmt55": // 4 - test += "TestStringForStmt01"; // 其他优化导致"TestStringForStmt01"的地址调用外提到22行,所以与33行合用。 - break; - default: - switch (test) { - case "TestStringForStmt34": // 5 - test = "TestStringForStmt01"; // 其他优化导致"TestStringForStmt01"的地址调用外提到22行,所以与33行合用 - break; - case "TestStringForStmt35": // 6 - test += "TestStringForStmt01"; // 7 - break; - default: - test = "TestStringForStmt"; - break; - } - } - String output = "ExpectResult"; // 8、 - if (test == "TestStringForStmt") { - System.out.println(output); - } else { - System.out.print("ExpectResult"); - } - - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest09 + *- @TestCaseName: StmtTest09 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief: 在同一个函数同一个分支(多层switch嵌套)中出现的字符串常量冗余,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。涉及到函数调用时,不会做该优化 + * -#step1: 在main方法中函数有switch-多case分支,并冗余使用字符串常量 + * -#step2: 校验中间文件StmtTest09.VtableImpl.mpl中callassigned &MCC_GetOrInsertLiteral出现的次数:8次。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: StmtTest09.java + *- @ExecuteClass: StmtTest09 + *- @ExecuteArgs: + */ + +public class StmtTest09 { + public static void main(String[] args) { + String test = "TestStringForStmt"; // 1 + switch (test) { + case "TestStringForStmt33": // 2 + test = "TestStringForStmt01"; // 3 + break; + case "TestStringForStmt55": // 4 + test += "TestStringForStmt01"; // 其他优化导致"TestStringForStmt01"的地址调用外提到22行,所以与33行合用。 + break; + default: + switch (test) { + case "TestStringForStmt34": // 5 + test = "TestStringForStmt01"; // 其他优化导致"TestStringForStmt01"的地址调用外提到22行,所以与33行合用 + break; + case "TestStringForStmt35": // 6 + test += "TestStringForStmt01"; // 7 + break; + default: + test = "TestStringForStmt"; + break; + } + } + String output = "ExpectResult"; // 8、 + if (test == "TestStringForStmt") { + System.out.println(output); + } else { + System.out.print("ExpectResult"); + } + + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0010-rt-String-StmtTest10/StmtTest10.java b/test/testsuite/ouroboros/stmtpre_test/RT0010-rt-String-StmtTest10/StmtTest10.java index 87e94738fa6af7d1b13ae7fb3aa9acf3dda62fc1..965ad8558cee4da459b1715bac77516b2cad2641 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0010-rt-String-StmtTest10/StmtTest10.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0010-rt-String-StmtTest10/StmtTest10.java @@ -1,73 +1,73 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest10 - *- @TestCaseName: StmtTest10 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief: 在同一个函数同一个分支(多层try-多cathc嵌套)中出现的字符串常量冗余,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。涉及到函数调用时,不会做该优化 - * -#step1: 在main方法中函数有两层try-多catch分支,并冗余使用字符串常量 - * -#step2: 校验中间文件StmtTest10.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:4次。 - * 注:"123#456"的函数调用会外提,因此在实际的中间代码里出现的次数是4次。 - *- @Expect:123#\n - *- @Priority: High - *- @Source: StmtTest10.java - *- @ExecuteClass: StmtTest10 - *- @ExecuteArgs: - */ - -public class StmtTest10 { - public static void main(String[] argv) { - int result = 2; - boolean check; - String str = "123#"; // 1 - try { - str = "123456"; // 2 - try { - Integer.parseInt(str); - } catch (NumberFormatException e) { - str = "123#456"; // 3 - result--; - } catch (NullPointerException e) { - str = "123456#"; // 4 - result = 2; - } catch (OutOfMemoryError e) { - str += "123#456"; // 与32行被其他优化了 - result = 2; - } finally { - str = "123#456"; - } - Integer.parseInt(str); - } catch (NumberFormatException e) { - str = "123#456"; - result--; - } catch (NullPointerException e) { - str = "123456"; - result = 2; - } catch (OutOfMemoryError e) { - str += "123#456"; - result = 2; - } finally { - check = str == "123#456"; - result--; - } - if (check == true && result == 0) { - System.out.println("123#"); - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest10 + *- @TestCaseName: StmtTest10 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief: 在同一个函数同一个分支(多层try-多cathc嵌套)中出现的字符串常量冗余,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。涉及到函数调用时,不会做该优化 + * -#step1: 在main方法中函数有两层try-多catch分支,并冗余使用字符串常量 + * -#step2: 校验中间文件StmtTest10.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:4次。 + * 注:"123#456"的函数调用会外提,因此在实际的中间代码里出现的次数是4次。 + *- @Expect:123#\n + *- @Priority: High + *- @Source: StmtTest10.java + *- @ExecuteClass: StmtTest10 + *- @ExecuteArgs: + */ + +public class StmtTest10 { + public static void main(String[] argv) { + int result = 2; + boolean check; + String str = "123#"; // 1 + try { + str = "123456"; // 2 + try { + Integer.parseInt(str); + } catch (NumberFormatException e) { + str = "123#456"; // 3 + result--; + } catch (NullPointerException e) { + str = "123456#"; // 4 + result = 2; + } catch (OutOfMemoryError e) { + str += "123#456"; // 与32行被其他优化了 + result = 2; + } finally { + str = "123#456"; + } + Integer.parseInt(str); + } catch (NumberFormatException e) { + str = "123#456"; + result--; + } catch (NullPointerException e) { + str = "123456"; + result = 2; + } catch (OutOfMemoryError e) { + str += "123#456"; + result = 2; + } finally { + check = str == "123#456"; + result--; + } + if (check == true && result == 0) { + System.out.println("123#"); + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 123#\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0011-rt-String-StmtTest11/StmtTest11.java b/test/testsuite/ouroboros/stmtpre_test/RT0011-rt-String-StmtTest11/StmtTest11.java index a2f36952f0ffb798c49fc8f4f412f380ea100584..9945063d5ddf1d34e6bb4d3a8f118a380c1fd6fb 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0011-rt-String-StmtTest11/StmtTest11.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0011-rt-String-StmtTest11/StmtTest11.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest11 - *- @TestCaseName: StmtTest11 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief: 在同一个函数同一数据流分支(For/If-else/try-catch/switch-case)中出现的字符串常量冗余时,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 - * -#step1: 在main方法中函数有try-catch/switch-case/if-else嵌套使用,并冗余使用字符串常量 - * -#step2: 校验中间文件StmtTest11.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:6次。 - *- @Expect:AB\nExpectResult\n - *- @Priority: High - *- @Source: StmtTest11.java - *- @ExecuteClass: StmtTest11 - *- @ExecuteArgs: - */ - -public class StmtTest11 { - public static void main(String[] args) { - if (test()) { - System.out.println("ExpectResult"); // 1 - } else { - String string = "ExpectResultExpectResult"; // 2 - System.out.println(string); - } - } - - // 基础的测试for循环嵌套 - private static boolean test() { - String string = "AA"; // 3 - try { - string = "AB"; // 4 - if (string.length() == 2) { - for (int jj = 0; jj < 10; jj++) { - for (int ii = 0; ii < getInt(); ii++) { - string += "123"; // 5,被外提 - } - } - } else { - switch (string) { - case "A": // 6 - string = "123"; //被外提 - break; - case "AA": - string = "A"; - break; - default: - break; - } - } - } catch (ArithmeticException a) { - System.out.println(string); - } - return string.length() == 2; //true; - } - - private static int getInt() { - return 1 / 0; - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest11 + *- @TestCaseName: StmtTest11 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief: 在同一个函数同一数据流分支(For/If-else/try-catch/switch-case)中出现的字符串常量冗余时,只需要为该字符串常量调用一次runtime的MCC_GetOrInsertLiteral函数。 + * -#step1: 在main方法中函数有try-catch/switch-case/if-else嵌套使用,并冗余使用字符串常量 + * -#step2: 校验中间文件StmtTest11.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:6次。 + *- @Expect:AB\nExpectResult\n + *- @Priority: High + *- @Source: StmtTest11.java + *- @ExecuteClass: StmtTest11 + *- @ExecuteArgs: + */ + +public class StmtTest11 { + public static void main(String[] args) { + if (test()) { + System.out.println("ExpectResult"); // 1 + } else { + String string = "ExpectResultExpectResult"; // 2 + System.out.println(string); + } + } + + // 基础的测试for循环嵌套 + private static boolean test() { + String string = "AA"; // 3 + try { + string = "AB"; // 4 + if (string.length() == 2) { + for (int jj = 0; jj < 10; jj++) { + for (int ii = 0; ii < getInt(); ii++) { + string += "123"; // 5,被外提 + } + } + } else { + switch (string) { + case "A": // 6 + string = "123"; //被外提 + break; + case "AA": + string = "A"; + break; + default: + break; + } + } + } catch (ArithmeticException a) { + System.out.println(string); + } + return string.length() == 2; //true; + } + + private static int getInt() { + return 1 / 0; + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan AB\nExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0013-rt-String-StmtTest13/StmtTest13.java b/test/testsuite/ouroboros/stmtpre_test/RT0013-rt-String-StmtTest13/StmtTest13.java index 92a72641cd117b5b355de2609240a3063bacf036..e727db8ddc0906590efe5f945f2b7f28e570f72f 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0013-rt-String-StmtTest13/StmtTest13.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0013-rt-String-StmtTest13/StmtTest13.java @@ -1,52 +1,52 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest13 - *- @TestCaseName: StmtTest13 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief: 字符串常量在字符串常量池中,引用变量拼接和new出来的在堆上,不会做该优化,实例变量上的字符串常量不参与常量。 - * -#step1: 校验中间文件StmtTest13.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:3次。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: StmtTest13.java - *- @ExecuteClass: StmtTest13 - *- @ExecuteArgs: - */ - -public class StmtTest13 { - private String outOfMethod = "AB"; //3 - - public static void main(String[] args) { - String string = "AB"; // 1 - for (int ii = 0; ii < 10; ii++) { - string += "A" + "B"; - } - if (string.length() == 22) { - string = "AB"; //此处在堆上分配内存,不会用第22行的伪寄存器地址 - } else { - char[] chars = {'A', 'B'}; - string = chars.toString(); - } - if (string.equals(new StmtTest13().outOfMethod)) { - System.out.println("ExpectResult"); // 2 - } else { - System.out.print("ExpectResult"); //优化外提,这边不会再取一次。 - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest13 + *- @TestCaseName: StmtTest13 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief: 字符串常量在字符串常量池中,引用变量拼接和new出来的在堆上,不会做该优化,实例变量上的字符串常量不参与常量。 + * -#step1: 校验中间文件StmtTest13.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:3次。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: StmtTest13.java + *- @ExecuteClass: StmtTest13 + *- @ExecuteArgs: + */ + +public class StmtTest13 { + private String outOfMethod = "AB"; //3 + + public static void main(String[] args) { + String string = "AB"; // 1 + for (int ii = 0; ii < 10; ii++) { + string += "A" + "B"; + } + if (string.length() == 22) { + string = "AB"; //此处在堆上分配内存,不会用第22行的伪寄存器地址 + } else { + char[] chars = {'A', 'B'}; + string = chars.toString(); + } + if (string.equals(new StmtTest13().outOfMethod)) { + System.out.println("ExpectResult"); // 2 + } else { + System.out.print("ExpectResult"); //优化外提,这边不会再取一次。 + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/stmtpre_test/RT0014-rt-String-StmtTest14/StmtTest14.java b/test/testsuite/ouroboros/stmtpre_test/RT0014-rt-String-StmtTest14/StmtTest14.java index 7124309faf1d5af138db243d48485ddd02b8bada..689f4bd02725e1e2d137415e198b81a948fabbf1 100644 --- a/test/testsuite/ouroboros/stmtpre_test/RT0014-rt-String-StmtTest14/StmtTest14.java +++ b/test/testsuite/ouroboros/stmtpre_test/RT0014-rt-String-StmtTest14/StmtTest14.java @@ -1,50 +1,50 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_StmtTest13 - *- @TestCaseName: StmtTest13 - *- @TestCaseType: Function Testing - *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) - *- @Brief: 字符串常量在各种情况下出现冗余时,都应该用优化后的同一个伪寄存器地址。 - * -#step1: 校验中间文件StmtTest14.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:1次。 - *- @Expect:AB\n - *- @Priority: High - *- @Source: StmtTest14.java - *- @ExecuteClass: StmtTest14 - *- @ExecuteArgs: - */ - -import java.nio.charset.StandardCharsets; - -public class StmtTest14 { - public static void main(String[] args) { - String string = "AB"; // 1 - for (int ii = 0; ii < 10; ii++) { - string += "A" + "B"; // +号拼接场景 - } - if (string.length() == 22) { - string = "AB"; // 作为入参 - } else { - char[] chars = "AB".toCharArray(); // 作为函数调用主体 - string = chars.toString(); - } - byte[] bs = string.getBytes(); - string = new String(bs, StandardCharsets.US_ASCII); - System.out.println(string); - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_StmtTest13 + *- @TestCaseName: StmtTest13 + *- @TestCaseType: Function Testing + *- @RequirementName: Store PRE和Stmt PRE使能(store PRE 收益十分有限,先挂起) + *- @Brief: 字符串常量在各种情况下出现冗余时,都应该用优化后的同一个伪寄存器地址。 + * -#step1: 校验中间文件StmtTest14.VtableImpl.mpl中 callassigned &MCC_GetOrInsertLiteral出现的次数:1次。 + *- @Expect:AB\n + *- @Priority: High + *- @Source: StmtTest14.java + *- @ExecuteClass: StmtTest14 + *- @ExecuteArgs: + */ + +import java.nio.charset.StandardCharsets; + +public class StmtTest14 { + public static void main(String[] args) { + String string = "AB"; // 1 + for (int ii = 0; ii < 10; ii++) { + string += "A" + "B"; // +号拼接场景 + } + if (string.length() == 22) { + string = "AB"; // 作为入参 + } else { + char[] chars = "AB".toCharArray(); // 作为函数调用主体 + string = chars.toString(); + } + byte[] bs = string.getBytes(); + string = new String(bs, StandardCharsets.US_ASCII); + System.out.println(string); + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan AB\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0001-rt-compiler-LiverangeSubsumeRCTest01/LiverangeSubsumeRCTest01.java b/test/testsuite/ouroboros/subsumeRC_test/RT0001-rt-compiler-LiverangeSubsumeRCTest01/LiverangeSubsumeRCTest01.java index 3d7a7adf6f9e10a221f9c29b706da30adae2226b..1cd31fe3a7ea03da01488a55184dd6e06b5719ac 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0001-rt-compiler-LiverangeSubsumeRCTest01/LiverangeSubsumeRCTest01.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0001-rt-compiler-LiverangeSubsumeRCTest01/LiverangeSubsumeRCTest01.java @@ -1,49 +1,49 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest01 - *- @TestCaseName: LiverangeSubsumeRCTest01 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1: 创建一个1个数组,先后用array1指针和array2指针指向了它; - * -#step2: 数组越界式的用一下这俩数组指针,第27行代码可以看出,array1指针存活状态包含了array2,所以array2的incref和decref都应该被优化掉。 - * -#step3: str1 和str2同时指向一个字符串,str1指针存活状态包含了str2,所以str2的incref和decref都应该被优化掉。 - * 校验中间文件LiverangeSubsumeRCTest01.VtableImpl.mpl中无IncRef - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest01.java - *- @ExecuteClass: LiverangeSubsumeRCTest01 - *- @ExecuteArgs: - */ - -public class LiverangeSubsumeRCTest01 { - public static void main(String[] args) { - int[] array1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - int[] array2 = array1; - String str1 = "ExpectResult"; - String str2 = str1; - try { - if (array2[10] == array1[10]) { - System.out.print(str2); // 错误输出 - } - } catch (Exception e) { - System.out.println(str1); - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest01 + *- @TestCaseName: LiverangeSubsumeRCTest01 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1: 创建一个1个数组,先后用array1指针和array2指针指向了它; + * -#step2: 数组越界式的用一下这俩数组指针,第27行代码可以看出,array1指针存活状态包含了array2,所以array2的incref和decref都应该被优化掉。 + * -#step3: str1 和str2同时指向一个字符串,str1指针存活状态包含了str2,所以str2的incref和decref都应该被优化掉。 + * 校验中间文件LiverangeSubsumeRCTest01.VtableImpl.mpl中无IncRef + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest01.java + *- @ExecuteClass: LiverangeSubsumeRCTest01 + *- @ExecuteArgs: + */ + +public class LiverangeSubsumeRCTest01 { + public static void main(String[] args) { + int[] array1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + int[] array2 = array1; + String str1 = "ExpectResult"; + String str2 = str1; + try { + if (array2[10] == array1[10]) { + System.out.print(str2); // 错误输出 + } + } catch (Exception e) { + System.out.println(str1); + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0002-rt-compiler-LiverangeSubsumeRCTest02/LiverangeSubsumeRCTest02.java b/test/testsuite/ouroboros/subsumeRC_test/RT0002-rt-compiler-LiverangeSubsumeRCTest02/LiverangeSubsumeRCTest02.java index 608192a6300765d7fb10b85884080e8398f7af66..c0c14d3a8285d4329dac8cead58740c90768e3fa 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0002-rt-compiler-LiverangeSubsumeRCTest02/LiverangeSubsumeRCTest02.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0002-rt-compiler-LiverangeSubsumeRCTest02/LiverangeSubsumeRCTest02.java @@ -1,47 +1,47 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest02 - *- @TestCaseName: LiverangeSubsumeRCTest02 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的不在某个生存区间内的存活状态时,不能去掉这个区间内的此对象的RC操作 - * -#step1: 创建一个1个数组,先后用array1指针和array2指针指向了它; - * -#step2: 数组越界式的用一下这俩数组指针,第29行代码可以看出,array1指针存活状态和array2相同,array2的incref和decref都能被优化掉。 - * -#step3: str1 和str2同时指向一个字符串,str1指针存活状态不能包含str2,所以str2的incref和decref都不能被优化掉。 - * 校验中间文件LiverangeSubsumeRCTest01.VtableImpl.mpl无IncRef - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest02.java - *- @ExecuteClass: LiverangeSubsumeRCTest02 - *- @ExecuteArgs: - */ -public class LiverangeSubsumeRCTest02 { - public static void main(String[] args) { - int[] array1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - int[] array2 = array1; - String str1 = "ExpectResult"; - String str2 = str1; //被优化掉了 - try { - if (array1[10] == array2[10]) { - System.out.print(str1); // 错误输出 - } - } catch (Exception e) { - System.out.println(str2); - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest02 + *- @TestCaseName: LiverangeSubsumeRCTest02 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的不在某个生存区间内的存活状态时,不能去掉这个区间内的此对象的RC操作 + * -#step1: 创建一个1个数组,先后用array1指针和array2指针指向了它; + * -#step2: 数组越界式的用一下这俩数组指针,第29行代码可以看出,array1指针存活状态和array2相同,array2的incref和decref都能被优化掉。 + * -#step3: str1 和str2同时指向一个字符串,str1指针存活状态不能包含str2,所以str2的incref和decref都不能被优化掉。 + * 校验中间文件LiverangeSubsumeRCTest01.VtableImpl.mpl无IncRef + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest02.java + *- @ExecuteClass: LiverangeSubsumeRCTest02 + *- @ExecuteArgs: + */ +public class LiverangeSubsumeRCTest02 { + public static void main(String[] args) { + int[] array1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + int[] array2 = array1; + String str1 = "ExpectResult"; + String str2 = str1; //被优化掉了 + try { + if (array1[10] == array2[10]) { + System.out.print(str1); // 错误输出 + } + } catch (Exception e) { + System.out.println(str2); + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0003-rt-compiler-LiverangeSubsumeRCTest03/LiverangeSubsumeRCTest03.java b/test/testsuite/ouroboros/subsumeRC_test/RT0003-rt-compiler-LiverangeSubsumeRCTest03/LiverangeSubsumeRCTest03.java index 32724f2340f613833d95bb42125408f40fbc6db8..4e2c3538075365edb662cdf074d3b7e71f20d2e0 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0003-rt-compiler-LiverangeSubsumeRCTest03/LiverangeSubsumeRCTest03.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0003-rt-compiler-LiverangeSubsumeRCTest03/LiverangeSubsumeRCTest03.java @@ -1,59 +1,59 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest03 - *- @TestCaseName: LiverangeSubsumeRCTest03 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1: 创建一个1个数组,先后用array1、array2、array3指针指向了它; - * -#step2: str1、str2和str3同时指向一个字符串,step1和step2里他们的生命周期都是按照这个流程来的: - * incref(array1) - * array2 = array1 incref优化掉 - * array3 = array2 incref优化掉 - * decref(array2) 优化掉 - * decref(array3) 优化掉 - * decref(array1) - * -#step3: - * 校验中间文件LiverangeSubsumeRCTest01.VtableImpl.mpl中无IncRef - *- @Expect:falsefalseExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest03.java - *- @ExecuteClass: LiverangeSubsumeRCTest03 - *- @ExecuteArgs: - */ - -public class LiverangeSubsumeRCTest03 { - public static void main(String[] args) { - int[] array1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - int[] array2 = array1; - int[] array3 = array2; - String str1 = "ExpectResult"; - String str2 = str1; - String str3 = str2; - boolean check = String.valueOf(array2[0]).equals(str2); // false - System.out.print(check); - check = String.valueOf(array3[1]) == str3; - System.out.print(check); // false - if (array1.length == 10) { - System.out.println(str1); - } else { - System.out.print(str1); // 错误输出,无换行符 - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest03 + *- @TestCaseName: LiverangeSubsumeRCTest03 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1: 创建一个1个数组,先后用array1、array2、array3指针指向了它; + * -#step2: str1、str2和str3同时指向一个字符串,step1和step2里他们的生命周期都是按照这个流程来的: + * incref(array1) + * array2 = array1 incref优化掉 + * array3 = array2 incref优化掉 + * decref(array2) 优化掉 + * decref(array3) 优化掉 + * decref(array1) + * -#step3: + * 校验中间文件LiverangeSubsumeRCTest01.VtableImpl.mpl中无IncRef + *- @Expect:falsefalseExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest03.java + *- @ExecuteClass: LiverangeSubsumeRCTest03 + *- @ExecuteArgs: + */ + +public class LiverangeSubsumeRCTest03 { + public static void main(String[] args) { + int[] array1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + int[] array2 = array1; + int[] array3 = array2; + String str1 = "ExpectResult"; + String str2 = str1; + String str3 = str2; + boolean check = String.valueOf(array2[0]).equals(str2); // false + System.out.print(check); + check = String.valueOf(array3[1]) == str3; + System.out.print(check); // false + if (array1.length == 10) { + System.out.println(str1); + } else { + System.out.print(str1); // 错误输出,无换行符 + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan falsefalseExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0004-rt-compiler-LiverangeSubsumeRCTest04/LiverangeSubsumeRCTest04.java b/test/testsuite/ouroboros/subsumeRC_test/RT0004-rt-compiler-LiverangeSubsumeRCTest04/LiverangeSubsumeRCTest04.java index 12349668f1686e4a63cb519923e124f38bde9c0d..0c12a8955e75567f89b74457171e2109b6ce7485 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0004-rt-compiler-LiverangeSubsumeRCTest04/LiverangeSubsumeRCTest04.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0004-rt-compiler-LiverangeSubsumeRCTest04/LiverangeSubsumeRCTest04.java @@ -1,286 +1,286 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest04 - *- @TestCaseName: LiverangeSubsumeRCTest04 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1: 构造是个类对象A1、A2、A3···A10,他们同时有实例变量同时指向一块内存地址b1; - * -#step2: b1的生命周期包含了这十个成员变量(A1···A10)的生命周期。代码51行--66行不再出现实例变量 - * -#step3: A1到A10的十个实例变量的incref和decRef都应该被优化掉都应该被优化掉。 - * 校验中间文件LiverangeSubsumeRCTest04.VtableImpl.mpl无IncRef。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest04.java - *- @ExecuteClass: LiverangeSubsumeRCTest04 - *- @ExecuteArgs: - */ - -public class LiverangeSubsumeRCTest04 { - - public static void main(String[] args) { - rc_testcase_main_wrapper(); - } - - private static void rc_testcase_main_wrapper() { - LiverangeSubsumeRCTest04_A1 a1_main = new LiverangeSubsumeRCTest04_A1("a1_main"); - LiverangeSubsumeRCTest04_A2 a2_main = new LiverangeSubsumeRCTest04_A2("a2_main"); - LiverangeSubsumeRCTest04_A3 a3_main = new LiverangeSubsumeRCTest04_A3("a3_main"); - LiverangeSubsumeRCTest04_A4 a4_main = new LiverangeSubsumeRCTest04_A4("a4_main"); - LiverangeSubsumeRCTest04_A5 a5_main = new LiverangeSubsumeRCTest04_A5("a5_main"); - LiverangeSubsumeRCTest04_A6 a6_main = new LiverangeSubsumeRCTest04_A6("a6_main"); - LiverangeSubsumeRCTest04_A7 a7_main = new LiverangeSubsumeRCTest04_A7("a7_main"); - LiverangeSubsumeRCTest04_A8 a8_main = new LiverangeSubsumeRCTest04_A8("a8_main"); - LiverangeSubsumeRCTest04_A9 a9_main = new LiverangeSubsumeRCTest04_A9("a9_main"); - LiverangeSubsumeRCTest04_A10 a10_main = new LiverangeSubsumeRCTest04_A10("a10_main"); - LiverangeSubsumeRCTest04_B1 b1 = new LiverangeSubsumeRCTest04_B1("b1_0"); - a1_main.b1_0 = b1; - a2_main.b1_0 = b1; - a3_main.b1_0 = b1; - a4_main.b1_0 = b1; - a5_main.b1_0 = b1; - a6_main.b1_0 = b1; - a7_main.b1_0 = b1; - a8_main.b1_0 = b1; - a9_main.b1_0 = b1; - a10_main.b1_0 = b1; - a1_main.add(); - a2_main.add(); - a3_main.add(); - a4_main.add(); - a5_main.add(); - a6_main.add(); - a7_main.add(); - a8_main.add(); - a9_main.add(); - a10_main.add(); - b1.add(); - int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a5_main.sum + a6_main.sum + a7_main.sum + a8_main.sum + a9_main.sum + a10_main.sum + b1.sum; - if (result == 3467) - System.out.println("ExpectResult"); - } -} - -class LiverangeSubsumeRCTest04_A1 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A1(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A1_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest04_A2 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A2(String strObjectName) { - b1_0 = null; - a = 102; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A2_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - - -class LiverangeSubsumeRCTest04_A3 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A3(String strObjectName) { - b1_0 = null; - a = 103; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A3_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest04_A4 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A4(String strObjectName) { - b1_0 = null; - a = 104; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A4_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest04_A5 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A5(String strObjectName) { - b1_0 = null; - a = 105; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A5_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - - -class LiverangeSubsumeRCTest04_A6 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A6(String strObjectName) { - b1_0 = null; - a = 106; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A6_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest04_A7 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A7(String strObjectName) { - b1_0 = null; - a = 107; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A7_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest04_A8 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A8(String strObjectName) { - b1_0 = null; - a = 108; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A8_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest04_A9 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A9(String strObjectName) { - b1_0 = null; - a = 109; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A9_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest04_A10 { - LiverangeSubsumeRCTest04_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_A10(String strObjectName) { - b1_0 = null; - a = 110; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_A10_"+strObjectName); - } - - void add() { - sum = a + b1_0.a; - } -} - - -class LiverangeSubsumeRCTest04_B1 { - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest04_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest04 + *- @TestCaseName: LiverangeSubsumeRCTest04 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1: 构造是个类对象A1、A2、A3···A10,他们同时有实例变量同时指向一块内存地址b1; + * -#step2: b1的生命周期包含了这十个成员变量(A1···A10)的生命周期。代码51行--66行不再出现实例变量 + * -#step3: A1到A10的十个实例变量的incref和decRef都应该被优化掉都应该被优化掉。 + * 校验中间文件LiverangeSubsumeRCTest04.VtableImpl.mpl无IncRef。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest04.java + *- @ExecuteClass: LiverangeSubsumeRCTest04 + *- @ExecuteArgs: + */ + +public class LiverangeSubsumeRCTest04 { + + public static void main(String[] args) { + rc_testcase_main_wrapper(); + } + + private static void rc_testcase_main_wrapper() { + LiverangeSubsumeRCTest04_A1 a1_main = new LiverangeSubsumeRCTest04_A1("a1_main"); + LiverangeSubsumeRCTest04_A2 a2_main = new LiverangeSubsumeRCTest04_A2("a2_main"); + LiverangeSubsumeRCTest04_A3 a3_main = new LiverangeSubsumeRCTest04_A3("a3_main"); + LiverangeSubsumeRCTest04_A4 a4_main = new LiverangeSubsumeRCTest04_A4("a4_main"); + LiverangeSubsumeRCTest04_A5 a5_main = new LiverangeSubsumeRCTest04_A5("a5_main"); + LiverangeSubsumeRCTest04_A6 a6_main = new LiverangeSubsumeRCTest04_A6("a6_main"); + LiverangeSubsumeRCTest04_A7 a7_main = new LiverangeSubsumeRCTest04_A7("a7_main"); + LiverangeSubsumeRCTest04_A8 a8_main = new LiverangeSubsumeRCTest04_A8("a8_main"); + LiverangeSubsumeRCTest04_A9 a9_main = new LiverangeSubsumeRCTest04_A9("a9_main"); + LiverangeSubsumeRCTest04_A10 a10_main = new LiverangeSubsumeRCTest04_A10("a10_main"); + LiverangeSubsumeRCTest04_B1 b1 = new LiverangeSubsumeRCTest04_B1("b1_0"); + a1_main.b1_0 = b1; + a2_main.b1_0 = b1; + a3_main.b1_0 = b1; + a4_main.b1_0 = b1; + a5_main.b1_0 = b1; + a6_main.b1_0 = b1; + a7_main.b1_0 = b1; + a8_main.b1_0 = b1; + a9_main.b1_0 = b1; + a10_main.b1_0 = b1; + a1_main.add(); + a2_main.add(); + a3_main.add(); + a4_main.add(); + a5_main.add(); + a6_main.add(); + a7_main.add(); + a8_main.add(); + a9_main.add(); + a10_main.add(); + b1.add(); + int result = a1_main.sum + a2_main.sum + a3_main.sum + a4_main.sum + a5_main.sum + a6_main.sum + a7_main.sum + a8_main.sum + a9_main.sum + a10_main.sum + b1.sum; + if (result == 3467) + System.out.println("ExpectResult"); + } +} + +class LiverangeSubsumeRCTest04_A1 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A1(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A1_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest04_A2 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A2(String strObjectName) { + b1_0 = null; + a = 102; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A2_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + + +class LiverangeSubsumeRCTest04_A3 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A3(String strObjectName) { + b1_0 = null; + a = 103; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A3_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest04_A4 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A4(String strObjectName) { + b1_0 = null; + a = 104; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A4_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest04_A5 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A5(String strObjectName) { + b1_0 = null; + a = 105; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A5_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + + +class LiverangeSubsumeRCTest04_A6 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A6(String strObjectName) { + b1_0 = null; + a = 106; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A6_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest04_A7 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A7(String strObjectName) { + b1_0 = null; + a = 107; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A7_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest04_A8 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A8(String strObjectName) { + b1_0 = null; + a = 108; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A8_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest04_A9 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A9(String strObjectName) { + b1_0 = null; + a = 109; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A9_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest04_A10 { + LiverangeSubsumeRCTest04_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_A10(String strObjectName) { + b1_0 = null; + a = 110; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_A10_"+strObjectName); + } + + void add() { + sum = a + b1_0.a; + } +} + + +class LiverangeSubsumeRCTest04_B1 { + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest04_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0005-rt-compiler-LiverangeSubsumeRCTest05/LiverangeSubsumeRCTest05.java b/test/testsuite/ouroboros/subsumeRC_test/RT0005-rt-compiler-LiverangeSubsumeRCTest05/LiverangeSubsumeRCTest05.java index c6bfb07a3881b787b333dc2689bc33090ae487a6..01d824cd4adc94259d89c1721f7627cc39b0ce22 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0005-rt-compiler-LiverangeSubsumeRCTest05/LiverangeSubsumeRCTest05.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0005-rt-compiler-LiverangeSubsumeRCTest05/LiverangeSubsumeRCTest05.java @@ -1,89 +1,89 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest05 - *- @TestCaseName: LiverangeSubsumeRCTest05 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1: 构造是个同一个类对象的引用指针test1,test2,test3和test4,他们同时有实例变量同时指向一块内存地址b1; - * -#step2: b1的生命周期包含了这test1.b1_0,test2.b1_0和test3.b1_0的生命周期,没有包含test4.b1_0的生命周期。 - * -#step3: test1.b1_0,test2.b1_0和test3.b1_0的incref和decRef都应该被优化掉都应该被优化掉;test4.b1_0的incref和decRef被保留。 - * 校验中间文件LiverangeSubsumeRCTest05.VtableImpl.mpl中无IncRef。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest05.java - *- @ExecuteClass: LiverangeSubsumeRCTest05 - *- @ExecuteArgs: - */ - -public class LiverangeSubsumeRCTest05 { - public static void main(String[] args) { - LiverangeSubsumeRCTest05_Node test1 = new LiverangeSubsumeRCTest05_Node("test1"); - LiverangeSubsumeRCTest05_Node test2 = new LiverangeSubsumeRCTest05_Node("test2"); - LiverangeSubsumeRCTest05_Node test3 = new LiverangeSubsumeRCTest05_Node("test3"); - LiverangeSubsumeRCTest05_Node test4 = new LiverangeSubsumeRCTest05_Node("test4"); - LiverangeSubsumeRCTest05_B1 b1 = new LiverangeSubsumeRCTest05_B1("b1"); - test1.b1_0 = b1; - test2.b1_0 = b1; - test3.b1_0 = b1; - test4.b1_0 = b1; - test1.b1_0.add(); - test2.b1_0.add(); - test3.b1_0.add(); - test4.b1_0.add(); - b1.add(); - int result = test1.sum + test2.sum + test3.sum + test4.sum + test4.b1_0.sum; - if (result == 402) { - System.out.println("ExpectResult"); - } - } -} - -class LiverangeSubsumeRCTest05_Node { - LiverangeSubsumeRCTest05_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest05_Node(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest05_B1 { - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest05_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest05 + *- @TestCaseName: LiverangeSubsumeRCTest05 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1: 构造是个同一个类对象的引用指针test1,test2,test3和test4,他们同时有实例变量同时指向一块内存地址b1; + * -#step2: b1的生命周期包含了这test1.b1_0,test2.b1_0和test3.b1_0的生命周期,没有包含test4.b1_0的生命周期。 + * -#step3: test1.b1_0,test2.b1_0和test3.b1_0的incref和decRef都应该被优化掉都应该被优化掉;test4.b1_0的incref和decRef被保留。 + * 校验中间文件LiverangeSubsumeRCTest05.VtableImpl.mpl中无IncRef。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest05.java + *- @ExecuteClass: LiverangeSubsumeRCTest05 + *- @ExecuteArgs: + */ + +public class LiverangeSubsumeRCTest05 { + public static void main(String[] args) { + LiverangeSubsumeRCTest05_Node test1 = new LiverangeSubsumeRCTest05_Node("test1"); + LiverangeSubsumeRCTest05_Node test2 = new LiverangeSubsumeRCTest05_Node("test2"); + LiverangeSubsumeRCTest05_Node test3 = new LiverangeSubsumeRCTest05_Node("test3"); + LiverangeSubsumeRCTest05_Node test4 = new LiverangeSubsumeRCTest05_Node("test4"); + LiverangeSubsumeRCTest05_B1 b1 = new LiverangeSubsumeRCTest05_B1("b1"); + test1.b1_0 = b1; + test2.b1_0 = b1; + test3.b1_0 = b1; + test4.b1_0 = b1; + test1.b1_0.add(); + test2.b1_0.add(); + test3.b1_0.add(); + test4.b1_0.add(); + b1.add(); + int result = test1.sum + test2.sum + test3.sum + test4.sum + test4.b1_0.sum; + if (result == 402) { + System.out.println("ExpectResult"); + } + } +} + +class LiverangeSubsumeRCTest05_Node { + LiverangeSubsumeRCTest05_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest05_Node(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest05_B1 { + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest05_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0006-rt-compiler-LiverangeSubsumeRCTest06/LiverangeSubsumeRCTest06.java b/test/testsuite/ouroboros/subsumeRC_test/RT0006-rt-compiler-LiverangeSubsumeRCTest06/LiverangeSubsumeRCTest06.java index 01cc960238172b402ba3a926168263c121608c5c..5a5822d9b441104f88bedd85122a92967ab2b934 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0006-rt-compiler-LiverangeSubsumeRCTest06/LiverangeSubsumeRCTest06.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0006-rt-compiler-LiverangeSubsumeRCTest06/LiverangeSubsumeRCTest06.java @@ -1,88 +1,88 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest06 - *- @TestCaseName: LiverangeSubsumeRCTest06 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1: 构造是个同一个类对象的引用指针test1,test2,test3和test4,他们同时指向一块内存地址,并且他们的实例变量b1_0同时指向一块内存地址b1; - * -#step2: test1的生命周期包含了test2,test3 和test4,所以test2,test3和test4的incref和dec ref都应该被优化掉。 - * -#step3: b1指针的生命周期包含了四个b1_0的生命周期,四个b1_0的incref,decref应该被优化掉 - * 校验中间文件LiverangeSubsumeRCTest06.VtableImpl.mpl无IncRef - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest06.java - *- @ExecuteClass: LiverangeSubsumeRCTest06 - *- @ExecuteArgs: - */ - -public class LiverangeSubsumeRCTest06 { - public static void main(String[] args) { - LiverangeSubsumeRCTest06_Node test1 = new LiverangeSubsumeRCTest06_Node("test1"); - LiverangeSubsumeRCTest06_Node test2 = test1; - LiverangeSubsumeRCTest06_Node test3 = test1; - LiverangeSubsumeRCTest06_Node test4 = test1; - LiverangeSubsumeRCTest06_B1 b1 = new LiverangeSubsumeRCTest06_B1("b1"); - test2.b1_0 = b1; - test2.b1_0.add(); - test3.b1_0 = b1; - test3.b1_0.add(); - test4.b1_0 = b1; - test4.b1_0.add(); - test1.b1_0 = b1; - test1.b1_0.add(); - int result = test1.sum + b1.sum; - if (result == 402) { - System.out.println("ExpectResult"); - } - } -} - -class LiverangeSubsumeRCTest06_Node { - LiverangeSubsumeRCTest06_B1 b1_0; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest06_Node(String strObjectName) { - b1_0 = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - void add() { - sum = a + b1_0.a; - } -} - -class LiverangeSubsumeRCTest06_B1 { - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest06_B1(String strObjectName) { - a = 201; - sum = 0; - this.strObjectName = strObjectName; -// System.out.println("RC-Testing_Construction_B1_"+strObjectName); - } - - void add() { - sum = a + a; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest06 + *- @TestCaseName: LiverangeSubsumeRCTest06 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1: 构造是个同一个类对象的引用指针test1,test2,test3和test4,他们同时指向一块内存地址,并且他们的实例变量b1_0同时指向一块内存地址b1; + * -#step2: test1的生命周期包含了test2,test3 和test4,所以test2,test3和test4的incref和dec ref都应该被优化掉。 + * -#step3: b1指针的生命周期包含了四个b1_0的生命周期,四个b1_0的incref,decref应该被优化掉 + * 校验中间文件LiverangeSubsumeRCTest06.VtableImpl.mpl无IncRef + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest06.java + *- @ExecuteClass: LiverangeSubsumeRCTest06 + *- @ExecuteArgs: + */ + +public class LiverangeSubsumeRCTest06 { + public static void main(String[] args) { + LiverangeSubsumeRCTest06_Node test1 = new LiverangeSubsumeRCTest06_Node("test1"); + LiverangeSubsumeRCTest06_Node test2 = test1; + LiverangeSubsumeRCTest06_Node test3 = test1; + LiverangeSubsumeRCTest06_Node test4 = test1; + LiverangeSubsumeRCTest06_B1 b1 = new LiverangeSubsumeRCTest06_B1("b1"); + test2.b1_0 = b1; + test2.b1_0.add(); + test3.b1_0 = b1; + test3.b1_0.add(); + test4.b1_0 = b1; + test4.b1_0.add(); + test1.b1_0 = b1; + test1.b1_0.add(); + int result = test1.sum + b1.sum; + if (result == 402) { + System.out.println("ExpectResult"); + } + } +} + +class LiverangeSubsumeRCTest06_Node { + LiverangeSubsumeRCTest06_B1 b1_0; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest06_Node(String strObjectName) { + b1_0 = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + void add() { + sum = a + b1_0.a; + } +} + +class LiverangeSubsumeRCTest06_B1 { + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest06_B1(String strObjectName) { + a = 201; + sum = 0; + this.strObjectName = strObjectName; +// System.out.println("RC-Testing_Construction_B1_"+strObjectName); + } + + void add() { + sum = a + a; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0007-rt-compiler-LiverangeSubsumeRCTest07/LiverangeSubsumeRCTest07.java b/test/testsuite/ouroboros/subsumeRC_test/RT0007-rt-compiler-LiverangeSubsumeRCTest07/LiverangeSubsumeRCTest07.java index ab9e80fb71422bbadd7c78e0c9f5c0320456198e..5f1ae93f6f4ffa423244ea1fe3ee1622e864ce6b 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0007-rt-compiler-LiverangeSubsumeRCTest07/LiverangeSubsumeRCTest07.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0007-rt-compiler-LiverangeSubsumeRCTest07/LiverangeSubsumeRCTest07.java @@ -1,60 +1,60 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest07 - *- @TestCaseName: LiverangeSubsumeRCTest07 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作:自成环的场景应该会被优化 - * -#step1: test07与test07./,而且test07.next的生命周期被test07包含,所以 test07.next的incref和dec ref都应该被优化掉。 - * -#step2: 这样RC的自成环问题会被优化掉,该种场景仅通过RC就可以做到内存回收 - * 校验中间文件LiverangeSubsumeRCTest07.VtableImpl.mpl中无IncRef。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest07.java - *- @ExecuteClass: LiverangeSubsumeRCTest07 - *- @ExecuteArgs: - */ -public class LiverangeSubsumeRCTest07 { - LiverangeSubsumeRCTest07 next; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest07(String strObjectName) { - next = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - public static void main(String[] args) { - LiverangeSubsumeRCTest07 test07 = new LiverangeSubsumeRCTest07("test1"); - test07.next = test07; // 使用intrinsiccall MCCWriteNoDec()代替 - test07.next.add(); - test07.add(); - if (test07.sum == 202) { - System.out.println("ExpectResult"); - } else { - System.out.println(test07.sum); - } - } - - void add() { - sum = a + next.a; - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest07 + *- @TestCaseName: LiverangeSubsumeRCTest07 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作:自成环的场景应该会被优化 + * -#step1: test07与test07./,而且test07.next的生命周期被test07包含,所以 test07.next的incref和dec ref都应该被优化掉。 + * -#step2: 这样RC的自成环问题会被优化掉,该种场景仅通过RC就可以做到内存回收 + * 校验中间文件LiverangeSubsumeRCTest07.VtableImpl.mpl中无IncRef。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest07.java + *- @ExecuteClass: LiverangeSubsumeRCTest07 + *- @ExecuteArgs: + */ +public class LiverangeSubsumeRCTest07 { + LiverangeSubsumeRCTest07 next; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest07(String strObjectName) { + next = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + public static void main(String[] args) { + LiverangeSubsumeRCTest07 test07 = new LiverangeSubsumeRCTest07("test1"); + test07.next = test07; // 使用intrinsiccall MCCWriteNoDec()代替 + test07.next.add(); + test07.add(); + if (test07.sum == 202) { + System.out.println("ExpectResult"); + } else { + System.out.println(test07.sum); + } + } + + void add() { + sum = a + next.a; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0008-rt-compiler-LiverangeSubsumeRCTest08/LiverangeSubsumeRCTest08.java b/test/testsuite/ouroboros/subsumeRC_test/RT0008-rt-compiler-LiverangeSubsumeRCTest08/LiverangeSubsumeRCTest08.java index 595b521af95dfba04696dbfe30f749e8c451fa5d..8a271c72179f7f950afe910035241ffb5893fdef 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0008-rt-compiler-LiverangeSubsumeRCTest08/LiverangeSubsumeRCTest08.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0008-rt-compiler-LiverangeSubsumeRCTest08/LiverangeSubsumeRCTest08.java @@ -1,61 +1,61 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest08 - *- @TestCaseName: LiverangeSubsumeRCTest08 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作:两个对象成环的场景应该会被优化 - * -#step1: test1与test1.next是两个不同的对象,占用不同的内存空间,而且test08.next.next的生命周期被test1包含,所以 test08.next的incref和dec ref都应该被优化掉。 - * -#step2: 这样RC的自成环问题会被优化掉,该种场景仅通过RC就可以做到内存回收 - * 校验中间文件LiverangeSubsumeRCTest08.VtableImpl.mpl中无IncRef。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest08.java - *- @ExecuteClass: LiverangeSubsumeRCTest08 - *- @ExecuteArgs: - */ -public class LiverangeSubsumeRCTest08 { - LiverangeSubsumeRCTest08 next; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest08(String strObjectName) { - next = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - public static void main(String[] args) { - LiverangeSubsumeRCTest08 test1 = new LiverangeSubsumeRCTest08("test1"); - test1.next = new LiverangeSubsumeRCTest08("test2"); - test1.next.next = test1; - test1.next.add(); - test1.next.next.add(); - test1.add(); - if (test1.sum == 202) { - System.out.println("ExpectResult"); - } else { - System.out.println(test1.sum); - } - } - - void add() { - sum = a + next.a; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest08 + *- @TestCaseName: LiverangeSubsumeRCTest08 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作:两个对象成环的场景应该会被优化 + * -#step1: test1与test1.next是两个不同的对象,占用不同的内存空间,而且test08.next.next的生命周期被test1包含,所以 test08.next的incref和dec ref都应该被优化掉。 + * -#step2: 这样RC的自成环问题会被优化掉,该种场景仅通过RC就可以做到内存回收 + * 校验中间文件LiverangeSubsumeRCTest08.VtableImpl.mpl中无IncRef。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest08.java + *- @ExecuteClass: LiverangeSubsumeRCTest08 + *- @ExecuteArgs: + */ +public class LiverangeSubsumeRCTest08 { + LiverangeSubsumeRCTest08 next; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest08(String strObjectName) { + next = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + public static void main(String[] args) { + LiverangeSubsumeRCTest08 test1 = new LiverangeSubsumeRCTest08("test1"); + test1.next = new LiverangeSubsumeRCTest08("test2"); + test1.next.next = test1; + test1.next.add(); + test1.next.next.add(); + test1.add(); + if (test1.sum == 202) { + System.out.println("ExpectResult"); + } else { + System.out.println(test1.sum); + } + } + + void add() { + sum = a + next.a; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0009-rt-compiler-LiverangeSubsumeRCTest09/LiverangeSubsumeRCTest09.java b/test/testsuite/ouroboros/subsumeRC_test/RT0009-rt-compiler-LiverangeSubsumeRCTest09/LiverangeSubsumeRCTest09.java index ff86abc2c3c945c76bdeaae0eb4c67a3c9d9d7e7..a378e6fb8293142cd52d3d26177c0e88a74ed82c 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0009-rt-compiler-LiverangeSubsumeRCTest09/LiverangeSubsumeRCTest09.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0009-rt-compiler-LiverangeSubsumeRCTest09/LiverangeSubsumeRCTest09.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest09 - *- @TestCaseName: LiverangeSubsumeRCTest09 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作:n(n>=3)个对象成环的场景应该会被优化 - * -#step1: test9与它后面的next是总共5个不同的对象,并且自成环,而且并且后面的所有next的生命周期被test9包含,所以所有的.next的incref和dec ref都应该被优化掉。 - * -#step2: 这样RC的自成环问题也会被优化掉,该种场景仅通过RC就可以做到内存回收 - * 校验中间文件LiverangeSubsumeRCTest09.VtableImpl.mpl中无IncRef - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest09.java - *- @ExecuteClass: LiverangeSubsumeRCTest09 - *- @ExecuteArgs: - */ -public class LiverangeSubsumeRCTest09 { - LiverangeSubsumeRCTest09 next; - int a; - int sum; - String strObjectName; - - LiverangeSubsumeRCTest09(String strObjectName) { - next = null; - a = 101; - sum = 0; - this.strObjectName = strObjectName; - } - - public static void main(String[] args) { - LiverangeSubsumeRCTest09 test9 = new LiverangeSubsumeRCTest09("test9"); - test9.next = new LiverangeSubsumeRCTest09("test2"); - test9.next.next = new LiverangeSubsumeRCTest09("test3"); - test9.next.next.next = new LiverangeSubsumeRCTest09("test4"); - test9.next.next.next.next = new LiverangeSubsumeRCTest09("test5"); - test9.next.next.next.next = test9; - test9.next.next.next.next.add(); - test9.add(); - if (test9.sum == 202) { - System.out.println("ExpectResult"); - } else { - System.out.println(test9.next.sum); - } - } - - void add() { - sum = a + next.a; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest09 + *- @TestCaseName: LiverangeSubsumeRCTest09 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作:n(n>=3)个对象成环的场景应该会被优化 + * -#step1: test9与它后面的next是总共5个不同的对象,并且自成环,而且并且后面的所有next的生命周期被test9包含,所以所有的.next的incref和dec ref都应该被优化掉。 + * -#step2: 这样RC的自成环问题也会被优化掉,该种场景仅通过RC就可以做到内存回收 + * 校验中间文件LiverangeSubsumeRCTest09.VtableImpl.mpl中无IncRef + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest09.java + *- @ExecuteClass: LiverangeSubsumeRCTest09 + *- @ExecuteArgs: + */ +public class LiverangeSubsumeRCTest09 { + LiverangeSubsumeRCTest09 next; + int a; + int sum; + String strObjectName; + + LiverangeSubsumeRCTest09(String strObjectName) { + next = null; + a = 101; + sum = 0; + this.strObjectName = strObjectName; + } + + public static void main(String[] args) { + LiverangeSubsumeRCTest09 test9 = new LiverangeSubsumeRCTest09("test9"); + test9.next = new LiverangeSubsumeRCTest09("test2"); + test9.next.next = new LiverangeSubsumeRCTest09("test3"); + test9.next.next.next = new LiverangeSubsumeRCTest09("test4"); + test9.next.next.next.next = new LiverangeSubsumeRCTest09("test5"); + test9.next.next.next.next = test9; + test9.next.next.next.next.add(); + test9.add(); + if (test9.sum == 202) { + System.out.println("ExpectResult"); + } else { + System.out.println(test9.next.sum); + } + } + + void add() { + sum = a + next.a; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0010-rt-compiler-LiverangeSubsumeRCTest10/LiverangeSubsumeRCTest10.java b/test/testsuite/ouroboros/subsumeRC_test/RT0010-rt-compiler-LiverangeSubsumeRCTest10/LiverangeSubsumeRCTest10.java index 6e2a69592bc2f4eeb74cc08245478ac80f9fedb2..18e5459b5c6ee0cbc8a85fc50dffb0d04f0b171d 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0010-rt-compiler-LiverangeSubsumeRCTest10/LiverangeSubsumeRCTest10.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0010-rt-compiler-LiverangeSubsumeRCTest10/LiverangeSubsumeRCTest10.java @@ -1,101 +1,101 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest10 - *- @TestCaseName: LiverangeSubsumeRCTest10 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:检测在循环语句(for, while, do-while)控制流中,当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1:函数1测试场景:周期大的对象a1初始化在for循环外,只在for循环内部使用生命周期小的a2;a2的incref和decRef都应该被优化掉 - * -#step2:函数2测试场景:周期大的对象a1和生命周期小的对象a2对象初始化和使用都在for循环内,因为a1的生命周期完全覆盖了a2的生命周期,a2的incref和decRef都应该被优化掉; - * -#step3:函数3测试场景:对象初始化在do-while循环内,循环之后,仍有使用;a2的生命周期因为被完全覆盖,所以它的incref和decRef都应该被优化掉; - * 校验中间文件LiverangeSubsumeRCTest10.VtableImpl.mpl中无IncRef。 - *- @Expect:a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1100ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest10.java - *- @ExecuteClass: LiverangeSubsumeRCTest10 - *- @ExecuteArgs: - */ -class A { - public int count = 0; - public String className = "A"; - - public A(String name) { - this.className = name; - } - - public void changeName(String name) { - this.className = name; - } -} - -public class LiverangeSubsumeRCTest10 { - private static volatile int count = 0; - private static A infiniteLoop = null; - private A defInsideUseOutside = null; - - public static boolean onlyUseInsideLoop() { - A a1 = new A("a1"); - for (count = 0; count < 100; count++) { - A a2 = a1; - a2.changeName("a" + count); - a2.count = count; - if (count == 99) - a2.toString(); - } - return a1.className.equals("a99"); - } - - public static void defAndUseInsideLoop() { - for (count = 0; count < 10; count++) { - A a1 = new A("a1_" + count); - a1.changeName("a1"); - A a2 = a1; - for (int j = 0; j < 2; j++) { - a2.changeName("a1_" + j); - } - System.out.print(a1.className); - } - } - - public static void main(String[] args) { - defAndUseInsideLoop(); - new LiverangeSubsumeRCTest10().defInsideAndUseOutsideLoop(); - if (onlyUseInsideLoop()) { - System.out.println("ExpectResult"); - } else { - System.out.println("ErrorResult"); - } - } - - public void defInsideAndUseOutsideLoop() { - count = 0; - do { - this.defInsideUseOutside = new A("a1_i" + count); - A a2 = this.defInsideUseOutside; - a2.count = count; - for (int j = 0; j < 2; j++) - a2 = new A("a2_i" + count + "_j" + j); - if (count == 99) - a2.toString(); - count++; - } while (this.defInsideUseOutside.count < 100 && count < 100); - System.out.print(count); - } - - -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest10 + *- @TestCaseName: LiverangeSubsumeRCTest10 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:检测在循环语句(for, while, do-while)控制流中,当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1:函数1测试场景:周期大的对象a1初始化在for循环外,只在for循环内部使用生命周期小的a2;a2的incref和decRef都应该被优化掉 + * -#step2:函数2测试场景:周期大的对象a1和生命周期小的对象a2对象初始化和使用都在for循环内,因为a1的生命周期完全覆盖了a2的生命周期,a2的incref和decRef都应该被优化掉; + * -#step3:函数3测试场景:对象初始化在do-while循环内,循环之后,仍有使用;a2的生命周期因为被完全覆盖,所以它的incref和decRef都应该被优化掉; + * 校验中间文件LiverangeSubsumeRCTest10.VtableImpl.mpl中无IncRef。 + *- @Expect:a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1100ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest10.java + *- @ExecuteClass: LiverangeSubsumeRCTest10 + *- @ExecuteArgs: + */ +class A { + public int count = 0; + public String className = "A"; + + public A(String name) { + this.className = name; + } + + public void changeName(String name) { + this.className = name; + } +} + +public class LiverangeSubsumeRCTest10 { + private static volatile int count = 0; + private static A infiniteLoop = null; + private A defInsideUseOutside = null; + + public static boolean onlyUseInsideLoop() { + A a1 = new A("a1"); + for (count = 0; count < 100; count++) { + A a2 = a1; + a2.changeName("a" + count); + a2.count = count; + if (count == 99) + a2.toString(); + } + return a1.className.equals("a99"); + } + + public static void defAndUseInsideLoop() { + for (count = 0; count < 10; count++) { + A a1 = new A("a1_" + count); + a1.changeName("a1"); + A a2 = a1; + for (int j = 0; j < 2; j++) { + a2.changeName("a1_" + j); + } + System.out.print(a1.className); + } + } + + public static void main(String[] args) { + defAndUseInsideLoop(); + new LiverangeSubsumeRCTest10().defInsideAndUseOutsideLoop(); + if (onlyUseInsideLoop()) { + System.out.println("ExpectResult"); + } else { + System.out.println("ErrorResult"); + } + } + + public void defInsideAndUseOutsideLoop() { + count = 0; + do { + this.defInsideUseOutside = new A("a1_i" + count); + A a2 = this.defInsideUseOutside; + a2.count = count; + for (int j = 0; j < 2; j++) + a2 = new A("a2_i" + count + "_j" + j); + if (count == 99) + a2.toString(); + count++; + } while (this.defInsideUseOutside.count < 100 && count < 100); + System.out.print(count); + } + + +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1a1_1100ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0011-rt-compiler-LiverangeSubsumeRCTest11/LiverangeSubsumeRCTest11.java b/test/testsuite/ouroboros/subsumeRC_test/RT0011-rt-compiler-LiverangeSubsumeRCTest11/LiverangeSubsumeRCTest11.java index cdf0f93a9589929f0663b0717cb7795064d108b1..24c0af84db97fc6390a5d2c3fc018aed397736f0 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0011-rt-compiler-LiverangeSubsumeRCTest11/LiverangeSubsumeRCTest11.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0011-rt-compiler-LiverangeSubsumeRCTest11/LiverangeSubsumeRCTest11.java @@ -1,109 +1,109 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest11 - *- @TestCaseName: LiverangeSubsumeRCTest11 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:检测在循环语句(if-then, if-then-else, switch)控制流中,当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1:函数1测试场景:周期大的对象a1初始化在for循环外,只在for循环内部使用生命周期小的a2;a1的最后调用放到for循环外的if语句里,a2的incRef和decRef会被优化掉。 - * -#step2:函数2测试场景:a2 = a1,q且在for循环内使用,在if逻辑体,a2的incref和decRef不会被优化掉,在else逻辑体内,a2的incRef和decRef会被优化掉。 - * -#step3:函数3测试场景:a2 =a1,在不同的switch--多case里,case1:a1包含了a2,会有优化;case2:没有包含住,不做优化;case3:无代码;case4: a2 = a1; - * 校验中间文件LiverangeSubsumeRCTest11.VtableImpl.mpl无IncRef。 - *- @Expect:a100\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest11.java - *- @ExecuteClass: LiverangeSubsumeRCTest11 - *- @ExecuteArgs: - */ - -class A2 { - public int count = 0; - public String className = "A"; - - public A2(String name) { - this.className = name; - } - - public void changeName(String name) { - this.className = name; - } -} - -public class LiverangeSubsumeRCTest11 { - private volatile static int count = 0; - - public static void onlyUseInsideLoop() { - A2 a1 = new A2("a1"); - for (count = 0; count < 100; count++) { - A2 a2 = new A2("a2"); - a2.changeName("a" + count); - a2.count = count; - } - if (count % 10 == 0) { - a1.changeName("a" + 100); - System.out.println(a1.className); - } - } - - public static void defAndUseInsideLoop() { - for (count = 0; count < 10; count++) { - A2 a1 = new A2("a1"); - a1.count = count; - A2 a2 = a1; - a2.changeName("null"); - if (count % 2 == 0) { - a2.changeName("a" + 100); - a2 = new A2("a10"); - a2.toString(); - } else { - a1.changeName("a" + 100); - a1.toString(); - } - } - } - - public static void main(String[] args) { - onlyUseInsideLoop(); - defAndUseInsideLoop(); - new LiverangeSubsumeRCTest11().defInsideAndUseOutsideLoop(); - } - - public void defInsideAndUseOutsideLoop() { - count = 0; - do { - int choice = count % 4; - A2 a1 = new A2("a2_i" + count); - A2 a2 = a1; - switch (choice) { - case 1: - a1.changeName("case 1"); - break; - case 2: - a2.changeName("case 2"); - break; - case 3: - break; - default: - a1 = a2; - } - count++; - } while (count < 10); - - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest11 + *- @TestCaseName: LiverangeSubsumeRCTest11 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:检测在循环语句(if-then, if-then-else, switch)控制流中,当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1:函数1测试场景:周期大的对象a1初始化在for循环外,只在for循环内部使用生命周期小的a2;a1的最后调用放到for循环外的if语句里,a2的incRef和decRef会被优化掉。 + * -#step2:函数2测试场景:a2 = a1,q且在for循环内使用,在if逻辑体,a2的incref和decRef不会被优化掉,在else逻辑体内,a2的incRef和decRef会被优化掉。 + * -#step3:函数3测试场景:a2 =a1,在不同的switch--多case里,case1:a1包含了a2,会有优化;case2:没有包含住,不做优化;case3:无代码;case4: a2 = a1; + * 校验中间文件LiverangeSubsumeRCTest11.VtableImpl.mpl无IncRef。 + *- @Expect:a100\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest11.java + *- @ExecuteClass: LiverangeSubsumeRCTest11 + *- @ExecuteArgs: + */ + +class A2 { + public int count = 0; + public String className = "A"; + + public A2(String name) { + this.className = name; + } + + public void changeName(String name) { + this.className = name; + } +} + +public class LiverangeSubsumeRCTest11 { + private volatile static int count = 0; + + public static void onlyUseInsideLoop() { + A2 a1 = new A2("a1"); + for (count = 0; count < 100; count++) { + A2 a2 = new A2("a2"); + a2.changeName("a" + count); + a2.count = count; + } + if (count % 10 == 0) { + a1.changeName("a" + 100); + System.out.println(a1.className); + } + } + + public static void defAndUseInsideLoop() { + for (count = 0; count < 10; count++) { + A2 a1 = new A2("a1"); + a1.count = count; + A2 a2 = a1; + a2.changeName("null"); + if (count % 2 == 0) { + a2.changeName("a" + 100); + a2 = new A2("a10"); + a2.toString(); + } else { + a1.changeName("a" + 100); + a1.toString(); + } + } + } + + public static void main(String[] args) { + onlyUseInsideLoop(); + defAndUseInsideLoop(); + new LiverangeSubsumeRCTest11().defInsideAndUseOutsideLoop(); + } + + public void defInsideAndUseOutsideLoop() { + count = 0; + do { + int choice = count % 4; + A2 a1 = new A2("a2_i" + count); + A2 a2 = a1; + switch (choice) { + case 1: + a1.changeName("case 1"); + break; + case 2: + a2.changeName("case 2"); + break; + case 3: + break; + default: + a1 = a2; + } + count++; + } while (count < 10); + + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan a100\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0012-rt-compiler-LiverangeSubsumeRCTest12/LiverangeSubsumeRCTest12.java b/test/testsuite/ouroboros/subsumeRC_test/RT0012-rt-compiler-LiverangeSubsumeRCTest12/LiverangeSubsumeRCTest12.java index 81ccceddd8750736ea003864a21a5d046b85c743..e67df983bcbe99baf7b80b75e1e470515d7b14e7 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0012-rt-compiler-LiverangeSubsumeRCTest12/LiverangeSubsumeRCTest12.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0012-rt-compiler-LiverangeSubsumeRCTest12/LiverangeSubsumeRCTest12.java @@ -1,92 +1,92 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest12 - *- @TestCaseName: LiverangeSubsumeRCTest12 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:检测在跳转语句(break, continue, return)控制流中,当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1:函数1做在continue ; continue tag的跳转for循环里,在if -else里,a1的生命周期都包含住了a3,所以a3会被优化掉 - * -#step2:函数2测试场景:a3 = a2,且在for循环内使用,在if逻辑体,a2的incref和decRef会被优化掉,在else逻辑体内,a2的incRef和decRef不会被优化掉。 - * 校验中间文件LiverangeSubsumeRCTest12.VtableImpl.mpl中有1个IncRef。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest12.java - *- @ExecuteClass: LiverangeSubsumeRCTest12 - *- @ExecuteArgs: - */ - -class A3 { - public int count = 0; - public String className = "temp"; - - public A3(String name) { - this.className = name; - } - - public void changeName(String name) { - this.className = name; - } -} - -public class LiverangeSubsumeRCTest12 { - private volatile static int count = 0; - private A3 defInsideUseOutside = null; - - //def outside, only use inside loop - public static void onlyUseInsideLoop() { - A3 a1 = new A3("a1"); - continueTag: - for (count = 0; count < 10; count++) { - A3 a3 = a1; - a1.changeName("a" + count); - a3.count = count; - if (count % 8 == 0) { - a1.changeName("Right"); // a3没有incRef和decRef - continue continueTag; - } else { - a1.className = "a1_" + count; // a3没有incRef和decRef - continue; - } - } - } - - public static A3 defAndUseInsideLoop() { - for (count = 0; count < 10; count++) { - A3 a2 = new A3("a2_i" + count); - A3 a3 = a2; //因为else分支,这边会有一个incRef - a2.count = count; - a3.changeName("null"); - if (count % 4 == 0 && count > 0) { - a2.changeName("Optimization"); - return a2; - } else if (count == 3) { - a3.changeName("NoOptimization"); - return a3; - } - } - return new A3("Error"); - } - - public static void main(String[] args) { - onlyUseInsideLoop(); - if (defAndUseInsideLoop().className.equals("NoOptimization")) { - System.out.println("ExpectResult"); - } else { - System.out.println("ErrorResult"); - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest12 + *- @TestCaseName: LiverangeSubsumeRCTest12 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:检测在跳转语句(break, continue, return)控制流中,当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1:函数1做在continue ; continue tag的跳转for循环里,在if -else里,a1的生命周期都包含住了a3,所以a3会被优化掉 + * -#step2:函数2测试场景:a3 = a2,且在for循环内使用,在if逻辑体,a2的incref和decRef会被优化掉,在else逻辑体内,a2的incRef和decRef不会被优化掉。 + * 校验中间文件LiverangeSubsumeRCTest12.VtableImpl.mpl中有1个IncRef。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest12.java + *- @ExecuteClass: LiverangeSubsumeRCTest12 + *- @ExecuteArgs: + */ + +class A3 { + public int count = 0; + public String className = "temp"; + + public A3(String name) { + this.className = name; + } + + public void changeName(String name) { + this.className = name; + } +} + +public class LiverangeSubsumeRCTest12 { + private volatile static int count = 0; + private A3 defInsideUseOutside = null; + + //def outside, only use inside loop + public static void onlyUseInsideLoop() { + A3 a1 = new A3("a1"); + continueTag: + for (count = 0; count < 10; count++) { + A3 a3 = a1; + a1.changeName("a" + count); + a3.count = count; + if (count % 8 == 0) { + a1.changeName("Right"); // a3没有incRef和decRef + continue continueTag; + } else { + a1.className = "a1_" + count; // a3没有incRef和decRef + continue; + } + } + } + + public static A3 defAndUseInsideLoop() { + for (count = 0; count < 10; count++) { + A3 a2 = new A3("a2_i" + count); + A3 a3 = a2; //因为else分支,这边会有一个incRef + a2.count = count; + a3.changeName("null"); + if (count % 4 == 0 && count > 0) { + a2.changeName("Optimization"); + return a2; + } else if (count == 3) { + a3.changeName("NoOptimization"); + return a3; + } + } + return new A3("Error"); + } + + public static void main(String[] args) { + onlyUseInsideLoop(); + if (defAndUseInsideLoop().className.equals("NoOptimization")) { + System.out.println("ExpectResult"); + } else { + System.out.println("ErrorResult"); + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0013-rt-compiler-LiverangeSubsumeRCTest13/LiverangeSubsumeRCTest13.java b/test/testsuite/ouroboros/subsumeRC_test/RT0013-rt-compiler-LiverangeSubsumeRCTest13/LiverangeSubsumeRCTest13.java index 3b37fee5a9f67c8b67eff82aaa9ca4b7b1caa0e4..b7dd3afb705bcbe6ab94bfd59bef2a1c7e43c905 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0013-rt-compiler-LiverangeSubsumeRCTest13/LiverangeSubsumeRCTest13.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0013-rt-compiler-LiverangeSubsumeRCTest13/LiverangeSubsumeRCTest13.java @@ -1,56 +1,56 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest13 - *- @TestCaseName: LiverangeSubsumeRCTest13 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:检测在跳转语句(try---多catch)控制流中,当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1:str2 = str;空指针的catch包含不住,不做优化外;另外两个catch都应该做incRef和decRef的优化。 - * 校验中间文件LiverangeSubsumeRCTest13.VtableImpl.mpl中无IncRef。 - *- @Expect:ExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest13.java - *- @ExecuteClass: LiverangeSubsumeRCTest13 - *- @ExecuteArgs: - */ - -public class LiverangeSubsumeRCTest13 { - public static void main(String[] argv) { - int result = 2; - boolean check; - String str = "123#"; - String str2 = str; - try { - str.notifyAll(); - str = str2; - Integer.parseInt(str); - } catch (NumberFormatException e) { - str = "123#456"; // 2 - result--; - } catch (NullPointerException e) { - str2 = "123456"; // 3 - result = 2; - } catch (IllegalMonitorStateException e) { - str2 = str; - result = 0; - } - if (result == 0) { - System.out.println("ExpectResult"); - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest13 + *- @TestCaseName: LiverangeSubsumeRCTest13 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:检测在跳转语句(try---多catch)控制流中,当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1:str2 = str;空指针的catch包含不住,不做优化外;另外两个catch都应该做incRef和decRef的优化。 + * 校验中间文件LiverangeSubsumeRCTest13.VtableImpl.mpl中无IncRef。 + *- @Expect:ExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest13.java + *- @ExecuteClass: LiverangeSubsumeRCTest13 + *- @ExecuteArgs: + */ + +public class LiverangeSubsumeRCTest13 { + public static void main(String[] argv) { + int result = 2; + boolean check; + String str = "123#"; + String str2 = str; + try { + str.notifyAll(); + str = str2; + Integer.parseInt(str); + } catch (NumberFormatException e) { + str = "123#456"; // 2 + result--; + } catch (NullPointerException e) { + str2 = "123456"; // 3 + result = 2; + } catch (IllegalMonitorStateException e) { + str2 = str; + result = 0; + } + if (result == 0) { + System.out.println("ExpectResult"); + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/subsumeRC_test/RT0014-rt-compiler-LiverangeSubsumeRCTest14/LiverangeSubsumeRCTest14.java b/test/testsuite/ouroboros/subsumeRC_test/RT0014-rt-compiler-LiverangeSubsumeRCTest14/LiverangeSubsumeRCTest14.java index 7ebd1f0260eaf9f83aa9b4bd9cc0b33cf4908b60..8aa12e31d4049301376ca797561e2077fd6aa463 100644 --- a/test/testsuite/ouroboros/subsumeRC_test/RT0014-rt-compiler-LiverangeSubsumeRCTest14/LiverangeSubsumeRCTest14.java +++ b/test/testsuite/ouroboros/subsumeRC_test/RT0014-rt-compiler-LiverangeSubsumeRCTest14/LiverangeSubsumeRCTest14.java @@ -1,51 +1,51 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest14 - *- @TestCaseName: LiverangeSubsumeRCTest14 - *- @TestCaseType: Function Testing - *- @RequirementName: Liverange subsumeRC优化 - *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 - * -#step1: str2 = str1;这俩指向同一个字符串地址。 - * -#step2: 在try里有str1 = str2; 仍然是str1的生命周期包含住了str2;所以str2的incref和decRef都会被优化掉 - * 校验中间文件LiverangeSubsumeRCTest14.VtableImpl.mpl中无IncRef。 - *- @Expect:ExpectResultExpectResult\n - *- @Priority: High - *- @Source: LiverangeSubsumeRCTest14.java - *- @ExecuteClass: LiverangeSubsumeRCTest14 - *- @ExecuteArgs: - */ - -public class LiverangeSubsumeRCTest14 { - public static void main(String[] args) { - String str1 = "ExpectResult"; - String str2 = str1; - try { - String temp = str2.substring(0, 3); - temp = str1.toLowerCase(); - str1 = str2; - temp = temp.equals("ExpectResult") ? temp : str1; - temp.notifyAll(); - str1.notifyAll(); - } catch (Exception e) { - System.out.print(str1); - } finally { - System.out.println(str1); - } - } -} - - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Maple_CompilerOptimization_LiverangeSubsumeRCTest14 + *- @TestCaseName: LiverangeSubsumeRCTest14 + *- @TestCaseType: Function Testing + *- @RequirementName: Liverange subsumeRC优化 + *- @Brief:当确定一个对象的在某个生存区间内的存活状态时,去掉这个区间内的此对象的RC操作 + * -#step1: str2 = str1;这俩指向同一个字符串地址。 + * -#step2: 在try里有str1 = str2; 仍然是str1的生命周期包含住了str2;所以str2的incref和decRef都会被优化掉 + * 校验中间文件LiverangeSubsumeRCTest14.VtableImpl.mpl中无IncRef。 + *- @Expect:ExpectResultExpectResult\n + *- @Priority: High + *- @Source: LiverangeSubsumeRCTest14.java + *- @ExecuteClass: LiverangeSubsumeRCTest14 + *- @ExecuteArgs: + */ + +public class LiverangeSubsumeRCTest14 { + public static void main(String[] args) { + String str1 = "ExpectResult"; + String str2 = str1; + try { + String temp = str2.substring(0, 3); + temp = str1.toLowerCase(); + str1 = str2; + temp = temp.equals("ExpectResult") ? temp : str1; + temp.notifyAll(); + str1.notifyAll(); + } catch (Exception e) { + System.out.print(str1); + } finally { + System.out.println(str1); + } + } +} + + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan ExpectResultExpectResult\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0149-rt-thread-ThreadConstructors13/ThreadConstructors13.java b/test/testsuite/ouroboros/thread_test/RT0149-rt-thread-ThreadConstructors13/ThreadConstructors13.java index 6f2b0ca5832b905fc887181dbedc2fc2182ecff5..95835051257744c4475b5c401df4abb9a6e2b778 100644 --- a/test/testsuite/ouroboros/thread_test/RT0149-rt-thread-ThreadConstructors13/ThreadConstructors13.java +++ b/test/testsuite/ouroboros/thread_test/RT0149-rt-thread-ThreadConstructors13/ThreadConstructors13.java @@ -1,78 +1,78 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadConstructors13 - *- @TestCaseName: Thread_ThreadConstructors13.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for Constructors Thread(String name) - *- @Brief: see below - * -#step1: Create thread instances. - * -#step2: Test Constructors Thread(String name) with null and "" params. - * -#step3: Check that Thread(String name) threw NullPointerException when param was null,and when param is "",it will - * be normal. - *- @Expect: expected.txt - *- @Priority: High - *- @Source: ThreadConstructors13.java - *- @ExecuteClass: ThreadConstructors13 - *- @ExecuteArgs: - */ - -public class ThreadConstructors13 extends Thread { - static int i = 0; - private static int ecount = 0; - - public ThreadConstructors13(String name) { - super(name); - } - - public static void main(String[] args) { - try { - ThreadConstructors13 test_illegal1 = new ThreadConstructors13(null); - } catch (NullPointerException e) { - ecount++; - } - ThreadConstructors13 test_illegal2 = new ThreadConstructors13(""); - ThreadConstructors13 test_illegal3 = new ThreadConstructors13(""); - - test_illegal2.start(); - try { - test_illegal2.join(); - } catch (InterruptedException e) { - System.out.println("InterruptedException"); - } - - test_illegal3.start(); - try { - test_illegal3.join(); - } catch (InterruptedException e) { - System.out.println("InterruptedException"); - } - - if (i == 2) { - if (ecount == 1) { - System.out.println("0"); - return; - } - } - System.out.println("2"); - return; - } - - public void run() { - i++; - super.run(); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadConstructors13 + *- @TestCaseName: Thread_ThreadConstructors13.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for Constructors Thread(String name) + *- @Brief: see below + * -#step1: Create thread instances. + * -#step2: Test Constructors Thread(String name) with null and "" params. + * -#step3: Check that Thread(String name) threw NullPointerException when param was null,and when param is "",it will + * be normal. + *- @Expect: expected.txt + *- @Priority: High + *- @Source: ThreadConstructors13.java + *- @ExecuteClass: ThreadConstructors13 + *- @ExecuteArgs: + */ + +public class ThreadConstructors13 extends Thread { + static int i = 0; + private static int ecount = 0; + + public ThreadConstructors13(String name) { + super(name); + } + + public static void main(String[] args) { + try { + ThreadConstructors13 test_illegal1 = new ThreadConstructors13(null); + } catch (NullPointerException e) { + ecount++; + } + ThreadConstructors13 test_illegal2 = new ThreadConstructors13(""); + ThreadConstructors13 test_illegal3 = new ThreadConstructors13(""); + + test_illegal2.start(); + try { + test_illegal2.join(); + } catch (InterruptedException e) { + System.out.println("InterruptedException"); + } + + test_illegal3.start(); + try { + test_illegal3.join(); + } catch (InterruptedException e) { + System.out.println("InterruptedException"); + } + + if (i == 2) { + if (ecount == 1) { + System.out.println("0"); + return; + } + } + System.out.println("2"); + return; + } + + public void run() { + i++; + super.run(); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0150-rt-thread-ThreadConstructors14/ThreadConstructors14.java b/test/testsuite/ouroboros/thread_test/RT0150-rt-thread-ThreadConstructors14/ThreadConstructors14.java index 7ad0ada9089713d5d3eeb3841c8d5c6acc7b4935..57b6ce7d4577dd47b043b2946d789aaf56c58791 100644 --- a/test/testsuite/ouroboros/thread_test/RT0150-rt-thread-ThreadConstructors14/ThreadConstructors14.java +++ b/test/testsuite/ouroboros/thread_test/RT0150-rt-thread-ThreadConstructors14/ThreadConstructors14.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadConstructors14 - *- @TestCaseName: Thread_ThreadConstructors14.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for Constructors Thread(ThreadGroup group, Runnable target) - *- @Brief: see below - * -#step1: Create a thread instance. - * -#step2: Start the thread. - * -#step3: Test Thread(ThreadGroup group, Runnable target) with null params. - * -#step4: Check that no wrong or exception when Thread(ThreadGroup group, Runnable target)'s params are null. - *- @Expect: expected.txt - *- @Priority: High - *- @Source: ThreadConstructors14.java - *- @ExecuteClass: ThreadConstructors14 - *- @ExecuteArgs: - */ - -public class ThreadConstructors14 extends Thread { - static int i = 0; - - public ThreadConstructors14(ThreadGroup group, Runnable target) { - super(group, target); - } - - public static void main(String[] args) { - - ThreadConstructors14 test_illegal1 = new ThreadConstructors14(null, null); - - test_illegal1.start(); - try { - test_illegal1.join(); - } catch (InterruptedException e) { - System.out.println("InterruptedException"); - } - - if (i == 1) { - System.out.println("0"); - return; - } - System.out.println("2"); - return; - } - - public void run() { - i++; - super.run(); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadConstructors14 + *- @TestCaseName: Thread_ThreadConstructors14.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for Constructors Thread(ThreadGroup group, Runnable target) + *- @Brief: see below + * -#step1: Create a thread instance. + * -#step2: Start the thread. + * -#step3: Test Thread(ThreadGroup group, Runnable target) with null params. + * -#step4: Check that no wrong or exception when Thread(ThreadGroup group, Runnable target)'s params are null. + *- @Expect: expected.txt + *- @Priority: High + *- @Source: ThreadConstructors14.java + *- @ExecuteClass: ThreadConstructors14 + *- @ExecuteArgs: + */ + +public class ThreadConstructors14 extends Thread { + static int i = 0; + + public ThreadConstructors14(ThreadGroup group, Runnable target) { + super(group, target); + } + + public static void main(String[] args) { + + ThreadConstructors14 test_illegal1 = new ThreadConstructors14(null, null); + + test_illegal1.start(); + try { + test_illegal1.join(); + } catch (InterruptedException e) { + System.out.println("InterruptedException"); + } + + if (i == 1) { + System.out.println("0"); + return; + } + System.out.println("2"); + return; + } + + public void run() { + i++; + super.run(); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0151-rt-thread-ThreadConstructors15/ThreadConstructors15.java b/test/testsuite/ouroboros/thread_test/RT0151-rt-thread-ThreadConstructors15/ThreadConstructors15.java index 69eac8ce3c8f9bfdd47894445205c8a7bc132a57..e8c94b6833b1b631827153d67355db33f1135cdd 100644 --- a/test/testsuite/ouroboros/thread_test/RT0151-rt-thread-ThreadConstructors15/ThreadConstructors15.java +++ b/test/testsuite/ouroboros/thread_test/RT0151-rt-thread-ThreadConstructors15/ThreadConstructors15.java @@ -1,79 +1,79 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadConstructors15 - *- @TestCaseName: Thread_ThreadConstructors15.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for Constructors Thread(ThreadGroup group, Runnable target, String name) - *- @Brief: see below - * -#step1: Create a thread instance. - * -#step2: Test Thread(ThreadGroup group, Runnable target, String name) with different params. - * -#step3: Check that NullPointerException was threw when the params are null. - *- @Expect: expected.txt - *- @Priority: High - *- @Source: ThreadConstructors15.java - *- @ExecuteClass: ThreadConstructors15 - *- @ExecuteArgs: - */ - -public class ThreadConstructors15 extends Thread { - static int i = 0; - static int ecount = 0; - - public ThreadConstructors15(ThreadGroup group, Runnable target, String name) { - super(group, target, name); - } - - public static void main(String[] args) { - try { - ThreadConstructors15 test_illegal1 = new ThreadConstructors15(null, null, null); - } catch (NullPointerException e) { - //System.out.println("NullPointerException"); - ecount++; - } - ThreadConstructors15 test_illegal2 = new ThreadConstructors15(null, null, ""); - ThreadConstructors15 test_illegal3 = new ThreadConstructors15(null, null, ""); - - test_illegal2.start(); - try { - test_illegal2.join(); - } catch (InterruptedException e) { - //System.out.println("NullPointerException"); - } - - test_illegal3.start(); - try { - test_illegal3.join(); - } catch (InterruptedException e) { - //System.out.println("NullPointerException"); - } - - if (i == 2) { - if (ecount == 1) { - System.out.println("0"); - return; - } - } - System.out.println("2"); - return; - } - - public void run() { - i++; - super.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadConstructors15 + *- @TestCaseName: Thread_ThreadConstructors15.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for Constructors Thread(ThreadGroup group, Runnable target, String name) + *- @Brief: see below + * -#step1: Create a thread instance. + * -#step2: Test Thread(ThreadGroup group, Runnable target, String name) with different params. + * -#step3: Check that NullPointerException was threw when the params are null. + *- @Expect: expected.txt + *- @Priority: High + *- @Source: ThreadConstructors15.java + *- @ExecuteClass: ThreadConstructors15 + *- @ExecuteArgs: + */ + +public class ThreadConstructors15 extends Thread { + static int i = 0; + static int ecount = 0; + + public ThreadConstructors15(ThreadGroup group, Runnable target, String name) { + super(group, target, name); + } + + public static void main(String[] args) { + try { + ThreadConstructors15 test_illegal1 = new ThreadConstructors15(null, null, null); + } catch (NullPointerException e) { + //System.out.println("NullPointerException"); + ecount++; + } + ThreadConstructors15 test_illegal2 = new ThreadConstructors15(null, null, ""); + ThreadConstructors15 test_illegal3 = new ThreadConstructors15(null, null, ""); + + test_illegal2.start(); + try { + test_illegal2.join(); + } catch (InterruptedException e) { + //System.out.println("NullPointerException"); + } + + test_illegal3.start(); + try { + test_illegal3.join(); + } catch (InterruptedException e) { + //System.out.println("NullPointerException"); + } + + if (i == 2) { + if (ecount == 1) { + System.out.println("0"); + return; + } + } + System.out.println("2"); + return; + } + + public void run() { + i++; + super.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0152-rt-thread-ThreadConstructors16/ThreadConstructors16.java b/test/testsuite/ouroboros/thread_test/RT0152-rt-thread-ThreadConstructors16/ThreadConstructors16.java index 635bdda2509e345c892927fad0847dc2e5469695..1a7925a002b4cd09aa0ed0b985d55ca7e6bc757a 100644 --- a/test/testsuite/ouroboros/thread_test/RT0152-rt-thread-ThreadConstructors16/ThreadConstructors16.java +++ b/test/testsuite/ouroboros/thread_test/RT0152-rt-thread-ThreadConstructors16/ThreadConstructors16.java @@ -1,85 +1,85 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadConstructors16 - *- @TestCaseName: Thread_ThreadConstructors16.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for Thread(ThreadGroup group, Runnable target, String name, long stackSize) - *- @Brief: see below - * -#step1: Create thread instance. - * -#step2: Test Thread(ThreadGroup group, Runnable target, String name, long stackSize) with different params. - * -#step3: Check that whatever stackSize is any value,there is no exception threw. - *- @Expect: expected.txt - *- @Priority: High - *- @Source: ThreadConstructors16.java - *- @ExecuteClass: ThreadConstructors16 - *- @ExecuteArgs: - */ - -public class ThreadConstructors16 extends Thread { - static int i = 0; - static int ecount = 0; - - public ThreadConstructors16(ThreadGroup group, Runnable target, String name, long stackSize) { - super(group, target, name, stackSize); - } - - public static void main(String[] args) { - try { - ThreadConstructors16 test_illegal1 = new ThreadConstructors16(null, null, null, 0); - } catch (NullPointerException e) { - //System.out.println("NullPointerException"); - ecount++; - } - - try { - ThreadConstructors16 test_illegal2 = new ThreadConstructors16(null, null, "", Long.MAX_VALUE); - } catch (OutOfMemoryError ee) { - System.out.println("OutOfMemoryError"); - ecount += 2; - } - - ThreadConstructors16[] test_illegal = new ThreadConstructors16[3]; - - test_illegal[0] = new ThreadConstructors16(null, null, "", 100); //Long.MIN_VALUE); - test_illegal[1] = new ThreadConstructors16(null, null, "", new Integer("-1")); - test_illegal[2] = new ThreadConstructors16(null, null, "", new Short("00356")); - - for (ThreadConstructors16 thread : test_illegal) { - thread.start(); - try { - thread.join(); - } catch (InterruptedException e) { - // System.out.println("InterruptedException"); - } - } - - if (i == 3) { - if (ecount == 1) { - System.out.println("0"); - return; - } - } - System.out.println("2"); - return; - } - - public void run() { - i++; - super.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadConstructors16 + *- @TestCaseName: Thread_ThreadConstructors16.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for Thread(ThreadGroup group, Runnable target, String name, long stackSize) + *- @Brief: see below + * -#step1: Create thread instance. + * -#step2: Test Thread(ThreadGroup group, Runnable target, String name, long stackSize) with different params. + * -#step3: Check that whatever stackSize is any value,there is no exception threw. + *- @Expect: expected.txt + *- @Priority: High + *- @Source: ThreadConstructors16.java + *- @ExecuteClass: ThreadConstructors16 + *- @ExecuteArgs: + */ + +public class ThreadConstructors16 extends Thread { + static int i = 0; + static int ecount = 0; + + public ThreadConstructors16(ThreadGroup group, Runnable target, String name, long stackSize) { + super(group, target, name, stackSize); + } + + public static void main(String[] args) { + try { + ThreadConstructors16 test_illegal1 = new ThreadConstructors16(null, null, null, 0); + } catch (NullPointerException e) { + //System.out.println("NullPointerException"); + ecount++; + } + + try { + ThreadConstructors16 test_illegal2 = new ThreadConstructors16(null, null, "", Long.MAX_VALUE); + } catch (OutOfMemoryError ee) { + System.out.println("OutOfMemoryError"); + ecount += 2; + } + + ThreadConstructors16[] test_illegal = new ThreadConstructors16[3]; + + test_illegal[0] = new ThreadConstructors16(null, null, "", 100); //Long.MIN_VALUE); + test_illegal[1] = new ThreadConstructors16(null, null, "", new Integer("-1")); + test_illegal[2] = new ThreadConstructors16(null, null, "", new Short("00356")); + + for (ThreadConstructors16 thread : test_illegal) { + thread.start(); + try { + thread.join(); + } catch (InterruptedException e) { + // System.out.println("InterruptedException"); + } + } + + if (i == 3) { + if (ecount == 1) { + System.out.println("0"); + return; + } + } + System.out.println("2"); + return; + } + + public void run() { + i++; + super.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0153-rt-thread-ThreadConstructors17/ThreadConstructors17.java b/test/testsuite/ouroboros/thread_test/RT0153-rt-thread-ThreadConstructors17/ThreadConstructors17.java index defc7ab1cb03d74fcebdddf53c61780ec7e430ec..f3c86c23fa878301c3a965ef0cebfe9c0d926261 100644 --- a/test/testsuite/ouroboros/thread_test/RT0153-rt-thread-ThreadConstructors17/ThreadConstructors17.java +++ b/test/testsuite/ouroboros/thread_test/RT0153-rt-thread-ThreadConstructors17/ThreadConstructors17.java @@ -1,80 +1,80 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadConstructors17 - *- @TestCaseName: Thread_ThreadConstructors17.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for Constructors Thread(ThreadGroup group, String name) - *- @Brief: see below - * -#step1: Create thread instance. - * -#step2: Test Constructors Thread(ThreadGroup group, String name) with different params. - * -#step3: Check that NullPointerException was threw when name param was null; - *- @Expect: expected.txt - *- @Priority: High - *- @Source: ThreadConstructors17.java - *- @ExecuteClass: ThreadConstructors17 - *- @ExecuteArgs: - */ - -public class ThreadConstructors17 extends Thread { - static int i = 0; - static int ecount = 0; - - public ThreadConstructors17(ThreadGroup group, String name) { - super(group, name); - } - - public static void main(String[] args) { - try { - ThreadConstructors17 test_illegal1 = new ThreadConstructors17(null, null); - } catch (NullPointerException e) { - //System.out.println("NullPointerException"); - ecount++; - } - - ThreadConstructors17 test_illegal2 = new ThreadConstructors17(null, ""); - ThreadConstructors17 test_illegal3 = new ThreadConstructors17(null, new String()); - - test_illegal2.start(); - try { - test_illegal2.join(); - } catch (InterruptedException e) { - System.out.println("InterruptedException"); - } - - test_illegal3.start(); - try { - test_illegal3.join(); - } catch (InterruptedException e) { - System.out.println("InterruptedException"); - } - - if (i == 2) { - if (ecount == 1) { - System.out.println("0"); - return; - } - } - System.out.println("2"); - return; - } - - public void run() { - i++; - super.run(); - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadConstructors17 + *- @TestCaseName: Thread_ThreadConstructors17.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for Constructors Thread(ThreadGroup group, String name) + *- @Brief: see below + * -#step1: Create thread instance. + * -#step2: Test Constructors Thread(ThreadGroup group, String name) with different params. + * -#step3: Check that NullPointerException was threw when name param was null; + *- @Expect: expected.txt + *- @Priority: High + *- @Source: ThreadConstructors17.java + *- @ExecuteClass: ThreadConstructors17 + *- @ExecuteArgs: + */ + +public class ThreadConstructors17 extends Thread { + static int i = 0; + static int ecount = 0; + + public ThreadConstructors17(ThreadGroup group, String name) { + super(group, name); + } + + public static void main(String[] args) { + try { + ThreadConstructors17 test_illegal1 = new ThreadConstructors17(null, null); + } catch (NullPointerException e) { + //System.out.println("NullPointerException"); + ecount++; + } + + ThreadConstructors17 test_illegal2 = new ThreadConstructors17(null, ""); + ThreadConstructors17 test_illegal3 = new ThreadConstructors17(null, new String()); + + test_illegal2.start(); + try { + test_illegal2.join(); + } catch (InterruptedException e) { + System.out.println("InterruptedException"); + } + + test_illegal3.start(); + try { + test_illegal3.join(); + } catch (InterruptedException e) { + System.out.println("InterruptedException"); + } + + if (i == 2) { + if (ecount == 1) { + System.out.println("0"); + return; + } + } + System.out.println("2"); + return; + } + + public void run() { + i++; + super.run(); + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0154-rt-thread-ThreadEHcountStackFrames/ThreadCountStackFramesTest.java b/test/testsuite/ouroboros/thread_test/RT0154-rt-thread-ThreadEHcountStackFrames/ThreadCountStackFramesTest.java index 3c0d186a9ea247868d22606b100593f0abf932f1..ccb209f515c1ea08c9b00c48bcb5dba83ff506af 100644 --- a/test/testsuite/ouroboros/thread_test/RT0154-rt-thread-ThreadEHcountStackFrames/ThreadCountStackFramesTest.java +++ b/test/testsuite/ouroboros/thread_test/RT0154-rt-thread-ThreadEHcountStackFrames/ThreadCountStackFramesTest.java @@ -1,66 +1,66 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadCountStackFramesTest - *- @TestCaseName: Thread_ThreadCountStackFramesTest.java - *- @RequirementName: Java Thread - *- @Title/Destination: Check if countStackFrames throws IllegalThreadStateException when thread not suspended. - *- @Brief: see below - * -#step1: 创建Thread对象实例。 - * -#step2:调用start()启动对象实例。 - * -#step3:调用countStackFrames()确认无异常抛出。 - * -#step4:调用getStackTrace(),获取返回的长度为0。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadCountStackFramesTest.java - *- @ExecuteClass: ThreadCountStackFramesTest - *- @ExecuteArgs: - */ - -public class ThreadCountStackFramesTest extends Thread { - static int cnt = 0; - static Object ob = "aa"; - - public static void main(String[] args) { - ThreadCountStackFramesTest thCountStackFramesTest = new ThreadCountStackFramesTest(); - thCountStackFramesTest.start(); - - try { - cnt = thCountStackFramesTest.countStackFrames(); - } catch (IllegalThreadStateException e) { - System.out.println(2); - return; - } - - int j = thCountStackFramesTest.getStackTrace().length; - if (j == cnt) { - System.out.println(0); - return; - } - - System.out.println(2); - } - - public void run() { - synchronized (ob) { - try { - ob.wait(1000); - } catch (InterruptedException e) { - System.out.println("Wait is interrupted"); - } - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadCountStackFramesTest + *- @TestCaseName: Thread_ThreadCountStackFramesTest.java + *- @RequirementName: Java Thread + *- @Title/Destination: Check if countStackFrames throws IllegalThreadStateException when thread not suspended. + *- @Brief: see below + * -#step1: 创建Thread对象实例。 + * -#step2:调用start()启动对象实例。 + * -#step3:调用countStackFrames()确认无异常抛出。 + * -#step4:调用getStackTrace(),获取返回的长度为0。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadCountStackFramesTest.java + *- @ExecuteClass: ThreadCountStackFramesTest + *- @ExecuteArgs: + */ + +public class ThreadCountStackFramesTest extends Thread { + static int cnt = 0; + static Object ob = "aa"; + + public static void main(String[] args) { + ThreadCountStackFramesTest thCountStackFramesTest = new ThreadCountStackFramesTest(); + thCountStackFramesTest.start(); + + try { + cnt = thCountStackFramesTest.countStackFrames(); + } catch (IllegalThreadStateException e) { + System.out.println(2); + return; + } + + int j = thCountStackFramesTest.getStackTrace().length; + if (j == cnt) { + System.out.println(0); + return; + } + + System.out.println(2); + } + + public void run() { + synchronized (ob) { + try { + ob.wait(1000); + } catch (InterruptedException e) { + System.out.println("Wait is interrupted"); + } + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0155-rt-thread-ThreadEHdestroy/ThreadDestroyUnsupportedOperationExceptionTest.java b/test/testsuite/ouroboros/thread_test/RT0155-rt-thread-ThreadEHdestroy/ThreadDestroyUnsupportedOperationExceptionTest.java index d05ebca1c2d734be02f69882a79d29ab9b271ee6..0954ddf1a41e96058cd61f34a7e5138325ed4e4a 100644 --- a/test/testsuite/ouroboros/thread_test/RT0155-rt-thread-ThreadEHdestroy/ThreadDestroyUnsupportedOperationExceptionTest.java +++ b/test/testsuite/ouroboros/thread_test/RT0155-rt-thread-ThreadEHdestroy/ThreadDestroyUnsupportedOperationExceptionTest.java @@ -1,49 +1,49 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadDestroyUnsupportedOperationExceptionTest - *- @TestCaseName: Thread_ThreadDestroyUnsupportedOperationExceptionTest.java - *- @RequirementName: Java Thread - *- @Title/Destination: Check if destroy() throws UnsupportedOperationException. - *- @Brief: see below - * -#step1: 创建Thread对象实例。 - * -#step2:调用start()启动对象实例。 - * -#step3: 调用destroy()方法。 - * -#step4:确认抛出UnsupportedOperationException。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadDestroyUnsupportedOperationExceptionTest.java - *- @ExecuteClass: ThreadDestroyUnsupportedOperationExceptionTest - *- @ExecuteArgs: - */ - -public class ThreadDestroyUnsupportedOperationExceptionTest extends Thread { - public static void main(String[] args) { - ThreadDestroyUnsupportedOperationExceptionTest thread = new ThreadDestroyUnsupportedOperationExceptionTest(); - thread.start(); - - try { - thread.destroy(); - } catch (UnsupportedOperationException e) { - System.out.println(0); - return; - } catch (Throwable ee) { - System.out.println(1); - return; - } - System.out.println(2); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadDestroyUnsupportedOperationExceptionTest + *- @TestCaseName: Thread_ThreadDestroyUnsupportedOperationExceptionTest.java + *- @RequirementName: Java Thread + *- @Title/Destination: Check if destroy() throws UnsupportedOperationException. + *- @Brief: see below + * -#step1: 创建Thread对象实例。 + * -#step2:调用start()启动对象实例。 + * -#step3: 调用destroy()方法。 + * -#step4:确认抛出UnsupportedOperationException。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadDestroyUnsupportedOperationExceptionTest.java + *- @ExecuteClass: ThreadDestroyUnsupportedOperationExceptionTest + *- @ExecuteArgs: + */ + +public class ThreadDestroyUnsupportedOperationExceptionTest extends Thread { + public static void main(String[] args) { + ThreadDestroyUnsupportedOperationExceptionTest thread = new ThreadDestroyUnsupportedOperationExceptionTest(); + thread.start(); + + try { + thread.destroy(); + } catch (UnsupportedOperationException e) { + System.out.println(0); + return; + } catch (Throwable ee) { + System.out.println(1); + return; + } + System.out.println(2); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0156-rt-thread-Threadenumerate2/Threadenumerate2.java b/test/testsuite/ouroboros/thread_test/RT0156-rt-thread-Threadenumerate2/Threadenumerate2.java index 45a14c2bff02bba48ddfc1e9f9013ecfb2cc02dc..ae08fb405280a290c6543336984486957ce63567 100644 --- a/test/testsuite/ouroboros/thread_test/RT0156-rt-thread-Threadenumerate2/Threadenumerate2.java +++ b/test/testsuite/ouroboros/thread_test/RT0156-rt-thread-Threadenumerate2/Threadenumerate2.java @@ -1,56 +1,56 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: Threadenumerate2 - *- @TestCaseName: Thread_Threadenumerate2.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for static int enumerate(Thread[] tarray). - *- @Brief: see below - * -#step1: 创建Thread对象实例。 - * -#step2:调用start()启动对象实例。 - * -#step3: 构造参数tarray为null,调用enumerate(Thread[] tarray)。 - * -#step4:确认NullPointerException抛出。 - * -#step5: 构造参数tarray为new Thread[0],调用enumerate(Thread[] tarray)。 - * -#step6:确认返回为0。 - *- @Expect: expected.txt - *- @Priority: High - *- @Source: Threadenumerate2.java - *- @ExecuteClass: Threadenumerate2 - *- @ExecuteArgs: - */ - -public class Threadenumerate2 extends Thread { - static int num = 0; - static int eCount = 0; - - public static void main(String[] args) { - Threadenumerate2 te = new Threadenumerate2(); - te.start(); - - try { - enumerate(null); - } catch (NullPointerException e) { - eCount++; - } - - num = enumerate(new Thread[0]); - if (num == 0 && eCount == 1) { - System.out.println(0); - return; - } - System.out.println(2); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: Threadenumerate2 + *- @TestCaseName: Thread_Threadenumerate2.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for static int enumerate(Thread[] tarray). + *- @Brief: see below + * -#step1: 创建Thread对象实例。 + * -#step2:调用start()启动对象实例。 + * -#step3: 构造参数tarray为null,调用enumerate(Thread[] tarray)。 + * -#step4:确认NullPointerException抛出。 + * -#step5: 构造参数tarray为new Thread[0],调用enumerate(Thread[] tarray)。 + * -#step6:确认返回为0。 + *- @Expect: expected.txt + *- @Priority: High + *- @Source: Threadenumerate2.java + *- @ExecuteClass: Threadenumerate2 + *- @ExecuteArgs: + */ + +public class Threadenumerate2 extends Thread { + static int num = 0; + static int eCount = 0; + + public static void main(String[] args) { + Threadenumerate2 te = new Threadenumerate2(); + te.start(); + + try { + enumerate(null); + } catch (NullPointerException e) { + eCount++; + } + + num = enumerate(new Thread[0]); + if (num == 0 && eCount == 1) { + System.out.println(0); + return; + } + System.out.println(2); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0 \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0158-rt-thread-ThreadgetStackTrace/ThreadgetStackTrace.java b/test/testsuite/ouroboros/thread_test/RT0158-rt-thread-ThreadgetStackTrace/ThreadgetStackTrace.java index 9adc6c4837135654fe6242d09e8a1026c42da33e..146efdd77643cc6dbe5939071dc601d376455db0 100644 --- a/test/testsuite/ouroboros/thread_test/RT0158-rt-thread-ThreadgetStackTrace/ThreadgetStackTrace.java +++ b/test/testsuite/ouroboros/thread_test/RT0158-rt-thread-ThreadgetStackTrace/ThreadgetStackTrace.java @@ -1,53 +1,52 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadGetStackTraceTest - *- @TestCaseName: Thread_ThreadgetStackTrace.java - *- @RequirementName: Java Thread - *- @Title/Destination: Test getStackTrace(). - *- @Brief: see below - * -#step1: 调用Thread.currentThread()获取Thread 实例。 - * -#step2:调用getStackTrace()获取对应的StackTraceElement数组。 - * -#step3:确认获取的StackTraceElement数组成员内容正确。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadgetStackTrace.java - *- @ExecuteClass: ThreadgetStackTrace - *- @ExecuteArgs: - */ - - -import java.io.PrintStream; - -public class ThreadgetStackTrace extends Thread { - - public static void main(String[] args) { - System.out.println(run(args, System.out)); - } - - public static int run(String[] args, PrintStream out) { - StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); - - int l = stackTraceElements.length; - if (stackTraceElements[l - 1].toString().contains("main") && stackTraceElements[l - 2].toString().contains("run") && stackTraceElements[l - 3].toString().contains("getStackTrace")) { - return 0; - } - - return 2; - } -} - -// DEPENDENCE: ThreadGetStackTraceTest.java_bak -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan 0\n \ No newline at end of file +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadGetStackTraceTest + *- @TestCaseName: Thread_ThreadgetStackTrace.java + *- @RequirementName: Java Thread + *- @Title/Destination: Test getStackTrace(). + *- @Brief: see below + * -#step1: 调用Thread.currentThread()获取Thread 实例。 + * -#step2:调用getStackTrace()获取对应的StackTraceElement数组。 + * -#step3:确认获取的StackTraceElement数组成员内容正确。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadgetStackTrace.java + *- @ExecuteClass: ThreadgetStackTrace + *- @ExecuteArgs: + */ + + +import java.io.PrintStream; + +public class ThreadgetStackTrace extends Thread { + + public static void main(String[] args) { + System.out.println(run(args, System.out)); + } + + public static int run(String[] args, PrintStream out) { + StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); + + int l = stackTraceElements.length; + if (stackTraceElements[l - 1].toString().contains("main") && stackTraceElements[l - 2].toString().contains("run") && stackTraceElements[l - 3].toString().contains("getStackTrace")) { + return 0; + } + + return 2; + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan 0\n diff --git a/test/testsuite/ouroboros/thread_test/RT0159-rt-thread-ThreadGroupallowThreadSuspension/ThreadGroupAllowThreadSuspensionTest.java b/test/testsuite/ouroboros/thread_test/RT0159-rt-thread-ThreadGroupallowThreadSuspension/ThreadGroupAllowThreadSuspensionTest.java index 0294a3be19409a9b45b75499eee75dcb08cfc43b..2258d7d2131055deba9ad6feecf23e4fbfd55972 100644 --- a/test/testsuite/ouroboros/thread_test/RT0159-rt-thread-ThreadGroupallowThreadSuspension/ThreadGroupAllowThreadSuspensionTest.java +++ b/test/testsuite/ouroboros/thread_test/RT0159-rt-thread-ThreadGroupallowThreadSuspension/ThreadGroupAllowThreadSuspensionTest.java @@ -1,77 +1,77 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadGroupAllowThreadSuspensionTest - *- @TestCaseName: Thread_ThreadGroupAllowThreadSuspensionTest.java - *- @RequirementName: Java Thread - *- @Title/Destination: Test ThreadGroup.allowSuspension(), it changes the value of vmAllowSuspension. - *- @Brief: see below - * -#step1: 通过new ThreadGroup(String name)构造新的实例。 - * -#step2:调用allowThreadSuspension(boolean b),参数b为true。 - * -#step3:通过反射getDeclaredField获取私有域vmAllowSuspension判断值不为true。 - * -#step4:调用allowThreadSuspension(boolean b),参数b为false。 - * -#step5:通过反射getDeclaredField获取私有域vmAllowSuspension判断值不为false。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadGroupAllowThreadSuspensionTest.java - *- @ExecuteClass: ThreadGroupAllowThreadSuspensionTest - *- @ExecuteArgs: - */ - -import java.lang.reflect.Field; - -public class ThreadGroupAllowThreadSuspensionTest { - public static void main(String[] args) { - ThreadGroup tg = new ThreadGroup("group"); - tg.allowThreadSuspension(true); - try { - if (getValue(tg, "vmAllowSuspension").toString() != "true") { - System.out.println(2); - return; - } - } catch (Throwable e) { - System.out.println(2); - return; - } - - tg.allowThreadSuspension(false); - try { - if (getValue(tg, "vmAllowSuspension").toString() != "false") { - System.out.println(2); - return; - } - } catch (Throwable e) { - System.out.println(2); - return; - } - System.out.println(0); - } - - // Use reflect to get the value of private field of ThreadGroup - public static Object getValue(Object instance, String fieldName) throws IllegalAccessException, NoSuchFieldException { - Field field = getField(instance.getClass(), fieldName); - field.setAccessible(true); - return field.get(instance); - } - - public static Field getField(Class thisClass, String fieldName) throws NoSuchFieldException { - if (fieldName == null) { - throw new NoSuchFieldException("Error field !"); - } - Field field = thisClass.getDeclaredField(fieldName); - return field; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadGroupAllowThreadSuspensionTest + *- @TestCaseName: Thread_ThreadGroupAllowThreadSuspensionTest.java + *- @RequirementName: Java Thread + *- @Title/Destination: Test ThreadGroup.allowSuspension(), it changes the value of vmAllowSuspension. + *- @Brief: see below + * -#step1: 通过new ThreadGroup(String name)构造新的实例。 + * -#step2:调用allowThreadSuspension(boolean b),参数b为true。 + * -#step3:通过反射getDeclaredField获取私有域vmAllowSuspension判断值不为true。 + * -#step4:调用allowThreadSuspension(boolean b),参数b为false。 + * -#step5:通过反射getDeclaredField获取私有域vmAllowSuspension判断值不为false。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadGroupAllowThreadSuspensionTest.java + *- @ExecuteClass: ThreadGroupAllowThreadSuspensionTest + *- @ExecuteArgs: + */ + +import java.lang.reflect.Field; + +public class ThreadGroupAllowThreadSuspensionTest { + public static void main(String[] args) { + ThreadGroup tg = new ThreadGroup("group"); + tg.allowThreadSuspension(true); + try { + if (getValue(tg, "vmAllowSuspension").toString() != "true") { + System.out.println(2); + return; + } + } catch (Throwable e) { + System.out.println(2); + return; + } + + tg.allowThreadSuspension(false); + try { + if (getValue(tg, "vmAllowSuspension").toString() != "false") { + System.out.println(2); + return; + } + } catch (Throwable e) { + System.out.println(2); + return; + } + System.out.println(0); + } + + // Use reflect to get the value of private field of ThreadGroup + public static Object getValue(Object instance, String fieldName) throws IllegalAccessException, NoSuchFieldException { + Field field = getField(instance.getClass(), fieldName); + field.setAccessible(true); + return field.get(instance); + } + + public static Field getField(Class thisClass, String fieldName) throws NoSuchFieldException { + if (fieldName == null) { + throw new NoSuchFieldException("Error field !"); + } + Field field = thisClass.getDeclaredField(fieldName); + return field; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0160-rt-thread-ThreadGroupEHdestroy/ThreadGroupEHdestroy.java b/test/testsuite/ouroboros/thread_test/RT0160-rt-thread-ThreadGroupEHdestroy/ThreadGroupEHdestroy.java index 583130bf154e15328b40bbcf7c3228c9b7912b36..72c5724f3b6f4a030f971791078e68f59c1bf662 100644 --- a/test/testsuite/ouroboros/thread_test/RT0160-rt-thread-ThreadGroupEHdestroy/ThreadGroupEHdestroy.java +++ b/test/testsuite/ouroboros/thread_test/RT0160-rt-thread-ThreadGroupEHdestroy/ThreadGroupEHdestroy.java @@ -1,68 +1,68 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadGroupEHdestroy - *- @TestCaseName: Thread_ThreadGroupEHdestroy.java - *- @RequirementName: Java Thread - *- @Title/Destination: Check if destroy throws IllegalThreadStateException. - *- @Brief: see below - * -#step1: 通过new ThreadGroup(String name)构造新的实例tg。 - * -#step2: 通过Thread(ThreadGroup group, String name)分配新的thread对象。 - * -#step3:调用start()启动线程。 - * -#step4:对ThreadGroup对象tg调用destroy(),预计会抛出IllegalThreadStateException。 - * -#step5:调用join()等待线程运行结束。 - * -#step6:对ThreadGroup对象tg调用destroy(),预计会抛出IllegalThreadStateException。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadGroupEHdestroy.java - *- @ExecuteClass: ThreadGroupEHdestroy - *- @ExecuteArgs: - */ - -public class ThreadGroupEHdestroy { - static int cnt = 0; - - public static void main(String[] args) { - ThreadGroup tg = new ThreadGroup("hi"); - Thread t = new Thread(tg, "hello"); - t.start(); - // Destroy a thread group which is not empty, throws IllegalThreadStateException - try { - tg.destroy(); - } catch (IllegalThreadStateException e) { - cnt++; - } - try { - t.join(); - } catch (InterruptedException ee) { - System.out.println("Join is interrupted"); - } - - tg.destroy(); - // Destroy a thread group which is already destroyed, throws IllegalThreadStateException - try { - tg.destroy(); - } catch (IllegalThreadStateException e) { - cnt += 2; - } - - if (cnt == 3) { - System.out.println(0); - return; - } - System.out.println(2); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadGroupEHdestroy + *- @TestCaseName: Thread_ThreadGroupEHdestroy.java + *- @RequirementName: Java Thread + *- @Title/Destination: Check if destroy throws IllegalThreadStateException. + *- @Brief: see below + * -#step1: 通过new ThreadGroup(String name)构造新的实例tg。 + * -#step2: 通过Thread(ThreadGroup group, String name)分配新的thread对象。 + * -#step3:调用start()启动线程。 + * -#step4:对ThreadGroup对象tg调用destroy(),预计会抛出IllegalThreadStateException。 + * -#step5:调用join()等待线程运行结束。 + * -#step6:对ThreadGroup对象tg调用destroy(),预计会抛出IllegalThreadStateException。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadGroupEHdestroy.java + *- @ExecuteClass: ThreadGroupEHdestroy + *- @ExecuteArgs: + */ + +public class ThreadGroupEHdestroy { + static int cnt = 0; + + public static void main(String[] args) { + ThreadGroup tg = new ThreadGroup("hi"); + Thread t = new Thread(tg, "hello"); + t.start(); + // Destroy a thread group which is not empty, throws IllegalThreadStateException + try { + tg.destroy(); + } catch (IllegalThreadStateException e) { + cnt++; + } + try { + t.join(); + } catch (InterruptedException ee) { + System.out.println("Join is interrupted"); + } + + tg.destroy(); + // Destroy a thread group which is already destroyed, throws IllegalThreadStateException + try { + tg.destroy(); + } catch (IllegalThreadStateException e) { + cnt += 2; + } + + if (cnt == 3) { + System.out.println(0); + return; + } + System.out.println(2); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0161-rt-thread-ThreadholdsLock4/ThreadholdsLock4.java b/test/testsuite/ouroboros/thread_test/RT0161-rt-thread-ThreadholdsLock4/ThreadholdsLock4.java index 6ae1d6e09626313918b11dfb3413c2296a3f502b..8057b42cffbb050c8d9f0bf3058de7e420b692b0 100644 --- a/test/testsuite/ouroboros/thread_test/RT0161-rt-thread-ThreadholdsLock4/ThreadholdsLock4.java +++ b/test/testsuite/ouroboros/thread_test/RT0161-rt-thread-ThreadholdsLock4/ThreadholdsLock4.java @@ -1,60 +1,60 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadholdsLock4 - *- @TestCaseName: Thread_ThreadholdsLock4.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for boolean holdsLock(Object obj). - *- @Brief: see below - * -#step1: 构造Thread实例。 - * -#step2:调用holdsLock(Object obj), 参数obj为null。 - * -#step3:确认抛出NullPointerException。 - * -#step4: 重复两次调用holdsLock(Object obj), 参数obj为"", 预期每次结果都返回false。 - * -#step5: 调用holdsLock(Object obj), 参数obj为new Object(), 预期结果返回false。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadholdsLock4.java - *- @ExecuteClass: ThreadholdsLock4 - *- @ExecuteArgs: - */ - -public class ThreadholdsLock4 extends Thread { - static int eCount = 0; - static int sCount = 0; - - public static void main(String[] args) { - ThreadholdsLock4 tl = new ThreadholdsLock4(); - try { - holdsLock(null); - } catch (NullPointerException e) { - eCount++; - } - - if (!holdsLock("")) { - if (!holdsLock("")) { - if (!holdsLock(new Object())) { - sCount++; - } - } - } - - if (sCount == 1 && eCount == 1) { - System.out.println(0); - return; - } - System.out.println(2); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadholdsLock4 + *- @TestCaseName: Thread_ThreadholdsLock4.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for boolean holdsLock(Object obj). + *- @Brief: see below + * -#step1: 构造Thread实例。 + * -#step2:调用holdsLock(Object obj), 参数obj为null。 + * -#step3:确认抛出NullPointerException。 + * -#step4: 重复两次调用holdsLock(Object obj), 参数obj为"", 预期每次结果都返回false。 + * -#step5: 调用holdsLock(Object obj), 参数obj为new Object(), 预期结果返回false。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadholdsLock4.java + *- @ExecuteClass: ThreadholdsLock4 + *- @ExecuteArgs: + */ + +public class ThreadholdsLock4 extends Thread { + static int eCount = 0; + static int sCount = 0; + + public static void main(String[] args) { + ThreadholdsLock4 tl = new ThreadholdsLock4(); + try { + holdsLock(null); + } catch (NullPointerException e) { + eCount++; + } + + if (!holdsLock("")) { + if (!holdsLock("")) { + if (!holdsLock(new Object())) { + sCount++; + } + } + } + + if (sCount == 1 && eCount == 1) { + System.out.println(0); + return; + } + System.out.println(2); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0162-rt-thread-ThreadLocalEHwithInitial/ThreadLocalEHwithInitial.java b/test/testsuite/ouroboros/thread_test/RT0162-rt-thread-ThreadLocalEHwithInitial/ThreadLocalEHwithInitial.java index 00a2fb779e09207464beb3f56b58e3d855128a47..9b3bce4110d2630fc266edfc8d292273f8afc9ba 100644 --- a/test/testsuite/ouroboros/thread_test/RT0162-rt-thread-ThreadLocalEHwithInitial/ThreadLocalEHwithInitial.java +++ b/test/testsuite/ouroboros/thread_test/RT0162-rt-thread-ThreadLocalEHwithInitial/ThreadLocalEHwithInitial.java @@ -1,42 +1,42 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadLocalEHwithInitial - *- @TestCaseName: Thread_ThreadLocalEHwithInitial.java - *- @RequirementName: Java Thread - *- @Title/Destination: Check if ThreadLocal.withInitial(Supplier supplier) throws NullPointerException. - *- @Brief: see below - * -#step1: 创建参数supplier为null。 - * -#step2:调用withInitial(Supplier supplier)。 - * -#step3:确认会抛出NullPointerException异常。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadLocalEHwithInitial.java - *- @ExecuteClass: ThreadLocalEHwithInitial - *- @ExecuteArgs: - */ - -public class ThreadLocalEHwithInitial { - public static void main(String[] args) { - try { - ThreadLocal threadLocal = ThreadLocal.withInitial(null); - } catch (NullPointerException e) { - System.out.println(0); - return; - } - System.out.println(2); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadLocalEHwithInitial + *- @TestCaseName: Thread_ThreadLocalEHwithInitial.java + *- @RequirementName: Java Thread + *- @Title/Destination: Check if ThreadLocal.withInitial(Supplier supplier) throws NullPointerException. + *- @Brief: see below + * -#step1: 创建参数supplier为null。 + * -#step2:调用withInitial(Supplier supplier)。 + * -#step3:确认会抛出NullPointerException异常。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadLocalEHwithInitial.java + *- @ExecuteClass: ThreadLocalEHwithInitial + *- @ExecuteArgs: + */ + +public class ThreadLocalEHwithInitial { + public static void main(String[] args) { + try { + ThreadLocal threadLocal = ThreadLocal.withInitial(null); + } catch (NullPointerException e) { + System.out.println(0); + return; + } + System.out.println(2); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0163-rt-thread-ThreadsetContextClassLoader1/ThreadsetContextClassLoader1.java b/test/testsuite/ouroboros/thread_test/RT0163-rt-thread-ThreadsetContextClassLoader1/ThreadsetContextClassLoader1.java index c740bb8c4c05bf6cdfd92bf629fc0a6390802cc4..b91c9d41d434b9aabce079c51bab12cfac91a7fe 100644 --- a/test/testsuite/ouroboros/thread_test/RT0163-rt-thread-ThreadsetContextClassLoader1/ThreadsetContextClassLoader1.java +++ b/test/testsuite/ouroboros/thread_test/RT0163-rt-thread-ThreadsetContextClassLoader1/ThreadsetContextClassLoader1.java @@ -1,58 +1,58 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadsetContextClassLoader1 - *- @TestCaseName: Thread_ThreadsetContextClassLoader1.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for setContextClassLoader(ClassLoader cl). - *- @Brief: see below - * -#step1: 创建Thread实例。 - * -#step2:调用setContextClassLoader(ClassLoader cl),参数cl为null。 - * -#step3:调用start()启动线程,等待线程结束。 - * -#step4:确认线程的run函数被正常调用。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadsetContextClassLoader1.java - *- @ExecuteClass: ThreadsetContextClassLoader1 - *- @ExecuteArgs: - */ - -public class ThreadsetContextClassLoader1 extends Thread { - static int i = 0; - - public static void main(String[] args) { - ThreadsetContextClassLoader1 t = new ThreadsetContextClassLoader1(); - t.setContextClassLoader(null); - - t.start(); - try { - t.join(); - } catch (InterruptedException e) { - System.out.println("Join is interrupted"); - } - - if (i == 1 && t.getContextClassLoader() == null) { - System.out.println(0); - return; - } - System.out.println(2); - } - - public void run() { - i++; - super.run(); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadsetContextClassLoader1 + *- @TestCaseName: Thread_ThreadsetContextClassLoader1.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for setContextClassLoader(ClassLoader cl). + *- @Brief: see below + * -#step1: 创建Thread实例。 + * -#step2:调用setContextClassLoader(ClassLoader cl),参数cl为null。 + * -#step3:调用start()启动线程,等待线程结束。 + * -#step4:确认线程的run函数被正常调用。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadsetContextClassLoader1.java + *- @ExecuteClass: ThreadsetContextClassLoader1 + *- @ExecuteArgs: + */ + +public class ThreadsetContextClassLoader1 extends Thread { + static int i = 0; + + public static void main(String[] args) { + ThreadsetContextClassLoader1 t = new ThreadsetContextClassLoader1(); + t.setContextClassLoader(null); + + t.start(); + try { + t.join(); + } catch (InterruptedException e) { + System.out.println("Join is interrupted"); + } + + if (i == 1 && t.getContextClassLoader() == null) { + System.out.println(0); + return; + } + System.out.println(2); + } + + public void run() { + i++; + super.run(); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0164-rt-thread-ThreadsetDefaultUncaughtExceptionHandler2/ThreadSetDefaultUncaughtExceptionHandlerTest.java b/test/testsuite/ouroboros/thread_test/RT0164-rt-thread-ThreadsetDefaultUncaughtExceptionHandler2/ThreadSetDefaultUncaughtExceptionHandlerTest.java index 26b8b56240bc430967beb1e17e614ef9289ec4b2..efc31be6a21e80990515597494501f2fa3cade6e 100644 --- a/test/testsuite/ouroboros/thread_test/RT0164-rt-thread-ThreadsetDefaultUncaughtExceptionHandler2/ThreadSetDefaultUncaughtExceptionHandlerTest.java +++ b/test/testsuite/ouroboros/thread_test/RT0164-rt-thread-ThreadsetDefaultUncaughtExceptionHandler2/ThreadSetDefaultUncaughtExceptionHandlerTest.java @@ -1,51 +1,51 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadSetDefaultUncaughtExceptionHandlerTest - *- @TestCaseName: Thread_ThreadSetDefaultUncaughtExceptionHandlerTest.java - *- @RequirementName: Java Thread - *- @Title/Destination: Test negative input for setDefaultUncaughtExceptionHandler(). - *- @Brief: see below - * -#step1: 创建Thread对象实例。 - * -#step2:构造参数eh为实例的getUncaughtExceptionHandler(),调用 - * setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)。 - * -#step3:调用getDefaultUncaughtExceptionHandler()确认返回不为null。 - * -#step4:构造参数eh为实例的null,调用setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)。 - * -#step3:调用getDefaultUncaughtExceptionHandler()确认返回为null。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadSetDefaultUncaughtExceptionHandlerTest.java - *- @ExecuteClass: ThreadSetDefaultUncaughtExceptionHandlerTest - *- @ExecuteArgs: - */ - -public class ThreadSetDefaultUncaughtExceptionHandlerTest extends Thread { - public static void main(String[] args) { - ThreadSetDefaultUncaughtExceptionHandlerTest setEH = new ThreadSetDefaultUncaughtExceptionHandlerTest(); - Thread.setDefaultUncaughtExceptionHandler(setEH.getUncaughtExceptionHandler()); - if (getDefaultUncaughtExceptionHandler() == null) { - System.out.println(1); - return; - } - - Thread.setDefaultUncaughtExceptionHandler(null); - if (getDefaultUncaughtExceptionHandler() == null) { - System.out.println(0); - return; - } - System.out.println(2); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadSetDefaultUncaughtExceptionHandlerTest + *- @TestCaseName: Thread_ThreadSetDefaultUncaughtExceptionHandlerTest.java + *- @RequirementName: Java Thread + *- @Title/Destination: Test negative input for setDefaultUncaughtExceptionHandler(). + *- @Brief: see below + * -#step1: 创建Thread对象实例。 + * -#step2:构造参数eh为实例的getUncaughtExceptionHandler(),调用 + * setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)。 + * -#step3:调用getDefaultUncaughtExceptionHandler()确认返回不为null。 + * -#step4:构造参数eh为实例的null,调用setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)。 + * -#step3:调用getDefaultUncaughtExceptionHandler()确认返回为null。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadSetDefaultUncaughtExceptionHandlerTest.java + *- @ExecuteClass: ThreadSetDefaultUncaughtExceptionHandlerTest + *- @ExecuteArgs: + */ + +public class ThreadSetDefaultUncaughtExceptionHandlerTest extends Thread { + public static void main(String[] args) { + ThreadSetDefaultUncaughtExceptionHandlerTest setEH = new ThreadSetDefaultUncaughtExceptionHandlerTest(); + Thread.setDefaultUncaughtExceptionHandler(setEH.getUncaughtExceptionHandler()); + if (getDefaultUncaughtExceptionHandler() == null) { + System.out.println(1); + return; + } + + Thread.setDefaultUncaughtExceptionHandler(null); + if (getDefaultUncaughtExceptionHandler() == null) { + System.out.println(0); + return; + } + System.out.println(2); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0165-rt-thread-ThreadsetUncaughtExceptionHandler2/ThreadSetUncaughtExceptionHandlerTest.java b/test/testsuite/ouroboros/thread_test/RT0165-rt-thread-ThreadsetUncaughtExceptionHandler2/ThreadSetUncaughtExceptionHandlerTest.java index 8f93b989b4b0ca4c4fc82555743c92fb64711cbd..c0850da7b9eea579867550fba2ac294864688868 100644 --- a/test/testsuite/ouroboros/thread_test/RT0165-rt-thread-ThreadsetUncaughtExceptionHandler2/ThreadSetUncaughtExceptionHandlerTest.java +++ b/test/testsuite/ouroboros/thread_test/RT0165-rt-thread-ThreadsetUncaughtExceptionHandler2/ThreadSetUncaughtExceptionHandlerTest.java @@ -1,65 +1,65 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadSetUncaughtExceptionHandlerTest - *- @TestCaseName: Thread_ThreadSetUncaughtExceptionHandlerTest.java - *- @RequirementName: Java Thread - *- @Title/Destination:test negative input for setUncaughtExceptionHandler() - *- @Brief: see below - * -#step1: 创建Thread对象实例。 - * -#step2: 实例调用getUncaughtExceptionHandler()确认返回不为null。 - * -#step3:构造参数eh为实例的null,调用setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)。 - * -#step4: 启动线程,实例调用getUncaughtExceptionHandler()确认返回不为null。 - * -#step5:等待线程结束,实例调用getUncaughtExceptionHandler()确认返回不为null,run函数被成功调用。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadSetUncaughtExceptionHandlerTest.java - *- @ExecuteClass: ThreadSetUncaughtExceptionHandlerTest - *- @ExecuteArgs: - */ - -public class ThreadSetUncaughtExceptionHandlerTest extends Thread { - static int i = 0; - - public static void main(String[] args) { - ThreadSetUncaughtExceptionHandlerTest setEH = new ThreadSetUncaughtExceptionHandlerTest(); - if (setEH.getUncaughtExceptionHandler() == null) { - System.out.println(1); - return; - } - setEH.setUncaughtExceptionHandler(null); - setEH.start(); - if (setEH.getUncaughtExceptionHandler() == null) { - System.out.println(2); - return; - } - try { - setEH.join(); - } catch (InterruptedException e1) { - System.out.println("Join is interrupted"); - } - - if (i == 1 && setEH.getUncaughtExceptionHandler() != null) { - System.out.println(0); - return; - } - System.out.println(3); - } - - public void run() { - i++; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadSetUncaughtExceptionHandlerTest + *- @TestCaseName: Thread_ThreadSetUncaughtExceptionHandlerTest.java + *- @RequirementName: Java Thread + *- @Title/Destination:test negative input for setUncaughtExceptionHandler() + *- @Brief: see below + * -#step1: 创建Thread对象实例。 + * -#step2: 实例调用getUncaughtExceptionHandler()确认返回不为null。 + * -#step3:构造参数eh为实例的null,调用setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)。 + * -#step4: 启动线程,实例调用getUncaughtExceptionHandler()确认返回不为null。 + * -#step5:等待线程结束,实例调用getUncaughtExceptionHandler()确认返回不为null,run函数被成功调用。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadSetUncaughtExceptionHandlerTest.java + *- @ExecuteClass: ThreadSetUncaughtExceptionHandlerTest + *- @ExecuteArgs: + */ + +public class ThreadSetUncaughtExceptionHandlerTest extends Thread { + static int i = 0; + + public static void main(String[] args) { + ThreadSetUncaughtExceptionHandlerTest setEH = new ThreadSetUncaughtExceptionHandlerTest(); + if (setEH.getUncaughtExceptionHandler() == null) { + System.out.println(1); + return; + } + setEH.setUncaughtExceptionHandler(null); + setEH.start(); + if (setEH.getUncaughtExceptionHandler() == null) { + System.out.println(2); + return; + } + try { + setEH.join(); + } catch (InterruptedException e1) { + System.out.println("Join is interrupted"); + } + + if (i == 1 && setEH.getUncaughtExceptionHandler() != null) { + System.out.println(0); + return; + } + System.out.println(3); + } + + public void run() { + i++; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0166-rt-thread-ThreadStatejoin16/ThreadStatejoin16.java b/test/testsuite/ouroboros/thread_test/RT0166-rt-thread-ThreadStatejoin16/ThreadStatejoin16.java index 527641a6816c9b293854f0c79c473e94145ed290..42ea26057fd40d159d3474de170ff9ad6dad9088 100644 --- a/test/testsuite/ouroboros/thread_test/RT0166-rt-thread-ThreadStatejoin16/ThreadStatejoin16.java +++ b/test/testsuite/ouroboros/thread_test/RT0166-rt-thread-ThreadStatejoin16/ThreadStatejoin16.java @@ -1,68 +1,68 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadStatejoin16 - *- @TestCaseName: Thread_ThreadStatejoin16.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for join(long millis) - *- @Brief: see below - * -#step1: 调用Thread()来构造对象实例。 - * -#step2:调用start()启动线程。 - * -#step3:构造参数millis为负数,调用join(long millis)等待线程结束,确认抛出IllegalArgumentException异常。 - * -#step4:构造参数millis为0,调用join(long millis)等待线程结束,确认线程能正常运行。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadStatejoin16.java - *- @ExecuteClass: ThreadStatejoin16 - *- @ExecuteArgs: - */ - -public class ThreadStatejoin16 extends Thread { - static int i = 0; - static int eCount = 0; - - public static void main(String[] args) { - ThreadStatejoin16 tj = new ThreadStatejoin16(); - tj.start(); - - try { - tj.join(-2); - } catch (InterruptedException e) { - System.out.println(e); - } catch (IllegalArgumentException ee) { - eCount++; - } - - try { - tj.join(0); - } catch (InterruptedException e) { - System.out.println(e); - } catch (IllegalArgumentException ee) { - eCount = eCount + 2; - } - - if (i == 1 && eCount == 1) { - System.out.println(0); - return; - } - System.out.println(2); - } - - public void run() { - i++; - super.run(); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadStatejoin16 + *- @TestCaseName: Thread_ThreadStatejoin16.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for join(long millis) + *- @Brief: see below + * -#step1: 调用Thread()来构造对象实例。 + * -#step2:调用start()启动线程。 + * -#step3:构造参数millis为负数,调用join(long millis)等待线程结束,确认抛出IllegalArgumentException异常。 + * -#step4:构造参数millis为0,调用join(long millis)等待线程结束,确认线程能正常运行。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadStatejoin16.java + *- @ExecuteClass: ThreadStatejoin16 + *- @ExecuteArgs: + */ + +public class ThreadStatejoin16 extends Thread { + static int i = 0; + static int eCount = 0; + + public static void main(String[] args) { + ThreadStatejoin16 tj = new ThreadStatejoin16(); + tj.start(); + + try { + tj.join(-2); + } catch (InterruptedException e) { + System.out.println(e); + } catch (IllegalArgumentException ee) { + eCount++; + } + + try { + tj.join(0); + } catch (InterruptedException e) { + System.out.println(e); + } catch (IllegalArgumentException ee) { + eCount = eCount + 2; + } + + if (i == 1 && eCount == 1) { + System.out.println(0); + return; + } + System.out.println(2); + } + + public void run() { + i++; + super.run(); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0167-rt-thread-ThreadStatejoin17/ThreadStatejoin17.java b/test/testsuite/ouroboros/thread_test/RT0167-rt-thread-ThreadStatejoin17/ThreadStatejoin17.java index 5544d965d9b4baa54fc1576fa62959cb65697c4d..681ce79fda361fc8e6b5bbf0fc531317ca1965c6 100644 --- a/test/testsuite/ouroboros/thread_test/RT0167-rt-thread-ThreadStatejoin17/ThreadStatejoin17.java +++ b/test/testsuite/ouroboros/thread_test/RT0167-rt-thread-ThreadStatejoin17/ThreadStatejoin17.java @@ -1,76 +1,76 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadStatejoin17 - *- @TestCaseName: Thread_ThreadStatejoin17.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for join(long millis, int nanos). - *- @Brief: see below - * -#step1: 调用Thread()来构造对象实例。 - * -#step2:调用start()启动线程。 - * -#step3:构造参数millis为负数,nanos为正整数,调用join(long millis, int nanos)等待线程结束,确认抛出 - * IllegalArgumentException异常。 - * -#step4:构造参数millis为正整数,nanos为负数,调用join(long millis, int nanos)等待线程结束,确认抛出 - * IllegalArgumentException异常。 - * -#step5:构造参数millis为0,nanos为0,调用join(long millis, int nanos)等待线程结束,确认线程能正常运行。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadStatejoin17.java - *- @ExecuteClass: ThreadStatejoin17 - *- @ExecuteArgs: - */ - -public class ThreadStatejoin17 extends Thread { - static int i = 0; - static int eCount = 0; - - public static void main(String[] args) { - ThreadStatejoin17 tj = new ThreadStatejoin17(); - tj.start(); - - long[] invalidMillis = new long[]{-2l, 2l}; - int[] invalidNanos = new int[]{2, -2}; - - for (int j = 0; j < invalidMillis.length; j++) { - try { - tj.join(invalidMillis[j], invalidNanos[j]); - } catch (InterruptedException e) { - System.out.println(e); - } catch (IllegalArgumentException ee) { - eCount++; - } - } - - try { - tj.join(0, 0); - } catch (InterruptedException e) { - System.out.println(e); - } catch (IllegalArgumentException ee) { - eCount = eCount + 10; - } - - if (i == 1 && eCount == invalidMillis.length) { - System.out.println(0); - return; - } - System.out.println(2); - } - - public void run() { - i++; - super.run(); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadStatejoin17 + *- @TestCaseName: Thread_ThreadStatejoin17.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for join(long millis, int nanos). + *- @Brief: see below + * -#step1: 调用Thread()来构造对象实例。 + * -#step2:调用start()启动线程。 + * -#step3:构造参数millis为负数,nanos为正整数,调用join(long millis, int nanos)等待线程结束,确认抛出 + * IllegalArgumentException异常。 + * -#step4:构造参数millis为正整数,nanos为负数,调用join(long millis, int nanos)等待线程结束,确认抛出 + * IllegalArgumentException异常。 + * -#step5:构造参数millis为0,nanos为0,调用join(long millis, int nanos)等待线程结束,确认线程能正常运行。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadStatejoin17.java + *- @ExecuteClass: ThreadStatejoin17 + *- @ExecuteArgs: + */ + +public class ThreadStatejoin17 extends Thread { + static int i = 0; + static int eCount = 0; + + public static void main(String[] args) { + ThreadStatejoin17 tj = new ThreadStatejoin17(); + tj.start(); + + long[] invalidMillis = new long[]{-2l, 2l}; + int[] invalidNanos = new int[]{2, -2}; + + for (int j = 0; j < invalidMillis.length; j++) { + try { + tj.join(invalidMillis[j], invalidNanos[j]); + } catch (InterruptedException e) { + System.out.println(e); + } catch (IllegalArgumentException ee) { + eCount++; + } + } + + try { + tj.join(0, 0); + } catch (InterruptedException e) { + System.out.println(e); + } catch (IllegalArgumentException ee) { + eCount = eCount + 10; + } + + if (i == 1 && eCount == invalidMillis.length) { + System.out.println(0); + return; + } + System.out.println(2); + } + + public void run() { + i++; + super.run(); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0168-rt-thread-ThreadStatesleep7/ThreadStatesleep7.java b/test/testsuite/ouroboros/thread_test/RT0168-rt-thread-ThreadStatesleep7/ThreadStatesleep7.java index 48f77ef0290888edb7629d80c7338699adb5ed6f..550b59897bcc65e3828d749f1022ef8837b3549e 100644 --- a/test/testsuite/ouroboros/thread_test/RT0168-rt-thread-ThreadStatesleep7/ThreadStatesleep7.java +++ b/test/testsuite/ouroboros/thread_test/RT0168-rt-thread-ThreadStatesleep7/ThreadStatesleep7.java @@ -1,48 +1,48 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadStatesleep7 - *- @TestCaseName: Thread_ThreadStatesleep7.java - *- @RequirementName: Java Thread - *- @Title/Destination: Sleep 0 millisecond time or 0 nanos, no exception threw. - *- @Brief: see below - * -#step1: 调用Thread()来构造对象实例。 - * -#step2:调用start()启动线程。 - * -#step3:构造参数millis为0,调用sleep(long millis),确认线程能正常运行,无异常抛出。 - * -#step4:构造参数millis为0,nanos为0,调用sleep(long millis, int nanos),确认确认线程能正常运行,无异常抛出。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadStatesleep7.java - *- @ExecuteClass: ThreadStatesleep7 - *- @ExecuteArgs: - */ - -public class ThreadStatesleep7 extends Thread { - public static void main(String[] args) { - ThreadStatesleep7 cls = new ThreadStatesleep7(); - cls.start(); - try { - sleep(0); - sleep(0, 0); - } catch (InterruptedException e) { - System.out.println("sleep is interrupted"); - } catch (IllegalArgumentException e1) { - System.out.println(2); - return; - } - System.out.println(0); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadStatesleep7 + *- @TestCaseName: Thread_ThreadStatesleep7.java + *- @RequirementName: Java Thread + *- @Title/Destination: Sleep 0 millisecond time or 0 nanos, no exception threw. + *- @Brief: see below + * -#step1: 调用Thread()来构造对象实例。 + * -#step2:调用start()启动线程。 + * -#step3:构造参数millis为0,调用sleep(long millis),确认线程能正常运行,无异常抛出。 + * -#step4:构造参数millis为0,nanos为0,调用sleep(long millis, int nanos),确认确认线程能正常运行,无异常抛出。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadStatesleep7.java + *- @ExecuteClass: ThreadStatesleep7 + *- @ExecuteArgs: + */ + +public class ThreadStatesleep7 extends Thread { + public static void main(String[] args) { + ThreadStatesleep7 cls = new ThreadStatesleep7(); + cls.start(); + try { + sleep(0); + sleep(0, 0); + } catch (InterruptedException e) { + System.out.println("sleep is interrupted"); + } catch (IllegalArgumentException e1) { + System.out.println(2); + return; + } + System.out.println(0); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0169-rt-thread-ThreadStatewait9/ThreadStatewait9.java b/test/testsuite/ouroboros/thread_test/RT0169-rt-thread-ThreadStatewait9/ThreadStatewait9.java index 7042fe3e099415b83019194025dd14c39a830ac9..39776101c9decd9619d5ad02ce5f08c97494a35b 100644 --- a/test/testsuite/ouroboros/thread_test/RT0169-rt-thread-ThreadStatewait9/ThreadStatewait9.java +++ b/test/testsuite/ouroboros/thread_test/RT0169-rt-thread-ThreadStatewait9/ThreadStatewait9.java @@ -1,65 +1,65 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadStatewait9 - *- @TestCaseName: Thread_ThreadStatewait9.java - *- @RequirementName: Java Thread - *- @Title/Destination: Invalid input for Object.wait(long timeout). - *- @Brief: see below - * -#step1: 调用Thread()来构造对象实例。 - * -#step2:调用start()启动线程。 - * -#step3: 构造参数timeout为负数,调用wait(long timeout),确认会抛出IllegalArgumentException异常。 - * -#step4:等待线程结束。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadStatewait9.java - *- @ExecuteClass: ThreadStatewait9 - *- @ExecuteArgs: - */ - -public class ThreadStatewait9 extends Thread { - static Object ob = "aa"; - static int i = 0; - - public static void main(String[] args) { - ThreadStatewait9 threadWait = new ThreadStatewait9(); - threadWait.start(); - try { - threadWait.join(); - } catch (InterruptedException ee) { - System.out.println(2); - return; - } - - if (i == 1) { - System.out.println(0); - return; - } - System.out.println(2); - } - - public void run() { - synchronized (ob) { - try { - ob.wait(-1000); - } catch (IllegalArgumentException ee) { - i++; - } catch (InterruptedException e) { - System.out.println("Wait is interrupted"); - } - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadStatewait9 + *- @TestCaseName: Thread_ThreadStatewait9.java + *- @RequirementName: Java Thread + *- @Title/Destination: Invalid input for Object.wait(long timeout). + *- @Brief: see below + * -#step1: 调用Thread()来构造对象实例。 + * -#step2:调用start()启动线程。 + * -#step3: 构造参数timeout为负数,调用wait(long timeout),确认会抛出IllegalArgumentException异常。 + * -#step4:等待线程结束。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadStatewait9.java + *- @ExecuteClass: ThreadStatewait9 + *- @ExecuteArgs: + */ + +public class ThreadStatewait9 extends Thread { + static Object ob = "aa"; + static int i = 0; + + public static void main(String[] args) { + ThreadStatewait9 threadWait = new ThreadStatewait9(); + threadWait.start(); + try { + threadWait.join(); + } catch (InterruptedException ee) { + System.out.println(2); + return; + } + + if (i == 1) { + System.out.println(0); + return; + } + System.out.println(2); + } + + public void run() { + synchronized (ob) { + try { + ob.wait(-1000); + } catch (IllegalArgumentException ee) { + i++; + } catch (InterruptedException e) { + System.out.println("Wait is interrupted"); + } + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0170-rt-thread-ThreadStatewait10/ThreadStatewait10.java b/test/testsuite/ouroboros/thread_test/RT0170-rt-thread-ThreadStatewait10/ThreadStatewait10.java index 5744b8f79dc9c97b2160f1fdfbe704aeb568991c..7b22fcde7dfb49c1efe858f9cea792aa8021e587 100644 --- a/test/testsuite/ouroboros/thread_test/RT0170-rt-thread-ThreadStatewait10/ThreadStatewait10.java +++ b/test/testsuite/ouroboros/thread_test/RT0170-rt-thread-ThreadStatewait10/ThreadStatewait10.java @@ -1,66 +1,66 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadStatewait10 - *- @TestCaseName: Thread_ThreadStatewait10.java - *- @RequirementName: Java Thread - *- @Title/Destination: Invalid input for Object.wait(long timeout, int nanos). - *- @Brief: see below - * -#step1: 调用Thread()来构造对象实例。 - * -#step2:调用start()启动线程。 - * -#step3: 构造参数timeout为正整数,参数nanos为负数,调用wait(long timeout, int nanos),确认会抛出 - * IllegalArgumentException. - * -#step4:等待线程结束。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadStatewait10.java - *- @ExecuteClass: ThreadStatewait10 - *- @ExecuteArgs: - */ - -public class ThreadStatewait10 extends Thread { - static Object ob = "aa"; - static int i = 0; - - public static void main(String[] args) { - ThreadStatewait10 threadWait = new ThreadStatewait10(); - threadWait.start(); - try { - threadWait.join(); - } catch (InterruptedException ee) { - System.out.println(2); - return; - } - - if (i == 1) { - System.out.println(0); - return; - } - System.out.println(2); - } - - public void run() { - synchronized (ob) { - try { - ob.wait(100, -1000); - } catch (IllegalArgumentException ee) { - i++; - } catch (InterruptedException e) { - System.out.println("Wait is interrupted"); - } - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadStatewait10 + *- @TestCaseName: Thread_ThreadStatewait10.java + *- @RequirementName: Java Thread + *- @Title/Destination: Invalid input for Object.wait(long timeout, int nanos). + *- @Brief: see below + * -#step1: 调用Thread()来构造对象实例。 + * -#step2:调用start()启动线程。 + * -#step3: 构造参数timeout为正整数,参数nanos为负数,调用wait(long timeout, int nanos),确认会抛出 + * IllegalArgumentException. + * -#step4:等待线程结束。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadStatewait10.java + *- @ExecuteClass: ThreadStatewait10 + *- @ExecuteArgs: + */ + +public class ThreadStatewait10 extends Thread { + static Object ob = "aa"; + static int i = 0; + + public static void main(String[] args) { + ThreadStatewait10 threadWait = new ThreadStatewait10(); + threadWait.start(); + try { + threadWait.join(); + } catch (InterruptedException ee) { + System.out.println(2); + return; + } + + if (i == 1) { + System.out.println(0); + return; + } + System.out.println(2); + } + + public void run() { + synchronized (ob) { + try { + ob.wait(100, -1000); + } catch (IllegalArgumentException ee) { + i++; + } catch (InterruptedException e) { + System.out.println("Wait is interrupted"); + } + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0171-rt-thread-ThreadStatewait11/ThreadStatewait11.java b/test/testsuite/ouroboros/thread_test/RT0171-rt-thread-ThreadStatewait11/ThreadStatewait11.java index e974cc3c8a2978060b72700fbe3eb8642b5a9216..c8310ff6df364d70b0073741873f3ce64b77f444 100644 --- a/test/testsuite/ouroboros/thread_test/RT0171-rt-thread-ThreadStatewait11/ThreadStatewait11.java +++ b/test/testsuite/ouroboros/thread_test/RT0171-rt-thread-ThreadStatewait11/ThreadStatewait11.java @@ -1,47 +1,47 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadStatewait11 - *- @TestCaseName: Thread_ThreadStatewait11.java - *- @RequirementName: Java Thread - *- @Title/Destination: Invalid input for Object.wait(long timeout). - *- @Brief: see below - * -#step1: 调用ThreadStatewait11()来构造对象实例。 - * -#step2:调用start()启动线程。 - * -#step3: 构造参数timeout为0,调用wait(long timeout),确认会抛出IllegalMonitorStateException. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadStatewait11.java - *- @ExecuteClass: ThreadStatewait11 - *- @ExecuteArgs: - */ - -public class ThreadStatewait11 extends Thread { - public static void main(String[] args) { - ThreadStatewait11 threadWait = new ThreadStatewait11(); - threadWait.start(); - try { - threadWait.wait(0); - } catch (InterruptedException e) { - System.out.println(2); - return; - } catch (IllegalMonitorStateException e1) { - System.out.println(0); - return; - } - System.out.println(2); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadStatewait11 + *- @TestCaseName: Thread_ThreadStatewait11.java + *- @RequirementName: Java Thread + *- @Title/Destination: Invalid input for Object.wait(long timeout). + *- @Brief: see below + * -#step1: 调用ThreadStatewait11()来构造对象实例。 + * -#step2:调用start()启动线程。 + * -#step3: 构造参数timeout为0,调用wait(long timeout),确认会抛出IllegalMonitorStateException. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadStatewait11.java + *- @ExecuteClass: ThreadStatewait11 + *- @ExecuteArgs: + */ + +public class ThreadStatewait11 extends Thread { + public static void main(String[] args) { + ThreadStatewait11 threadWait = new ThreadStatewait11(); + threadWait.start(); + try { + threadWait.wait(0); + } catch (InterruptedException e) { + System.out.println(2); + return; + } catch (IllegalMonitorStateException e1) { + System.out.println(0); + return; + } + System.out.println(2); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0172-rt-thread-ThreadStatewait12/ThreadStatewait12.java b/test/testsuite/ouroboros/thread_test/RT0172-rt-thread-ThreadStatewait12/ThreadStatewait12.java index 577619616e422f890680bd6d91a2ed1c5ebff2cd..0e01de478b939a9f0f1250916315889a8b98677a 100644 --- a/test/testsuite/ouroboros/thread_test/RT0172-rt-thread-ThreadStatewait12/ThreadStatewait12.java +++ b/test/testsuite/ouroboros/thread_test/RT0172-rt-thread-ThreadStatewait12/ThreadStatewait12.java @@ -1,47 +1,47 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadStatewait12 - *- @TestCaseName: Thread_ThreadStatewait12.java - *- @RequirementName: Java Thread - *- @Title/Destination: Invalid input for Object.wait(long timeout, int nanos). - *- @Brief: see below - * -#step1: 调用ThreadStatewait12()来构造对象实例。 - * -#step2:调用start()启动线程。 - * -#step3: 构造参数timeout为0,nanos为0,调用wait(long timeout, int nanos),确认会抛出IllegalMonitorStateException. - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadStatewait12.java - *- @ExecuteClass: ThreadStatewait12 - *- @ExecuteArgs: - */ - -public class ThreadStatewait12 extends Thread { - public static void main(String[] args) { - ThreadStatewait12 threadWait = new ThreadStatewait12(); - threadWait.start(); - try { - threadWait.wait(0, 0); - } catch (InterruptedException e) { - System.out.println(2); - return; - } catch (IllegalMonitorStateException e1) { - System.out.println(0); - return; - } - System.out.println(2); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadStatewait12 + *- @TestCaseName: Thread_ThreadStatewait12.java + *- @RequirementName: Java Thread + *- @Title/Destination: Invalid input for Object.wait(long timeout, int nanos). + *- @Brief: see below + * -#step1: 调用ThreadStatewait12()来构造对象实例。 + * -#step2:调用start()启动线程。 + * -#step3: 构造参数timeout为0,nanos为0,调用wait(long timeout, int nanos),确认会抛出IllegalMonitorStateException. + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadStatewait12.java + *- @ExecuteClass: ThreadStatewait12 + *- @ExecuteArgs: + */ + +public class ThreadStatewait12 extends Thread { + public static void main(String[] args) { + ThreadStatewait12 threadWait = new ThreadStatewait12(); + threadWait.start(); + try { + threadWait.wait(0, 0); + } catch (InterruptedException e) { + System.out.println(2); + return; + } catch (IllegalMonitorStateException e1) { + System.out.println(0); + return; + } + System.out.println(2); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0173-rt-thread-ThreadConstructors11/ThreadConstructors11.java b/test/testsuite/ouroboros/thread_test/RT0173-rt-thread-ThreadConstructors11/ThreadConstructors11.java index af54efa7e92142d7b71fc5b79b5fd7fab61cc601..88e270d350e3db220e2f6ef1f7ceffca47ff1e12 100644 --- a/test/testsuite/ouroboros/thread_test/RT0173-rt-thread-ThreadConstructors11/ThreadConstructors11.java +++ b/test/testsuite/ouroboros/thread_test/RT0173-rt-thread-ThreadConstructors11/ThreadConstructors11.java @@ -1,59 +1,59 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadConstructors11 - *- @TestCaseName: Thread_ThreadConstructors11.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for Constructors Thread(Runnable target). - *- @Brief: see below - * -#step1: 构造参数target为null,调用Thread(Runnable target)来构造对象实例。 - * -#step2:调用start()启动线程。 - * -#step3:等待线程结束,确认线程能正常运行。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadConstructors11.java - *- @ExecuteClass: ThreadConstructors11 - *- @ExecuteArgs: - */ - -public class ThreadConstructors11 extends Thread { - static int i = 0; - - public ThreadConstructors11(Runnable target) { - super(target); - } - - public static void main(String[] args) { - ThreadConstructors11 test_illegal1 = new ThreadConstructors11(null); - - test_illegal1.start(); - try { - test_illegal1.join(); - } catch (InterruptedException e) { - System.out.println("Join is interrupted"); - } - - if (i == 1) { - System.out.println(0); - return; - } - System.out.println(2); - } - - public void run() { - i++; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadConstructors11 + *- @TestCaseName: Thread_ThreadConstructors11.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for Constructors Thread(Runnable target). + *- @Brief: see below + * -#step1: 构造参数target为null,调用Thread(Runnable target)来构造对象实例。 + * -#step2:调用start()启动线程。 + * -#step3:等待线程结束,确认线程能正常运行。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadConstructors11.java + *- @ExecuteClass: ThreadConstructors11 + *- @ExecuteArgs: + */ + +public class ThreadConstructors11 extends Thread { + static int i = 0; + + public ThreadConstructors11(Runnable target) { + super(target); + } + + public static void main(String[] args) { + ThreadConstructors11 test_illegal1 = new ThreadConstructors11(null); + + test_illegal1.start(); + try { + test_illegal1.join(); + } catch (InterruptedException e) { + System.out.println("Join is interrupted"); + } + + if (i == 1) { + System.out.println(0); + return; + } + System.out.println(2); + } + + public void run() { + i++; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0174-rt-thread-ThreadConstructors12/ThreadConstructors12.java b/test/testsuite/ouroboros/thread_test/RT0174-rt-thread-ThreadConstructors12/ThreadConstructors12.java index f634f69d0bc46fa5201c56e608301a2856520cbf..a0c0018ed3695f6b0fc5c77656dad4b236827085 100644 --- a/test/testsuite/ouroboros/thread_test/RT0174-rt-thread-ThreadConstructors12/ThreadConstructors12.java +++ b/test/testsuite/ouroboros/thread_test/RT0174-rt-thread-ThreadConstructors12/ThreadConstructors12.java @@ -1,79 +1,79 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadConstructors12 - *- @TestCaseName: Thread_ThreadConstructors12.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for Constructors Thread(Runnable target, String name). - *- @Brief: see below - * -#step1: 构造参数target为null,name为null,调用Thread(Runnable target, String name)来构造对象实例。 - * -#step2: 确认会抛出NullPointerException异常。 - * -#step3:构造参数target为null,name为"",调用Thread(Runnable target, String name)来构造对象实例test_illegal2。 - * -#step4: 构造参数target为null,name为new String(),调用Thread(Runnable target, String name)来构造对象实例 - * test_illegal3. - * -#step2:调用start()启动线程test_illegal2,test_illegal3。 - * -#step3:等待线程结束,确认两个线程都能正常运行。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadConstructors12.java - *- @ExecuteClass: ThreadConstructors12 - *- @ExecuteArgs: - */ - -public class ThreadConstructors12 extends Thread { - static int i = 0; - static int eCount = 0; - - public ThreadConstructors12(Runnable target, String name) { - super(target, name); - } - - public static void main(String[] args) { - try { - ThreadConstructors12 test_illegal1 = new ThreadConstructors12(null, null); - } catch (NullPointerException e) { - eCount++; - } - - ThreadConstructors12 test_illegal2 = new ThreadConstructors12(null, ""); - ThreadConstructors12 test_illegal3 = new ThreadConstructors12(null, new String()); - - test_illegal2.start(); - try { - test_illegal2.join(); - } catch (InterruptedException e) { - System.out.println("test_illegal2 join is interrupted"); - } - - test_illegal3.start(); - try { - test_illegal3.join(); - } catch (InterruptedException e) { - System.out.println("test_illegal3 join is interrupted"); - } - - if (i == 2 && eCount == 1) { - System.out.println(0); - return; - } - System.out.println(2); - } - - public void run() { - i++; - super.run(); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadConstructors12 + *- @TestCaseName: Thread_ThreadConstructors12.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for Constructors Thread(Runnable target, String name). + *- @Brief: see below + * -#step1: 构造参数target为null,name为null,调用Thread(Runnable target, String name)来构造对象实例。 + * -#step2: 确认会抛出NullPointerException异常。 + * -#step3:构造参数target为null,name为"",调用Thread(Runnable target, String name)来构造对象实例test_illegal2。 + * -#step4: 构造参数target为null,name为new String(),调用Thread(Runnable target, String name)来构造对象实例 + * test_illegal3. + * -#step2:调用start()启动线程test_illegal2,test_illegal3。 + * -#step3:等待线程结束,确认两个线程都能正常运行。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadConstructors12.java + *- @ExecuteClass: ThreadConstructors12 + *- @ExecuteArgs: + */ + +public class ThreadConstructors12 extends Thread { + static int i = 0; + static int eCount = 0; + + public ThreadConstructors12(Runnable target, String name) { + super(target, name); + } + + public static void main(String[] args) { + try { + ThreadConstructors12 test_illegal1 = new ThreadConstructors12(null, null); + } catch (NullPointerException e) { + eCount++; + } + + ThreadConstructors12 test_illegal2 = new ThreadConstructors12(null, ""); + ThreadConstructors12 test_illegal3 = new ThreadConstructors12(null, new String()); + + test_illegal2.start(); + try { + test_illegal2.join(); + } catch (InterruptedException e) { + System.out.println("test_illegal2 join is interrupted"); + } + + test_illegal3.start(); + try { + test_illegal3.join(); + } catch (InterruptedException e) { + System.out.println("test_illegal3 join is interrupted"); + } + + if (i == 2 && eCount == 1) { + System.out.println(0); + return; + } + System.out.println(2); + } + + public void run() { + i++; + super.run(); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0175-rt-thread-MonitorTestCase1/MonitorTestCase1.java b/test/testsuite/ouroboros/thread_test/RT0175-rt-thread-MonitorTestCase1/MonitorTestCase1.java index f44d21c2479abfa2e699937e316f41f361d9aa65..7b8d8e63c0e748b8e8b8eeea1c0e1a81cc4f7a0a 100644 --- a/test/testsuite/ouroboros/thread_test/RT0175-rt-thread-MonitorTestCase1/MonitorTestCase1.java +++ b/test/testsuite/ouroboros/thread_test/RT0175-rt-thread-MonitorTestCase1/MonitorTestCase1.java @@ -1,152 +1,152 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MonitorTestCase1.java - *- @TestCaseName: Thread_MonitorTestCase1.java - *- @RequirementName: Java Thread - *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src - * /com/huawei/stress. - *- @Brief: see below - * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 - * -#step2: 分配INIT_DEFAULT_THREAD_NUM / 2个对象来自于new StopAbleThread类,同时启动监控线程。 - * -#step3: 调用start()启动所有的对象线程。 - * -#step4: 调用join()等待线程运行结束。 - * -#step5: 调用Runtime.getRuntime().gc()回收资源。 - * -#step6: 重复步骤1~4。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: MonitorTestCase1.java - *- @ExecuteClass: MonitorTestCase1 - *- @ExecuteArgs: - */ - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -public class MonitorTestCase1 { - private static final int INIT_DEFAULT_THREAD_NUM = 100; - private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; - private static final int THREAD_SLEEP_TIME_DEFAULT = 1; - private static final String MODULE_NAME_MONITOR = "M"; - private static final int THREAD_REPEATS_INFINITE = -1; - private static final int THREAD_REPEATS_DEFAULT = 1; - private static boolean mRunning = true; - private static boolean mRest = false; - private static int mRestTime = 5000; - static List mAllThread = new ArrayList<>(); - - public static void main(String[] args) { - testCase1(); - Runtime.getRuntime().gc(); - testCase1(); - System.out.println(0); - } - - public static void testCase1() { - ArrayList list = new ArrayList<>(); - Thread thread; - Object lockObject = new Object(); - for (int i = 0; i < DEFAULT_THREAD_NUM_HALF; i++) { - thread = new StopAbleThread(new MonitorTest(lockObject, THREAD_SLEEP_TIME_DEFAULT, THREAD_REPEATS_DEFAULT), - MODULE_NAME_MONITOR + "_testCase1_" + i); - list.add(thread); - } - startAllThread(list); - waitAllThreadFinish(list); - } - - public static void waitAllThreadFinish(List list) { - for (Thread s : list) { - try { - s.join(); - } catch (InterruptedException e) { - e.printStackTrace(); - } finally { - removeDeadThread(s); - } - } - } - - public static void removeDeadThread(Thread t) { - if (t == null) { - return; - } - if (!t.isAlive()) { - synchronized (mAllThread) { - mAllThread.remove(t); - } - } - } - - public static void startAllThread(List list) { - for (Thread s : list) { - s.start(); - trySleep(new Random().nextInt(2)); - } - } - - public static void trySleep(long time) { - try { - Thread.sleep(time); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - static class MonitorTest implements Runnable { - Object lockObject; - int sleepTime; - int repeats; - - public MonitorTest(Object lockObject, int sleepTime, int repeatTimes) { - this.lockObject = lockObject; - this.sleepTime = sleepTime; - repeats = repeatTimes; - } - - @Override - public void run() { - while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { - if (repeats > 0) { - repeats--; - } - synchronized (lockObject) { - lockObject.toString(); - tryRest(); - trySleep(sleepTime); - if (!mRunning) { - break; - } - } - } - } - } - - private static boolean tryRest() { - if (mRest) { - trySleep(mRestTime); - return true; - } - return false; - } - - static class StopAbleThread extends Thread { - public StopAbleThread(Runnable r, String name) { - super(r, name); - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MonitorTestCase1.java + *- @TestCaseName: Thread_MonitorTestCase1.java + *- @RequirementName: Java Thread + *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src + * /com/huawei/stress. + *- @Brief: see below + * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 + * -#step2: 分配INIT_DEFAULT_THREAD_NUM / 2个对象来自于new StopAbleThread类,同时启动监控线程。 + * -#step3: 调用start()启动所有的对象线程。 + * -#step4: 调用join()等待线程运行结束。 + * -#step5: 调用Runtime.getRuntime().gc()回收资源。 + * -#step6: 重复步骤1~4。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: MonitorTestCase1.java + *- @ExecuteClass: MonitorTestCase1 + *- @ExecuteArgs: + */ + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class MonitorTestCase1 { + private static final int INIT_DEFAULT_THREAD_NUM = 100; + private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; + private static final int THREAD_SLEEP_TIME_DEFAULT = 1; + private static final String MODULE_NAME_MONITOR = "M"; + private static final int THREAD_REPEATS_INFINITE = -1; + private static final int THREAD_REPEATS_DEFAULT = 1; + private static boolean mRunning = true; + private static boolean mRest = false; + private static int mRestTime = 5000; + static List mAllThread = new ArrayList<>(); + + public static void main(String[] args) { + testCase1(); + Runtime.getRuntime().gc(); + testCase1(); + System.out.println(0); + } + + public static void testCase1() { + ArrayList list = new ArrayList<>(); + Thread thread; + Object lockObject = new Object(); + for (int i = 0; i < DEFAULT_THREAD_NUM_HALF; i++) { + thread = new StopAbleThread(new MonitorTest(lockObject, THREAD_SLEEP_TIME_DEFAULT, THREAD_REPEATS_DEFAULT), + MODULE_NAME_MONITOR + "_testCase1_" + i); + list.add(thread); + } + startAllThread(list); + waitAllThreadFinish(list); + } + + public static void waitAllThreadFinish(List list) { + for (Thread s : list) { + try { + s.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + removeDeadThread(s); + } + } + } + + public static void removeDeadThread(Thread t) { + if (t == null) { + return; + } + if (!t.isAlive()) { + synchronized (mAllThread) { + mAllThread.remove(t); + } + } + } + + public static void startAllThread(List list) { + for (Thread s : list) { + s.start(); + trySleep(new Random().nextInt(2)); + } + } + + public static void trySleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + static class MonitorTest implements Runnable { + Object lockObject; + int sleepTime; + int repeats; + + public MonitorTest(Object lockObject, int sleepTime, int repeatTimes) { + this.lockObject = lockObject; + this.sleepTime = sleepTime; + repeats = repeatTimes; + } + + @Override + public void run() { + while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { + if (repeats > 0) { + repeats--; + } + synchronized (lockObject) { + lockObject.toString(); + tryRest(); + trySleep(sleepTime); + if (!mRunning) { + break; + } + } + } + } + } + + private static boolean tryRest() { + if (mRest) { + trySleep(mRestTime); + return true; + } + return false; + } + + static class StopAbleThread extends Thread { + public StopAbleThread(Runnable r, String name) { + super(r, name); + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0176-rt-thread-MonitorTestCase2/MonitorTestCase2.java b/test/testsuite/ouroboros/thread_test/RT0176-rt-thread-MonitorTestCase2/MonitorTestCase2.java index 2d2e25814bd943b3d6a4ba02b923677ff37ffc34..000a759d14cd7cb0a84d4cc06ff9524f365f2d08 100644 --- a/test/testsuite/ouroboros/thread_test/RT0176-rt-thread-MonitorTestCase2/MonitorTestCase2.java +++ b/test/testsuite/ouroboros/thread_test/RT0176-rt-thread-MonitorTestCase2/MonitorTestCase2.java @@ -1,183 +1,183 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MonitorTestCase2.java - *- @TestCaseName: Thread_MonitorTestCase2.java - *- @RequirementName: Java Thread - *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src - * /com/huawei/stress. - *- @Brief: see below - * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 - * -#step2: 分配INIT_DEFAULT_THREAD_NUM / 2个对象来自于new StopAbleThread类,同时启动监控线程,监控进程解锁后等待sleepTime时间。 - * -#step3: 调用start()启动所有的对象线程。 - * -#step4: 调用join()等待线程运行结束。 - * -#step5: 调用Runtime.getRuntime().gc()回收资源。 - * -#step6: 重复步骤1~4。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: MonitorTestCase2.java - *- @ExecuteClass: MonitorTestCase2 - *- @ExecuteArgs: - */ - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -public class MonitorTestCase2 { - private static final int INIT_DEFAULT_THREAD_NUM = 100; - private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; - private static final int THREAD_SLEEP_TIME_DEFAULT = 1; - private static final String MODULE_NAME_MONITOR = "M"; - private static final int THREAD_REPEATS_INFINITE = -1; - private static final int THREAD_REPEATS_DEFAULT = 1; - private static boolean mRunning = true; - private static boolean mRest = false; - private static int mRestTime = 5000; - static List mAllThread = new ArrayList<>(); - - public static void main(String[] args) { - testCase2(); - Runtime.getRuntime().gc(); - testCase2(); - System.out.println("0"); - } - - public static void testCase2() { - ArrayList list = new ArrayList<>(); - Thread t; - Object lockObject = new Object(); - for (int i = 0; i < DEFAULT_THREAD_NUM_HALF; i++) { - t = new StopAbleThread(new MonitorTestWait(lockObject, THREAD_SLEEP_TIME_DEFAULT, THREAD_REPEATS_DEFAULT), - MODULE_NAME_MONITOR + "_testCase2_" + i); - list.add(t); - } - startAllThread(list); - waitAllThreadFinish(list); - } - - public static void waitAllThreadFinish(List list) { - for (Thread s : list) { - try { - s.join(); - } catch (InterruptedException e) { - e.printStackTrace(); - } finally { - removeDeadThread(s); - } - } - } - - public static void removeDeadThread(Thread t) { - if (t == null) { - return; - } - if (!t.isAlive()) { - synchronized (mAllThread) { - mAllThread.remove(t); - } - } - } - - public static void startAllThread(List list) { - for (Thread s : list) { - s.start(); - trySleep(new Random().nextInt(2)); - } - } - - public static void trySleep(long time) { - try { - Thread.sleep(time); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - static class MonitorTest implements Runnable { - Object lockObject; - int sleepTime; - int repeats; - - public MonitorTest(Object lockObject, int sleepTime) { - this(lockObject, sleepTime, THREAD_REPEATS_INFINITE); - } - - public MonitorTest(Object lockObject, int sleepTime, int repeatTimes) { - this.lockObject = lockObject; - this.sleepTime = sleepTime; - repeats = repeatTimes; - } - - @Override - public void run() { - while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { - if (repeats > 0) { - repeats--; - } - synchronized (lockObject) { - lockObject.toString(); - tryRest(); - trySleep(sleepTime); - if (!mRunning) { - break; - } - } - } - } - } - - static class MonitorTestWait extends MonitorTest { - public MonitorTestWait(Object lockObject, int sleepTime, int repeatTimes) { - super(lockObject, sleepTime, repeatTimes); - } - - @Override - public void run() { - while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { - if (repeats > 0) { - repeats--; - } - if (!mRunning) { - break; - } - synchronized (lockObject) { - lockObject.toString(); - tryRest(); - try { - lockObject.wait(sleepTime); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - } - } - - private static boolean tryRest() { - if (mRest) { - trySleep(mRestTime); - return true; - } - return false; - } - - static class StopAbleThread extends Thread { - public StopAbleThread(Runnable r, String name) { - super(r, name); - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MonitorTestCase2.java + *- @TestCaseName: Thread_MonitorTestCase2.java + *- @RequirementName: Java Thread + *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src + * /com/huawei/stress. + *- @Brief: see below + * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 + * -#step2: 分配INIT_DEFAULT_THREAD_NUM / 2个对象来自于new StopAbleThread类,同时启动监控线程,监控进程解锁后等待sleepTime时间。 + * -#step3: 调用start()启动所有的对象线程。 + * -#step4: 调用join()等待线程运行结束。 + * -#step5: 调用Runtime.getRuntime().gc()回收资源。 + * -#step6: 重复步骤1~4。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: MonitorTestCase2.java + *- @ExecuteClass: MonitorTestCase2 + *- @ExecuteArgs: + */ + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class MonitorTestCase2 { + private static final int INIT_DEFAULT_THREAD_NUM = 100; + private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; + private static final int THREAD_SLEEP_TIME_DEFAULT = 1; + private static final String MODULE_NAME_MONITOR = "M"; + private static final int THREAD_REPEATS_INFINITE = -1; + private static final int THREAD_REPEATS_DEFAULT = 1; + private static boolean mRunning = true; + private static boolean mRest = false; + private static int mRestTime = 5000; + static List mAllThread = new ArrayList<>(); + + public static void main(String[] args) { + testCase2(); + Runtime.getRuntime().gc(); + testCase2(); + System.out.println("0"); + } + + public static void testCase2() { + ArrayList list = new ArrayList<>(); + Thread t; + Object lockObject = new Object(); + for (int i = 0; i < DEFAULT_THREAD_NUM_HALF; i++) { + t = new StopAbleThread(new MonitorTestWait(lockObject, THREAD_SLEEP_TIME_DEFAULT, THREAD_REPEATS_DEFAULT), + MODULE_NAME_MONITOR + "_testCase2_" + i); + list.add(t); + } + startAllThread(list); + waitAllThreadFinish(list); + } + + public static void waitAllThreadFinish(List list) { + for (Thread s : list) { + try { + s.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + removeDeadThread(s); + } + } + } + + public static void removeDeadThread(Thread t) { + if (t == null) { + return; + } + if (!t.isAlive()) { + synchronized (mAllThread) { + mAllThread.remove(t); + } + } + } + + public static void startAllThread(List list) { + for (Thread s : list) { + s.start(); + trySleep(new Random().nextInt(2)); + } + } + + public static void trySleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + static class MonitorTest implements Runnable { + Object lockObject; + int sleepTime; + int repeats; + + public MonitorTest(Object lockObject, int sleepTime) { + this(lockObject, sleepTime, THREAD_REPEATS_INFINITE); + } + + public MonitorTest(Object lockObject, int sleepTime, int repeatTimes) { + this.lockObject = lockObject; + this.sleepTime = sleepTime; + repeats = repeatTimes; + } + + @Override + public void run() { + while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { + if (repeats > 0) { + repeats--; + } + synchronized (lockObject) { + lockObject.toString(); + tryRest(); + trySleep(sleepTime); + if (!mRunning) { + break; + } + } + } + } + } + + static class MonitorTestWait extends MonitorTest { + public MonitorTestWait(Object lockObject, int sleepTime, int repeatTimes) { + super(lockObject, sleepTime, repeatTimes); + } + + @Override + public void run() { + while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { + if (repeats > 0) { + repeats--; + } + if (!mRunning) { + break; + } + synchronized (lockObject) { + lockObject.toString(); + tryRest(); + try { + lockObject.wait(sleepTime); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + } + } + + private static boolean tryRest() { + if (mRest) { + trySleep(mRestTime); + return true; + } + return false; + } + + static class StopAbleThread extends Thread { + public StopAbleThread(Runnable r, String name) { + super(r, name); + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0177-rt-thread-MonitorTestCase4/MonitorTestCase4.java b/test/testsuite/ouroboros/thread_test/RT0177-rt-thread-MonitorTestCase4/MonitorTestCase4.java index e66d13fe4ac89a91451fc50b370976f4d1bcde91..2f2412365a1eee7ca4d7a4fcb5b6e545f929f414 100644 --- a/test/testsuite/ouroboros/thread_test/RT0177-rt-thread-MonitorTestCase4/MonitorTestCase4.java +++ b/test/testsuite/ouroboros/thread_test/RT0177-rt-thread-MonitorTestCase4/MonitorTestCase4.java @@ -1,183 +1,183 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MonitorTestCase4.java - *- @TestCaseName: Thread_MonitorTestCase4.java - *- @RequirementName: Java Thread - *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src - * /com/huawei/stress. - *- @Brief: see below - * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 - * -#step2: 分配INIT_DEFAULT_THREAD_NUM / 2个对象来自于new StopAbleThread类,同时启动mTestVolatileRun线程。 - * -#step3: 调用start()启动所有的对象线程。 - * -#step4: 调用join()等待线程运行结束。 - * -#step5: 调用Runtime.getRuntime().gc()回收资源。 - * -#step6: 重复步骤1~4。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: MonitorTestCase4.java - *- @ExecuteClass: MonitorTestCase4 - *- @ExecuteArgs: - */ - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -public class MonitorTestCase4 { - private static final int INIT_DEFAULT_THREAD_NUM = 100; - private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; - private static final int THREAD_SLEEP_TIME_DEFAULT = 1; - private static final int THREAD_REPEATS_INFINITE = -1; - private static final int THREAD_REPEATS_DEFAULT = 1; - private static boolean mRunning = true; - private static boolean mRest = false; - private static int mRestTime = 5000; - - private static final String MODULE_NAME_MONITOR = "M"; - static List mAllThread = new ArrayList<>(); - - public static void main(String[] args) { - testCase4(); - Runtime.getRuntime().gc(); - testCase4(); - System.out.println("0"); - } - - public static void testCase4() { - ArrayList list = new ArrayList<>(); - Thread t1; - for (int i = 0; i < DEFAULT_THREAD_NUM_HALF; i++) { - t1 = new StopAbleThread(new CommonRun(mTestVolatileRun, THREAD_SLEEP_TIME_DEFAULT, THREAD_REPEATS_DEFAULT), - MODULE_NAME_MONITOR + "_testCase4_" + i); - list.add(t1); - } - startAllThread(list); - waitAllThreadFinish(list); - } - - public static void waitAllThreadFinish(List list) { - for (Thread s : list) { - try { - s.join(); - } catch (InterruptedException e) { - e.printStackTrace(); - } finally { - removeDeadThread(s); - } - } - } - - public static void startAllThread(List list) { - for (Thread s : list) { - s.start(); - trySleep(new Random().nextInt(2)); - } - } - - public static void removeDeadThread(Thread t) { - if (t == null) { - return; - } - if (!t.isAlive()) { - synchronized (mAllThread) { - mAllThread.remove(t); - } - } - } - - public static void trySleep(long time) { - try { - Thread.sleep(time); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - private static Runnable mTestVolatileRun = new Runnable() { - @Override - public void run() { - for (int i = 0; i < 100; i++) { - tryRest(); - Object testa = GetTestVolatile(); - // Visit meta - if (testa instanceof Object) { - continue; - } - } - } - }; - - public static volatile Object testVolatile = null; - - private static Object GetTestVolatileImpl() { - if (testVolatile == null) { - testVolatile = new testVolatileClass(); - } - return testVolatile; - } - - static class testVolatileClass { - int a; - } - - private static Object GetTestVolatile() { - return GetTestVolatileImpl(); - } - - private static boolean tryRest() { - if (mRest) { - trySleep(mRestTime); - return true; - } - return false; - } - - static class CommonRun implements Runnable { - int sleepTime; - int repeats; - Runnable cbFun; - - public CommonRun(Runnable cb, int sleepTime, int repeatTimes) { - this.sleepTime = sleepTime; - repeats = repeatTimes; - cbFun = cb; - } - - @Override - public void run() { - while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { - if (repeats > 0) { - repeats--; - } - tryRest(); - if (cbFun != null) { - cbFun.run(); - } - trySleep(sleepTime); - if (!mRunning) { - break; - } - } - } - } - - static class StopAbleThread extends Thread { - public StopAbleThread(Runnable r, String name) { - super(r, name); - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MonitorTestCase4.java + *- @TestCaseName: Thread_MonitorTestCase4.java + *- @RequirementName: Java Thread + *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src + * /com/huawei/stress. + *- @Brief: see below + * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 + * -#step2: 分配INIT_DEFAULT_THREAD_NUM / 2个对象来自于new StopAbleThread类,同时启动mTestVolatileRun线程。 + * -#step3: 调用start()启动所有的对象线程。 + * -#step4: 调用join()等待线程运行结束。 + * -#step5: 调用Runtime.getRuntime().gc()回收资源。 + * -#step6: 重复步骤1~4。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: MonitorTestCase4.java + *- @ExecuteClass: MonitorTestCase4 + *- @ExecuteArgs: + */ + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class MonitorTestCase4 { + private static final int INIT_DEFAULT_THREAD_NUM = 100; + private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; + private static final int THREAD_SLEEP_TIME_DEFAULT = 1; + private static final int THREAD_REPEATS_INFINITE = -1; + private static final int THREAD_REPEATS_DEFAULT = 1; + private static boolean mRunning = true; + private static boolean mRest = false; + private static int mRestTime = 5000; + + private static final String MODULE_NAME_MONITOR = "M"; + static List mAllThread = new ArrayList<>(); + + public static void main(String[] args) { + testCase4(); + Runtime.getRuntime().gc(); + testCase4(); + System.out.println("0"); + } + + public static void testCase4() { + ArrayList list = new ArrayList<>(); + Thread t1; + for (int i = 0; i < DEFAULT_THREAD_NUM_HALF; i++) { + t1 = new StopAbleThread(new CommonRun(mTestVolatileRun, THREAD_SLEEP_TIME_DEFAULT, THREAD_REPEATS_DEFAULT), + MODULE_NAME_MONITOR + "_testCase4_" + i); + list.add(t1); + } + startAllThread(list); + waitAllThreadFinish(list); + } + + public static void waitAllThreadFinish(List list) { + for (Thread s : list) { + try { + s.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + removeDeadThread(s); + } + } + } + + public static void startAllThread(List list) { + for (Thread s : list) { + s.start(); + trySleep(new Random().nextInt(2)); + } + } + + public static void removeDeadThread(Thread t) { + if (t == null) { + return; + } + if (!t.isAlive()) { + synchronized (mAllThread) { + mAllThread.remove(t); + } + } + } + + public static void trySleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + private static Runnable mTestVolatileRun = new Runnable() { + @Override + public void run() { + for (int i = 0; i < 100; i++) { + tryRest(); + Object testa = GetTestVolatile(); + // Visit meta + if (testa instanceof Object) { + continue; + } + } + } + }; + + public static volatile Object testVolatile = null; + + private static Object GetTestVolatileImpl() { + if (testVolatile == null) { + testVolatile = new testVolatileClass(); + } + return testVolatile; + } + + static class testVolatileClass { + int a; + } + + private static Object GetTestVolatile() { + return GetTestVolatileImpl(); + } + + private static boolean tryRest() { + if (mRest) { + trySleep(mRestTime); + return true; + } + return false; + } + + static class CommonRun implements Runnable { + int sleepTime; + int repeats; + Runnable cbFun; + + public CommonRun(Runnable cb, int sleepTime, int repeatTimes) { + this.sleepTime = sleepTime; + repeats = repeatTimes; + cbFun = cb; + } + + @Override + public void run() { + while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { + if (repeats > 0) { + repeats--; + } + tryRest(); + if (cbFun != null) { + cbFun.run(); + } + trySleep(sleepTime); + if (!mRunning) { + break; + } + } + } + } + + static class StopAbleThread extends Thread { + public StopAbleThread(Runnable r, String name) { + super(r, name); + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0178-rt-thread-MonitorTestCase5/MonitorTestCase5.java b/test/testsuite/ouroboros/thread_test/RT0178-rt-thread-MonitorTestCase5/MonitorTestCase5.java index ec77b47b7474ee7b021c6990244eb248188a1b3c..4a052c81617f5415a8f60e17aa7a008d1324a732 100644 --- a/test/testsuite/ouroboros/thread_test/RT0178-rt-thread-MonitorTestCase5/MonitorTestCase5.java +++ b/test/testsuite/ouroboros/thread_test/RT0178-rt-thread-MonitorTestCase5/MonitorTestCase5.java @@ -1,182 +1,182 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MonitorTestCase5.java - *- @TestCaseName: Thread_MonitorTestCase5.java - *- @RequirementName: Java Thread - *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src - * /com/huawei/stress. - *- @Brief: see below - * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 - * -#step2: 分配INIT_DEFAULT_THREAD_NUM / 2个对象来自于new StopAbleThread类,同时启动mTestVolatileRun线程。 - * -#step3: 调用start()启动所有的对象线程。 - * -#step4: 调用join()等待线程运行结束。 - * -#step5: 调用Runtime.getRuntime().gc()回收资源。 - * -#step6: 重复步骤1~4。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: MonitorTestCase5.java - *- @ExecuteClass: MonitorTestCase5 - *- @ExecuteArgs: - */ - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -public class MonitorTestCase5 { - private static final int INIT_DEFAULT_THREAD_NUM = 100; - private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; - private static final int THREAD_SLEEP_TIME_DEFAULT = 1; - private static final int THREAD_REPEATS_INFINITE = -1; - private static final int THREAD_REPEATS_DEFAULT = 1; - private static final String MODULE_NAME_MONITOR = "M"; - private static boolean mRunning = true; - private static boolean mRest = false; - private static int mRestTime = 5000; - static List mAllThread = new ArrayList<>(); - - public static void main(String[] args) { - testCase5(); - Runtime.getRuntime().gc(); - testCase5(); - System.out.println("0"); - } - - public static void testCase5() { - ArrayList list = new ArrayList<>(); - Thread t1; - for (int i = 0; i < DEFAULT_THREAD_NUM_HALF; i++) { - t1 = new StopAbleThread(new CommonRun(mTestVolatileRun, THREAD_SLEEP_TIME_DEFAULT, THREAD_REPEATS_DEFAULT), - MODULE_NAME_MONITOR + "_testCase5_" + i); - list.add(t1); - } - startAllThread(list); - waitAllThreadFinish(list); - } - - public static void waitAllThreadFinish(List list) { - for (Thread s : list) { - try { - s.join(); - } catch (InterruptedException e) { - e.printStackTrace(); - } finally { - removeDeadThread(s); - } - } - } - - public static void removeDeadThread(Thread t) { - if (t == null) { - return; - } - if (!t.isAlive()) { - synchronized (mAllThread) { - mAllThread.remove(t); - } - } - } - - public static void startAllThread(List list) { - for (Thread s : list) { - s.start(); - trySleep(new Random().nextInt(2)); - } - } - - public static void trySleep(long time) { - try { - Thread.sleep(time); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - private static Runnable mTestVolatileRun = new Runnable() { - @Override - public void run() { - for (int i = 0; i < 100; i++) { - tryRest(); - Object testa = GetTestVolatile(); - - if (testa instanceof Object) { - continue; - } - } - } - }; - - public static volatile Object testVolatile = null; - - private static Object GetTestVolatileImpl() { - if (testVolatile == null) { - testVolatile = new testVolatileClass(); - } - return testVolatile; - } - - static class testVolatileClass { - // test class - } - - private static Object GetTestVolatile() { - return GetTestVolatileImpl(); - } - - private static boolean tryRest() { - if (mRest) { - trySleep(mRestTime); - return true; - } - return false; - } - - static class CommonRun implements Runnable { - int sleepTime; - int repeats; - Runnable cbFun; - - public CommonRun(Runnable cb, int sleepTime, int repeatTimes) { - this.sleepTime = sleepTime; - repeats = repeatTimes; - cbFun = cb; - } - - @Override - public void run() { - while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { - if (repeats > 0) { - repeats--; - } - tryRest(); - if (cbFun != null) { - cbFun.run(); - } - trySleep(sleepTime); - if (!mRunning) { - break; - } - } - } - } - - static class StopAbleThread extends Thread { - public StopAbleThread(Runnable r, String name) { - super(r, name); - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MonitorTestCase5.java + *- @TestCaseName: Thread_MonitorTestCase5.java + *- @RequirementName: Java Thread + *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src + * /com/huawei/stress. + *- @Brief: see below + * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 + * -#step2: 分配INIT_DEFAULT_THREAD_NUM / 2个对象来自于new StopAbleThread类,同时启动mTestVolatileRun线程。 + * -#step3: 调用start()启动所有的对象线程。 + * -#step4: 调用join()等待线程运行结束。 + * -#step5: 调用Runtime.getRuntime().gc()回收资源。 + * -#step6: 重复步骤1~4。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: MonitorTestCase5.java + *- @ExecuteClass: MonitorTestCase5 + *- @ExecuteArgs: + */ + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class MonitorTestCase5 { + private static final int INIT_DEFAULT_THREAD_NUM = 100; + private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; + private static final int THREAD_SLEEP_TIME_DEFAULT = 1; + private static final int THREAD_REPEATS_INFINITE = -1; + private static final int THREAD_REPEATS_DEFAULT = 1; + private static final String MODULE_NAME_MONITOR = "M"; + private static boolean mRunning = true; + private static boolean mRest = false; + private static int mRestTime = 5000; + static List mAllThread = new ArrayList<>(); + + public static void main(String[] args) { + testCase5(); + Runtime.getRuntime().gc(); + testCase5(); + System.out.println("0"); + } + + public static void testCase5() { + ArrayList list = new ArrayList<>(); + Thread t1; + for (int i = 0; i < DEFAULT_THREAD_NUM_HALF; i++) { + t1 = new StopAbleThread(new CommonRun(mTestVolatileRun, THREAD_SLEEP_TIME_DEFAULT, THREAD_REPEATS_DEFAULT), + MODULE_NAME_MONITOR + "_testCase5_" + i); + list.add(t1); + } + startAllThread(list); + waitAllThreadFinish(list); + } + + public static void waitAllThreadFinish(List list) { + for (Thread s : list) { + try { + s.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + removeDeadThread(s); + } + } + } + + public static void removeDeadThread(Thread t) { + if (t == null) { + return; + } + if (!t.isAlive()) { + synchronized (mAllThread) { + mAllThread.remove(t); + } + } + } + + public static void startAllThread(List list) { + for (Thread s : list) { + s.start(); + trySleep(new Random().nextInt(2)); + } + } + + public static void trySleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + private static Runnable mTestVolatileRun = new Runnable() { + @Override + public void run() { + for (int i = 0; i < 100; i++) { + tryRest(); + Object testa = GetTestVolatile(); + + if (testa instanceof Object) { + continue; + } + } + } + }; + + public static volatile Object testVolatile = null; + + private static Object GetTestVolatileImpl() { + if (testVolatile == null) { + testVolatile = new testVolatileClass(); + } + return testVolatile; + } + + static class testVolatileClass { + // test class + } + + private static Object GetTestVolatile() { + return GetTestVolatileImpl(); + } + + private static boolean tryRest() { + if (mRest) { + trySleep(mRestTime); + return true; + } + return false; + } + + static class CommonRun implements Runnable { + int sleepTime; + int repeats; + Runnable cbFun; + + public CommonRun(Runnable cb, int sleepTime, int repeatTimes) { + this.sleepTime = sleepTime; + repeats = repeatTimes; + cbFun = cb; + } + + @Override + public void run() { + while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { + if (repeats > 0) { + repeats--; + } + tryRest(); + if (cbFun != null) { + cbFun.run(); + } + trySleep(sleepTime); + if (!mRunning) { + break; + } + } + } + } + + static class StopAbleThread extends Thread { + public StopAbleThread(Runnable r, String name) { + super(r, name); + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0179-rt-thread-MonitorTestCase6/MonitorTestCase6.java b/test/testsuite/ouroboros/thread_test/RT0179-rt-thread-MonitorTestCase6/MonitorTestCase6.java index ff76e274e8b5fd5f1ffdba7234dfa0f0c869f695..6158c6592871301b590eee7f77b73865cbe0f677 100644 --- a/test/testsuite/ouroboros/thread_test/RT0179-rt-thread-MonitorTestCase6/MonitorTestCase6.java +++ b/test/testsuite/ouroboros/thread_test/RT0179-rt-thread-MonitorTestCase6/MonitorTestCase6.java @@ -1,137 +1,137 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MonitorTestCase6.java - *- @TestCaseName: Thread_MonitorTestCase6.java - *- @RequirementName: Java Thread - *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src - * /com/huawei/stress. - *- @Brief: see below - * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 - * -#step2: 分配INIT_DEFAULT_THREAD_NUM个对象来自于new StopAbleThread类,同时启动SyncThread监控线程,该线程带同步锁。 - * -#step3: 调用Runtime.getRuntime().gc()回收资源。 - * -#step4: 重复步骤1~2。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: MonitorTestCase6.java - *- @ExecuteClass: MonitorTestCase6 - *- @ExecuteArgs: - */ - -import java.util.ArrayList; -import java.util.Random; - -public class MonitorTestCase6 { - private static boolean quit = false; - private static final int INIT_DEFAULT_THREAD_NUM = 100; - private static int DEFAULT_THREAD_NUM = INIT_DEFAULT_THREAD_NUM; - private static final String MODULE_NAME_MONITOR = "M"; - private static int monitorLengthForCase6 = DEFAULT_THREAD_NUM / 5; - private static boolean mRest = false; - private static int mRestTime = 5000; - - public static void main(String[] args) { - testCase6(); - Runtime.getRuntime().gc(); - testCase6(); - System.out.println("0"); - } - - public static void testCase6() { - quit = false; - ArrayList mList = createTestObject(); - ArrayList list = new ArrayList<>(); - Thread t; - - for (int i = 0; i < (DEFAULT_THREAD_NUM / 10); i++) { - t = new StopAbleThread(new SyncThread(mList), MODULE_NAME_MONITOR + "_testCase6_A" + i); - list.add(t); - } - } - - public static class SyncThread implements Runnable { - private Random intRandom; - private ArrayList mList; - - public SyncThread(ArrayList list) { - this.intRandom = new Random(); - this.mList = list; - } - - @Override - public void run() { - monitorTestUnit monitor; - int start; - int sleepTime; - for (int j = 0; j < 2000; j++) { - start = this.intRandom.nextInt(monitorLengthForCase6); - for (int k = 0; k < monitorLengthForCase6; k++) { - monitor = mList.get((k + start) % monitorLengthForCase6); - synchronized (monitor) { - tryRest(); - monitor.testCount++; - sleepTime = this.intRandom.nextInt(4) + 1; - trySleep(sleepTime * 3); - } - } - - if (quit) { - break; - } - } - } - } - - public static void trySleep(long time) { - try { - Thread.sleep(time); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - private static boolean tryRest() { - if (mRest) { - trySleep(mRestTime); - return true; - } - return false; - } - - public static ArrayList createTestObject() { - ArrayList mList = new ArrayList<>(); - for (int i = 0; i < monitorLengthForCase6; i++) { - mList.add(new monitorTestUnit()); - } - return mList; - } - - static class StopAbleThread extends Thread { - public StopAbleThread(Runnable r, String name) { - super(r, name); - } - } - - static class monitorTestUnit { - int testCount; - boolean isWait; - - monitorTestUnit() { - testCount = 0; - isWait = false; - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MonitorTestCase6.java + *- @TestCaseName: Thread_MonitorTestCase6.java + *- @RequirementName: Java Thread + *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src + * /com/huawei/stress. + *- @Brief: see below + * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 + * -#step2: 分配INIT_DEFAULT_THREAD_NUM个对象来自于new StopAbleThread类,同时启动SyncThread监控线程,该线程带同步锁。 + * -#step3: 调用Runtime.getRuntime().gc()回收资源。 + * -#step4: 重复步骤1~2。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: MonitorTestCase6.java + *- @ExecuteClass: MonitorTestCase6 + *- @ExecuteArgs: + */ + +import java.util.ArrayList; +import java.util.Random; + +public class MonitorTestCase6 { + private static boolean quit = false; + private static final int INIT_DEFAULT_THREAD_NUM = 100; + private static int DEFAULT_THREAD_NUM = INIT_DEFAULT_THREAD_NUM; + private static final String MODULE_NAME_MONITOR = "M"; + private static int monitorLengthForCase6 = DEFAULT_THREAD_NUM / 5; + private static boolean mRest = false; + private static int mRestTime = 5000; + + public static void main(String[] args) { + testCase6(); + Runtime.getRuntime().gc(); + testCase6(); + System.out.println("0"); + } + + public static void testCase6() { + quit = false; + ArrayList mList = createTestObject(); + ArrayList list = new ArrayList<>(); + Thread t; + + for (int i = 0; i < (DEFAULT_THREAD_NUM / 10); i++) { + t = new StopAbleThread(new SyncThread(mList), MODULE_NAME_MONITOR + "_testCase6_A" + i); + list.add(t); + } + } + + public static class SyncThread implements Runnable { + private Random intRandom; + private ArrayList mList; + + public SyncThread(ArrayList list) { + this.intRandom = new Random(); + this.mList = list; + } + + @Override + public void run() { + monitorTestUnit monitor; + int start; + int sleepTime; + for (int j = 0; j < 2000; j++) { + start = this.intRandom.nextInt(monitorLengthForCase6); + for (int k = 0; k < monitorLengthForCase6; k++) { + monitor = mList.get((k + start) % monitorLengthForCase6); + synchronized (monitor) { + tryRest(); + monitor.testCount++; + sleepTime = this.intRandom.nextInt(4) + 1; + trySleep(sleepTime * 3); + } + } + + if (quit) { + break; + } + } + } + } + + public static void trySleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + private static boolean tryRest() { + if (mRest) { + trySleep(mRestTime); + return true; + } + return false; + } + + public static ArrayList createTestObject() { + ArrayList mList = new ArrayList<>(); + for (int i = 0; i < monitorLengthForCase6; i++) { + mList.add(new monitorTestUnit()); + } + return mList; + } + + static class StopAbleThread extends Thread { + public StopAbleThread(Runnable r, String name) { + super(r, name); + } + } + + static class monitorTestUnit { + int testCount; + boolean isWait; + + monitorTestUnit() { + testCount = 0; + isWait = false; + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0180-rt-thread-MonitorTestCase8/MonitorTestCase8.java b/test/testsuite/ouroboros/thread_test/RT0180-rt-thread-MonitorTestCase8/MonitorTestCase8.java index c77e322f0279404a77c90d3ec15ef13bf45f9aaf..cffba0acfbed93acb78b6e3101085b9091b26d58 100644 --- a/test/testsuite/ouroboros/thread_test/RT0180-rt-thread-MonitorTestCase8/MonitorTestCase8.java +++ b/test/testsuite/ouroboros/thread_test/RT0180-rt-thread-MonitorTestCase8/MonitorTestCase8.java @@ -1,305 +1,305 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: MonitorTestCase8.java - *- @TestCaseName: Thread_MonitorTestCase8.java - *- @RequirementName: Java Thread - *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src - * /com/huawei/stress. - *- @Brief: see below - * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 - * -#step2: 分配DEFAULT_THREAD_NUM_HALF / 2个对象来自于new StopAbleThread类,同时在new的参数1里定义new CommonRun监控线程。 - * -#step3: 调用start()启动所有的对象线程。 - * -#step4: 调用join()等待线程运行结束。 - * -#step5: 调用Runtime.getRuntime().gc()回收资源。 - * -#step6: 重复步骤1~4。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: MonitorTestCase8.java - *- @ExecuteClass: MonitorTestCase8 - *- @ExecuteArgs: - */ - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -public class MonitorTestCase8 { - private static final int INIT_DEFAULT_THREAD_NUM = 10; - private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; - private static final int THREAD_REPEATS_DEFAULT = 1; - private static final int THREAD_REPEATS_INFINITE = -1; - private static boolean mRunning = true; - private static boolean mRest = false; - private static int mRestTime = 500; - static List mAllThread = new ArrayList<>(); - - public static void main(String[] args) { - testCase8(); - Runtime.getRuntime().gc(); - testCase8(); - System.out.println("0"); - } - - public static void testCase8() { - List list = new ArrayList<>(); - List stringList = new ArrayList<>(); - for (int i = 0; i < (DEFAULT_THREAD_NUM_HALF / 2); i++) { - int index = i; - stringList.add(""); - list.add(new StopAbleThread(new CommonRun(() -> { - ArrayList strings = new ArrayList<>(100); - for (int j = 0; j < 100; j++) { - strings.add(StringMethod.getStringRandom()); - } - for (String str : strings) { - stringList.set(index, stringList.get(index) + str); - } - }, 100, THREAD_REPEATS_DEFAULT), "testCase8_" + (i + 1))); - } - startAllThread(list); - waitAllThreadFinish(list); - } - - public static void startAllThread(List list) { - for (Thread s : list) { - s.start(); - trySleep(new Random().nextInt(2)); - } - } - - public static void trySleep(long time) { - try { - Thread.sleep(time); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - public static void waitAllThreadFinish(List list) { - for (Thread s : list) { - try { - s.join(); - } catch (InterruptedException e) { - e.printStackTrace(); - } finally { - removeDeadThread(s); - } - } - } - - public static void removeDeadThread(Thread t) { - if (t == null) { - return; - } - if (!t.isAlive()) { - synchronized (mAllThread) { - mAllThread.remove(t); - } - } - } - - static class StopAbleThread extends Thread { - public StopAbleThread(Runnable r, String name) { - super(r, name); - } - } - - static class CommonRun implements Runnable { - int sleepTime; - int repeats; - Runnable cbFun; - - public CommonRun(Runnable cb, int sleepTime, int repeatTimes) { - this.sleepTime = sleepTime; - repeats = repeatTimes; - cbFun = cb; - } - - @Override - public void run() { - while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { - if (repeats > 0) { - repeats--; - } - tryRest(); - if (cbFun != null) { - cbFun.run(); - } - trySleep(sleepTime); - if (!mRunning) { - break; - } - } - } - } - - private static boolean tryRest() { - if (mRest) { - trySleep(mRestTime); - return true; - } - return false; - } - - private enum StringMethod { - METHOD0("DirectString") { - @Override - public String apply() { - return "DirectString"; - } - }, - METHOD1("ReferenceString") { - @Override - public String apply() { - return this.name; - } - }, - METHOD2("FinalString") { - @Override - public String apply() { - return FINAL_STRING; - } - }, - METHOD3("ConcatString") { - @Override - public String apply() { - return "Concat".concat("String"); - } - }, - METHOD4("StringAddition") { - @Override - public String apply() { - return "String" + "Addition" + 1; - } - }, - METHOD5("CopyValueOf") { - @Override - public String apply() { - char[] tmp = {'C', 'o', 'p', 'y', 'V', 'a', 'l', 'u', 'e', 'O', 'f'}; - return String.copyValueOf(tmp); - } - }, - METHOD6("Intern") { - @Override - public String apply() { - return mRandom.toString().intern(); - } - }, - METHOD7("Integer") { - @Override - public String apply() { - return Integer.toString(mRandom.nextInt()); - } - }, - METHOD8("Float") { - @Override - public String apply() { - return Float.toString(mRandom.nextFloat()); - } - }, - METHOD9("Double") { - @Override - public String apply() { - return Double.toString(mRandom.nextDouble()); - } - }, - METHOD10("Boolean") { - @Override - public String apply() { - return Boolean.toString(mRandom.nextBoolean()); - } - }, - METHOD11("ReplaceChar") { - @Override - public String apply() { - return mRandom.toString().replace('R', 'r'); - } - }, - METHOD12("ReplaceString") { - @Override - public String apply() { - return mRandom.toString().replace("Ran", "RED"); - } - }, - METHOD13("Split") { - @Override - public String apply() { - return mRandom.toString().split("@")[0]; - } - }, - METHOD14("SubString") { - @Override - public String apply() { - return mRandom.toString().substring(3, 5); - } - }, - METHOD15("ToLowerCase") { - @Override - public String apply() { - return mRandom.toString().toLowerCase(); - } - }, - METHOD16("ToUpperCase") { - @Override - public String apply() { - return mRandom.toString().toUpperCase(); - } - }, - METHOD17("StringBuffer") { - @Override - public String apply() { - return new StringBuffer("String").append("Buffer").append(1).toString(); - } - }, - METHOD18("StringBuilder") { - @Override - public String apply() { - return new StringBuilder(20).append(mRandom).toString(); - } - }, - METHOD19("subSequence") { - @Override - public String apply() { - return mRandom.toString().subSequence(1, 3).toString(); - } - }; - - public final String name; - private static final String FINAL_STRING = "FinalString"; - private static final Random mRandom = new Random(); - - StringMethod(String name) { - this.name = name; - } - - public String apply() { - return name; - } - - public static String getString(int id) { - if ((id < 0) || (id >= StringMethod.values().length)) { - return ""; - } else { - return StringMethod.values()[id].apply(); - } - } - - public static String getStringRandom() { - return getString(mRandom.nextInt(StringMethod.values().length)); - } - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: MonitorTestCase8.java + *- @TestCaseName: Thread_MonitorTestCase8.java + *- @RequirementName: Java Thread + *- @Title/Destination: Added according to stress cases SyscompTestCase/Maple_harness/tools/testapp_MemStressTest/src + * /com/huawei/stress. + *- @Brief: see below + * -#step1: 创建一个static的类StopAbleThread继承Thread,类的构造方法使用了父函数的构造方法。 + * -#step2: 分配DEFAULT_THREAD_NUM_HALF / 2个对象来自于new StopAbleThread类,同时在new的参数1里定义new CommonRun监控线程。 + * -#step3: 调用start()启动所有的对象线程。 + * -#step4: 调用join()等待线程运行结束。 + * -#step5: 调用Runtime.getRuntime().gc()回收资源。 + * -#step6: 重复步骤1~4。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: MonitorTestCase8.java + *- @ExecuteClass: MonitorTestCase8 + *- @ExecuteArgs: + */ + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class MonitorTestCase8 { + private static final int INIT_DEFAULT_THREAD_NUM = 10; + private static int DEFAULT_THREAD_NUM_HALF = INIT_DEFAULT_THREAD_NUM / 2; + private static final int THREAD_REPEATS_DEFAULT = 1; + private static final int THREAD_REPEATS_INFINITE = -1; + private static boolean mRunning = true; + private static boolean mRest = false; + private static int mRestTime = 500; + static List mAllThread = new ArrayList<>(); + + public static void main(String[] args) { + testCase8(); + Runtime.getRuntime().gc(); + testCase8(); + System.out.println("0"); + } + + public static void testCase8() { + List list = new ArrayList<>(); + List stringList = new ArrayList<>(); + for (int i = 0; i < (DEFAULT_THREAD_NUM_HALF / 2); i++) { + int index = i; + stringList.add(""); + list.add(new StopAbleThread(new CommonRun(() -> { + ArrayList strings = new ArrayList<>(100); + for (int j = 0; j < 100; j++) { + strings.add(StringMethod.getStringRandom()); + } + for (String str : strings) { + stringList.set(index, stringList.get(index) + str); + } + }, 100, THREAD_REPEATS_DEFAULT), "testCase8_" + (i + 1))); + } + startAllThread(list); + waitAllThreadFinish(list); + } + + public static void startAllThread(List list) { + for (Thread s : list) { + s.start(); + trySleep(new Random().nextInt(2)); + } + } + + public static void trySleep(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + public static void waitAllThreadFinish(List list) { + for (Thread s : list) { + try { + s.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + removeDeadThread(s); + } + } + } + + public static void removeDeadThread(Thread t) { + if (t == null) { + return; + } + if (!t.isAlive()) { + synchronized (mAllThread) { + mAllThread.remove(t); + } + } + } + + static class StopAbleThread extends Thread { + public StopAbleThread(Runnable r, String name) { + super(r, name); + } + } + + static class CommonRun implements Runnable { + int sleepTime; + int repeats; + Runnable cbFun; + + public CommonRun(Runnable cb, int sleepTime, int repeatTimes) { + this.sleepTime = sleepTime; + repeats = repeatTimes; + cbFun = cb; + } + + @Override + public void run() { + while (THREAD_REPEATS_INFINITE == repeats || repeats > 0) { + if (repeats > 0) { + repeats--; + } + tryRest(); + if (cbFun != null) { + cbFun.run(); + } + trySleep(sleepTime); + if (!mRunning) { + break; + } + } + } + } + + private static boolean tryRest() { + if (mRest) { + trySleep(mRestTime); + return true; + } + return false; + } + + private enum StringMethod { + METHOD0("DirectString") { + @Override + public String apply() { + return "DirectString"; + } + }, + METHOD1("ReferenceString") { + @Override + public String apply() { + return this.name; + } + }, + METHOD2("FinalString") { + @Override + public String apply() { + return FINAL_STRING; + } + }, + METHOD3("ConcatString") { + @Override + public String apply() { + return "Concat".concat("String"); + } + }, + METHOD4("StringAddition") { + @Override + public String apply() { + return "String" + "Addition" + 1; + } + }, + METHOD5("CopyValueOf") { + @Override + public String apply() { + char[] tmp = {'C', 'o', 'p', 'y', 'V', 'a', 'l', 'u', 'e', 'O', 'f'}; + return String.copyValueOf(tmp); + } + }, + METHOD6("Intern") { + @Override + public String apply() { + return mRandom.toString().intern(); + } + }, + METHOD7("Integer") { + @Override + public String apply() { + return Integer.toString(mRandom.nextInt()); + } + }, + METHOD8("Float") { + @Override + public String apply() { + return Float.toString(mRandom.nextFloat()); + } + }, + METHOD9("Double") { + @Override + public String apply() { + return Double.toString(mRandom.nextDouble()); + } + }, + METHOD10("Boolean") { + @Override + public String apply() { + return Boolean.toString(mRandom.nextBoolean()); + } + }, + METHOD11("ReplaceChar") { + @Override + public String apply() { + return mRandom.toString().replace('R', 'r'); + } + }, + METHOD12("ReplaceString") { + @Override + public String apply() { + return mRandom.toString().replace("Ran", "RED"); + } + }, + METHOD13("Split") { + @Override + public String apply() { + return mRandom.toString().split("@")[0]; + } + }, + METHOD14("SubString") { + @Override + public String apply() { + return mRandom.toString().substring(3, 5); + } + }, + METHOD15("ToLowerCase") { + @Override + public String apply() { + return mRandom.toString().toLowerCase(); + } + }, + METHOD16("ToUpperCase") { + @Override + public String apply() { + return mRandom.toString().toUpperCase(); + } + }, + METHOD17("StringBuffer") { + @Override + public String apply() { + return new StringBuffer("String").append("Buffer").append(1).toString(); + } + }, + METHOD18("StringBuilder") { + @Override + public String apply() { + return new StringBuilder(20).append(mRandom).toString(); + } + }, + METHOD19("subSequence") { + @Override + public String apply() { + return mRandom.toString().subSequence(1, 3).toString(); + } + }; + + public final String name; + private static final String FINAL_STRING = "FinalString"; + private static final Random mRandom = new Random(); + + StringMethod(String name) { + this.name = name; + } + + public String apply() { + return name; + } + + public static String getString(int id) { + if ((id < 0) || (id >= StringMethod.values().length)) { + return ""; + } else { + return StringMethod.values()[id].apply(); + } + } + + public static String getStringRandom() { + return getString(mRandom.nextInt(StringMethod.values().length)); + } + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0181-rt-thread-ThreadCountStackFrames/ThreadCountStackFrames.java b/test/testsuite/ouroboros/thread_test/RT0181-rt-thread-ThreadCountStackFrames/ThreadCountStackFrames.java index d479056b68816f563d5f4d578e2ab80aca1a388e..fb738e46965b22b764b1d28d59d743fb99079e2c 100644 --- a/test/testsuite/ouroboros/thread_test/RT0181-rt-thread-ThreadCountStackFrames/ThreadCountStackFrames.java +++ b/test/testsuite/ouroboros/thread_test/RT0181-rt-thread-ThreadCountStackFrames/ThreadCountStackFrames.java @@ -1,65 +1,65 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadCountStackFrames - *- @TestCaseName: Thread_ThreadCountStackFrames.java - *- @RequirementName: Java Thread - *- @Brief: see below - * -#step1: 创建一个线程。 - * -#step2:在线程启动前检查,调用countStackFrames()确认返回0,调用getStackTrace()确认返回的长度为0。 - * -#step3:启动线程,等待线程结束。 - * -#step4:确认线程已经结束,调用countStackFrames()确认返回0,调用getStackTrace()确认返回的长度为0。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadCountStackFrames.java - *- @ExecuteClass: ThreadCountStackFrames - *- @ExecuteArgs: - */ - -public class ThreadCountStackFrames { - static int threadFinish = 0; - - public static void main(String[] args) { - int result = 2; - Thread thread = new Thread("ThreadCountStackFrames") { - public void run() { - try { - sleep(1000); - } catch (Exception e) { - System.out.println(e); - } - ThreadCountStackFrames.threadFinish++; - } - }; - // Before the thread started. - if (thread.countStackFrames() == 0 && thread.getStackTrace().length == 0) { - result--; - } - - thread.start(); - try { - thread.join(); - } catch (Exception e) { - System.out.println(e); - } - // After a thread finished. - if (thread.countStackFrames() == 0 && thread.getStackTrace().length == 0 - && ThreadCountStackFrames.threadFinish == 1) { - result--; - } - System.out.println(result); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f -// ASSERT: scan 0\n +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadCountStackFrames + *- @TestCaseName: Thread_ThreadCountStackFrames.java + *- @RequirementName: Java Thread + *- @Brief: see below + * -#step1: 创建一个线程。 + * -#step2:在线程启动前检查,调用countStackFrames()确认返回0,调用getStackTrace()确认返回的长度为0。 + * -#step3:启动线程,等待线程结束。 + * -#step4:确认线程已经结束,调用countStackFrames()确认返回0,调用getStackTrace()确认返回的长度为0。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadCountStackFrames.java + *- @ExecuteClass: ThreadCountStackFrames + *- @ExecuteArgs: + */ + +public class ThreadCountStackFrames { + static int threadFinish = 0; + + public static void main(String[] args) { + int result = 2; + Thread thread = new Thread("ThreadCountStackFrames") { + public void run() { + try { + sleep(1000); + } catch (Exception e) { + System.out.println(e); + } + ThreadCountStackFrames.threadFinish++; + } + }; + // Before the thread started. + if (thread.countStackFrames() == 0 && thread.getStackTrace().length == 0) { + result--; + } + + thread.start(); + try { + thread.join(); + } catch (Exception e) { + System.out.println(e); + } + // After a thread finished. + if (thread.countStackFrames() == 0 && thread.getStackTrace().length == 0 + && ThreadCountStackFrames.threadFinish == 1) { + result--; + } + System.out.println(result); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f +// ASSERT: scan 0\n diff --git a/test/testsuite/ouroboros/thread_test/RT0182-rt-thread-ThreadDMdestory2/ThreadDMdestory2.java b/test/testsuite/ouroboros/thread_test/RT0182-rt-thread-ThreadDMdestory2/ThreadDMdestory2.java index 48dad6a5cd5d9ceb505dcb56516b2d4729ff3d1a..9253153bbed5d1d43c22a4301e3a978983997987 100644 --- a/test/testsuite/ouroboros/thread_test/RT0182-rt-thread-ThreadDMdestory2/ThreadDMdestory2.java +++ b/test/testsuite/ouroboros/thread_test/RT0182-rt-thread-ThreadDMdestory2/ThreadDMdestory2.java @@ -1,112 +1,112 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadDMDestroy2 - *- @TestCaseName: Thread_ThreadDMdestory2.java - *- @RequirementName: Java Thread - *- @Title/Destination: Thread api: destroy(), added from JCK test case ${MAPLE_ROOT}/clinic/jck/JCK-runtime-8b/tests/ - * api/java_lang/Thread/index.html#destroy destroy001, destroy002, destroy003. - *- @Brief: see below - * -#step1: 直接调用new Thread().destroy(),确认会抛出UnsupportedOperationException。 - * -#step2:创建一个线程thread,调用start()启动,调用join()等待线程结束,调用destroy(),确认会抛出 - * UnsupportedOperationException。 - * -#step3:创建一个线程st,调用start()启动,线程会执行sleep操作,调用destroy(),确认会抛出UnsupportedOperationException。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadDMdestory2.java - *- @ExecuteClass: ThreadDMdestory2 - *- @ExecuteArgs: - */ - -public class ThreadDMdestory2 { - - public static void main(String[] args) { - System.out.println(run()); - } - - private static int run() { - int exceptionCount = 0; - - // destroy001: test destroy() when the thread is not started - try { - new Thread().destroy(); - return 1; - } catch (UnsupportedOperationException ok) { - exceptionCount++; - } - - // destroy002: test destroy() when the thread is finished - Thread thread = new Thread(); - thread.start(); - try { - thread.join(); - } catch (InterruptedException e) { - System.out.println(e); - } - - try { - thread.destroy(); - return 2; - } catch (UnsupportedOperationException ok) { - exceptionCount++; - } - - // destroy003: test destroy() when a thread is sleeping - SleepingThread st = new SleepingThread(); - st.start(); - - while (! st.started) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // ignore any attempt to interrupt - System.out.println(e); - } - } - - try { - st.destroy(); - return 3; - } catch (UnsupportedOperationException ok) { - exceptionCount++; - } - st.checked=true; - - if (exceptionCount == 3) { - return 0; - }else{ - return 4; - } - } -} - -class SleepingThread extends Thread { - public volatile boolean started = false; - public volatile boolean checked = false; - - public void run() { - started = true; - while (! checked) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // ignore any attempt to interrupt - System.out.println(e); - } - } - } -} - -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadDMDestroy2 + *- @TestCaseName: Thread_ThreadDMdestory2.java + *- @RequirementName: Java Thread + *- @Title/Destination: Thread api: destroy(), added from JCK test case ${MAPLE_ROOT}/clinic/jck/JCK-runtime-8b/tests/ + * api/java_lang/Thread/index.html#destroy destroy001, destroy002, destroy003. + *- @Brief: see below + * -#step1: 直接调用new Thread().destroy(),确认会抛出UnsupportedOperationException。 + * -#step2:创建一个线程thread,调用start()启动,调用join()等待线程结束,调用destroy(),确认会抛出 + * UnsupportedOperationException。 + * -#step3:创建一个线程st,调用start()启动,线程会执行sleep操作,调用destroy(),确认会抛出UnsupportedOperationException。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadDMdestory2.java + *- @ExecuteClass: ThreadDMdestory2 + *- @ExecuteArgs: + */ + +public class ThreadDMdestory2 { + + public static void main(String[] args) { + System.out.println(run()); + } + + private static int run() { + int exceptionCount = 0; + + // destroy001: test destroy() when the thread is not started + try { + new Thread().destroy(); + return 1; + } catch (UnsupportedOperationException ok) { + exceptionCount++; + } + + // destroy002: test destroy() when the thread is finished + Thread thread = new Thread(); + thread.start(); + try { + thread.join(); + } catch (InterruptedException e) { + System.out.println(e); + } + + try { + thread.destroy(); + return 2; + } catch (UnsupportedOperationException ok) { + exceptionCount++; + } + + // destroy003: test destroy() when a thread is sleeping + SleepingThread st = new SleepingThread(); + st.start(); + + while (! st.started) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignore any attempt to interrupt + System.out.println(e); + } + } + + try { + st.destroy(); + return 3; + } catch (UnsupportedOperationException ok) { + exceptionCount++; + } + st.checked=true; + + if (exceptionCount == 3) { + return 0; + }else{ + return 4; + } + } +} + +class SleepingThread extends Thread { + public volatile boolean started = false; + public volatile boolean checked = false; + + public void run() { + started = true; + while (! checked) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // ignore any attempt to interrupt + System.out.println(e); + } + } + } +} + +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/RT0183-rt-thread-ThreadGetContextClassLoader/ThreadGetContextClassLoader.java b/test/testsuite/ouroboros/thread_test/RT0183-rt-thread-ThreadGetContextClassLoader/ThreadGetContextClassLoader.java index 1fcb73e250048e63cebb0b0e4d97b147e197d910..2d9528bf4c1bc7e8bed2e110437614661f89831a 100644 --- a/test/testsuite/ouroboros/thread_test/RT0183-rt-thread-ThreadGetContextClassLoader/ThreadGetContextClassLoader.java +++ b/test/testsuite/ouroboros/thread_test/RT0183-rt-thread-ThreadGetContextClassLoader/ThreadGetContextClassLoader.java @@ -1,50 +1,50 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadGetContextClassLoader.java - *- @TestCaseName: Thread_ThreadGetContextClassLoader.java - *- @RequirementName: Java Thread - *- @Title/Destination: Thread api: getContextClassLoader(), added from JCK test case ${MAPLE_ROOT}/clinic/jck/ - * JCK-runtime-8b/tests/api/java_lang/Thread/index.html#getContextClassLoader(), Thread4404. - *- @Brief: see below - * -#step1: 创建线程,调用getContextClassLoader()确认为父线程的ClassLoader上下文。 - * -#step2:启动线程,等待线程结束。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadGetContextClassLoader.java - *- @ExecuteClass: ThreadGetContextClassLoader - *- @ExecuteArgs: - */ - -public class ThreadGetContextClassLoader { - public static void main(String[] args) { - Thread thr = new Thread(); - try { - // If not set, the default is the ClassLoader context of the parent Thread. - if (thr.getContextClassLoader() != Thread.currentThread().getContextClassLoader()) { - System.out.println(2); - } - } finally { - thr.start(); - try { - thr.join(); - } catch (InterruptedException e) { - System.out.println("Join is interrupted"); - } - } - System.out.println(0); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadGetContextClassLoader.java + *- @TestCaseName: Thread_ThreadGetContextClassLoader.java + *- @RequirementName: Java Thread + *- @Title/Destination: Thread api: getContextClassLoader(), added from JCK test case ${MAPLE_ROOT}/clinic/jck/ + * JCK-runtime-8b/tests/api/java_lang/Thread/index.html#getContextClassLoader(), Thread4404. + *- @Brief: see below + * -#step1: 创建线程,调用getContextClassLoader()确认为父线程的ClassLoader上下文。 + * -#step2:启动线程,等待线程结束。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadGetContextClassLoader.java + *- @ExecuteClass: ThreadGetContextClassLoader + *- @ExecuteArgs: + */ + +public class ThreadGetContextClassLoader { + public static void main(String[] args) { + Thread thr = new Thread(); + try { + // If not set, the default is the ClassLoader context of the parent Thread. + if (thr.getContextClassLoader() != Thread.currentThread().getContextClassLoader()) { + System.out.println(2); + } + } finally { + thr.start(); + try { + thr.join(); + } catch (InterruptedException e) { + System.out.println("Join is interrupted"); + } + } + System.out.println(0); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/issue-RT0577-rt-Thread-ThreadsetContextClassLoader2/ThreadSetContextClassLoader2.java b/test/testsuite/ouroboros/thread_test/issue-RT0577-rt-Thread-ThreadsetContextClassLoader2/ThreadSetContextClassLoader2.java index 077b8352afcc26752c0f2dace5ac771324679905..2933c6db383dd77a87c124d302b031202f8fc7f0 100644 --- a/test/testsuite/ouroboros/thread_test/issue-RT0577-rt-Thread-ThreadsetContextClassLoader2/ThreadSetContextClassLoader2.java +++ b/test/testsuite/ouroboros/thread_test/issue-RT0577-rt-Thread-ThreadsetContextClassLoader2/ThreadSetContextClassLoader2.java @@ -1,61 +1,61 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadSetContextClassLoader2 - *- @TestCaseName: Thread_ThreadSetContextClassLoader2.java - *- @RequirementName: Java Thread - *- @Title/Destination: Use setContextClassLoader(ClassLoader cl) to change the class loader of Thread. - *- @Brief: see below - * -#step1: 创建本用例类的对象,通过getContextClassLoader()获取对应的类加载器。 - * -#step2:调用setContextClassLoader(ClassLoader cl)来设置类的ClassLoader。 - * -#step3:调用start()启动对应的实例对象,等待线程运行结束。 - * -#step4:确认对应的加载器成功运行。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadSetContextClassLoader2.java - *- @ExecuteClass: ThreadSetContextClassLoader2 - *- @ExecuteArgs: - */ - -public class ThreadSetContextClassLoader2 extends Thread { - static int i; - - public static void main(String[] args) { - ThreadSetContextClassLoader2 threadSetContextClassLoader2 = new ThreadSetContextClassLoader2(); - ClassLoader cl = threadSetContextClassLoader2.getContextClassLoader(); - threadSetContextClassLoader2.setContextClassLoader(cl.getParent()); - - threadSetContextClassLoader2.start(); - try { - threadSetContextClassLoader2.join(); - } catch (InterruptedException e) { - System.out.println("Join is interrupted"); - } - - if (i == 1) { - if (threadSetContextClassLoader2.getContextClassLoader() != cl) { - System.out.println(0); - return; - } - } - System.out.println(2); - } - - public void run() { - i++; - super.run(); - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadSetContextClassLoader2 + *- @TestCaseName: Thread_ThreadSetContextClassLoader2.java + *- @RequirementName: Java Thread + *- @Title/Destination: Use setContextClassLoader(ClassLoader cl) to change the class loader of Thread. + *- @Brief: see below + * -#step1: 创建本用例类的对象,通过getContextClassLoader()获取对应的类加载器。 + * -#step2:调用setContextClassLoader(ClassLoader cl)来设置类的ClassLoader。 + * -#step3:调用start()启动对应的实例对象,等待线程运行结束。 + * -#step4:确认对应的加载器成功运行。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadSetContextClassLoader2.java + *- @ExecuteClass: ThreadSetContextClassLoader2 + *- @ExecuteArgs: + */ + +public class ThreadSetContextClassLoader2 extends Thread { + static int i; + + public static void main(String[] args) { + ThreadSetContextClassLoader2 threadSetContextClassLoader2 = new ThreadSetContextClassLoader2(); + ClassLoader cl = threadSetContextClassLoader2.getContextClassLoader(); + threadSetContextClassLoader2.setContextClassLoader(cl.getParent()); + + threadSetContextClassLoader2.start(); + try { + threadSetContextClassLoader2.join(); + } catch (InterruptedException e) { + System.out.println("Join is interrupted"); + } + + if (i == 1) { + if (threadSetContextClassLoader2.getContextClassLoader() != cl) { + System.out.println(0); + return; + } + } + System.out.println(2); + } + + public void run() { + i++; + super.run(); + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file diff --git a/test/testsuite/ouroboros/thread_test/issue-RT0579-rt-Thread-ThreadsetName3/ThreadSetName3Test.java b/test/testsuite/ouroboros/thread_test/issue-RT0579-rt-Thread-ThreadsetName3/ThreadSetName3Test.java index 80b1afc4fcafc4ab445feb06e0ecf41d220c61ad..47fcf67a64395d2e3fb1838c12f102bbc4614336 100644 --- a/test/testsuite/ouroboros/thread_test/issue-RT0579-rt-Thread-ThreadsetName3/ThreadSetName3Test.java +++ b/test/testsuite/ouroboros/thread_test/issue-RT0579-rt-Thread-ThreadsetName3/ThreadSetName3Test.java @@ -1,51 +1,51 @@ -/* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - * -@TestCaseID: ThreadSetName3Test - *- @TestCaseName: Thread_ThreadSetName3Test.java - *- @RequirementName: Java Thread - *- @Title/Destination: Negative input for setName(String name). - *- @Brief: see below - * -#step1: 创建两个线程分别为testName1,testName2。 - * -#step2:调用start()启动两个线程。 - * -#step3:创建参数name为空字符串,两个线程分别都调用setName(String name)。 - * -#step4:通过getName()检查设置成功。 - *- @Expect: 0\n - *- @Priority: High - *- @Source: ThreadSetName3Test.java - *- @ExecuteClass: ThreadSetName3Test - *- @ExecuteArgs: - */ - -public class ThreadSetName3Test extends Thread { - public static void main(String[] args) { - ThreadSetName3Test testName1 = new ThreadSetName3Test(); - ThreadSetName3Test testName2 = new ThreadSetName3Test(); - testName1.start(); - testName1.setName(""); - testName2.start(); - testName2.setName(""); - - if (testName1.getName().equals("")) { - if (testName1.getName().equals("")) { - System.out.println(0); - return; - } - } - System.out.println(2); - return; - } -} -// EXEC:%maple %f %build_option -o %n.so -// EXEC:%run %n.so %n %run_option | compare %f +/* + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * + * OpenArkCompiler is licensed under the Mulan PSL v1. + * You can use this software according to the terms and conditions of the Mulan PSL v1. + * You may obtain a copy of Mulan PSL v1 at: + * + * http://license.coscl.org.cn/MulanPSL + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR + * FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v1 for more details. + * -@TestCaseID: ThreadSetName3Test + *- @TestCaseName: Thread_ThreadSetName3Test.java + *- @RequirementName: Java Thread + *- @Title/Destination: Negative input for setName(String name). + *- @Brief: see below + * -#step1: 创建两个线程分别为testName1,testName2。 + * -#step2:调用start()启动两个线程。 + * -#step3:创建参数name为空字符串,两个线程分别都调用setName(String name)。 + * -#step4:通过getName()检查设置成功。 + *- @Expect: 0\n + *- @Priority: High + *- @Source: ThreadSetName3Test.java + *- @ExecuteClass: ThreadSetName3Test + *- @ExecuteArgs: + */ + +public class ThreadSetName3Test extends Thread { + public static void main(String[] args) { + ThreadSetName3Test testName1 = new ThreadSetName3Test(); + ThreadSetName3Test testName2 = new ThreadSetName3Test(); + testName1.start(); + testName1.setName(""); + testName2.start(); + testName2.setName(""); + + if (testName1.getName().equals("")) { + if (testName1.getName().equals("")) { + System.out.println(0); + return; + } + } + System.out.println(2); + return; + } +} +// EXEC:%maple %f %build_option -o %n.so +// EXEC:%run %n.so %n %run_option | compare %f // ASSERT: scan 0\n \ No newline at end of file