From 41a57d2d6386066b7c6eae449520a63eca31f046 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sun, 13 Feb 2022 22:50:41 +0300 Subject: [PATCH 01/29] Unroll & vectorize String.Equals --- src/coreclr/jit/compiler.h | 12 +- src/coreclr/jit/gentree.cpp | 20 + src/coreclr/jit/importer.cpp | 495 +++++++++++++++++- src/coreclr/jit/namedintrinsiclist.h | 5 + .../System/MemoryExtensions.Globalization.cs | 1 + .../src/System/MemoryExtensions.cs | 15 +- .../src/System/String.Comparison.cs | 16 +- .../src/System/StringComparison.cs | 1 + .../StringEquals/StringEquals.cs | 364 +++++++++++++ .../StringEquals/StringEquals.csproj | 9 + 10 files changed, 911 insertions(+), 27 deletions(-) create mode 100644 src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.cs create mode 100644 src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.csproj diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 281758d67ef88..38a582b7d6ae7 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -3014,6 +3014,7 @@ class Compiler // For binary opers. GenTree* gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1, GenTree* op2); + GenTreeColon* gtNewColonNode(var_types type, GenTree* elseNode, GenTree* thenNode); GenTreeQmark* gtNewQmarkNode(var_types type, GenTree* cond, GenTreeColon* colon); GenTree* gtNewLargeOperNode(genTreeOps oper, @@ -3023,6 +3024,9 @@ class Compiler GenTreeIntCon* gtNewIconNode(ssize_t value, var_types type = TYP_INT); GenTreeIntCon* gtNewIconNode(unsigned fieldOffset, FieldSeqNode* fieldSeq); + GenTreeIntCon* gtNull(); + GenTreeIntCon* gtTrue(); + GenTreeIntCon* gtFalse(); GenTree* gtNewPhysRegNode(regNumber reg, var_types type); @@ -4392,6 +4396,12 @@ class Compiler void impResetLeaveBlock(BasicBlock* block, unsigned jmpAddr); GenTree* impTypeIsAssignable(GenTree* typeTo, GenTree* typeFrom); + GenTree* impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset); + GenTree* impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset); + GenTree* impExpandHalfConstEquals( + GenTree* data, GenTree* lengthFld, bool checkForNull, WCHAR* cnsData, int len, int dataOffset); + GenTreeStrCon* impGetStrConFromSpan(GenTree* span); + GenTree* impIntrinsic(GenTree* newobjThis, CORINFO_CLASS_HANDLE clsHnd, CORINFO_METHOD_HANDLE method, @@ -4508,7 +4518,7 @@ class Compiler void impInsertTreeBefore(GenTree* tree, const DebugInfo& di, Statement* stmtBefore); void impAssignTempGen(unsigned tmp, GenTree* val, - unsigned curLevel, + unsigned curLevel = (unsigned)CHECK_SPILL_NONE, Statement** pAfterStmt = nullptr, const DebugInfo& di = DebugInfo(), BasicBlock* block = nullptr); diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index 8e1dd02c2c2f2..c1c8d2d073363 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -5685,6 +5685,11 @@ GenTree* Compiler::gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1, return node; } +GenTreeColon* Compiler::gtNewColonNode(var_types type, GenTree* elseNode, GenTree* thenNode) +{ + return new (this, GT_COLON) GenTreeColon(TYP_INT, elseNode, thenNode); +} + GenTreeQmark* Compiler::gtNewQmarkNode(var_types type, GenTree* cond, GenTreeColon* colon) { compQmarkUsed = true; @@ -5703,6 +5708,21 @@ GenTreeIntCon* Compiler::gtNewIconNode(ssize_t value, var_types type) return new (this, GT_CNS_INT) GenTreeIntCon(type, value); } +GenTreeIntCon* Compiler::gtNull() +{ + return gtNewIconNode(0, TYP_REF); +} + +GenTreeIntCon* Compiler::gtTrue() +{ + return gtNewIconNode(1, TYP_INT); +} + +GenTreeIntCon* Compiler::gtFalse() +{ + return gtNewIconNode(0, TYP_INT); +} + GenTreeIntCon* Compiler::gtNewIconNode(unsigned fieldOffset, FieldSeqNode* fieldSeq) { GenTreeIntCon* node = new (this, GT_CNS_INT) GenTreeIntCon(TYP_I_IMPL, static_cast(fieldOffset)); diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 9e00910d5d85e..5b743281a6b86 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -3676,6 +3676,361 @@ GenTree* Compiler::impCreateSpanIntrinsic(CORINFO_SIG_INFO* sig) return impCreateLocalNode(spanTempNum DEBUGARG(0)); } +//------------------------------------------------------------------------ +// impExpandHalfConstEqualsSIMD: Attempts to unroll and vectorize +// Equals against a constant WCHAR data for Length in [8..32] range +// using SIMD instructions. It uses the following expression: +// +// bool equasl = ((v1 ^ cns1) | (v2 ^ cns2)) == Vector128.Zero +// +// or if a single vector is enough (len == 8 or len == 16 with AVX): +// +// bool equasl = (v1 ^ cns1) == Vector128.Zero +// +// Arguments: +// data - Pointer to a data to vectorize +// cns - Constant data (array of 2-byte chars) +// len - Number of chars in the cns +// dataOffset - Offset for data +// +// Return Value: +// A pointer to the newly created SIMD node or nullptr if unrolling is not +// possible or not profitable +// +// Notes: +// This function doesn't check obj for null or its Length, it's just an internal helper +// for impExpandHalfConstEquals +// +GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset) +{ + assert(len >= 8 && len <= 32); + +#if defined(FEATURE_HW_INTRINSICS) + if (!compOpportunisticallyDependsOn(InstructionSet_Vector128)) + { + // We need SSE2 or ADVSIMD at least + return nullptr; + } + + CorInfoType type = CORINFO_TYPE_ULONG; + + int simdSize; + var_types simdType; + + NamedIntrinsic niZero; + NamedIntrinsic niEquals; + NamedIntrinsic loadIntrinsic; + + GenTree* cnsVec1; + GenTree* cnsVec2; + + bool useSingleVector = false; + +#if defined(TARGET_XARCH) + if (compOpportunisticallyDependsOn(InstructionSet_Vector256) && len >= 16) + { + // Handle [16..32] inputs via two Vector256 + assert(len >= 16 && len <= 32); + + simdSize = 32; + simdType = TYP_SIMD32; + + niZero = NI_Vector256_get_Zero; + niEquals = NI_Vector256_op_Equality; + + // Special case: use a single vector for len=16 + useSingleVector = len == 16; + + GenTree* long1 = gtNewIconNode(*(UINT64*)(cns + 0), TYP_LONG); + GenTree* long2 = gtNewIconNode(*(UINT64*)(cns + 4), TYP_LONG); + GenTree* long3 = gtNewIconNode(*(UINT64*)(cns + 8), TYP_LONG); + GenTree* long4 = gtNewIconNode(*(UINT64*)(cns + 12), TYP_LONG); + cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, long3, long4, NI_Vector256_Create, type, simdSize); + + // cnsVec2 most likely overlaps with cnsVec1: + GenTree* long5 = gtNewIconNode(*(UINT64*)(cns + len - 16), TYP_LONG); + GenTree* long6 = gtNewIconNode(*(UINT64*)(cns + len - 12), TYP_LONG); + GenTree* long7 = gtNewIconNode(*(UINT64*)(cns + len - 8), TYP_LONG); + GenTree* long8 = gtNewIconNode(*(UINT64*)(cns + len - 4), TYP_LONG); + cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, NI_Vector256_Create, type, simdSize); + + loadIntrinsic = NI_AVX_LoadVector256; + } + else +#endif + if (len <= 16) + { + // Handle [8..16] inputs via two Vector256 + assert(len >= 8 && len <= 16); + + simdSize = 16; + simdType = TYP_SIMD16; + + niZero = NI_Vector128_get_Zero; + niEquals = NI_Vector128_op_Equality; + + // Special case: use a single vector for len=8 + useSingleVector = len == 8; + + GenTree* long1 = gtNewIconNode(*(UINT64*)(cns + 0), TYP_LONG); + GenTree* long2 = gtNewIconNode(*(UINT64*)(cns + 4), TYP_LONG); + cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, NI_Vector128_Create, type, simdSize); + + // cnsVec2 most likely overlaps with cnsVec1: + GenTree* long3 = gtNewIconNode(*(UINT64*)(cns + len - 8), TYP_LONG); + GenTree* long4 = gtNewIconNode(*(UINT64*)(cns + len - 4), TYP_LONG); + cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long3, long4, NI_Vector128_Create, type, simdSize); + +#if defined(TARGET_XARCH) + loadIntrinsic = NI_SSE2_LoadVector128; +#else + loadIntrinsic = NI_AdvSimd_LoadVector128; +#endif + } + else + { + JITDUMP("impExpandHalfConstEqualsSIMD: No V256 and data is too big for V128\n"); + // NOTE: We might consider using four V128 for ARM64 + return nullptr; + } + + GenTree* zero = gtNewSimdHWIntrinsicNode(simdType, niZero, type, simdSize); + + GenTree* offset1 = gtNewIconNode(dataOffset, TYP_I_IMPL); + GenTree* offset2 = gtNewIconNode(dataOffset + len * 2 - simdSize, TYP_I_IMPL); + GenTree* dataPtr1 = gtNewOperNode(GT_ADD, TYP_BYREF, data, offset1); + GenTree* dataPtr2 = gtNewOperNode(GT_ADD, TYP_BYREF, gtClone(data), offset2); + + GenTree* vec1 = gtNewSimdHWIntrinsicNode(simdType, dataPtr1, loadIntrinsic, type, simdSize); + GenTree* vec2 = gtNewSimdHWIntrinsicNode(simdType, dataPtr2, loadIntrinsic, type, simdSize); + + // TODO-CQ: Spill vec1 and vec2 for better pipelining + // However, Forward-Sub most likely will glue it back + + // ((v1 ^ cns1) | (v2 ^ cns2)) == zero + GenTree* xor1 = gtNewSimdBinOpNode(GT_XOR, simdType, vec1, cnsVec1, type, simdSize, false); + GenTree* xor2 = gtNewSimdBinOpNode(GT_XOR, simdType, vec2, cnsVec2, type, simdSize, false); + GenTree* or = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, type, simdSize, false); + return gtNewSimdHWIntrinsicNode(TYP_BOOL, useSingleVector ? xor1 : or, zero, niEquals, type, simdSize); +#else + return nullptr; +#endif +} + +//------------------------------------------------------------------------ +// impExpandHalfConstEqualsSWAR: Attempts to unroll and vectorize +// Equals against a constant WCHAR data for Length in [1..8] range +// using SWAR (a sort of SIMD but for GPR registers and instructions) +// +// Arguments: +// data - Pointer to a data to vectorize +// cns - Constant data (array of 2-byte chars) +// len - Number of chars in the cns +// dataOffset - Offset for data +// +// Return Value: +// A pointer to the newly created SWAR node or nullptr if unrolling is not +// possible or not profitable +// +// Notes: +// This function doesn't check obj for null or its Length, it's just an internal helper +// for impExpandHalfConstEquals +// +GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset) +{ + assert(len >= 1 && len <= 8); + + auto compareValue = [](Compiler* comp, GenTree* obj, var_types type, ssize_t offset, ssize_t value) { + GenTree* offsetTree = comp->gtNewIconNode(offset, TYP_I_IMPL); + GenTree* addOffsetTree = comp->gtNewOperNode(GT_ADD, TYP_BYREF, obj, offsetTree); + GenTree* indirTree = comp->gtNewIndir(type, addOffsetTree); + GenTree* valueTree = comp->gtNewIconNode(value, type); + if (varTypeIsSmall(indirTree)) + { + indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, TYP_UINT); + valueTree->ChangeType(TYP_INT); + } + return comp->gtNewOperNode(GT_EQ, TYP_INT, indirTree, valueTree); + }; + +// Compose Int32 or Int64 values from ushort components +#define MAKEINT32(c1, c2) ((UINT64)c2 << 16) | ((UINT64)c1 << 0) +#define MAKEINT64(c1, c2, c3, c4) ((UINT64)c4 << 48) | ((UINT64)c3 << 32) | ((UINT64)c2 << 16) | ((UINT64)c1 << 0) + + if (len == 1) + { + return compareValue(this, data, TYP_SHORT, dataOffset, cns[0]); + } + else if (len == 2) + { + const UINT32 value = MAKEINT32(cns[0], cns[1]); + return compareValue(this, data, TYP_INT, dataOffset, value); + } +#ifdef TARGET_64BIT + else if (len == 3) + { + if (dataOffset > 2) + { + // for len == 3 we slightly overlap with Length field + const UINT64 value = MAKEINT64(0 /*part of Length field*/, cns[0], cns[1], cns[2]); + return compareValue(this, data, TYP_LONG, dataOffset - 2, value); + } + else + { + // We can't load part of Length for spans + // TODO: implement via two indirs + return nullptr; + } + } + else + { + assert(len >= 4 && len <= 8); + + UINT64 value1 = MAKEINT64(cns[0], cns[1], cns[2], cns[3]); + if (len == 4) + { + return compareValue(this, data, TYP_LONG, dataOffset, value1); + } + else // [5..8] range + { + // For 5..7 value2 will overlap with value1 + UINT64 value2 = MAKEINT64(cns[len - 4], cns[len - 3], cns[len - 2], cns[len - 1]); + GenTree* firstIndir = compareValue(this, data, TYP_LONG, dataOffset, value1); + + ssize_t offset = dataOffset + len * 2 - sizeof(UINT64); + GenTree* secondIndir = compareValue(this, gtClone(data), TYP_LONG, offset, value2); + + // Alternativly, we can do OR here and avoid a branch + GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); + return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); + } + } +#else // TARGET_64BIT + return nullptr; +#endif +} + +//------------------------------------------------------------------------ +// impExpandHalfConstEquals: Attempts to unroll and vectorize +// Equals against a constant WCHAR data for Length in [8..32] range +// using either SWAR or SIMD. In a general case it will look like this: +// +// bool equals = obj != null && obj.Length == len && (SWAR or SIMD) +// +// Arguments: +// data - Pointer to a data to vectorize +// lengthFld - Pointer to Length field +// checkForNull - Check data for null +// cns - Constant data (array of 2-byte chars) +// len - Number of 2-byte chars in the cns +// dataOffset - Offset for data +// +// Return Value: +// A pointer to the newly created SIMD node or nullptr if unrolling is not +// possible or not profitable +// +GenTree* Compiler::impExpandHalfConstEquals( + GenTree* data, GenTree* lengthFld, bool checkForNull, WCHAR* cnsData, int len, int dataOffset) +{ + assert(len >= 0); + + if (compCurBB->isRunRarely()) + { + // Not profitable to expand + JITDUMP("impExpandHalfConstEquals: block is cold - not profitable to expand.\n"); + return nullptr; + } + + if (fgBBcount > 20) + { + // We don't want to unroll too much and in big methods + // TODO: come up with some better heuristic/budget + JITDUMP("impExpandHalfConstEquals: method has too many BBs (>20) - not profitable to expand.\n"); + return nullptr; + } + + GenTree* elementsCount = gtNewIconNode(len); + GenTree* lenCheckNode; + if (len == 0) + { + // For zero length we don't need to compare content, the following expression is enough: + // + // varData != null && lengthFld == 0 + // + lenCheckNode = gtNewOperNode(GT_EQ, TYP_INT, lengthFld, elementsCount); + } + else + { + assert(cnsData != nullptr); + + GenTree* indirCmp = nullptr; + if (len < 8) // SWAR impl supports len == 8 but we'd better give it to SIMD + { + indirCmp = impExpandHalfConstEqualsSWAR(gtClone(data), cnsData, len, dataOffset); + } + else if (len <= 32) + { + indirCmp = impExpandHalfConstEqualsSIMD(gtClone(data), cnsData, len, dataOffset); + } + + if (indirCmp == nullptr) + { + return nullptr; + } + + GenTreeColon* lenCheckColon = gtNewColonNode(TYP_INT, gtFalse(), indirCmp); + lenCheckNode = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_NE, TYP_INT, lengthFld, elementsCount), lenCheckColon); + } + + GenTree* rootQmark; + if (checkForNull) + { + // varData == nullptr + GenTreeColon* nullCheckColon = gtNewColonNode(TYP_INT, gtFalse(), lenCheckNode); + rootQmark = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_EQ, TYP_INT, data, gtNull()), nullCheckColon); + } + else + { + // no nullcheck, just "obj.Length == len && (SWAR or SIMD)" + rootQmark = lenCheckNode; + } + + return rootQmark; +} + +//------------------------------------------------------------------------ +// impGetStrConFromSpan: Try to obtain string literal out of a span +// if it was inited with one. +// +// Arguments: +// span - ReadOnlySpan tree +// +// Returns: +// GenTreeStrCon node or nullptr +// +GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) +{ + GenTreeCall* argCall = nullptr; + if (span->OperIs(GT_RET_EXPR)) + { + argCall = span->AsRetExpr()->gtInlineCandidate->AsCall(); + } + else if (span->OperIs(GT_CALL)) + { + argCall = span->AsCall(); + } + + // TODO: Do the same for '"cns".AsSpan()' and 'new ReadOnlySpan("cns")' + if ((argCall != nullptr) && (lookupNamedIntrinsic(argCall->gtCallMethHnd) == NI_System_String_op_Implicit)) + { + if (argCall->gtCallArgs->GetNode()->OperIs(GT_CNS_STR)) + { + return argCall->gtCallArgs->GetNode()->AsStrCon(); + } + } + return nullptr; +} + //------------------------------------------------------------------------ // impIntrinsic: possibly expand intrinsic call into alternate IR sequence // @@ -3860,6 +4215,125 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, retNode = impArrayAccessIntrinsic(clsHnd, sig, memberRef, readonlyCall, ni); break; + case NI_System_String_Equals: + { + // We're going to unroll & vectorize the following cases: + // + // 1) String.Equals(obj, "cns") + // 2) String.Equals(obj, "cns", StringComparison.Ordinal) + // 3) String.Equals("cns", obj) + // 4) String.Equals("cns", obj, StringComparison.Ordinal) + // 5) obj.Equals("cns") + // 6) obj.Equals("cns", StringComparison.Ordinal) + // 7) "cns".Equals(obj) + // 8) "cns".Equals(obj, StringComparison.Ordinal) + // + // NOTE: for cases 5 and 6 we don't emit "obj != null" + // TODO: Add support for String.Equals(object) + + GenTree* op1; + GenTree* op2; + if (sig->numArgs == 3) + { + if (!impStackTop(0).val->IsIntegralConst(4)) // StringComparison.Ordinal + { + // TODO: Unroll & vectorize OrdinalIgnoreCase + break; + } + op1 = impStackTop(2).val; + op2 = impStackTop(1).val; + } + else + { + op1 = impStackTop(1).val; + op2 = impStackTop(0).val; + } + + if (!(op1->OperIs(GT_CNS_STR) ^ op2->OperIs(GT_CNS_STR))) + { + // either op1 or op2 has to be CNS_STR, but not both - that case is optimized + // just fine as is. + break; + } + + GenTree* varStr; + GenTreeStrCon* cnsStr; + if (op1->OperIs(GT_CNS_STR)) + { + cnsStr = op1->AsStrCon(); + varStr = op2; + } + else + { + cnsStr = op2->AsStrCon(); + varStr = op1; + } + + assert(varStr->TypeIs(TYP_REF)); + + bool needsNullcheck = true; + if ((op1 != cnsStr) && ((methodFlags & CORINFO_FLG_STATIC) == 0)) + { + // for the following cases we should not check varStr for null: + // + // obj.Equals("cns") + // obj.Equals("cns", StringComparison.Ordinal) + // + // instead, it should throw NRE if it's null + needsNullcheck = false; + } + + int cnsLength = -1; + const char16_t* str = nullptr; + if (cnsStr->IsStringEmptyField()) + { + cnsLength = 0; + JITDUMP("Trying to unroll String.Equals(op1, \"\")...\n", str) + } + else + { + str = info.compCompHnd->getStringLiteral(cnsStr->gtScpHnd, cnsStr->gtSconCPX, &cnsLength); + if (cnsLength < 0 || str == nullptr) + { + break; + } + JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) + } + + // Create a temp safe to gtClone for varStr + // We're not appending it as a statement untill we figure out + // unrolling is profitable (and possible) + unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("spilling varStr")); + lvaTable[varStrTmp].lvType = TYP_REF; + GenTree* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); + + // TODO: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN + int strLenOffset = OFFSETOF__CORINFO_String__stringLen; + GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); + GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); + GenTree* unrolled = impExpandHalfConstEquals(gtClone(varStrLcl), lenNode, needsNullcheck, (WCHAR*)str, + cnsLength, strLenOffset + sizeof(int)); + if (unrolled != nullptr) + { + impAssignTempGen(varStrTmp, varStr); + if (unrolled->OperIs(GT_QMARK)) + { + // QMARK can't be a root node, spill it to a temp + unsigned rootTmp = lvaGrabTemp(true DEBUGARG("spilling unroll qmark")); + impAssignTempGen(rootTmp, unrolled); + retNode = gtNewLclvNode(rootTmp, TYP_INT); + } + + JITDUMP("... Successfully unrolled to:\n") + DISPTREE(unrolled) + for (unsigned i = 0; i < sig->numArgs; i++) + { + impPopStack(); + } + } + break; + } + case NI_System_String_get_Chars: { GenTree* op2 = impPopStack().val; @@ -5176,7 +5650,11 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) } else if (strcmp(className, "String") == 0) { - if (strcmp(methodName, "get_Chars") == 0) + if (strcmp(methodName, "Equals") == 0) + { + result = NI_System_String_Equals; + } + else if (strcmp(methodName, "get_Chars") == 0) { result = NI_System_String_get_Chars; } @@ -5184,6 +5662,21 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) { result = NI_System_String_get_Length; } + else if (strcmp(methodName, "op_Implicit") == 0) + { + result = NI_System_String_op_Implicit; + } + } + else if (strcmp(className, "MemoryExtensions") == 0) + { + if (strcmp(methodName, "SequenceEqual") == 0) + { + result = NI_System_MemoryExtensions_SequenceEqual; + } + else if (strcmp(methodName, "Equals") == 0) + { + result = NI_System_MemoryExtensions_Equals; + } } else if (strcmp(className, "Span`1") == 0) { diff --git a/src/coreclr/jit/namedintrinsiclist.h b/src/coreclr/jit/namedintrinsiclist.h index d864c3f7baeda..f161c670ba285 100644 --- a/src/coreclr/jit/namedintrinsiclist.h +++ b/src/coreclr/jit/namedintrinsiclist.h @@ -84,11 +84,16 @@ enum NamedIntrinsic : unsigned short NI_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray, NI_System_Runtime_CompilerServices_RuntimeHelpers_IsKnownConstant, + NI_System_String_Equals, NI_System_String_get_Chars, NI_System_String_get_Length, + NI_System_String_op_Implicit, NI_System_Span_get_Item, NI_System_ReadOnlySpan_get_Item, + NI_System_MemoryExtensions_Equals, + NI_System_MemoryExtensions_SequenceEqual, + // These are used by HWIntrinsics but are defined more generally // to allow dead code optimization and handle the recursion case diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs index 46c19e06b38dd..f79a1015d35a8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs @@ -43,6 +43,7 @@ public static bool Contains(this ReadOnlySpan span, ReadOnlySpan val /// The value to compare with the source span. /// One of the enumeration values that determines how the and are compared. /// + [Intrinsic] // Unrolled and vectorized for half-constant input public static bool Equals(this ReadOnlySpan span, ReadOnlySpan other, StringComparison comparisonType) { string.CheckStringComparison(comparisonType); diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs index 3c7c13fa645f0..19f6efefaa568 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs @@ -451,19 +451,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(value)), [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool SequenceEqual(this Span span, ReadOnlySpan other) where T : IEquatable { - int length = span.Length; - - if (RuntimeHelpers.IsBitwiseEquatable()) - { - nuint size = (nuint)Unsafe.SizeOf(); - return length == other.Length && - SpanHelpers.SequenceEqual( - ref Unsafe.As(ref MemoryMarshal.GetReference(span)), - ref Unsafe.As(ref MemoryMarshal.GetReference(other)), - ((uint)length) * size); // If this multiplication overflows, the Span we got overflows the entire address range. There's no happy outcome for this api in such a case so we choose not to take the overhead of checking. - } - - return length == other.Length && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other), length); + return SequenceEqual((ReadOnlySpan)span, other); } /// @@ -1025,6 +1013,7 @@ private static unsafe int LastIndexOfAnyProbabilistic(ref char searchSpace, int /// Determines whether two sequences are equal by comparing the elements using IEquatable{T}.Equals(T). /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] // Unrolled and vectorized for half-constant input public static bool SequenceEqual(this ReadOnlySpan span, ReadOnlySpan other) where T : IEquatable { int length = span.Length; diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs index 8860c7a660ba1..e1bc40706871b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs @@ -612,6 +612,7 @@ public override bool Equals([NotNullWhen(true)] object? obj) } // Determines whether two strings match. + [Intrinsic] // Can be unrolled and vectorized public bool Equals([NotNullWhen(true)] string? value) { if (object.ReferenceEquals(this, value)) @@ -630,6 +631,7 @@ public bool Equals([NotNullWhen(true)] string? value) return EqualsHelper(this, value); } + [Intrinsic] // Can be unrolled and vectorized public bool Equals([NotNullWhen(true)] string? value, StringComparison comparisonType) { if (object.ReferenceEquals(this, value)) @@ -671,20 +673,9 @@ public bool Equals([NotNullWhen(true)] string? value, StringComparison compariso } // Determines whether two Strings match. + [Intrinsic] // Can be unrolled and vectorized public static bool Equals(string? a, string? b) { - // Transform 'str == ""' to 'str != null && str.Length == 0' if either a or b are jit-time - // constants. Otherwise, these two blocks are eliminated - if (RuntimeHelpers.IsKnownConstant(a) && a != null && a.Length == 0) - { - return b != null && b.Length == 0; - } - - if (RuntimeHelpers.IsKnownConstant(b) && b != null && b.Length == 0) - { - return a != null && a.Length == 0; - } - if (object.ReferenceEquals(a, b)) { return true; @@ -698,6 +689,7 @@ public static bool Equals(string? a, string? b) return EqualsHelper(a, b); } + [Intrinsic] // Can be unrolled and vectorized public static bool Equals(string? a, string? b, StringComparison comparisonType) { if (object.ReferenceEquals(a, b)) diff --git a/src/libraries/System.Private.CoreLib/src/System/StringComparison.cs b/src/libraries/System.Private.CoreLib/src/System/StringComparison.cs index ba31e7e5318d3..b0d64c42eae0e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/StringComparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/StringComparison.cs @@ -5,6 +5,7 @@ namespace System { public enum StringComparison { + // NOTE: RyuJIT has some of these values hardcoded CurrentCulture = 0, CurrentCultureIgnoreCase = 1, InvariantCulture = 2, diff --git a/src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.cs b/src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.cs new file mode 100644 index 0000000000000..d5c80c0e41126 --- /dev/null +++ b/src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.cs @@ -0,0 +1,364 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; + +public class StringEquals +{ + public static int Main() + { + int testCount = 0; + foreach (var method in typeof(Tests).GetMethods()) + { + if (!method.Name.StartsWith("Equals_")) + continue; + + foreach (string testStr in Tests.s_TestData) + { + testCount++; + method.Invoke(null, new object[] { testStr }); + } + } + + Console.WriteLine(testCount); + return testCount == 25920 ? 100 : 0; + } +} + +public static class Tests +{ + [MethodImpl(MethodImplOptions.NoInlining)] + static void ValidateEquals(bool result, string left, string right) + { + if (result != (left == right)) + throw new Exception($"{result} != ({left} == {right})"); + } + + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_0(string s) => ValidateEquals(s == "", s, ""); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_1(string s) => ValidateEquals(s == "3", s, "3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_2(string s) => ValidateEquals(s == "\0", s, "\0"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_3(string s) => ValidateEquals(s == "ж", s, "ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_4(string s) => ValidateEquals(s == "1", s, "1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_5(string s) => ValidateEquals(s == "33", s, "33"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_6(string s) => ValidateEquals(s == "31", s, "31"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_7(string s) => ValidateEquals(s == "a1", s, "a1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_8(string s) => ValidateEquals(s == "12", s, "12"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_9(string s) => ValidateEquals(s == "1\0", s, "1\0"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_10(string s) => ValidateEquals(s == "b12", s, "b12"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_11(string s) => ValidateEquals(s == "ж23", s, "ж23"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_12(string s) => ValidateEquals(s == "2a2", s, "2a2"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_13(string s) => ValidateEquals(s == "222", s, "222"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_14(string s) => ValidateEquals(s == "0ь3", s, "0ь3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_15(string s) => ValidateEquals(s == "bж31", s, "bж31"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_16(string s) => ValidateEquals(s == "ьЙbЙ", s, "ьЙbЙ"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_17(string s) => ValidateEquals(s == "b033", s, "b033"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_18(string s) => ValidateEquals(s == "311ь", s, "311ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_19(string s) => ValidateEquals(s == "жЙ12", s, "жЙ12"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_20(string s) => ValidateEquals(s == "2011b", s, "2011b"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_21(string s) => ValidateEquals(s == "222b2", s, "222b2"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_22(string s) => ValidateEquals(s == "aЙ213", s, "aЙ213"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_23(string s) => ValidateEquals(s == "1a131", s, "1a131"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_24(string s) => ValidateEquals(s == "3232Й", s, "3232Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_25(string s) => ValidateEquals(s == "3b0ьжь", s, "3b0ьжь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_26(string s) => ValidateEquals(s == "213b2Й", s, "213b2Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_27(string s) => ValidateEquals(s == "b31210", s, "b31210"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_28(string s) => ValidateEquals(s == "1ж0021", s, "1ж0021"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_29(string s) => ValidateEquals(s == "3ь3112", s, "3ь3112"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_30(string s) => ValidateEquals(s == "122b231", s, "122b231"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_31(string s) => ValidateEquals(s == "03ж32ж3", s, "03ж32ж3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_32(string s) => ValidateEquals(s == "bb31ж2Й", s, "bb31ж2Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_33(string s) => ValidateEquals(s == "023bьжЙ", s, "023bьжЙ"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_34(string s) => ValidateEquals(s == "\0232a12", s, "\0232a12"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_35(string s) => ValidateEquals(s == "ж13ь11Йь", s, "ж13ь11Йь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_36(string s) => ValidateEquals(s == "11ьbb32ь", s, "11ьbb32ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_37(string s) => ValidateEquals(s == "222Йж3ж3", s, "222Йж3ж3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_38(string s) => ValidateEquals(s == "ж303aЙ12", s, "ж303aЙ12"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_39(string s) => ValidateEquals(s == "ьb22322b", s, "ьb22322b"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_40(string s) => ValidateEquals(s == "a22b10b1Й", s, "a22b10b1Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_41(string s) => ValidateEquals(s == "3ba2221ь3", s, "3ba2221ь3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_42(string s) => ValidateEquals(s == "жa1Й0b1Й1", s, "жa1Й0b1Й1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_43(string s) => ValidateEquals(s == "a20Йжж1ьь", s, "a20Йжж1ьь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_44(string s) => ValidateEquals(s == "ьaж32132ь", s, "ьaж32132ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_45(string s) => ValidateEquals(s == "11111Й3Й12", s, "11111Й3Й12"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_46(string s) => ValidateEquals(s == "11Й\02Йb3жж", s, "11Й\02Йb3жж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_47(string s) => ValidateEquals(s == "21bжжж0103", s, "21bжжж0103"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_48(string s) => ValidateEquals(s == "333332aЙ11", s, "333332aЙ11"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_49(string s) => ValidateEquals(s == "Й123112313", s, "Й123112313"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_50(string s) => ValidateEquals(s == "12ЙьЙaЙ11ьb", s, "12ЙьЙaЙ11ьb"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_51(string s) => ValidateEquals(s == "жж22221Й3Й2", s, "жж22221Й3Й2"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_52(string s) => ValidateEquals(s == "ьЙ1bbж3202ж", s, "ьЙ1bbж3202ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_53(string s) => ValidateEquals(s == "1bbЙ2Й33Й2ж", s, "1bbЙ2Й33Й2ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_54(string s) => ValidateEquals(s == "2013133ь1bж", s, "2013133ь1bж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_55(string s) => ValidateEquals(s == "23a2\02жa2a13", s, "23a2\02жa2a13"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_56(string s) => ValidateEquals(s == "23Й210Й3a3ж1", s, "23Й210Й3a3ж1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_57(string s) => ValidateEquals(s == "32Й2133bb2Й3", s, "32Й2133bb2Й3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_58(string s) => ValidateEquals(s == "Й3bb1ь3bbьb3", s, "Й3bb1ь3bbьb3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_59(string s) => ValidateEquals(s == "a0Йbabж2Й133", s, "a0Йbabж2Й133"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_60(string s) => ValidateEquals(s == "320жa22a11ж1b", s, "320жa22a11ж1b"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_61(string s) => ValidateEquals(s == "ь321b3ьЙЙ13Й2", s, "ь321b3ьЙЙ13Й2"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_62(string s) => ValidateEquals(s == "a3ь1ж2a\022a1a", s, "a3ь1ж2a\022a1a"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_63(string s) => ValidateEquals(s == "3Йb30b33231bь", s, "3Йb30b33231bь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_64(string s) => ValidateEquals(s == "2210121ж13231", s, "2210121ж13231"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_65(string s) => ValidateEquals(s == "013311aa3203Й1", s, "013311aa3203Й1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_66(string s) => ValidateEquals(s == "12ЙЙ1Й2aЙ2ьbЙa", s, "12ЙЙ1Й2aЙ2ьbЙa"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_67(string s) => ValidateEquals(s == "2b1Й11130221bь", s, "2b1Й11130221bь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_68(string s) => ValidateEquals(s == "230110Й0b3112ж", s, "230110Й0b3112ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_69(string s) => ValidateEquals(s == "a213ьab121b332", s, "a213ьab121b332"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_70(string s) => ValidateEquals(s == "111a01ж3121b123", s, "111a01ж3121b123"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_71(string s) => ValidateEquals(s == "13a322Й2Й3bжb0Й", s, "13a322Й2Й3bжb0Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_72(string s) => ValidateEquals(s == "\021232b1Йaa1032", s, "\021232b1Йaa1032"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_73(string s) => ValidateEquals(s == "жЙ112ьb12Йь3b2ж", s, "жЙ112ьb12Йь3b2ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_74(string s) => ValidateEquals(s == "2bьь331bb\023122", s, "2bьь331bb\023122"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_75(string s) => ValidateEquals(s == "aж22Й2203b023bь3", s, "aж22Й2203b023bь3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_76(string s) => ValidateEquals(s == "aЙ033ж3a220ь3331", s, "aЙ033ж3a220ь3331"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_77(string s) => ValidateEquals(s == "20Йжa1b1313жЙb2a", s, "20Йжa1b1313жЙb2a"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_78(string s) => ValidateEquals(s == "131Й1\022ж2322123", s, "131Й1\022ж2322123"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_79(string s) => ValidateEquals(s == "23323b21ь11bЙ321", s, "23323b21ь11bЙ321"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_80(string s) => ValidateEquals(s == "302aьжa3213жaЙ3Йж", s, "302aьжa3213жaЙ3Йж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_81(string s) => ValidateEquals(s == "ж13b00210b1212102", s, "ж13b00210b1212102"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_82(string s) => ValidateEquals(s == "20320Й3Й3ьж3Й2122", s, "20320Й3Й3ьж3Й2122"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_83(string s) => ValidateEquals(s == "0bb23a30baЙb2333ь", s, "0bb23a30baЙb2333ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_84(string s) => ValidateEquals(s == "22122ь130230103a2", s, "22122ь130230103a2"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_85(string s) => ValidateEquals(s == "ььba20ж1жьЙьbЙ31bж", s, "ььba20ж1жьЙьbЙ31bж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_86(string s) => ValidateEquals(s == "bb1ь1033bж3011bж10", s, "bb1ь1033bж3011bж10"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_87(string s) => ValidateEquals(s == "1ь320a3a22b3333b13", s, "1ь320a3a22b3333b13"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_88(string s) => ValidateEquals(s == "0a22aЙжa2222ж23Й13", s, "0a22aЙжa2222ж23Й13"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_89(string s) => ValidateEquals(s == "Й11Й213212ж1233b23", s, "Й11Й213212ж1233b23"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_90(string s) => ValidateEquals(s == "32ь1Й03123ь011332ab", s, "32ь1Й03123ь011332ab"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_91(string s) => ValidateEquals(s == "222ж2311b133b3ж3223", s, "222ж2311b133b3ж3223"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_92(string s) => ValidateEquals(s == "0111ь3002222a3aaaa3", s, "0111ь3002222a3aaaa3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_93(string s) => ValidateEquals(s == "313Й213aж01a12231a2", s, "313Й213aж01a12231a2"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_94(string s) => ValidateEquals(s == "1ж022ь1323b3b3ж222ь", s, "1ж022ь1323b3b3ж222ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_95(string s) => ValidateEquals(s == "ь023a3b213ь033ж13231", s, "ь023a3b213ь033ж13231"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_96(string s) => ValidateEquals(s == "ab2b0bь322300ж2220ж2", s, "ab2b0bь322300ж2220ж2"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_97(string s) => ValidateEquals(s == "1133Й323223ж31002123", s, "1133Й323223ж31002123"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_98(string s) => ValidateEquals(s == "233ж0b3Й023Йьaaж3321", s, "233ж0b3Й023Йьaaж3321"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_99(string s) => ValidateEquals(s == "3Й11b313323230a02Й30", s, "3Й11b313323230a02Й30"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_100(string s) => ValidateEquals(s == "1ж2Йж0131a2ж2aЙЙ3ьb11", s, "1ж2Йж0131a2ж2aЙЙ3ьb11"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_101(string s) => ValidateEquals(s == "Й13303ba3ьж31a1102222", s, "Й13303ba3ьж31a1102222"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_102(string s) => ValidateEquals(s == "32331221ь3ьb103212132", s, "32331221ь3ьb103212132"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_103(string s) => ValidateEquals(s == "133Й0332210231331100Й", s, "133Й0332210231331100Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_104(string s) => ValidateEquals(s == "22221322Й1133bb0Й3222", s, "22221322Й1133bb0Й3222"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_105(string s) => ValidateEquals(s == "12b011ж3a1ж3ЙЙa12Й0ь3ь", s, "12b011ж3a1ж3ЙЙa12Й0ь3ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_106(string s) => ValidateEquals(s == "0333ь12113ь11331ж323Йж", s, "0333ь12113ь11331ж323Йж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_107(string s) => ValidateEquals(s == "0Й13a310ь12\02ь\02320331", s, "0Й13a310ь12\02ь\02320331"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_108(string s) => ValidateEquals(s == "022b2ьж0302b33Й21ж1112", s, "022b2ьж0302b33Й21ж1112"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_109(string s) => ValidateEquals(s == "3322ж2133133b3032Йaa12", s, "3322ж2133133b3032Йaa12"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_110(string s) => ValidateEquals(s == "Й132Йaьb33a3Й33Йb21a2b2", s, "Й132Йaьb33a3Й33Йb21a2b2"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_111(string s) => ValidateEquals(s == "31102113Й11жb31bЙ12b133", s, "31102113Й11жb31bЙ12b133"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_112(string s) => ValidateEquals(s == "ЙьЙЙ0Й03a\023ь3311ьЙ1323", s, "ЙьЙЙ0Й03a\023ь3311ьЙ1323"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_113(string s) => ValidateEquals(s == "212323жa23203bb00жa12ж3", s, "212323жa23203bb00жa12ж3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_114(string s) => ValidateEquals(s == "жЙ31130ж32322313010aa13", s, "жЙ31130ж32322313010aa13"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_115(string s) => ValidateEquals(s == "123aж2221\022ж22Й021bЙЙ0Й", s, "123aж2221\022ж22Й021bЙЙ0Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_116(string s) => ValidateEquals(s == "211131ж2213303b1b0231a11", s, "211131ж2213303b1b0231a11"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_117(string s) => ValidateEquals(s == "ь1aЙжь0110Й2b220жж3ьж3ж1", s, "ь1aЙжь0110Й2b220жж3ьж3ж1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_118(string s) => ValidateEquals(s == "3жab2221133331311\023ЙЙ3ж", s, "3жab2221133331311\023ЙЙ3ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_119(string s) => ValidateEquals(s == "21Й20\02ьь333ьb332223Йж1Й", s, "21Й20\02ьь333ьb332223Йж1Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_120(string s) => ValidateEquals(s == "1Й2120a01110Й1121003a3b33", s, "1Й2120a01110Й1121003a3b33"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_121(string s) => ValidateEquals(s == "3021a1Й1aa1111b22Й112Й201", s, "3021a1Й1aa1111b22Й112Й201"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_122(string s) => ValidateEquals(s == "2b21ьaьb\023Й33301Й3123Йж1", s, "2b21ьaьb\023Й33301Й3123Йж1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_123(string s) => ValidateEquals(s == "2ж1baЙЙ1a\021ж23323жbж331ж", s, "2ж1baЙЙ1a\021ж23323жbж331ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_124(string s) => ValidateEquals(s == "bab12332ж31130Й3230ь1011a", s, "bab12332ж31130Й3230ь1011a"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_125(string s) => ValidateEquals(s == "110aь31ж33ьь33333a2b32ь12ь", s, "110aь31ж33ьь33333a2b32ь12ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_126(string s) => ValidateEquals(s == "a2жЙ11ь1bь312a11aьaьb02Йb0", s, "a2жЙ11ь1bь312a11aьaьb02Йb0"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_127(string s) => ValidateEquals(s == "32b2ж12a32a3ж23ж1ьЙbb22213", s, "32b2ж12a32a3ж23ж1ьЙbb22213"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_128(string s) => ValidateEquals(s == "30ж111ь11120жжb10212жbь33Й", s, "30ж111ь11120жжb10212жbь33Й"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_129(string s) => ValidateEquals(s == "33b1311ж1\023bж020Й10b0302ж", s, "33b1311ж1\023bж020Й10b0302ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_130(string s) => ValidateEquals(s == "b3122жa12\021123a3130100113ь", s, "b3122жa12\021123a3130100113ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_131(string s) => ValidateEquals(s == "302a1ж322\021221\02a1331b2жь1", s, "302a1ж322\021221\02a1331b2жь1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_132(string s) => ValidateEquals(s == "31201322жж\0221Й\021Йьь32Й11ж", s, "31201322жж\0221Й\021Йьь32Й11ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_133(string s) => ValidateEquals(s == "3bжa132a13ba1311ж1Й22ЙbЙa33", s, "3bжa132a13ba1311ж1Й22ЙbЙa33"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_134(string s) => ValidateEquals(s == "b33Й113ЙЙab1b332211222Й32\02", s, "b33Й113ЙЙab1b332211222Й32\02"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_135(string s) => ValidateEquals(s == "0ж333b31b212121b1aж02ж133111", s, "0ж333b31b212121b1aж02ж133111"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_136(string s) => ValidateEquals(s == "0101Й220Й0жЙ3Й2abba0b1223aab", s, "0101Й220Й0жЙ3Й2abba0b1223aab"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_137(string s) => ValidateEquals(s == "2Й330bЙ123ж2ж02ж212ь112111Й1", s, "2Й330bЙ123ж2ж02ж212ь112111Й1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_138(string s) => ValidateEquals(s == "22a\0212aь3b1303Й3bb2b313Й222", s, "22a\0212aь3b1303Й3bb2b313Й222"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_139(string s) => ValidateEquals(s == "2ьж133332102222\020Йжbb2\022\02", s, "2ьж133332102222\020Йжbb2\022\02"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_140(string s) => ValidateEquals(s == "2\02321b31123231b2ЙЙ122abЙ2131", s, "2\02321b31123231b2ЙЙ122abЙ2131"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_141(string s) => ValidateEquals(s == "1b021ьЙ30a2332ь3Й12231жж1aжь1", s, "1b021ьЙ30a2332ь3Й12231жж1aжь1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_142(string s) => ValidateEquals(s == "1ж3ьь3ь1ь1ь0ж1Й122132a2ььaЙ3b", s, "1ж3ьь3ь1ь1ь0ж1Й122132a2ььaЙ3b"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_143(string s) => ValidateEquals(s == "21bbb31301ь3жaaж0Й3323b33ь1ь1", s, "21bbb31301ь3жaaж0Й3323b33ь1ь1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_144(string s) => ValidateEquals(s == "a00Йь11жжaa321ьЙ1Й31жa21ж3223", s, "a00Йь11жжaa321ьЙ1Й31жa21ж3223"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_145(string s) => ValidateEquals(s == "3132b0Йb3110ab\0201Й1ж32222a33ж", s, "3132b0Йb3110ab\0201Й1ж32222a33ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_146(string s) => ValidateEquals(s == "32b110bb312ь02Й1b2Й23232Й12ь33", s, "32b110bb312ь02Й1b2Й23232Й12ь33"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_147(string s) => ValidateEquals(s == "ж121bbbЙ2b1ж12222Йь1Йb02013жь1", s, "ж121bbbЙ2b1ж12222Йь1Йb02013жь1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_148(string s) => ValidateEquals(s == "ь1b00a3310231001b1a1ь33жжb130ь", s, "ь1b00a3310231001b1a1ь33жжb130ь"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_149(string s) => ValidateEquals(s == "ж3b211b121ж23bь12a1Й2Йж12313aж", s, "ж3b211b121ж23bь12a1Й2Йж12313aж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_150(string s) => ValidateEquals(s == "1a3жb31311322жь33213Й3ь13330жa3", s, "1a3жb31311322жь33213Й3ь13330жa3"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_151(string s) => ValidateEquals(s == "b33Йbж3333233101a33ж3b231221ь11", s, "b33Йbж3333233101a33ж3b231221ь11"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_152(string s) => ValidateEquals(s == "1Й212Й3ж112a31aьжьЙ32ж233a32Й1ж", s, "1Й212Й3ж112a31aьжьЙ32ж233a32Й1ж"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_153(string s) => ValidateEquals(s == "133ь02aьa0Й3Йab3ь1Й3Й2a21121210", s, "133ь02aьa0Й3Йab3ь1Й3Й2a21121210"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_154(string s) => ValidateEquals(s == "1320baж31b3Й2Й1322b113212212331", s, "1320baж31b3Й2Й1322b113212212331"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_155(string s) => ValidateEquals(s == "1Йa332132жb31Й33Й32321ж31b120ж03", s, "1Йa332132жb31Й33Й32321ж31b120ж03"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_156(string s) => ValidateEquals(s == "213321a1b3жь3111жЙ2b2Й3101221ь33", s, "213321a1b3жь3111жЙ2b2Й3101221ь33"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_157(string s) => ValidateEquals(s == "2ж1311a23b2212aЙ21Й11жb3233bb3a1", s, "2ж1311a23b2212aЙ21Й11жb3233bb3a1"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_158(string s) => ValidateEquals(s == "01Й11113ь3Й32a3ьЙЙ3Й32b2ab221310", s, "01Й11113ь3Й32a3ьЙЙ3Й32b2ab221310"); + [MethodImpl(MethodImplOptions.NoInlining)] public static void Equals_159(string s) => ValidateEquals(s == "a120213b11211\0223223312ьь1Й3222Й", s, "a120213b11211\0223223312ьь1Й3222Й"); + + public static readonly string[] s_TestData = + { + null, + "", + "\0", + "a", + "0", + "ж", + "3", + "33", + "31", + "a\0", + "12", + "13", + "b12", + "ж23", + "2a2", + "222", + "0ь3", + "bж31", + "ьЙbЙ", + "b033", + "311ь", + "жЙ12", + "2011b", + "222b2", + "aЙ213", + "1a131", + "3232Й", + "3b0ьжь", + "213b2Й", + "b31210", + "1ж0021", + "3ь3112", + "122b231", + "03ж32ж3", + "bb31ж2Й", + "023bьжЙ", + "\0232a12", + "ж13ь11Йь", + "11ьbb32ь", + "222Йж3ж3", + "ж303aЙ12", + "ьb22322b", + "a22b10b1Й", + "3ba2221ь3", + "жa1Й0b1Й1", + "a20Йжж1ьь", + "ьaж32132ь", + "11111Й3Й12", + "11Й\02Йb3жж", + "21bжжж0103", + "333332aЙ11", + "Й123112313", + "12ЙьЙaЙ11ьb", + "жж22221Й3Й2", + "ьЙ1bbж3202ж", + "1bbЙ2Й33Й2ж", + "2013133ь1bж", + "23a2\02жa2a13", + "23Й210Й3a3ж1", + "32Й2133bb2Й3", + "Й3bb1ь3bbьb3", + "a0Йbabж2Й133", + "320жa22a11ж1b", + "ь321b3ьЙЙ13Й2", + "a3ь1ж2a\022a1a", + "3Йb30b33231bь", + "2210121ж13231", + "013311aa3203Й1", + "12ЙЙ1Й2aЙ2ьbЙa", + "2b1Й11130221bь", + "230110Й0b3112ж", + "a213ьab121b332", + "111a01ж3121b123", + "13a322Й2Й3bжb0Й", + "\021232b1Йaa1032", + "жЙ112ьb12Йь3b2ж", + "2bьь331bb\023122", + "aж22Й2203b023bь3", + "aЙ033ж3a220ь3331", + "20Йжa1b1313жЙb2a", + "131Й1\022ж2322123", + "23323b21ь11bЙ321", + "302aьжa3213жaЙ3Йж", + "ж13b00210b1212102", + "20320Й3Й3ьж3Й2122", + "0bb23a30baЙb2333ь", + "22122ь130230103a2", + "ььba20ж1жьЙьbЙ31bж", + "bb1ь1033bж3011bж10", + "1ь320a3a22b3333b13", + "0a22aЙжa2222ж23Й13", + "Й11Й213212ж1233b23", + "32ь1Й03123ь011332ab", + "222ж2311b133b3ж3223", + "0111ь3002222a3aaaa3", + "313Й213aж01a12231a2", + "1ж022ь1323b3b3ж222ь", + "ь023a3b213ь033ж13231", + "ab2b0bь322300ж2220ж2", + "1133Й323223ж31002123", + "233ж0b3Й023Йьaaж3321", + "3Й11b313323230a02Й30", + "1ж2Йж0131a2ж2aЙЙ3ьb11", + "Й13303ba3ьж31a1102222", + "32331221ь3ьb103212132", + "133Й0332210231331100Й", + "22221322Й1133bb0Й3222", + "12b011ж3a1ж3ЙЙa12Й0ь3ь", + "0333ь12113ь11331ж323Йж", + "0Й13a310ь12\02ь\02\02320331", + "022b2ьж0302b33Й21ж1112", + "3322ж2133133b3032Йaa12", + "Й132Йaьb33a3Й33Йb21a2b2", + "31102113Й11жb31bЙ12b133", + "ЙьЙЙ0Й03a\023ь3311ьЙ1323", + "212323жa23203bb00жa12ж3", + "жЙ31130ж32322313010aa13", + "123aж2221\022ж22Й021bЙЙ0Й", + "211131ж2213303b1b0231a11", + "ь1aЙжь0110Й2b220жж3ьж3ж1", + "3жab2221133331311\023ЙЙ3ж", + "21Й20\02ьь333ьb332223Йж1Й", + "1Й2120a01110Й1121003a3b33", + "3021a1Й1aa1111b22Й112Й201", + "2b21ьaьb\023Й33301Й3123Йж1", + "2ж1baЙЙ1a\021ж23323жbж331ж", + "bab12332ж31130Й3230ь1011a", + "110aь31ж33ьь33333a2b32ь12ь", + "a2жЙ11ь1bь312a11aьaьb02Йb0", + "32b2ж12a32a3ж23ж1ьЙbb22213", + "30ж111ь11120жжb10212жbь33Й", + "33b1311ж1\023bж020Й10b0302ж", + "b3122жa12\021123a3130100113ь", + "302a1ж322\021221z2a1331b2жь1", + "31201322жж\0221Йz21Йьь32Й11ж", + "3bжa132a13ba1311ж1Й22ЙbЙa33", + "b33Й113ЙЙab1b332211222Й32\02", + "0ж333b31b212121b1aж02ж133111", + "0101Й220Й0жЙ3Й2abba0b1223aa\0", + "2Й330bЙ123ж2ж02ж212ь112111Й1", + "22a\0212aь3b1303Й3bb2b313Й222", + "2ьж133332102222\020Йжbb2\022\02", + "2\02321b31123231b2ЙЙ122abЙ2131", + "1b021ьЙ30a2332ь3Й12231жж1aжь1", + "1ж3ьь3ь1ь1ь0ж1Й122132a2ььaЙ3b", + "21bbb31301ь3жaaж0Й3323b33ь1ь1", + "a00Йь11жжaa321ьЙ1Й31жa21ж3223", + "3132b0Йb3110ab\0201Й1ж32222a33ж", + "32b110bb312ь02Й1b2Й23232Й12ь33", + "ж121bbbЙ2b1ж12222Йь1Йb02013жь1", + "ь1b00a3310231001b1a1ь33жжb130ь", + "ж3b211b121ж23bь12a1Й2Йж12313aж", + "1a3жb31311322жь33213Й3ь13330жa3", + "b33Йbж3333233101a33ж3b231221ь11", + "1Й212Й3ж112a31aьжьЙ32ж233a32Й1ж", + "133ь02aьa0Й3Йab3ь1Й3Й2a21121210", + "1320baж31b3Й2Й1322b113212212331", + "1Йa332132жb31Й33Й32321ж31b120ж03", + "213321a1b3жь3111жЙ2b2Й3101221ь33", + "2ж1311a23b2212aЙ21Й11жb3233bb3a1", + "01Й11113ь3Й32a3ьЙЙ3Й32b2ab221310", + "a120213b11211\0223223312ьь1Й3222Й", + }; +} diff --git a/src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.csproj b/src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.csproj new file mode 100644 index 0000000000000..6946bed81bfd5 --- /dev/null +++ b/src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.csproj @@ -0,0 +1,9 @@ + + + Exe + True + + + + + From e7106d6e3578346eb3fbe2f76b8c316de721376f Mon Sep 17 00:00:00 2001 From: EgorBo Date: Mon, 14 Feb 2022 01:30:35 +0300 Subject: [PATCH 02/29] fix bug --- src/coreclr/jit/importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 5b743281a6b86..88f449f29bbd1 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -4326,7 +4326,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, JITDUMP("... Successfully unrolled to:\n") DISPTREE(unrolled) - for (unsigned i = 0; i < sig->numArgs; i++) + for (unsigned i = 0; i < max(2, sig->numArgs); i++) { impPopStack(); } From 2985162a15311223b4815b24310a6b817e80f47d Mon Sep 17 00:00:00 2001 From: EgorBo Date: Mon, 14 Feb 2022 05:19:59 +0300 Subject: [PATCH 03/29] StartsWith, clean up --- src/coreclr/jit/compiler.h | 3 +- src/coreclr/jit/importer.cpp | 297 ++++++++++-------- src/coreclr/jit/namedintrinsiclist.h | 2 + .../System/MemoryExtensions.Globalization.cs | 3 +- .../src/System/String.Comparison.cs | 9 +- 5 files changed, 177 insertions(+), 137 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 38a582b7d6ae7..4bd07e340a366 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -4399,8 +4399,9 @@ class Compiler GenTree* impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset); GenTree* impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset); GenTree* impExpandHalfConstEquals( - GenTree* data, GenTree* lengthFld, bool checkForNull, WCHAR* cnsData, int len, int dataOffset); + GenTree* data, GenTree* lengthFld, bool checkForNull, bool startsWith, WCHAR* cnsData, int len, int dataOffset); GenTreeStrCon* impGetStrConFromSpan(GenTree* span); + GenTree* impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); GenTree* impIntrinsic(GenTree* newobjThis, CORINFO_CLASS_HANDLE clsHnd, diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 88f449f29bbd1..ec5eff804bb68 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -3869,18 +3869,17 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l #ifdef TARGET_64BIT else if (len == 3) { - if (dataOffset > 2) - { - // for len == 3 we slightly overlap with Length field - const UINT64 value = MAKEINT64(0 /*part of Length field*/, cns[0], cns[1], cns[2]); - return compareValue(this, data, TYP_LONG, dataOffset - 2, value); - } - else - { - // We can't load part of Length for spans - // TODO: implement via two indirs - return nullptr; - } + // handle len = 3 via two Int32 with overlapping + UINT32 value1 = MAKEINT32(cns[0], cns[1]); + UINT32 value2 = MAKEINT32(cns[1], cns[2]); + GenTree* firstIndir = compareValue(this, data, TYP_INT, dataOffset, value1); + GenTree* secondIndir = compareValue(this, gtClone(data), TYP_INT, dataOffset + 2, value2); + + // TODO: Consider marging two indirs via XOR instead of QMARK + // e.g. gtNewOperNode(GT_XOR, TYP_INT, firstIndir, secondIndir); + // but it currently has CQ issues + GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); + return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); } else { @@ -3900,7 +3899,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l ssize_t offset = dataOffset + len * 2 - sizeof(UINT64); GenTree* secondIndir = compareValue(this, gtClone(data), TYP_LONG, offset, value2); - // Alternativly, we can do OR here and avoid a branch + // TODO: Consider marging two indirs via XOR instead of QMARK GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); } @@ -3921,6 +3920,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l // data - Pointer to a data to vectorize // lengthFld - Pointer to Length field // checkForNull - Check data for null +// startsWith - true - StartsWith, false - Equals // cns - Constant data (array of 2-byte chars) // len - Number of 2-byte chars in the cns // dataOffset - Offset for data @@ -3930,7 +3930,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l // possible or not profitable // GenTree* Compiler::impExpandHalfConstEquals( - GenTree* data, GenTree* lengthFld, bool checkForNull, WCHAR* cnsData, int len, int dataOffset) + GenTree* data, GenTree* lengthFld, bool checkForNull, bool startsWith, WCHAR* cnsData, int len, int dataOffset) { assert(len >= 0); @@ -3953,6 +3953,12 @@ GenTree* Compiler::impExpandHalfConstEquals( GenTree* lenCheckNode; if (len == 0) { + if (startsWith) + { + // Any string starts with "" + return gtTrue(); + } + // For zero length we don't need to compare content, the following expression is enough: // // varData != null && lengthFld == 0 @@ -3975,19 +3981,22 @@ GenTree* Compiler::impExpandHalfConstEquals( if (indirCmp == nullptr) { + JITDUMP("unable to compose indirCmp\n"); return nullptr; } - GenTreeColon* lenCheckColon = gtNewColonNode(TYP_INT, gtFalse(), indirCmp); - lenCheckNode = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_NE, TYP_INT, lengthFld, elementsCount), lenCheckColon); + GenTreeColon* lenCheckColon = gtNewColonNode(TYP_INT, indirCmp, gtFalse()); + lenCheckNode = + gtNewQmarkNode(TYP_INT, gtNewOperNode(startsWith ? GT_GE : GT_EQ, TYP_INT, lengthFld, elementsCount), + lenCheckColon); } GenTree* rootQmark; if (checkForNull) { // varData == nullptr - GenTreeColon* nullCheckColon = gtNewColonNode(TYP_INT, gtFalse(), lenCheckNode); - rootQmark = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_EQ, TYP_INT, data, gtNull()), nullCheckColon); + GenTreeColon* nullCheckColon = gtNewColonNode(TYP_INT, lenCheckNode, gtFalse()); + rootQmark = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_NE, TYP_INT, data, gtNull()), nullCheckColon); } else { @@ -4031,6 +4040,131 @@ GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) return nullptr; } +GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags) +{ + // We're going to unroll & vectorize the following cases: + // + // 1) String.Equals(obj, "cns") + // 2) String.Equals(obj, "cns", StringComparison.Ordinal) + // 3) String.Equals("cns", obj) + // 4) String.Equals("cns", obj, StringComparison.Ordinal) + // 5) obj.Equals("cns") + // 6) obj.Equals("cns", StringComparison.Ordinal) + // 7) "cns".Equals(obj) + // 8) "cns".Equals(obj, StringComparison.Ordinal) + // + // NOTE: for cases 5 and 6 we don't emit "obj != null" + // TODO: Add support for String.Equals(object) + + bool isStatic = methodFlags & CORINFO_FLG_STATIC; + int argsCount = sig->numArgs + (isStatic ? 0 : 1); + + GenTree* op1; + GenTree* op2; + if (argsCount == 3) + { + if (!impStackTop(0).val->IsIntegralConst(4)) // StringComparison.Ordinal + { + // TODO: Unroll & vectorize OrdinalIgnoreCase + return nullptr; + } + op1 = impStackTop(2).val; + op2 = impStackTop(1).val; + } + else + { + op1 = impStackTop(1).val; + op2 = impStackTop(0).val; + } + + if (!(op1->OperIs(GT_CNS_STR) ^ op2->OperIs(GT_CNS_STR))) + { + // either op1 or op2 has to be CNS_STR, but not both - that case is optimized + // just fine as is. + return nullptr; + } + + GenTree* varStr; + GenTreeStrCon* cnsStr; + if (op1->OperIs(GT_CNS_STR)) + { + cnsStr = op1->AsStrCon(); + varStr = op2; + } + else + { + cnsStr = op2->AsStrCon(); + varStr = op1; + } + + bool needsNullcheck = true; + if ((op1 != cnsStr) && !isStatic) + { + // for the following cases we should not check varStr for null: + // + // obj.Equals("cns") + // obj.Equals("cns", StringComparison.Ordinal) + // + // instead, it should throw NRE if it's null + needsNullcheck = false; + } + + int cnsLength = -1; + const char16_t* str = nullptr; + if (cnsStr->IsStringEmptyField()) + { + // check for fake "" first + cnsLength = 0; + JITDUMP("Trying to unroll String.Equals(op1, \"\")...\n", str) + } + else + { + str = info.compCompHnd->getStringLiteral(cnsStr->gtScpHnd, cnsStr->gtSconCPX, &cnsLength); + if (cnsLength < 0 || str == nullptr) + { + // We were unable to get the literal (e.g. dynamic context) + return nullptr; + } + JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) + } + + // Create a temp safe to gtClone for varStr + // We're not appending it as a statement untill we figure out unrolling is profitable (and possible) + unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("spilling varStr")); + lvaTable[varStrTmp].lvType = varStr->TypeGet(); + GenTree* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); + + // TODO: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN + int strLenOffset = OFFSETOF__CORINFO_String__stringLen; + GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); + GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); + GenTree* unrolled = impExpandHalfConstEquals(gtClone(varStrLcl), lenNode, needsNullcheck, startsWith, (WCHAR*)str, + cnsLength, strLenOffset + sizeof(int)); + + GenTree* retNode = nullptr; + if (unrolled != nullptr) + { + impAssignTempGen(varStrTmp, varStr); + if (unrolled->OperIs(GT_QMARK)) + { + // QMARK nodes cannot reside on the evaluation stack + unsigned rootTmp = lvaGrabTemp(true DEBUGARG("spilling unroll qmark")); + impAssignTempGen(rootTmp, unrolled); + retNode = gtNewLclvNode(rootTmp, TYP_INT); + } + + JITDUMP("\n... Successfully unrolled to:\n") + DISPTREE(unrolled) + for (int i = 0; i < argsCount; i++) + { + // max(2, numArgs) just to handle instance-method Equals that + // doesn't report "this" as an argument + impPopStack(); + } + } + return retNode; +} + //------------------------------------------------------------------------ // impIntrinsic: possibly expand intrinsic call into alternate IR sequence // @@ -4217,120 +4351,13 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, case NI_System_String_Equals: { - // We're going to unroll & vectorize the following cases: - // - // 1) String.Equals(obj, "cns") - // 2) String.Equals(obj, "cns", StringComparison.Ordinal) - // 3) String.Equals("cns", obj) - // 4) String.Equals("cns", obj, StringComparison.Ordinal) - // 5) obj.Equals("cns") - // 6) obj.Equals("cns", StringComparison.Ordinal) - // 7) "cns".Equals(obj) - // 8) "cns".Equals(obj, StringComparison.Ordinal) - // - // NOTE: for cases 5 and 6 we don't emit "obj != null" - // TODO: Add support for String.Equals(object) - - GenTree* op1; - GenTree* op2; - if (sig->numArgs == 3) - { - if (!impStackTop(0).val->IsIntegralConst(4)) // StringComparison.Ordinal - { - // TODO: Unroll & vectorize OrdinalIgnoreCase - break; - } - op1 = impStackTop(2).val; - op2 = impStackTop(1).val; - } - else - { - op1 = impStackTop(1).val; - op2 = impStackTop(0).val; - } - - if (!(op1->OperIs(GT_CNS_STR) ^ op2->OperIs(GT_CNS_STR))) - { - // either op1 or op2 has to be CNS_STR, but not both - that case is optimized - // just fine as is. - break; - } - - GenTree* varStr; - GenTreeStrCon* cnsStr; - if (op1->OperIs(GT_CNS_STR)) - { - cnsStr = op1->AsStrCon(); - varStr = op2; - } - else - { - cnsStr = op2->AsStrCon(); - varStr = op1; - } - - assert(varStr->TypeIs(TYP_REF)); - - bool needsNullcheck = true; - if ((op1 != cnsStr) && ((methodFlags & CORINFO_FLG_STATIC) == 0)) - { - // for the following cases we should not check varStr for null: - // - // obj.Equals("cns") - // obj.Equals("cns", StringComparison.Ordinal) - // - // instead, it should throw NRE if it's null - needsNullcheck = false; - } - - int cnsLength = -1; - const char16_t* str = nullptr; - if (cnsStr->IsStringEmptyField()) - { - cnsLength = 0; - JITDUMP("Trying to unroll String.Equals(op1, \"\")...\n", str) - } - else - { - str = info.compCompHnd->getStringLiteral(cnsStr->gtScpHnd, cnsStr->gtSconCPX, &cnsLength); - if (cnsLength < 0 || str == nullptr) - { - break; - } - JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) - } - - // Create a temp safe to gtClone for varStr - // We're not appending it as a statement untill we figure out - // unrolling is profitable (and possible) - unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("spilling varStr")); - lvaTable[varStrTmp].lvType = TYP_REF; - GenTree* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); - - // TODO: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN - int strLenOffset = OFFSETOF__CORINFO_String__stringLen; - GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); - GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); - GenTree* unrolled = impExpandHalfConstEquals(gtClone(varStrLcl), lenNode, needsNullcheck, (WCHAR*)str, - cnsLength, strLenOffset + sizeof(int)); - if (unrolled != nullptr) - { - impAssignTempGen(varStrTmp, varStr); - if (unrolled->OperIs(GT_QMARK)) - { - // QMARK can't be a root node, spill it to a temp - unsigned rootTmp = lvaGrabTemp(true DEBUGARG("spilling unroll qmark")); - impAssignTempGen(rootTmp, unrolled); - retNode = gtNewLclvNode(rootTmp, TYP_INT); - } + retNode = impStringEqualsOrStartsWith(false, sig, methodFlags); + break; + } - JITDUMP("... Successfully unrolled to:\n") - DISPTREE(unrolled) - for (unsigned i = 0; i < max(2, sig->numArgs); i++) - { - impPopStack(); - } - } + case NI_System_String_StartsWith: + { + retNode = impStringEqualsOrStartsWith(true, sig, methodFlags); break; } @@ -5666,6 +5693,10 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) { result = NI_System_String_op_Implicit; } + else if (strcmp(methodName, "StartsWith") == 0) + { + result = NI_System_String_StartsWith; + } } else if (strcmp(className, "MemoryExtensions") == 0) { @@ -5677,6 +5708,10 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) { result = NI_System_MemoryExtensions_Equals; } + else if (strcmp(methodName, "StartsWith") == 0) + { + result = NI_System_MemoryExtensions_StartsWith; + } } else if (strcmp(className, "Span`1") == 0) { diff --git a/src/coreclr/jit/namedintrinsiclist.h b/src/coreclr/jit/namedintrinsiclist.h index f161c670ba285..5545e265aeb41 100644 --- a/src/coreclr/jit/namedintrinsiclist.h +++ b/src/coreclr/jit/namedintrinsiclist.h @@ -88,11 +88,13 @@ enum NamedIntrinsic : unsigned short NI_System_String_get_Chars, NI_System_String_get_Length, NI_System_String_op_Implicit, + NI_System_String_StartsWith, NI_System_Span_get_Item, NI_System_ReadOnlySpan_get_Item, NI_System_MemoryExtensions_Equals, NI_System_MemoryExtensions_SequenceEqual, + NI_System_MemoryExtensions_StartsWith, // These are used by HWIntrinsics but are defined more generally // to allow dead code optimization and handle the recursion case diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs index f79a1015d35a8..5659b4a602f10 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs @@ -43,7 +43,7 @@ public static bool Contains(this ReadOnlySpan span, ReadOnlySpan val /// The value to compare with the source span. /// One of the enumeration values that determines how the and are compared. /// - [Intrinsic] // Unrolled and vectorized for half-constant input + [Intrinsic] // Unrolled and vectorized for half-constant input (Ordinal) public static bool Equals(this ReadOnlySpan span, ReadOnlySpan other, StringComparison comparisonType) { string.CheckStringComparison(comparisonType); @@ -332,6 +332,7 @@ ref MemoryMarshal.GetReference(value), /// The source span. /// The sequence to compare to the beginning of the source span. /// One of the enumeration values that determines how the and are compared. + [Intrinsic] // Unrolled and vectorized for half-constant input (Ordinal) public static bool StartsWith(this ReadOnlySpan span, ReadOnlySpan value, StringComparison comparisonType) { string.CheckStringComparison(comparisonType); diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs index e1bc40706871b..78fd0c975688d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs @@ -612,7 +612,7 @@ public override bool Equals([NotNullWhen(true)] object? obj) } // Determines whether two strings match. - [Intrinsic] // Can be unrolled and vectorized + [Intrinsic] // Unrolled and vectorized for half-constant input public bool Equals([NotNullWhen(true)] string? value) { if (object.ReferenceEquals(this, value)) @@ -631,7 +631,7 @@ public bool Equals([NotNullWhen(true)] string? value) return EqualsHelper(this, value); } - [Intrinsic] // Can be unrolled and vectorized + [Intrinsic] // Unrolled and vectorized for half-constant input (Ordinal) public bool Equals([NotNullWhen(true)] string? value, StringComparison comparisonType) { if (object.ReferenceEquals(this, value)) @@ -673,7 +673,7 @@ public bool Equals([NotNullWhen(true)] string? value, StringComparison compariso } // Determines whether two Strings match. - [Intrinsic] // Can be unrolled and vectorized + [Intrinsic] // Unrolled and vectorized for half-constant input public static bool Equals(string? a, string? b) { if (object.ReferenceEquals(a, b)) @@ -689,7 +689,7 @@ public static bool Equals(string? a, string? b) return EqualsHelper(a, b); } - [Intrinsic] // Can be unrolled and vectorized + [Intrinsic] // Unrolled and vectorized for half-constant input (Ordinal) public static bool Equals(string? a, string? b, StringComparison comparisonType) { if (object.ReferenceEquals(a, b)) @@ -934,6 +934,7 @@ public bool StartsWith(string value!!) return StartsWith(value, StringComparison.CurrentCulture); } + [Intrinsic] // Unrolled and vectorized for half-constant input (Ordinal) public bool StartsWith(string value!!, StringComparison comparisonType) { if ((object)this == (object)value) From 4047ce59bbc12d617416c0d9fd655db4e2af9d30 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Mon, 14 Feb 2022 11:44:49 +0300 Subject: [PATCH 04/29] Update importer.cpp --- src/coreclr/jit/importer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index ec5eff804bb68..5dde74426ddc7 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -3810,8 +3810,8 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l // ((v1 ^ cns1) | (v2 ^ cns2)) == zero GenTree* xor1 = gtNewSimdBinOpNode(GT_XOR, simdType, vec1, cnsVec1, type, simdSize, false); GenTree* xor2 = gtNewSimdBinOpNode(GT_XOR, simdType, vec2, cnsVec2, type, simdSize, false); - GenTree* or = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, type, simdSize, false); - return gtNewSimdHWIntrinsicNode(TYP_BOOL, useSingleVector ? xor1 : or, zero, niEquals, type, simdSize); + GenTree* orr = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, type, simdSize, false); + return gtNewSimdHWIntrinsicNode(TYP_BOOL, useSingleVector ? xor1 : orr, zero, niEquals, type, simdSize); #else return nullptr; #endif From 7d889605a65d11b956f1c8ec50d354c070432555 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Mon, 14 Feb 2022 12:44:35 +0300 Subject: [PATCH 05/29] fix build errors --- src/coreclr/jit/importer.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 5dde74426ddc7..759f54bb29a0a 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -3705,7 +3705,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l { assert(len >= 8 && len <= 32); -#if defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_HW_INTRINSICS) && defined(TARGET_64BIT) if (!compOpportunisticallyDependsOn(InstructionSet_Vector128)) { // We need SSE2 or ADVSIMD at least @@ -3741,17 +3741,18 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l // Special case: use a single vector for len=16 useSingleVector = len == 16; - GenTree* long1 = gtNewIconNode(*(UINT64*)(cns + 0), TYP_LONG); - GenTree* long2 = gtNewIconNode(*(UINT64*)(cns + 4), TYP_LONG); - GenTree* long3 = gtNewIconNode(*(UINT64*)(cns + 8), TYP_LONG); - GenTree* long4 = gtNewIconNode(*(UINT64*)(cns + 12), TYP_LONG); + assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT + GenTree* long1 = gtNewIconNode(*(ssize_t*)(cns + 0), TYP_LONG); + GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); + GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + 8), TYP_LONG); + GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + 12), TYP_LONG); cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, long3, long4, NI_Vector256_Create, type, simdSize); // cnsVec2 most likely overlaps with cnsVec1: - GenTree* long5 = gtNewIconNode(*(UINT64*)(cns + len - 16), TYP_LONG); - GenTree* long6 = gtNewIconNode(*(UINT64*)(cns + len - 12), TYP_LONG); - GenTree* long7 = gtNewIconNode(*(UINT64*)(cns + len - 8), TYP_LONG); - GenTree* long8 = gtNewIconNode(*(UINT64*)(cns + len - 4), TYP_LONG); + GenTree* long5 = gtNewIconNode(*(ssize_t*)(cns + len - 16), TYP_LONG); + GenTree* long6 = gtNewIconNode(*(ssize_t*)(cns + len - 12), TYP_LONG); + GenTree* long7 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); + GenTree* long8 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, NI_Vector256_Create, type, simdSize); loadIntrinsic = NI_AVX_LoadVector256; @@ -3772,13 +3773,14 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l // Special case: use a single vector for len=8 useSingleVector = len == 8; - GenTree* long1 = gtNewIconNode(*(UINT64*)(cns + 0), TYP_LONG); - GenTree* long2 = gtNewIconNode(*(UINT64*)(cns + 4), TYP_LONG); + assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT + GenTree* long1 = gtNewIconNode(*(ssize_t*)(cns + 0), TYP_LONG); + GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, NI_Vector128_Create, type, simdSize); // cnsVec2 most likely overlaps with cnsVec1: - GenTree* long3 = gtNewIconNode(*(UINT64*)(cns + len - 8), TYP_LONG); - GenTree* long4 = gtNewIconNode(*(UINT64*)(cns + len - 4), TYP_LONG); + GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); + GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long3, long4, NI_Vector128_Create, type, simdSize); #if defined(TARGET_XARCH) From 486d3844d9ede49941227b8e167144187d32400f Mon Sep 17 00:00:00 2001 From: EgorBo Date: Mon, 14 Feb 2022 13:48:24 +0300 Subject: [PATCH 06/29] formatting --- src/coreclr/jit/importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 759f54bb29a0a..6b1669b310962 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -3812,7 +3812,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l // ((v1 ^ cns1) | (v2 ^ cns2)) == zero GenTree* xor1 = gtNewSimdBinOpNode(GT_XOR, simdType, vec1, cnsVec1, type, simdSize, false); GenTree* xor2 = gtNewSimdBinOpNode(GT_XOR, simdType, vec2, cnsVec2, type, simdSize, false); - GenTree* orr = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, type, simdSize, false); + GenTree* orr = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, type, simdSize, false); return gtNewSimdHWIntrinsicNode(TYP_BOOL, useSingleVector ? xor1 : orr, zero, niEquals, type, simdSize); #else return nullptr; From 8d4bc7e5d93b75e0db5b54cf4b9d173989886caf Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 16 Feb 2022 04:20:16 +0300 Subject: [PATCH 07/29] Add Spans, move everything to a separate file --- src/coreclr/jit/CMakeLists.txt | 1 + src/coreclr/jit/compiler.h | 1 + src/coreclr/jit/importer.cpp | 508 +------------- src/coreclr/jit/importer_vectorization.cpp | 663 ++++++++++++++++++ src/coreclr/jit/namedintrinsiclist.h | 1 + .../src/System/MemoryExtensions.cs | 20 +- .../src/System/StringComparison.cs | 1 - 7 files changed, 701 insertions(+), 494 deletions(-) create mode 100644 src/coreclr/jit/importer_vectorization.cpp diff --git a/src/coreclr/jit/CMakeLists.txt b/src/coreclr/jit/CMakeLists.txt index 0534375b821af..362a8b1d82df3 100644 --- a/src/coreclr/jit/CMakeLists.txt +++ b/src/coreclr/jit/CMakeLists.txt @@ -115,6 +115,7 @@ set( JIT_SOURCES hostallocator.cpp indirectcalltransformer.cpp importer.cpp + importer_vectorization.cpp inline.cpp inlinepolicy.cpp instr.cpp diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 4bd07e340a366..9b7f5252b67a3 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -4402,6 +4402,7 @@ class Compiler GenTree* data, GenTree* lengthFld, bool checkForNull, bool startsWith, WCHAR* cnsData, int len, int dataOffset); GenTreeStrCon* impGetStrConFromSpan(GenTree* span); GenTree* impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); + GenTree* impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); GenTree* impIntrinsic(GenTree* newobjThis, CORINFO_CLASS_HANDLE clsHnd, diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 6b1669b310962..2f81ca86acafc 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -3676,497 +3676,6 @@ GenTree* Compiler::impCreateSpanIntrinsic(CORINFO_SIG_INFO* sig) return impCreateLocalNode(spanTempNum DEBUGARG(0)); } -//------------------------------------------------------------------------ -// impExpandHalfConstEqualsSIMD: Attempts to unroll and vectorize -// Equals against a constant WCHAR data for Length in [8..32] range -// using SIMD instructions. It uses the following expression: -// -// bool equasl = ((v1 ^ cns1) | (v2 ^ cns2)) == Vector128.Zero -// -// or if a single vector is enough (len == 8 or len == 16 with AVX): -// -// bool equasl = (v1 ^ cns1) == Vector128.Zero -// -// Arguments: -// data - Pointer to a data to vectorize -// cns - Constant data (array of 2-byte chars) -// len - Number of chars in the cns -// dataOffset - Offset for data -// -// Return Value: -// A pointer to the newly created SIMD node or nullptr if unrolling is not -// possible or not profitable -// -// Notes: -// This function doesn't check obj for null or its Length, it's just an internal helper -// for impExpandHalfConstEquals -// -GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset) -{ - assert(len >= 8 && len <= 32); - -#if defined(FEATURE_HW_INTRINSICS) && defined(TARGET_64BIT) - if (!compOpportunisticallyDependsOn(InstructionSet_Vector128)) - { - // We need SSE2 or ADVSIMD at least - return nullptr; - } - - CorInfoType type = CORINFO_TYPE_ULONG; - - int simdSize; - var_types simdType; - - NamedIntrinsic niZero; - NamedIntrinsic niEquals; - NamedIntrinsic loadIntrinsic; - - GenTree* cnsVec1; - GenTree* cnsVec2; - - bool useSingleVector = false; - -#if defined(TARGET_XARCH) - if (compOpportunisticallyDependsOn(InstructionSet_Vector256) && len >= 16) - { - // Handle [16..32] inputs via two Vector256 - assert(len >= 16 && len <= 32); - - simdSize = 32; - simdType = TYP_SIMD32; - - niZero = NI_Vector256_get_Zero; - niEquals = NI_Vector256_op_Equality; - - // Special case: use a single vector for len=16 - useSingleVector = len == 16; - - assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT - GenTree* long1 = gtNewIconNode(*(ssize_t*)(cns + 0), TYP_LONG); - GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); - GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + 8), TYP_LONG); - GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + 12), TYP_LONG); - cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, long3, long4, NI_Vector256_Create, type, simdSize); - - // cnsVec2 most likely overlaps with cnsVec1: - GenTree* long5 = gtNewIconNode(*(ssize_t*)(cns + len - 16), TYP_LONG); - GenTree* long6 = gtNewIconNode(*(ssize_t*)(cns + len - 12), TYP_LONG); - GenTree* long7 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); - GenTree* long8 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); - cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, NI_Vector256_Create, type, simdSize); - - loadIntrinsic = NI_AVX_LoadVector256; - } - else -#endif - if (len <= 16) - { - // Handle [8..16] inputs via two Vector256 - assert(len >= 8 && len <= 16); - - simdSize = 16; - simdType = TYP_SIMD16; - - niZero = NI_Vector128_get_Zero; - niEquals = NI_Vector128_op_Equality; - - // Special case: use a single vector for len=8 - useSingleVector = len == 8; - - assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT - GenTree* long1 = gtNewIconNode(*(ssize_t*)(cns + 0), TYP_LONG); - GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); - cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, NI_Vector128_Create, type, simdSize); - - // cnsVec2 most likely overlaps with cnsVec1: - GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); - GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); - cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long3, long4, NI_Vector128_Create, type, simdSize); - -#if defined(TARGET_XARCH) - loadIntrinsic = NI_SSE2_LoadVector128; -#else - loadIntrinsic = NI_AdvSimd_LoadVector128; -#endif - } - else - { - JITDUMP("impExpandHalfConstEqualsSIMD: No V256 and data is too big for V128\n"); - // NOTE: We might consider using four V128 for ARM64 - return nullptr; - } - - GenTree* zero = gtNewSimdHWIntrinsicNode(simdType, niZero, type, simdSize); - - GenTree* offset1 = gtNewIconNode(dataOffset, TYP_I_IMPL); - GenTree* offset2 = gtNewIconNode(dataOffset + len * 2 - simdSize, TYP_I_IMPL); - GenTree* dataPtr1 = gtNewOperNode(GT_ADD, TYP_BYREF, data, offset1); - GenTree* dataPtr2 = gtNewOperNode(GT_ADD, TYP_BYREF, gtClone(data), offset2); - - GenTree* vec1 = gtNewSimdHWIntrinsicNode(simdType, dataPtr1, loadIntrinsic, type, simdSize); - GenTree* vec2 = gtNewSimdHWIntrinsicNode(simdType, dataPtr2, loadIntrinsic, type, simdSize); - - // TODO-CQ: Spill vec1 and vec2 for better pipelining - // However, Forward-Sub most likely will glue it back - - // ((v1 ^ cns1) | (v2 ^ cns2)) == zero - GenTree* xor1 = gtNewSimdBinOpNode(GT_XOR, simdType, vec1, cnsVec1, type, simdSize, false); - GenTree* xor2 = gtNewSimdBinOpNode(GT_XOR, simdType, vec2, cnsVec2, type, simdSize, false); - GenTree* orr = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, type, simdSize, false); - return gtNewSimdHWIntrinsicNode(TYP_BOOL, useSingleVector ? xor1 : orr, zero, niEquals, type, simdSize); -#else - return nullptr; -#endif -} - -//------------------------------------------------------------------------ -// impExpandHalfConstEqualsSWAR: Attempts to unroll and vectorize -// Equals against a constant WCHAR data for Length in [1..8] range -// using SWAR (a sort of SIMD but for GPR registers and instructions) -// -// Arguments: -// data - Pointer to a data to vectorize -// cns - Constant data (array of 2-byte chars) -// len - Number of chars in the cns -// dataOffset - Offset for data -// -// Return Value: -// A pointer to the newly created SWAR node or nullptr if unrolling is not -// possible or not profitable -// -// Notes: -// This function doesn't check obj for null or its Length, it's just an internal helper -// for impExpandHalfConstEquals -// -GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset) -{ - assert(len >= 1 && len <= 8); - - auto compareValue = [](Compiler* comp, GenTree* obj, var_types type, ssize_t offset, ssize_t value) { - GenTree* offsetTree = comp->gtNewIconNode(offset, TYP_I_IMPL); - GenTree* addOffsetTree = comp->gtNewOperNode(GT_ADD, TYP_BYREF, obj, offsetTree); - GenTree* indirTree = comp->gtNewIndir(type, addOffsetTree); - GenTree* valueTree = comp->gtNewIconNode(value, type); - if (varTypeIsSmall(indirTree)) - { - indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, TYP_UINT); - valueTree->ChangeType(TYP_INT); - } - return comp->gtNewOperNode(GT_EQ, TYP_INT, indirTree, valueTree); - }; - -// Compose Int32 or Int64 values from ushort components -#define MAKEINT32(c1, c2) ((UINT64)c2 << 16) | ((UINT64)c1 << 0) -#define MAKEINT64(c1, c2, c3, c4) ((UINT64)c4 << 48) | ((UINT64)c3 << 32) | ((UINT64)c2 << 16) | ((UINT64)c1 << 0) - - if (len == 1) - { - return compareValue(this, data, TYP_SHORT, dataOffset, cns[0]); - } - else if (len == 2) - { - const UINT32 value = MAKEINT32(cns[0], cns[1]); - return compareValue(this, data, TYP_INT, dataOffset, value); - } -#ifdef TARGET_64BIT - else if (len == 3) - { - // handle len = 3 via two Int32 with overlapping - UINT32 value1 = MAKEINT32(cns[0], cns[1]); - UINT32 value2 = MAKEINT32(cns[1], cns[2]); - GenTree* firstIndir = compareValue(this, data, TYP_INT, dataOffset, value1); - GenTree* secondIndir = compareValue(this, gtClone(data), TYP_INT, dataOffset + 2, value2); - - // TODO: Consider marging two indirs via XOR instead of QMARK - // e.g. gtNewOperNode(GT_XOR, TYP_INT, firstIndir, secondIndir); - // but it currently has CQ issues - GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); - return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); - } - else - { - assert(len >= 4 && len <= 8); - - UINT64 value1 = MAKEINT64(cns[0], cns[1], cns[2], cns[3]); - if (len == 4) - { - return compareValue(this, data, TYP_LONG, dataOffset, value1); - } - else // [5..8] range - { - // For 5..7 value2 will overlap with value1 - UINT64 value2 = MAKEINT64(cns[len - 4], cns[len - 3], cns[len - 2], cns[len - 1]); - GenTree* firstIndir = compareValue(this, data, TYP_LONG, dataOffset, value1); - - ssize_t offset = dataOffset + len * 2 - sizeof(UINT64); - GenTree* secondIndir = compareValue(this, gtClone(data), TYP_LONG, offset, value2); - - // TODO: Consider marging two indirs via XOR instead of QMARK - GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); - return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); - } - } -#else // TARGET_64BIT - return nullptr; -#endif -} - -//------------------------------------------------------------------------ -// impExpandHalfConstEquals: Attempts to unroll and vectorize -// Equals against a constant WCHAR data for Length in [8..32] range -// using either SWAR or SIMD. In a general case it will look like this: -// -// bool equals = obj != null && obj.Length == len && (SWAR or SIMD) -// -// Arguments: -// data - Pointer to a data to vectorize -// lengthFld - Pointer to Length field -// checkForNull - Check data for null -// startsWith - true - StartsWith, false - Equals -// cns - Constant data (array of 2-byte chars) -// len - Number of 2-byte chars in the cns -// dataOffset - Offset for data -// -// Return Value: -// A pointer to the newly created SIMD node or nullptr if unrolling is not -// possible or not profitable -// -GenTree* Compiler::impExpandHalfConstEquals( - GenTree* data, GenTree* lengthFld, bool checkForNull, bool startsWith, WCHAR* cnsData, int len, int dataOffset) -{ - assert(len >= 0); - - if (compCurBB->isRunRarely()) - { - // Not profitable to expand - JITDUMP("impExpandHalfConstEquals: block is cold - not profitable to expand.\n"); - return nullptr; - } - - if (fgBBcount > 20) - { - // We don't want to unroll too much and in big methods - // TODO: come up with some better heuristic/budget - JITDUMP("impExpandHalfConstEquals: method has too many BBs (>20) - not profitable to expand.\n"); - return nullptr; - } - - GenTree* elementsCount = gtNewIconNode(len); - GenTree* lenCheckNode; - if (len == 0) - { - if (startsWith) - { - // Any string starts with "" - return gtTrue(); - } - - // For zero length we don't need to compare content, the following expression is enough: - // - // varData != null && lengthFld == 0 - // - lenCheckNode = gtNewOperNode(GT_EQ, TYP_INT, lengthFld, elementsCount); - } - else - { - assert(cnsData != nullptr); - - GenTree* indirCmp = nullptr; - if (len < 8) // SWAR impl supports len == 8 but we'd better give it to SIMD - { - indirCmp = impExpandHalfConstEqualsSWAR(gtClone(data), cnsData, len, dataOffset); - } - else if (len <= 32) - { - indirCmp = impExpandHalfConstEqualsSIMD(gtClone(data), cnsData, len, dataOffset); - } - - if (indirCmp == nullptr) - { - JITDUMP("unable to compose indirCmp\n"); - return nullptr; - } - - GenTreeColon* lenCheckColon = gtNewColonNode(TYP_INT, indirCmp, gtFalse()); - lenCheckNode = - gtNewQmarkNode(TYP_INT, gtNewOperNode(startsWith ? GT_GE : GT_EQ, TYP_INT, lengthFld, elementsCount), - lenCheckColon); - } - - GenTree* rootQmark; - if (checkForNull) - { - // varData == nullptr - GenTreeColon* nullCheckColon = gtNewColonNode(TYP_INT, lenCheckNode, gtFalse()); - rootQmark = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_NE, TYP_INT, data, gtNull()), nullCheckColon); - } - else - { - // no nullcheck, just "obj.Length == len && (SWAR or SIMD)" - rootQmark = lenCheckNode; - } - - return rootQmark; -} - -//------------------------------------------------------------------------ -// impGetStrConFromSpan: Try to obtain string literal out of a span -// if it was inited with one. -// -// Arguments: -// span - ReadOnlySpan tree -// -// Returns: -// GenTreeStrCon node or nullptr -// -GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) -{ - GenTreeCall* argCall = nullptr; - if (span->OperIs(GT_RET_EXPR)) - { - argCall = span->AsRetExpr()->gtInlineCandidate->AsCall(); - } - else if (span->OperIs(GT_CALL)) - { - argCall = span->AsCall(); - } - - // TODO: Do the same for '"cns".AsSpan()' and 'new ReadOnlySpan("cns")' - if ((argCall != nullptr) && (lookupNamedIntrinsic(argCall->gtCallMethHnd) == NI_System_String_op_Implicit)) - { - if (argCall->gtCallArgs->GetNode()->OperIs(GT_CNS_STR)) - { - return argCall->gtCallArgs->GetNode()->AsStrCon(); - } - } - return nullptr; -} - -GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags) -{ - // We're going to unroll & vectorize the following cases: - // - // 1) String.Equals(obj, "cns") - // 2) String.Equals(obj, "cns", StringComparison.Ordinal) - // 3) String.Equals("cns", obj) - // 4) String.Equals("cns", obj, StringComparison.Ordinal) - // 5) obj.Equals("cns") - // 6) obj.Equals("cns", StringComparison.Ordinal) - // 7) "cns".Equals(obj) - // 8) "cns".Equals(obj, StringComparison.Ordinal) - // - // NOTE: for cases 5 and 6 we don't emit "obj != null" - // TODO: Add support for String.Equals(object) - - bool isStatic = methodFlags & CORINFO_FLG_STATIC; - int argsCount = sig->numArgs + (isStatic ? 0 : 1); - - GenTree* op1; - GenTree* op2; - if (argsCount == 3) - { - if (!impStackTop(0).val->IsIntegralConst(4)) // StringComparison.Ordinal - { - // TODO: Unroll & vectorize OrdinalIgnoreCase - return nullptr; - } - op1 = impStackTop(2).val; - op2 = impStackTop(1).val; - } - else - { - op1 = impStackTop(1).val; - op2 = impStackTop(0).val; - } - - if (!(op1->OperIs(GT_CNS_STR) ^ op2->OperIs(GT_CNS_STR))) - { - // either op1 or op2 has to be CNS_STR, but not both - that case is optimized - // just fine as is. - return nullptr; - } - - GenTree* varStr; - GenTreeStrCon* cnsStr; - if (op1->OperIs(GT_CNS_STR)) - { - cnsStr = op1->AsStrCon(); - varStr = op2; - } - else - { - cnsStr = op2->AsStrCon(); - varStr = op1; - } - - bool needsNullcheck = true; - if ((op1 != cnsStr) && !isStatic) - { - // for the following cases we should not check varStr for null: - // - // obj.Equals("cns") - // obj.Equals("cns", StringComparison.Ordinal) - // - // instead, it should throw NRE if it's null - needsNullcheck = false; - } - - int cnsLength = -1; - const char16_t* str = nullptr; - if (cnsStr->IsStringEmptyField()) - { - // check for fake "" first - cnsLength = 0; - JITDUMP("Trying to unroll String.Equals(op1, \"\")...\n", str) - } - else - { - str = info.compCompHnd->getStringLiteral(cnsStr->gtScpHnd, cnsStr->gtSconCPX, &cnsLength); - if (cnsLength < 0 || str == nullptr) - { - // We were unable to get the literal (e.g. dynamic context) - return nullptr; - } - JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) - } - - // Create a temp safe to gtClone for varStr - // We're not appending it as a statement untill we figure out unrolling is profitable (and possible) - unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("spilling varStr")); - lvaTable[varStrTmp].lvType = varStr->TypeGet(); - GenTree* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); - - // TODO: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN - int strLenOffset = OFFSETOF__CORINFO_String__stringLen; - GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); - GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); - GenTree* unrolled = impExpandHalfConstEquals(gtClone(varStrLcl), lenNode, needsNullcheck, startsWith, (WCHAR*)str, - cnsLength, strLenOffset + sizeof(int)); - - GenTree* retNode = nullptr; - if (unrolled != nullptr) - { - impAssignTempGen(varStrTmp, varStr); - if (unrolled->OperIs(GT_QMARK)) - { - // QMARK nodes cannot reside on the evaluation stack - unsigned rootTmp = lvaGrabTemp(true DEBUGARG("spilling unroll qmark")); - impAssignTempGen(rootTmp, unrolled); - retNode = gtNewLclvNode(rootTmp, TYP_INT); - } - - JITDUMP("\n... Successfully unrolled to:\n") - DISPTREE(unrolled) - for (int i = 0; i < argsCount; i++) - { - // max(2, numArgs) just to handle instance-method Equals that - // doesn't report "this" as an argument - impPopStack(); - } - } - return retNode; -} - //------------------------------------------------------------------------ // impIntrinsic: possibly expand intrinsic call into alternate IR sequence // @@ -4363,6 +3872,19 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, break; } + case NI_System_MemoryExtensions_Equals: + case NI_System_MemoryExtensions_SequenceEqual: + { + retNode = impSpanEqualsOrStartsWith(false, sig, methodFlags); + break; + } + + case NI_System_MemoryExtensions_StartsWith: + { + retNode = impSpanEqualsOrStartsWith(true, sig, methodFlags); + break; + } + case NI_System_String_get_Chars: { GenTree* op2 = impPopStack().val; @@ -5702,6 +5224,10 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) } else if (strcmp(className, "MemoryExtensions") == 0) { + if (strcmp(methodName, "AsSpan") == 0) + { + result = NI_System_MemoryExtensions_AsSpan; + } if (strcmp(methodName, "SequenceEqual") == 0) { result = NI_System_MemoryExtensions_SequenceEqual; diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp new file mode 100644 index 0000000000000..f5adc28b4d5ea --- /dev/null +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -0,0 +1,663 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "jitpch.h" +#ifdef _MSC_VER +#pragma hdrstop +#endif + +//------------------------------------------------------------------------ +// impExpandHalfConstEqualsSIMD: Attempts to unroll and vectorize +// Equals against a constant WCHAR data for Length in [8..32] range +// using SIMD instructions. It uses the following expression: +// +// bool equasl = ((v1 ^ cns1) | (v2 ^ cns2)) == Vector128.Zero +// +// or if a single vector is enough (len == 8 or len == 16 with AVX): +// +// bool equasl = (v1 ^ cns1) == Vector128.Zero +// +// Arguments: +// data - Pointer to a data to vectorize +// cns - Constant data (array of 2-byte chars) +// len - Number of chars in the cns +// dataOffset - Offset for data +// +// Return Value: +// A pointer to the newly created SIMD node or nullptr if unrolling is not +// possible or not profitable +// +// Notes: +// This function doesn't check obj for null or its Length, it's just an internal helper +// for impExpandHalfConstEquals +// +GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset) +{ + assert(len >= 8 && len <= 32); + +#if defined(FEATURE_HW_INTRINSICS) && defined(TARGET_64BIT) + if (!compOpportunisticallyDependsOn(InstructionSet_Vector128)) + { + // We need SSE2 or ADVSIMD at least + return nullptr; + } + + CorInfoType type = CORINFO_TYPE_ULONG; + + int simdSize; + var_types simdType; + + NamedIntrinsic niZero; + NamedIntrinsic niEquals; + NamedIntrinsic loadIntrinsic; + + GenTree* cnsVec1; + GenTree* cnsVec2; + + bool useSingleVector = false; + +#if defined(TARGET_XARCH) + if (compOpportunisticallyDependsOn(InstructionSet_Vector256) && len >= 16) + { + // Handle [16..32] inputs via two Vector256 + assert(len >= 16 && len <= 32); + + simdSize = 32; + simdType = TYP_SIMD32; + + niZero = NI_Vector256_get_Zero; + niEquals = NI_Vector256_op_Equality; + + // Special case: use a single vector for len=16 + useSingleVector = len == 16; + + assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT + GenTree* long1 = gtNewIconNode(*(ssize_t*)(cns + 0), TYP_LONG); + GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); + GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + 8), TYP_LONG); + GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + 12), TYP_LONG); + cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, long3, long4, NI_Vector256_Create, type, simdSize); + + // cnsVec2 most likely overlaps with cnsVec1: + GenTree* long5 = gtNewIconNode(*(ssize_t*)(cns + len - 16), TYP_LONG); + GenTree* long6 = gtNewIconNode(*(ssize_t*)(cns + len - 12), TYP_LONG); + GenTree* long7 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); + GenTree* long8 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); + cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, NI_Vector256_Create, type, simdSize); + + loadIntrinsic = NI_AVX_LoadVector256; + } + else +#endif + if (len <= 16) + { + // Handle [8..16] inputs via two Vector256 + assert(len >= 8 && len <= 16); + + simdSize = 16; + simdType = TYP_SIMD16; + + niZero = NI_Vector128_get_Zero; + niEquals = NI_Vector128_op_Equality; + + // Special case: use a single vector for len=8 + useSingleVector = len == 8; + + assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT + GenTree* long1 = gtNewIconNode(*(ssize_t*)(cns + 0), TYP_LONG); + GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); + cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, NI_Vector128_Create, type, simdSize); + + // cnsVec2 most likely overlaps with cnsVec1: + GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); + GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); + cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long3, long4, NI_Vector128_Create, type, simdSize); + +#if defined(TARGET_XARCH) + loadIntrinsic = NI_SSE2_LoadVector128; +#else + loadIntrinsic = NI_AdvSimd_LoadVector128; +#endif + } + else + { + JITDUMP("impExpandHalfConstEqualsSIMD: No V256 and data is too big for V128\n"); + // NOTE: We might consider using four V128 for ARM64 + return nullptr; + } + + GenTree* zero = gtNewSimdHWIntrinsicNode(simdType, niZero, type, simdSize); + + GenTree* offset1 = gtNewIconNode(dataOffset, TYP_I_IMPL); + GenTree* offset2 = gtNewIconNode(dataOffset + len * 2 - simdSize, TYP_I_IMPL); + GenTree* dataPtr1 = gtNewOperNode(GT_ADD, TYP_BYREF, data, offset1); + GenTree* dataPtr2 = gtNewOperNode(GT_ADD, TYP_BYREF, gtClone(data), offset2); + + GenTree* vec1 = gtNewSimdHWIntrinsicNode(simdType, dataPtr1, loadIntrinsic, type, simdSize); + GenTree* vec2 = gtNewSimdHWIntrinsicNode(simdType, dataPtr2, loadIntrinsic, type, simdSize); + + // TODO-CQ: Spill vec1 and vec2 for better pipelining + // However, Forward-Sub most likely will glue it back + + // ((v1 ^ cns1) | (v2 ^ cns2)) == zero + GenTree* xor1 = gtNewSimdBinOpNode(GT_XOR, simdType, vec1, cnsVec1, type, simdSize, false); + GenTree* xor2 = gtNewSimdBinOpNode(GT_XOR, simdType, vec2, cnsVec2, type, simdSize, false); + GenTree* orr = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, type, simdSize, false); + return gtNewSimdHWIntrinsicNode(TYP_BOOL, useSingleVector ? xor1 : orr, zero, niEquals, type, simdSize); +#else + return nullptr; +#endif +} + +//------------------------------------------------------------------------ +// impExpandHalfConstEqualsSWAR: Attempts to unroll and vectorize +// Equals against a constant WCHAR data for Length in [1..8] range +// using SWAR (a sort of SIMD but for GPR registers and instructions) +// +// Arguments: +// data - Pointer to a data to vectorize +// cns - Constant data (array of 2-byte chars) +// len - Number of chars in the cns +// dataOffset - Offset for data +// +// Return Value: +// A pointer to the newly created SWAR node or nullptr if unrolling is not +// possible or not profitable +// +// Notes: +// This function doesn't check obj for null or its Length, it's just an internal helper +// for impExpandHalfConstEquals +// +GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset) +{ + assert(len >= 1 && len <= 8); + + auto compareValue = [](Compiler* comp, GenTree* obj, var_types type, ssize_t offset, ssize_t value) { + GenTree* offsetTree = comp->gtNewIconNode(offset, TYP_I_IMPL); + GenTree* addOffsetTree = comp->gtNewOperNode(GT_ADD, TYP_BYREF, obj, offsetTree); + GenTree* indirTree = comp->gtNewIndir(type, addOffsetTree); + GenTree* valueTree = comp->gtNewIconNode(value, type); + if (varTypeIsSmall(indirTree)) + { + indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, TYP_UINT); + valueTree->ChangeType(TYP_INT); + } + return comp->gtNewOperNode(GT_EQ, TYP_INT, indirTree, valueTree); + }; + +// Compose Int32 or Int64 values from ushort components +#define MAKEINT32(c1, c2) ((UINT64)c2 << 16) | ((UINT64)c1 << 0) +#define MAKEINT64(c1, c2, c3, c4) ((UINT64)c4 << 48) | ((UINT64)c3 << 32) | ((UINT64)c2 << 16) | ((UINT64)c1 << 0) + + if (len == 1) + { + return compareValue(this, data, TYP_SHORT, dataOffset, cns[0]); + } + else if (len == 2) + { + const UINT32 value = MAKEINT32(cns[0], cns[1]); + return compareValue(this, data, TYP_INT, dataOffset, value); + } +#ifdef TARGET_64BIT + else if (len == 3) + { + // handle len = 3 via two Int32 with overlapping + UINT32 value1 = MAKEINT32(cns[0], cns[1]); + UINT32 value2 = MAKEINT32(cns[1], cns[2]); + GenTree* firstIndir = compareValue(this, data, TYP_INT, dataOffset, value1); + GenTree* secondIndir = compareValue(this, gtClone(data), TYP_INT, dataOffset + 2, value2); + + // TODO: Consider marging two indirs via XOR instead of QMARK + // e.g. gtNewOperNode(GT_XOR, TYP_INT, firstIndir, secondIndir); + // but it currently has CQ issues + GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); + return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); + } + else + { + assert(len >= 4 && len <= 8); + + UINT64 value1 = MAKEINT64(cns[0], cns[1], cns[2], cns[3]); + if (len == 4) + { + return compareValue(this, data, TYP_LONG, dataOffset, value1); + } + else // [5..8] range + { + // For 5..7 value2 will overlap with value1 + UINT64 value2 = MAKEINT64(cns[len - 4], cns[len - 3], cns[len - 2], cns[len - 1]); + GenTree* firstIndir = compareValue(this, data, TYP_LONG, dataOffset, value1); + + ssize_t offset = dataOffset + len * 2 - sizeof(UINT64); + GenTree* secondIndir = compareValue(this, gtClone(data), TYP_LONG, offset, value2); + + // TODO: Consider marging two indirs via XOR instead of QMARK + GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); + return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); + } + } +#else // TARGET_64BIT + return nullptr; +#endif +} + +//------------------------------------------------------------------------ +// impExpandHalfConstEquals: Attempts to unroll and vectorize +// Equals against a constant WCHAR data for Length in [8..32] range +// using either SWAR or SIMD. In a general case it will look like this: +// +// bool equals = obj != null && obj.Length == len && (SWAR or SIMD) +// +// Arguments: +// data - Pointer to a data to vectorize +// lengthFld - Pointer to Length field +// checkForNull - Check data for null +// startsWith - true - StartsWith, false - Equals +// cns - Constant data (array of 2-byte chars) +// len - Number of 2-byte chars in the cns +// dataOffset - Offset for data +// +// Return Value: +// A pointer to the newly created SIMD node or nullptr if unrolling is not +// possible or not profitable +// +GenTree* Compiler::impExpandHalfConstEquals( + GenTree* data, GenTree* lengthFld, bool checkForNull, bool startsWith, WCHAR* cnsData, int len, int dataOffset) +{ + assert(len >= 0); + + if (compCurBB->isRunRarely()) + { + // Not profitable to expand + JITDUMP("impExpandHalfConstEquals: block is cold - not profitable to expand.\n"); + return nullptr; + } + + if (fgBBcount > 20) + { + // We don't want to unroll too much and in big methods + // TODO: come up with some better heuristic/budget + JITDUMP("impExpandHalfConstEquals: method has too many BBs (>20) - not profitable to expand.\n"); + return nullptr; + } + + GenTree* elementsCount = gtNewIconNode(len); + GenTree* lenCheckNode; + if (len == 0) + { + if (startsWith) + { + // Any string starts with "" + return gtTrue(); + } + + // For zero length we don't need to compare content, the following expression is enough: + // + // varData != null && lengthFld == 0 + // + lenCheckNode = gtNewOperNode(GT_EQ, TYP_INT, lengthFld, elementsCount); + } + else + { + assert(cnsData != nullptr); + + GenTree* indirCmp = nullptr; + if (len < 8) // SWAR impl supports len == 8 but we'd better give it to SIMD + { + indirCmp = impExpandHalfConstEqualsSWAR(gtClone(data), cnsData, len, dataOffset); + } + else if (len <= 32) + { + indirCmp = impExpandHalfConstEqualsSIMD(gtClone(data), cnsData, len, dataOffset); + } + + if (indirCmp == nullptr) + { + JITDUMP("unable to compose indirCmp\n"); + return nullptr; + } + + GenTreeColon* lenCheckColon = gtNewColonNode(TYP_INT, indirCmp, gtFalse()); + lenCheckNode = + gtNewQmarkNode(TYP_INT, gtNewOperNode(startsWith ? GT_GE : GT_EQ, TYP_INT, lengthFld, elementsCount), + lenCheckColon); + } + + GenTree* rootQmark; + if (checkForNull) + { + // varData == nullptr + GenTreeColon* nullCheckColon = gtNewColonNode(TYP_INT, lenCheckNode, gtFalse()); + rootQmark = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_NE, TYP_INT, data, gtNull()), nullCheckColon); + } + else + { + // no nullcheck, just "obj.Length == len && (SWAR or SIMD)" + rootQmark = lenCheckNode; + } + + return rootQmark; +} + +//------------------------------------------------------------------------ +// impGetStrConFromSpan: Try to obtain string literal out of a span +// if it was inited with one. +// +// Arguments: +// span - ReadOnlySpan tree +// +// Returns: +// GenTreeStrCon node or nullptr +// +GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) +{ + GenTreeCall* argCall = nullptr; + if (span->OperIs(GT_RET_EXPR)) + { + argCall = span->AsRetExpr()->gtInlineCandidate->AsCall(); + } + else if (span->OperIs(GT_CALL)) + { + argCall = span->AsCall(); + } + + if (argCall != nullptr) + { + NamedIntrinsic ni = lookupNamedIntrinsic(argCall->gtCallMethHnd); + if ((ni == NI_System_MemoryExtensions_AsSpan) || (ni == NI_System_String_op_Implicit)) + { + if (argCall->gtCallArgs->GetNode()->OperIs(GT_CNS_STR)) + { + return argCall->gtCallArgs->GetNode()->AsStrCon(); + } + } + } + return nullptr; +} + +GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags) +{ + // We're going to unroll & vectorize the following cases: + // + // 1) String.Equals(obj, "cns") + // 2) String.Equals(obj, "cns", StringComparison.Ordinal) + // 3) String.Equals("cns", obj) + // 4) String.Equals("cns", obj, StringComparison.Ordinal) + // 5) obj.Equals("cns") + // 6) obj.Equals("cns", StringComparison.Ordinal) + // 7) "cns".Equals(obj) + // 8) "cns".Equals(obj, StringComparison.Ordinal) + // + // 9) obj.StartsWith("cns", StringComparison.Ordinal) + // 10) "cns".StartsWith(obj, StringComparison.Ordinal) + // + // For cases 5, 6 and 9 we don't emit "obj != null" + // NOTE: String.Equals(object) is not supported currently + + bool isStatic = methodFlags & CORINFO_FLG_STATIC; + int argsCount = sig->numArgs + (isStatic ? 0 : 1); + + GenTree* op1; + GenTree* op2; + if (argsCount == 3) // overload with StringComparison + { + if (!impStackTop(0).val->IsIntegralConst(4)) // StringComparison.Ordinal + { + // TODO: Unroll & vectorize OrdinalIgnoreCase + return nullptr; + } + op1 = impStackTop(2).val; + op2 = impStackTop(1).val; + } + else + { + op1 = impStackTop(1).val; + op2 = impStackTop(0).val; + } + + if (!(op1->OperIs(GT_CNS_STR) ^ op2->OperIs(GT_CNS_STR))) + { + // either op1 or op2 has to be CNS_STR, but not both - that case is optimized + // just fine as is. + return nullptr; + } + + GenTree* varStr; + GenTreeStrCon* cnsStr; + if (op1->OperIs(GT_CNS_STR)) + { + cnsStr = op1->AsStrCon(); + varStr = op2; + } + else + { + cnsStr = op2->AsStrCon(); + varStr = op1; + } + + bool needsNullcheck = true; + if ((op1 != cnsStr) && !isStatic) + { + // for the following cases we should not check varStr for null: + // + // obj.Equals("cns") + // obj.Equals("cns", StringComparison.Ordinal) + // + // instead, it should throw NRE if it's null + needsNullcheck = false; + } + + int cnsLength = -1; + const char16_t* str = nullptr; + if (cnsStr->IsStringEmptyField()) + { + // check for fake "" first + cnsLength = 0; + JITDUMP("Trying to unroll String.Equals(op1, \"\")...\n", str) + } + else + { + str = info.compCompHnd->getStringLiteral(cnsStr->gtScpHnd, cnsStr->gtSconCPX, &cnsLength); + if (cnsLength < 0 || str == nullptr) + { + // We were unable to get the literal (e.g. dynamic context) + return nullptr; + } + JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) + } + + // Create a temp safe to gtClone for varStr + // We're not appending it as a statement untill we figure out unrolling is profitable (and possible) + unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("spilling varStr")); + lvaTable[varStrTmp].lvType = varStr->TypeGet(); + GenTree* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); + + // TODO: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN + int strLenOffset = OFFSETOF__CORINFO_String__stringLen; + GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); + GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); + GenTree* unrolled = impExpandHalfConstEquals(gtClone(varStrLcl), lenNode, needsNullcheck, startsWith, (WCHAR*)str, + cnsLength, strLenOffset + sizeof(int)); + + GenTree* retNode = nullptr; + if (unrolled != nullptr) + { + impAssignTempGen(varStrTmp, varStr); + if (unrolled->OperIs(GT_QMARK)) + { + // QMARK nodes cannot reside on the evaluation stack + unsigned rootTmp = lvaGrabTemp(true DEBUGARG("spilling unroll qmark")); + impAssignTempGen(rootTmp, unrolled); + retNode = gtNewLclvNode(rootTmp, TYP_INT); + } + else + { + retNode = unrolled; + } + + JITDUMP("\n... Successfully unrolled to:\n") + DISPTREE(unrolled) + for (int i = 0; i < argsCount; i++) + { + // max(2, numArgs) just to handle instance-method Equals that + // doesn't report "this" as an argument + impPopStack(); + } + } + return retNode; +} + +GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags) +{ + // We're going to unroll & vectorize the following cases: + // + // 1) MemoryExtensions.SequenceEqual(var, "cns") + // 2) MemoryExtensions.SequenceEqual("cns", var) + // 3) MemoryExtensions.Equals(var, "cns", StringComparison.Ordinal) + // 4) MemoryExtensions.Equals("cns", var, StringComparison.Ordinal) + // 5) MemoryExtensions.StartsWith("cns", var) + // 6) MemoryExtensions.StartsWith(var, "cns") + // 7) MemoryExtensions.StartsWith("cns", var, StringComparison.Ordinal) + // 8) MemoryExtensions.StartsWith(var, "cns", StringComparison.Ordinal) + + bool isStatic = methodFlags & CORINFO_FLG_STATIC; + int argsCount = sig->numArgs + (isStatic ? 0 : 1); + + GenTree* op1; + GenTree* op2; + if (argsCount == 3) // overload with StringComparison + { + if (!impStackTop(0).val->IsIntegralConst(4)) // StringComparison.Ordinal + { + // TODO: Unroll & vectorize OrdinalIgnoreCase + return nullptr; + } + op1 = impStackTop(2).val; + op2 = impStackTop(1).val; + } + else + { + op1 = impStackTop(1).val; + op2 = impStackTop(0).val; + } + + // For generic StartsWith and Equals we need to make sure T is char + if (sig->sigInst.methInstCount != 0) + { + assert(sig->sigInst.methInstCount == 1); + CORINFO_CLASS_HANDLE targetElemHnd = sig->sigInst.methInst[0]; + CorInfoType typ = info.compCompHnd->getTypeForPrimitiveValueClass(targetElemHnd); + if ((typ != CORINFO_TYPE_SHORT) && (typ != CORINFO_TYPE_USHORT) && (typ != CORINFO_TYPE_CHAR)) + { + return nullptr; + } + } + + GenTreeStrCon* op1Str = impGetStrConFromSpan(op1); + GenTreeStrCon* op2Str = impGetStrConFromSpan(op2); + + if (!((op1Str != nullptr) ^ (op2Str != nullptr))) + { + // either op1 or op2 has to be '(ReadOnlySpan)"cns"' + return nullptr; + } + + GenTree* varStr; + GenTreeStrCon* cnsStr; + if (op1Str != nullptr) + { + cnsStr = op1Str; + varStr = op2; + } + else + { + cnsStr = op2Str; + varStr = op1; + } + + int cnsLength = -1; + const char16_t* str = nullptr; + if (cnsStr->IsStringEmptyField()) + { + // check for fake "" first + cnsLength = 0; + JITDUMP("Trying to unroll String.Equals(op1, \"\")...\n", str) + } + else + { + str = info.compCompHnd->getStringLiteral(cnsStr->gtScpHnd, cnsStr->gtSconCPX, &cnsLength); + if (cnsLength < 0 || str == nullptr) + { + // We were unable to get the literal (e.g. dynamic context) + return nullptr; + } + JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) + } + + // Rewrite this nonsense (to fields) + + CORINFO_CLASS_HANDLE spanCls = gtGetStructHandle(varStr); + CORINFO_FIELD_HANDLE pointerHnd = info.compCompHnd->getFieldInClass(spanCls, 0); + CORINFO_FIELD_HANDLE lengthHnd = info.compCompHnd->getFieldInClass(spanCls, 1); + const unsigned lengthOffset = info.compCompHnd->getFieldOffset(lengthHnd); + + GenTree* spanRef = varStr; + if (varStr->TypeIs(TYP_STRUCT)) + { + spanRef = gtNewOperNode(GT_ADDR, TYP_BYREF, varStr); + } + assert(spanRef->TypeIs(TYP_BYREF)); + + unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("t1")); + lvaTable[varStrTmp].lvType = TYP_BYREF; + + GenTree* spanRefLcl = gtNewLclvNode(varStrTmp, spanRef->TypeGet()); + GenTree* spanData = gtNewFieldRef(TYP_BYREF, pointerHnd, spanRefLcl); + GenTree* spanLength = gtNewFieldRef(TYP_INT, lengthHnd, gtClone(spanRefLcl), lengthOffset); + + unsigned spanDataTmp = lvaGrabTemp(true DEBUGARG("t2")); + lvaSetStruct(spanDataTmp, spanCls, false); + lvaTable[spanDataTmp].lvType = spanData->TypeGet(); + + GenTree* result = nullptr; + GenTree* unrolled = impExpandHalfConstEquals(gtNewLclvNode(spanDataTmp, spanData->TypeGet()), spanLength, false, + startsWith, (WCHAR*)str, cnsLength, 0); + if (unrolled != nullptr) + { + impAssignTempGen(varStrTmp, spanRef); + impAssignTempGen(spanDataTmp, spanData); + if (unrolled->OperIs(GT_QMARK)) + { + // QMARK can't be a root node, spill it to a temp + unsigned rootTmp = lvaGrabTemp(true DEBUGARG("spilling unroll qmark")); + impAssignTempGen(rootTmp, unrolled); + result = gtNewLclvNode(rootTmp, TYP_INT); + } + else + { + result = unrolled; + } + + JITDUMP("... Successfully unrolled to:\n") + DISPTREE(unrolled) + + for (int i = 0; i < argsCount; i++) + { + impPopStack(); + } + + // We have to clean up GT_RET_EXPR for String.op_Implicit + if (op1->OperIs(GT_RET_EXPR)) + { + op1->AsRetExpr()->gtInlineCandidate->ReplaceWith(gtNewNothingNode(), this); + DEBUG_DESTROY_NODE(op1); + } + else if (op2->OperIs(GT_RET_EXPR)) + { + assert(op2Str != nullptr); + op2->AsRetExpr()->gtInlineCandidate->ReplaceWith(gtNewNothingNode(), this); + DEBUG_DESTROY_NODE(op2); + } + } + return result; +} diff --git a/src/coreclr/jit/namedintrinsiclist.h b/src/coreclr/jit/namedintrinsiclist.h index 5545e265aeb41..b73faa05aa3e6 100644 --- a/src/coreclr/jit/namedintrinsiclist.h +++ b/src/coreclr/jit/namedintrinsiclist.h @@ -92,6 +92,7 @@ enum NamedIntrinsic : unsigned short NI_System_Span_get_Item, NI_System_ReadOnlySpan_get_Item, + NI_System_MemoryExtensions_AsSpan, NI_System_MemoryExtensions_Equals, NI_System_MemoryExtensions_SequenceEqual, NI_System_MemoryExtensions_StartsWith, diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs index 19f6efefaa568..910a84bc02d79 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs @@ -89,6 +89,7 @@ public static Span AsSpan(this T[]? array, Range range) /// /// The target string. /// Returns default when is null. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ReadOnlySpan AsSpan(this string? text) { @@ -448,10 +449,23 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(value)), /// /// Determines whether two sequences are equal by comparing the elements using IEquatable{T}.Equals(T). /// + [Intrinsic] // Unrolled and vectorized for half-constant input [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool SequenceEqual(this Span span, ReadOnlySpan other) where T : IEquatable { - return SequenceEqual((ReadOnlySpan)span, other); + int length = span.Length; + + if (RuntimeHelpers.IsBitwiseEquatable()) + { + nuint size = (nuint)Unsafe.SizeOf(); + return length == other.Length && + SpanHelpers.SequenceEqual( + ref Unsafe.As(ref MemoryMarshal.GetReference(span)), + ref Unsafe.As(ref MemoryMarshal.GetReference(other)), + ((uint)length) * size); // If this multiplication overflows, the Span we got overflows the entire address range. There's no happy outcome for this api in such a case so we choose not to take the overhead of checking. + } + + return length == other.Length && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other), length); } /// @@ -1012,8 +1026,8 @@ private static unsafe int LastIndexOfAnyProbabilistic(ref char searchSpace, int /// /// Determines whether two sequences are equal by comparing the elements using IEquatable{T}.Equals(T). /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] [Intrinsic] // Unrolled and vectorized for half-constant input + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool SequenceEqual(this ReadOnlySpan span, ReadOnlySpan other) where T : IEquatable { int length = span.Length; @@ -1125,6 +1139,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(other)), /// /// Determines whether the specified sequence appears at the start of the span. /// + [Intrinsic] // Unrolled and vectorized for half-constant input [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool StartsWith(this Span span, ReadOnlySpan value) where T : IEquatable { @@ -1145,6 +1160,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(value)), /// /// Determines whether the specified sequence appears at the start of the span. /// + [Intrinsic] // Unrolled and vectorized for half-constant input [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool StartsWith(this ReadOnlySpan span, ReadOnlySpan value) where T : IEquatable { diff --git a/src/libraries/System.Private.CoreLib/src/System/StringComparison.cs b/src/libraries/System.Private.CoreLib/src/System/StringComparison.cs index b0d64c42eae0e..ba31e7e5318d3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/StringComparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/StringComparison.cs @@ -5,7 +5,6 @@ namespace System { public enum StringComparison { - // NOTE: RyuJIT has some of these values hardcoded CurrentCulture = 0, CurrentCultureIgnoreCase = 1, InvariantCulture = 2, From 87fa3bfca8fc86d02ebbba625476c6af7e27d821 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 16 Feb 2022 13:50:48 +0300 Subject: [PATCH 08/29] Clean up, more comments --- src/coreclr/jit/compiler.h | 6 +- src/coreclr/jit/gentree.cpp | 6 +- src/coreclr/jit/importer_vectorization.cpp | 364 +++++++++++++-------- 3 files changed, 227 insertions(+), 149 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 9b7f5252b67a3..c443838404d08 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -3024,9 +3024,9 @@ class Compiler GenTreeIntCon* gtNewIconNode(ssize_t value, var_types type = TYP_INT); GenTreeIntCon* gtNewIconNode(unsigned fieldOffset, FieldSeqNode* fieldSeq); - GenTreeIntCon* gtNull(); - GenTreeIntCon* gtTrue(); - GenTreeIntCon* gtFalse(); + GenTreeIntCon* gtNewNull(); + GenTreeIntCon* gtNewTrue(); + GenTreeIntCon* gtNewFalse(); GenTree* gtNewPhysRegNode(regNumber reg, var_types type); diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index c1c8d2d073363..52a958c16e6b4 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -5708,17 +5708,17 @@ GenTreeIntCon* Compiler::gtNewIconNode(ssize_t value, var_types type) return new (this, GT_CNS_INT) GenTreeIntCon(type, value); } -GenTreeIntCon* Compiler::gtNull() +GenTreeIntCon* Compiler::gtNewNull() { return gtNewIconNode(0, TYP_REF); } -GenTreeIntCon* Compiler::gtTrue() +GenTreeIntCon* Compiler::gtNewTrue() { return gtNewIconNode(1, TYP_INT); } -GenTreeIntCon* Compiler::gtFalse() +GenTreeIntCon* Compiler::gtNewFalse() { return gtNewIconNode(0, TYP_INT); } diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index f5adc28b4d5ea..d55a22831f515 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -6,16 +6,43 @@ #pragma hdrstop #endif +//------------------------------------------------------------------------ +// importer_vectorization.cpp +// +// This file is responsible for various (partial) vectorizations during import phase, +// e.g. the following APIs are currently supported: +// +// 1) String.Equals(string, string) +// 2) String.Equals(string, string, StringComparison.Ordinal) +// 3) str.Equals(string) +// 4) str.Equals(String, StringComparison.Ordinal) +// 5) str.StartsWith(string, StringComparison.Ordinal) +// 6) MemoryExtensions.SequenceEqual(ROS, ROS) +// 7) MemoryExtensions.Equals(ROS, ROS, StringComparison.Ordinal) +// 8) MemoryExtensions.StartsWith(ROS, ROS) +// 9) MemoryExtensions.StartsWith(ROS, ROS, StringComparison.Ordinal) +// +// When one of the arguments is a constant string of a [0..32] size so we can inline +// a vectorized comparison against it using SWAR or SIMD techniques (e.g. via two V256 vectors) +// +// We might add these in future: +// 1) OrdinalIgnoreCase for everything above +// 2) Span.CopyTo +// 3) Spans/Arrays of bytes (e.g. UTF8) against a constant RVA data +// + //------------------------------------------------------------------------ // impExpandHalfConstEqualsSIMD: Attempts to unroll and vectorize // Equals against a constant WCHAR data for Length in [8..32] range // using SIMD instructions. It uses the following expression: // -// bool equasl = ((v1 ^ cns1) | (v2 ^ cns2)) == Vector128.Zero +// bool equasl = ((v1 ^ cns1) | (v2 ^ cns2)) == Vector128.Zero // // or if a single vector is enough (len == 8 or len == 16 with AVX): // -// bool equasl = (v1 ^ cns1) == Vector128.Zero +// bool equasl = (v1 ^ cns1) == Vector128.Zero +// +// C# equivalent of what this function emits: https://gist.github.com/EgorBo/085f9c15da11eecc00f482710f48aef6 // // Arguments: // data - Pointer to a data to vectorize @@ -54,6 +81,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* cnsVec1; GenTree* cnsVec2; + // Optimization: don't use two vectors for Length == 8 or 16 bool useSingleVector = false; #if defined(TARGET_XARCH) @@ -68,7 +96,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l niZero = NI_Vector256_get_Zero; niEquals = NI_Vector256_op_Equality; - // Special case: use a single vector for len=16 + // Special case: use a single vector for Length == 16 useSingleVector = len == 16; assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT @@ -100,7 +128,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l niZero = NI_Vector128_get_Zero; niEquals = NI_Vector128_op_Equality; - // Special case: use a single vector for len=8 + // Special case: use a single vector for Length == 8 useSingleVector = len == 8; assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT @@ -121,7 +149,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l } else { - JITDUMP("impExpandHalfConstEqualsSIMD: No V256 and data is too big for V128\n"); + JITDUMP("impExpandHalfConstEqualsSIMD: No V256 support and data is too big for V128\n"); // NOTE: We might consider using four V128 for ARM64 return nullptr; } @@ -136,8 +164,20 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* vec1 = gtNewSimdHWIntrinsicNode(simdType, dataPtr1, loadIntrinsic, type, simdSize); GenTree* vec2 = gtNewSimdHWIntrinsicNode(simdType, dataPtr2, loadIntrinsic, type, simdSize); - // TODO-CQ: Spill vec1 and vec2 for better pipelining - // However, Forward-Sub most likely will glue it back + // TODO-CQ: Spill vec1 and vec2 for better pipelining, currently we end up emitting: + // + // vmovdqu xmm0, xmmword ptr [rcx+12] + // vpxor xmm0, xmm0, xmmword ptr[reloc @RWD00] + // vmovdqu xmm1, xmmword ptr [rcx + 20] + // vpxor xmm1, xmm1, xmmword ptr[reloc @RWD16] + // + // While we should re-order them to be: + // + // vmovdqu xmm0, xmmword ptr [rcx+12] + // vmovdqu xmm1, xmmword ptr [rcx + 20] + // vpxor xmm0, xmm0, xmmword ptr[reloc @RWD00] + // vpxor xmm1, xmm1, xmmword ptr[reloc @RWD16] + // // ((v1 ^ cns1) | (v2 ^ cns2)) == zero GenTree* xor1 = gtNewSimdBinOpNode(GT_XOR, simdType, vec1, cnsVec1, type, simdSize, false); @@ -149,6 +189,40 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l #endif } +//------------------------------------------------------------------------ +// impCreateCompareInd: creates the following tree: +// +// * EQ int +// +--* IND +// | \--* ADD byref +// | +--* +// | \--* CNS_INT +// \--* CNS_INT +// +// Arguments: +// comp - Compiler object +// obj - GenTree representing data pointer +// type - type for the IND node +// offset - offset for the data pointer +// value - constant value to compare against +// +// Return Value: +// A tree with indirect load and comparison +// +static GenTree* impCreateCompareInd(Compiler* comp, GenTree* obj, var_types type, ssize_t offset, ssize_t value) +{ + GenTree* offsetTree = comp->gtNewIconNode(offset, TYP_I_IMPL); + GenTree* addOffsetTree = comp->gtNewOperNode(GT_ADD, TYP_BYREF, obj, offsetTree); + GenTree* indirTree = comp->gtNewIndir(type, addOffsetTree); + GenTree* valueTree = comp->gtNewIconNode(value, type); + if (varTypeIsSmall(indirTree)) + { + indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, TYP_UINT); + valueTree->ChangeType(TYP_INT); + } + return comp->gtNewOperNode(GT_EQ, TYP_INT, indirTree, valueTree); +} + //------------------------------------------------------------------------ // impExpandHalfConstEqualsSWAR: Attempts to unroll and vectorize // Equals against a constant WCHAR data for Length in [1..8] range @@ -172,70 +246,70 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l { assert(len >= 1 && len <= 8); - auto compareValue = [](Compiler* comp, GenTree* obj, var_types type, ssize_t offset, ssize_t value) { - GenTree* offsetTree = comp->gtNewIconNode(offset, TYP_I_IMPL); - GenTree* addOffsetTree = comp->gtNewOperNode(GT_ADD, TYP_BYREF, obj, offsetTree); - GenTree* indirTree = comp->gtNewIndir(type, addOffsetTree); - GenTree* valueTree = comp->gtNewIconNode(value, type); - if (varTypeIsSmall(indirTree)) - { - indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, TYP_UINT); - valueTree->ChangeType(TYP_INT); - } - return comp->gtNewOperNode(GT_EQ, TYP_INT, indirTree, valueTree); - }; - // Compose Int32 or Int64 values from ushort components #define MAKEINT32(c1, c2) ((UINT64)c2 << 16) | ((UINT64)c1 << 0) #define MAKEINT64(c1, c2, c3, c4) ((UINT64)c4 << 48) | ((UINT64)c3 << 32) | ((UINT64)c2 << 16) | ((UINT64)c1 << 0) if (len == 1) { - return compareValue(this, data, TYP_SHORT, dataOffset, cns[0]); + return impCreateCompareInd(this, data, TYP_SHORT, dataOffset, cns[0]); } - else if (len == 2) + if (len == 2) { + // [ ch1 ][ ch2 ] + // [ value ] + // const UINT32 value = MAKEINT32(cns[0], cns[1]); - return compareValue(this, data, TYP_INT, dataOffset, value); + return impCreateCompareInd(this, data, TYP_INT, dataOffset, value); } #ifdef TARGET_64BIT - else if (len == 3) + if (len == 3) { - // handle len = 3 via two Int32 with overlapping + // handle len = 3 via two Int32 with overlapping: + // + // [ ch1 ][ ch2 ][ ch3 ] + // [ value1 ] + // [ value2 ] + // UINT32 value1 = MAKEINT32(cns[0], cns[1]); UINT32 value2 = MAKEINT32(cns[1], cns[2]); - GenTree* firstIndir = compareValue(this, data, TYP_INT, dataOffset, value1); - GenTree* secondIndir = compareValue(this, gtClone(data), TYP_INT, dataOffset + 2, value2); + GenTree* firstIndir = impCreateCompareInd(this, data, TYP_INT, dataOffset, value1); + GenTree* secondIndir = impCreateCompareInd(this, gtClone(data), TYP_INT, dataOffset + 2, value2); // TODO: Consider marging two indirs via XOR instead of QMARK // e.g. gtNewOperNode(GT_XOR, TYP_INT, firstIndir, secondIndir); - // but it currently has CQ issues - GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); + // but it currently has CQ issues (redundant movs) + GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtNewFalse()); return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); } - else + + assert(len >= 4 && len <= 8); + + UINT64 value1 = MAKEINT64(cns[0], cns[1], cns[2], cns[3]); + if (len == 4) { - assert(len >= 4 && len <= 8); + // [ ch1 ][ ch2 ][ ch3 ][ ch4 ] + // [ value ] + // + return impCreateCompareInd(this, data, TYP_LONG, dataOffset, value1); + } - UINT64 value1 = MAKEINT64(cns[0], cns[1], cns[2], cns[3]); - if (len == 4) - { - return compareValue(this, data, TYP_LONG, dataOffset, value1); - } - else // [5..8] range - { - // For 5..7 value2 will overlap with value1 - UINT64 value2 = MAKEINT64(cns[len - 4], cns[len - 3], cns[len - 2], cns[len - 1]); - GenTree* firstIndir = compareValue(this, data, TYP_LONG, dataOffset, value1); + // For 5..7 value2 will overlap with value1, e.g. for Length == 6: + // + // + // [ ch1 ][ ch2 ][ ch3 ][ ch4 ][ ch5 ][ ch6 ] + // [ value1 ] + // [ value2 ] + // + UINT64 value2 = MAKEINT64(cns[len - 4], cns[len - 3], cns[len - 2], cns[len - 1]); + GenTree* firstIndir = impCreateCompareInd(this, data, TYP_LONG, dataOffset, value1); - ssize_t offset = dataOffset + len * 2 - sizeof(UINT64); - GenTree* secondIndir = compareValue(this, gtClone(data), TYP_LONG, offset, value2); + ssize_t offset = dataOffset + len * sizeof(WCHAR) - sizeof(UINT64); + GenTree* secondIndir = impCreateCompareInd(this, gtClone(data), TYP_LONG, offset, value2); - // TODO: Consider marging two indirs via XOR instead of QMARK - GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtFalse()); - return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); - } - } + // TODO: Consider marging two indirs via XOR instead of QMARK + GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtNewFalse()); + return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); #else // TARGET_64BIT return nullptr; #endif @@ -249,13 +323,13 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l // bool equals = obj != null && obj.Length == len && (SWAR or SIMD) // // Arguments: -// data - Pointer to a data to vectorize -// lengthFld - Pointer to Length field +// data - Pointer to a data to vectorize +// lengthFld - Pointer to Length field // checkForNull - Check data for null -// startsWith - true - StartsWith, false - Equals -// cns - Constant data (array of 2-byte chars) -// len - Number of 2-byte chars in the cns -// dataOffset - Offset for data +// startsWith - Is it StartsWith or Equals? +// cns - Constant data (array of 2-byte chars) +// len - Number of 2-byte chars in the cns +// dataOffset - Offset for data // // Return Value: // A pointer to the newly created SIMD node or nullptr if unrolling is not @@ -288,7 +362,7 @@ GenTree* Compiler::impExpandHalfConstEquals( if (startsWith) { // Any string starts with "" - return gtTrue(); + return gtNewTrue(); } // For zero length we don't need to compare content, the following expression is enough: @@ -317,7 +391,9 @@ GenTree* Compiler::impExpandHalfConstEquals( return nullptr; } - GenTreeColon* lenCheckColon = gtNewColonNode(TYP_INT, indirCmp, gtFalse()); + GenTreeColon* lenCheckColon = gtNewColonNode(TYP_INT, indirCmp, gtNewFalse()); + + // For StartsWith we use GT_GE, e.g.: `x.Length >= 10` lenCheckNode = gtNewQmarkNode(TYP_INT, gtNewOperNode(startsWith ? GT_GE : GT_EQ, TYP_INT, lengthFld, elementsCount), lenCheckColon); @@ -327,8 +403,8 @@ GenTree* Compiler::impExpandHalfConstEquals( if (checkForNull) { // varData == nullptr - GenTreeColon* nullCheckColon = gtNewColonNode(TYP_INT, lenCheckNode, gtFalse()); - rootQmark = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_NE, TYP_INT, data, gtNull()), nullCheckColon); + GenTreeColon* nullCheckColon = gtNewColonNode(TYP_INT, lenCheckNode, gtNewFalse()); + rootQmark = gtNewQmarkNode(TYP_INT, gtNewOperNode(GT_NE, TYP_INT, data, gtNewNull()), nullCheckColon); } else { @@ -340,8 +416,9 @@ GenTree* Compiler::impExpandHalfConstEquals( } //------------------------------------------------------------------------ -// impGetStrConFromSpan: Try to obtain string literal out of a span -// if it was inited with one. +// impGetStrConFromSpan: Try to obtain string literal out of a span: +// var span = "str".AsSpan(); +// var span = (ReadOnlySpan)"str" // // Arguments: // span - ReadOnlySpan tree @@ -375,27 +452,36 @@ GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) return nullptr; } +//------------------------------------------------------------------------ +// impStringEqualsOrStartsWith: The main entry-point for String methods +// We're going to unroll & vectorize the following cases: +// 1) String.Equals(obj, "cns") +// 2) String.Equals(obj, "cns", StringComparison.Ordinal) +// 3) String.Equals("cns", obj) +// 4) String.Equals("cns", obj, StringComparison.Ordinal) +// 5) obj.Equals("cns") +// 5) obj.Equals("cns") +// 6) obj.Equals("cns", StringComparison.Ordinal) +// 7) "cns".Equals(obj) +// 8) "cns".Equals(obj, StringComparison.Ordinal) +// 9) obj.StartsWith("cns", StringComparison.Ordinal) +// 10) "cns".StartsWith(obj, StringComparison.Ordinal) +// +// For cases 5, 6 and 9 we don't emit "obj != null" +// NOTE: String.Equals(object) is not supported currently +// +// Arguments: +// startsWith - Is it StartsWith or Equals? +// sig - signature of StartsWith or Equals method +// methodFlags - its flags +// +// Returns: +// GenTree representing vectorized comparison or nullptr +// GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags) { - // We're going to unroll & vectorize the following cases: - // - // 1) String.Equals(obj, "cns") - // 2) String.Equals(obj, "cns", StringComparison.Ordinal) - // 3) String.Equals("cns", obj) - // 4) String.Equals("cns", obj, StringComparison.Ordinal) - // 5) obj.Equals("cns") - // 6) obj.Equals("cns", StringComparison.Ordinal) - // 7) "cns".Equals(obj) - // 8) "cns".Equals(obj, StringComparison.Ordinal) - // - // 9) obj.StartsWith("cns", StringComparison.Ordinal) - // 10) "cns".StartsWith(obj, StringComparison.Ordinal) - // - // For cases 5, 6 and 9 we don't emit "obj != null" - // NOTE: String.Equals(object) is not supported currently - - bool isStatic = methodFlags & CORINFO_FLG_STATIC; - int argsCount = sig->numArgs + (isStatic ? 0 : 1); + const bool isStatic = methodFlags & CORINFO_FLG_STATIC; + const int argsCount = sig->numArgs + (isStatic ? 0 : 1); GenTree* op1; GenTree* op2; @@ -442,6 +528,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO // // obj.Equals("cns") // obj.Equals("cns", StringComparison.Ordinal) + // obj.StartsWith("cns", StringComparison.Ordinal) // // instead, it should throw NRE if it's null needsNullcheck = false; @@ -466,20 +553,20 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) } - // Create a temp safe to gtClone for varStr - // We're not appending it as a statement untill we figure out unrolling is profitable (and possible) + // Create a temp which is safe to gtClone for varStr + // We're not appending it as a statement until we figure out unrolling is profitable (and possible) unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("spilling varStr")); lvaTable[varStrTmp].lvType = varStr->TypeGet(); GenTree* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); + // Create a tree representing string's Length: // TODO: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN int strLenOffset = OFFSETOF__CORINFO_String__stringLen; GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); + GenTree* unrolled = impExpandHalfConstEquals(gtClone(varStrLcl), lenNode, needsNullcheck, startsWith, (WCHAR*)str, cnsLength, strLenOffset + sizeof(int)); - - GenTree* retNode = nullptr; if (unrolled != nullptr) { impAssignTempGen(varStrTmp, varStr); @@ -488,40 +575,43 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO // QMARK nodes cannot reside on the evaluation stack unsigned rootTmp = lvaGrabTemp(true DEBUGARG("spilling unroll qmark")); impAssignTempGen(rootTmp, unrolled); - retNode = gtNewLclvNode(rootTmp, TYP_INT); - } - else - { - retNode = unrolled; + unrolled = gtNewLclvNode(rootTmp, TYP_INT); } JITDUMP("\n... Successfully unrolled to:\n") DISPTREE(unrolled) for (int i = 0; i < argsCount; i++) { - // max(2, numArgs) just to handle instance-method Equals that - // doesn't report "this" as an argument impPopStack(); } } - return retNode; + return unrolled; } +//------------------------------------------------------------------------ +// impSpanEqualsOrStartsWith: The main entry-point for [ReadOnly]Span methods +// We're going to unroll & vectorize the following cases: +// 1) MemoryExtensions.SequenceEqual(var, "cns") +// 2) MemoryExtensions.SequenceEqual("cns", var) +// 3) MemoryExtensions.Equals(var, "cns", StringComparison.Ordinal) +// 4) MemoryExtensions.Equals("cns", var, StringComparison.Ordinal) +// 5) MemoryExtensions.StartsWith("cns", var) +// 6) MemoryExtensions.StartsWith(var, "cns") +// 7) MemoryExtensions.StartsWith("cns", var, StringComparison.Ordinal) +// 8) MemoryExtensions.StartsWith(var, "cns", StringComparison.Ordinal) +// +// Arguments: +// startsWith - Is it StartsWith or Equals? +// sig - signature of StartsWith or Equals method +// methodFlags - its flags +// +// Returns: +// GenTree representing vectorized comparison or nullptr +// GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags) { - // We're going to unroll & vectorize the following cases: - // - // 1) MemoryExtensions.SequenceEqual(var, "cns") - // 2) MemoryExtensions.SequenceEqual("cns", var) - // 3) MemoryExtensions.Equals(var, "cns", StringComparison.Ordinal) - // 4) MemoryExtensions.Equals("cns", var, StringComparison.Ordinal) - // 5) MemoryExtensions.StartsWith("cns", var) - // 6) MemoryExtensions.StartsWith(var, "cns") - // 7) MemoryExtensions.StartsWith("cns", var, StringComparison.Ordinal) - // 8) MemoryExtensions.StartsWith(var, "cns", StringComparison.Ordinal) - - bool isStatic = methodFlags & CORINFO_FLG_STATIC; - int argsCount = sig->numArgs + (isStatic ? 0 : 1); + const bool isStatic = methodFlags & CORINFO_FLG_STATIC; + const int argsCount = sig->numArgs + (isStatic ? 0 : 1); GenTree* op1; GenTree* op2; @@ -553,6 +643,7 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* } } + // Try to obtain original string literals out of span arguments GenTreeStrCon* op1Str = impGetStrConFromSpan(op1); GenTreeStrCon* op2Str = impGetStrConFromSpan(op2); @@ -562,17 +653,17 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* return nullptr; } - GenTree* varStr; + GenTree* spanObj; GenTreeStrCon* cnsStr; if (op1Str != nullptr) { - cnsStr = op1Str; - varStr = op2; + cnsStr = op1Str; + spanObj = op2; } else { - cnsStr = op2Str; - varStr = op1; + cnsStr = op2Str; + spanObj = op1; } int cnsLength = -1; @@ -594,48 +685,38 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) } - // Rewrite this nonsense (to fields) - - CORINFO_CLASS_HANDLE spanCls = gtGetStructHandle(varStr); + CORINFO_CLASS_HANDLE spanCls = gtGetStructHandle(spanObj); CORINFO_FIELD_HANDLE pointerHnd = info.compCompHnd->getFieldInClass(spanCls, 0); CORINFO_FIELD_HANDLE lengthHnd = info.compCompHnd->getFieldInClass(spanCls, 1); const unsigned lengthOffset = info.compCompHnd->getFieldOffset(lengthHnd); - GenTree* spanRef = varStr; - if (varStr->TypeIs(TYP_STRUCT)) - { - spanRef = gtNewOperNode(GT_ADDR, TYP_BYREF, varStr); - } - assert(spanRef->TypeIs(TYP_BYREF)); - - unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("t1")); - lvaTable[varStrTmp].lvType = TYP_BYREF; + // Create a placeholder for Span object - we're not going to Append it to statements + // in advance to avoid redundant spills in case if we fail to vectorize + unsigned spanObjRef = lvaGrabTemp(true DEBUGARG("spanObjRef")); + lvaTable[spanObjRef].lvType = TYP_BYREF; - GenTree* spanRefLcl = gtNewLclvNode(varStrTmp, spanRef->TypeGet()); - GenTree* spanData = gtNewFieldRef(TYP_BYREF, pointerHnd, spanRefLcl); - GenTree* spanLength = gtNewFieldRef(TYP_INT, lengthHnd, gtClone(spanRefLcl), lengthOffset); + GenTree* spanObjRefLcl = gtNewLclvNode(spanObjRef, TYP_BYREF); + GenTree* spanLength = gtNewFieldRef(TYP_INT, lengthHnd, gtClone(spanObjRefLcl), lengthOffset); + GenTree* spanData = gtNewFieldRef(TYP_BYREF, pointerHnd, spanObjRefLcl); - unsigned spanDataTmp = lvaGrabTemp(true DEBUGARG("t2")); - lvaSetStruct(spanDataTmp, spanCls, false); - lvaTable[spanDataTmp].lvType = spanData->TypeGet(); + // Additionally spill spanData to a local which we might need to clone then: + unsigned spanDataTmp = lvaGrabTemp(true DEBUGARG("spanData tmp")); + lvaTable[spanDataTmp].lvType = TYP_BYREF; + GenTree* spanDataTmpLcl = gtNewLclvNode(spanDataTmp, spanData->TypeGet()); - GenTree* result = nullptr; - GenTree* unrolled = impExpandHalfConstEquals(gtNewLclvNode(spanDataTmp, spanData->TypeGet()), spanLength, false, - startsWith, (WCHAR*)str, cnsLength, 0); + GenTree* unrolled = + impExpandHalfConstEquals(spanDataTmpLcl, spanLength, false, startsWith, (WCHAR*)str, cnsLength, 0); if (unrolled != nullptr) { - impAssignTempGen(varStrTmp, spanRef); + // We succeeded, fill the placeholders: + impAssignTempGen(spanObjRef, impGetStructAddr(spanObj, spanCls, (unsigned)CHECK_SPILL_ALL, true)); impAssignTempGen(spanDataTmp, spanData); if (unrolled->OperIs(GT_QMARK)) { // QMARK can't be a root node, spill it to a temp unsigned rootTmp = lvaGrabTemp(true DEBUGARG("spilling unroll qmark")); impAssignTempGen(rootTmp, unrolled); - result = gtNewLclvNode(rootTmp, TYP_INT); - } - else - { - result = unrolled; + unrolled = gtNewLclvNode(rootTmp, TYP_INT); } JITDUMP("... Successfully unrolled to:\n") @@ -646,18 +727,15 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* impPopStack(); } - // We have to clean up GT_RET_EXPR for String.op_Implicit - if (op1->OperIs(GT_RET_EXPR)) + // We have to clean up GT_RET_EXPR for String.op_Implicit or MemoryExtensions.AsSpans + if ((spanObj != op1) && op1->OperIs(GT_RET_EXPR)) { op1->AsRetExpr()->gtInlineCandidate->ReplaceWith(gtNewNothingNode(), this); - DEBUG_DESTROY_NODE(op1); } - else if (op2->OperIs(GT_RET_EXPR)) + else if ((spanObj != op2) && op2->OperIs(GT_RET_EXPR)) { - assert(op2Str != nullptr); op2->AsRetExpr()->gtInlineCandidate->ReplaceWith(gtNewNothingNode(), this); - DEBUG_DESTROY_NODE(op2); } } - return result; + return unrolled; } From 8dc111b55b6e662fe04d40f0eb858de1a01db6a6 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 16 Feb 2022 14:08:18 +0300 Subject: [PATCH 09/29] fix typos, clean up --- src/coreclr/jit/compiler.h | 8 ++++---- src/coreclr/jit/importer.cpp | 14 +++++++------- src/coreclr/jit/importer_vectorization.cpp | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index c443838404d08..382174f3b233a 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -4396,13 +4396,13 @@ class Compiler void impResetLeaveBlock(BasicBlock* block, unsigned jmpAddr); GenTree* impTypeIsAssignable(GenTree* typeTo, GenTree* typeFrom); - GenTree* impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset); - GenTree* impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset); + GenTree* impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); + GenTree* impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); GenTree* impExpandHalfConstEquals( GenTree* data, GenTree* lengthFld, bool checkForNull, bool startsWith, WCHAR* cnsData, int len, int dataOffset); + GenTree* impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset); + GenTree* impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset); GenTreeStrCon* impGetStrConFromSpan(GenTree* span); - GenTree* impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); - GenTree* impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); GenTree* impIntrinsic(GenTree* newobjThis, CORINFO_CLASS_HANDLE clsHnd, diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 2f81ca86acafc..e347ec31486bb 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -3862,26 +3862,26 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, case NI_System_String_Equals: { - retNode = impStringEqualsOrStartsWith(false, sig, methodFlags); + retNode = impStringEqualsOrStartsWith(/*startsWith:*/ false, sig, methodFlags); break; } - case NI_System_String_StartsWith: + case NI_System_MemoryExtensions_Equals: + case NI_System_MemoryExtensions_SequenceEqual: { - retNode = impStringEqualsOrStartsWith(true, sig, methodFlags); + retNode = impSpanEqualsOrStartsWith(/*startsWith:*/ false, sig, methodFlags); break; } - case NI_System_MemoryExtensions_Equals: - case NI_System_MemoryExtensions_SequenceEqual: + case NI_System_String_StartsWith: { - retNode = impSpanEqualsOrStartsWith(false, sig, methodFlags); + retNode = impStringEqualsOrStartsWith(/*startsWith:*/ true, sig, methodFlags); break; } case NI_System_MemoryExtensions_StartsWith: { - retNode = impSpanEqualsOrStartsWith(true, sig, methodFlags); + retNode = impSpanEqualsOrStartsWith(/*startsWith:*/ true, sig, methodFlags); break; } diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index d55a22831f515..94b2f6be6b64d 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -276,7 +276,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l GenTree* firstIndir = impCreateCompareInd(this, data, TYP_INT, dataOffset, value1); GenTree* secondIndir = impCreateCompareInd(this, gtClone(data), TYP_INT, dataOffset + 2, value2); - // TODO: Consider marging two indirs via XOR instead of QMARK + // TODO: Consider merging two indirs via XOR instead of QMARK // e.g. gtNewOperNode(GT_XOR, TYP_INT, firstIndir, secondIndir); // but it currently has CQ issues (redundant movs) GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtNewFalse()); @@ -307,7 +307,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l ssize_t offset = dataOffset + len * sizeof(WCHAR) - sizeof(UINT64); GenTree* secondIndir = impCreateCompareInd(this, gtClone(data), TYP_LONG, offset, value2); - // TODO: Consider marging two indirs via XOR instead of QMARK + // TODO: Consider merging two indirs via XOR instead of QMARK GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtNewFalse()); return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); #else // TARGET_64BIT From c9658dcff467c3284de8ecfc3ba5d6b449f9f2e6 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 16 Feb 2022 14:21:52 +0300 Subject: [PATCH 10/29] Address feedback --- src/coreclr/jit/importer_vectorization.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 94b2f6be6b64d..ed4c44a119377 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -540,7 +540,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO { // check for fake "" first cnsLength = 0; - JITDUMP("Trying to unroll String.Equals(op1, \"\")...\n", str) + JITDUMP("Trying to unroll String.Equals|StartsWith(op1, \"\")...\n", str) } else { @@ -550,7 +550,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO // We were unable to get the literal (e.g. dynamic context) return nullptr; } - JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) + JITDUMP("Trying to unroll String.Equals|StartsWith(op1, \"%ws\")...\n", str) } // Create a temp which is safe to gtClone for varStr @@ -672,7 +672,7 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* { // check for fake "" first cnsLength = 0; - JITDUMP("Trying to unroll String.Equals(op1, \"\")...\n", str) + JITDUMP("Trying to unroll MemoryExtensions.Equals|SequenceEqual|StartsWith(op1, \"\")...\n", str) } else { @@ -682,7 +682,7 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* // We were unable to get the literal (e.g. dynamic context) return nullptr; } - JITDUMP("Trying to unroll String.Equals(op1, \"%ws\")...\n", str) + JITDUMP("Trying to unroll MemoryExtensions.Equals|SequenceEqual|StartsWith(op1, \"%ws\")...\n", str) } CORINFO_CLASS_HANDLE spanCls = gtGetStructHandle(spanObj); From 6f296464c99477d9d607beb759f6dae3eb9e496f Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 16 Feb 2022 16:50:41 +0300 Subject: [PATCH 11/29] Use IND for simd loads --- src/coreclr/jit/importer_vectorization.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index ed4c44a119377..86a201d59eacd 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -76,7 +76,6 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l NamedIntrinsic niZero; NamedIntrinsic niEquals; - NamedIntrinsic loadIntrinsic; GenTree* cnsVec1; GenTree* cnsVec2; @@ -112,8 +111,6 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* long7 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); GenTree* long8 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, NI_Vector256_Create, type, simdSize); - - loadIntrinsic = NI_AVX_LoadVector256; } else #endif @@ -140,12 +137,6 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long3, long4, NI_Vector128_Create, type, simdSize); - -#if defined(TARGET_XARCH) - loadIntrinsic = NI_SSE2_LoadVector128; -#else - loadIntrinsic = NI_AdvSimd_LoadVector128; -#endif } else { @@ -161,8 +152,8 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* dataPtr1 = gtNewOperNode(GT_ADD, TYP_BYREF, data, offset1); GenTree* dataPtr2 = gtNewOperNode(GT_ADD, TYP_BYREF, gtClone(data), offset2); - GenTree* vec1 = gtNewSimdHWIntrinsicNode(simdType, dataPtr1, loadIntrinsic, type, simdSize); - GenTree* vec2 = gtNewSimdHWIntrinsicNode(simdType, dataPtr2, loadIntrinsic, type, simdSize); + GenTree* vec1 = gtNewIndir(simdType, dataPtr1); + GenTree* vec2 = gtNewIndir(simdType, dataPtr2); // TODO-CQ: Spill vec1 and vec2 for better pipelining, currently we end up emitting: // From c8826eecc8805c56c21c243f0f768289b68fe863 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 16 Feb 2022 21:14:46 +0300 Subject: [PATCH 12/29] Address feedback --- src/coreclr/jit/importer_vectorization.cpp | 59 ++++++++++++++-------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 86a201d59eacd..fd55967c5ab6e 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -34,15 +34,21 @@ //------------------------------------------------------------------------ // impExpandHalfConstEqualsSIMD: Attempts to unroll and vectorize // Equals against a constant WCHAR data for Length in [8..32] range -// using SIMD instructions. It uses the following expression: -// -// bool equasl = ((v1 ^ cns1) | (v2 ^ cns2)) == Vector128.Zero -// -// or if a single vector is enough (len == 8 or len == 16 with AVX): -// -// bool equasl = (v1 ^ cns1) == Vector128.Zero -// -// C# equivalent of what this function emits: https://gist.github.com/EgorBo/085f9c15da11eecc00f482710f48aef6 +// using SIMD instructions. C# equivalent of what this function emits: +// +// bool IsTestString(ReadOnlySpan span) +// { +// // Length and Null checks are not handled here +// ref char s = ref MemoryMarshal.GetReference(span); +// var v1 = Vector128.LoadUnsafe(ref s); +// var v1 = Vector128.LoadUnsafe(ref s, span.Length - Vector128.Count); +// var cns1 = Vector128.Create('T', 'e', 's', 't', 'S', 't', 'r', 'i'); +// var cns2 = Vector128.Create('s', 't', 'S', 't', 'r', 'i', 'n', 'g'); +// return ((v1 ^ cns1) | (v2 ^ cns2)) == Vector.Zero; +// +// // for: +// // return span.SequenceEqual("TestString"); +// } // // Arguments: // data - Pointer to a data to vectorize @@ -69,13 +75,14 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l return nullptr; } - CorInfoType type = CORINFO_TYPE_ULONG; + CorInfoType baseType = CORINFO_TYPE_ULONG; int simdSize; var_types simdType; NamedIntrinsic niZero; NamedIntrinsic niEquals; + NamedIntrinsic niCreate; GenTree* cnsVec1; GenTree* cnsVec2; @@ -94,6 +101,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l niZero = NI_Vector256_get_Zero; niEquals = NI_Vector256_op_Equality; + niCreate = NI_Vector256_Create; // Special case: use a single vector for Length == 16 useSingleVector = len == 16; @@ -103,14 +111,14 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + 8), TYP_LONG); GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + 12), TYP_LONG); - cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, long3, long4, NI_Vector256_Create, type, simdSize); + cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, long3, long4, niCreate, baseType, simdSize); // cnsVec2 most likely overlaps with cnsVec1: GenTree* long5 = gtNewIconNode(*(ssize_t*)(cns + len - 16), TYP_LONG); GenTree* long6 = gtNewIconNode(*(ssize_t*)(cns + len - 12), TYP_LONG); GenTree* long7 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); GenTree* long8 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); - cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, NI_Vector256_Create, type, simdSize); + cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, niCreate, baseType, simdSize); } else #endif @@ -124,6 +132,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l niZero = NI_Vector128_get_Zero; niEquals = NI_Vector128_op_Equality; + niCreate = NI_Vector128_Create; // Special case: use a single vector for Length == 8 useSingleVector = len == 8; @@ -131,12 +140,12 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l assert(sizeof(ssize_t) == 8); // this code is guarded with TARGET_64BIT GenTree* long1 = gtNewIconNode(*(ssize_t*)(cns + 0), TYP_LONG); GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); - cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, NI_Vector128_Create, type, simdSize); + cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, niCreate, baseType, simdSize); // cnsVec2 most likely overlaps with cnsVec1: GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); - cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long3, long4, NI_Vector128_Create, type, simdSize); + cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long3, long4, niCreate, baseType, simdSize); } else { @@ -145,7 +154,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l return nullptr; } - GenTree* zero = gtNewSimdHWIntrinsicNode(simdType, niZero, type, simdSize); + GenTree* zero = gtNewSimdHWIntrinsicNode(simdType, niZero, baseType, simdSize); GenTree* offset1 = gtNewIconNode(dataOffset, TYP_I_IMPL); GenTree* offset2 = gtNewIconNode(dataOffset + len * 2 - simdSize, TYP_I_IMPL); @@ -171,10 +180,10 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l // // ((v1 ^ cns1) | (v2 ^ cns2)) == zero - GenTree* xor1 = gtNewSimdBinOpNode(GT_XOR, simdType, vec1, cnsVec1, type, simdSize, false); - GenTree* xor2 = gtNewSimdBinOpNode(GT_XOR, simdType, vec2, cnsVec2, type, simdSize, false); - GenTree* orr = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, type, simdSize, false); - return gtNewSimdHWIntrinsicNode(TYP_BOOL, useSingleVector ? xor1 : orr, zero, niEquals, type, simdSize); + GenTree* xor1 = gtNewSimdBinOpNode(GT_XOR, simdType, vec1, cnsVec1, baseType, simdSize, false); + GenTree* xor2 = gtNewSimdBinOpNode(GT_XOR, simdType, vec2, cnsVec2, baseType, simdSize, false); + GenTree* orr = gtNewSimdBinOpNode(GT_OR, simdType, xor1, xor2, baseType, simdSize, false); + return gtNewSimdHWIntrinsicNode(TYP_BOOL, useSingleVector ? xor1 : orr, zero, niEquals, baseType, simdSize); #else return nullptr; #endif @@ -243,6 +252,9 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l if (len == 1) { + // [ ch1 ] + // [value] + // return impCreateCompareInd(this, data, TYP_SHORT, dataOffset, cns[0]); } if (len == 2) @@ -287,7 +299,6 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l // For 5..7 value2 will overlap with value1, e.g. for Length == 6: // - // // [ ch1 ][ ch2 ][ ch3 ][ ch4 ][ ch5 ][ ch6 ] // [ value1 ] // [ value2 ] @@ -412,7 +423,8 @@ GenTree* Compiler::impExpandHalfConstEquals( // var span = (ReadOnlySpan)"str" // // Arguments: -// span - ReadOnlySpan tree +// span - String_op_Implicit or MemoryExtensions_AsSpan call +// with a string literal // // Returns: // GenTreeStrCon node or nullptr @@ -434,6 +446,9 @@ GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) NamedIntrinsic ni = lookupNamedIntrinsic(argCall->gtCallMethHnd); if ((ni == NI_System_MemoryExtensions_AsSpan) || (ni == NI_System_String_op_Implicit)) { + // To make sure only single-arg methods are marked as [Intrinsic] + assert(argCall->fgArgInfo->ArgCount() == 1); + if (argCall->gtCallArgs->GetNode()->OperIs(GT_CNS_STR)) { return argCall->gtCallArgs->GetNode()->AsStrCon(); @@ -488,6 +503,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO } else { + assert(argsCount == 2); op1 = impStackTop(1).val; op2 = impStackTop(0).val; } @@ -618,6 +634,7 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* } else { + assert(argsCount == 2); op1 = impStackTop(1).val; op2 = impStackTop(0).val; } From 9c8033f0c436fa0d7c3301b2f6fac61c876c6e8f Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 16 Feb 2022 21:34:22 +0300 Subject: [PATCH 13/29] fix assert --- src/coreclr/jit/importer_vectorization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index fd55967c5ab6e..df822dd905c6f 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -447,7 +447,7 @@ GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) if ((ni == NI_System_MemoryExtensions_AsSpan) || (ni == NI_System_String_op_Implicit)) { // To make sure only single-arg methods are marked as [Intrinsic] - assert(argCall->fgArgInfo->ArgCount() == 1); + assert(argCall->gtCallArgs->GetNext() == nullptr); if (argCall->gtCallArgs->GetNode()->OperIs(GT_CNS_STR)) { From 08ab8e224f1ef13896da63f26d3f19c95208af0b Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 16 Feb 2022 22:04:21 +0300 Subject: [PATCH 14/29] formatting --- src/coreclr/jit/importer_vectorization.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index df822dd905c6f..b6da57ae333b7 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -111,14 +111,14 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* long2 = gtNewIconNode(*(ssize_t*)(cns + 4), TYP_LONG); GenTree* long3 = gtNewIconNode(*(ssize_t*)(cns + 8), TYP_LONG); GenTree* long4 = gtNewIconNode(*(ssize_t*)(cns + 12), TYP_LONG); - cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, long3, long4, niCreate, baseType, simdSize); + cnsVec1 = gtNewSimdHWIntrinsicNode(simdType, long1, long2, long3, long4, niCreate, baseType, simdSize); // cnsVec2 most likely overlaps with cnsVec1: GenTree* long5 = gtNewIconNode(*(ssize_t*)(cns + len - 16), TYP_LONG); GenTree* long6 = gtNewIconNode(*(ssize_t*)(cns + len - 12), TYP_LONG); GenTree* long7 = gtNewIconNode(*(ssize_t*)(cns + len - 8), TYP_LONG); GenTree* long8 = gtNewIconNode(*(ssize_t*)(cns + len - 4), TYP_LONG); - cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, niCreate, baseType, simdSize); + cnsVec2 = gtNewSimdHWIntrinsicNode(simdType, long5, long6, long7, long8, niCreate, baseType, simdSize); } else #endif From 39b61518a40231e4ec3c1d5958094709ef806d31 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Fri, 18 Feb 2022 04:33:51 +0300 Subject: [PATCH 15/29] How is MemoryExtensions.AsSpan(string,int) also gets recognized as [Intrinsic]? --- src/coreclr/jit/importer_vectorization.cpp | 5 +---- .../System.Private.CoreLib/src/System/MemoryExtensions.cs | 2 +- src/libraries/System.Private.CoreLib/src/System/String.cs | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index b6da57ae333b7..db8484b6cabe1 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -441,14 +441,11 @@ GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) argCall = span->AsCall(); } - if (argCall != nullptr) + if ((argCall != nullptr) && (argCall->callSig != nullptr) && (argCall->callSig->numArgs == 1)) { NamedIntrinsic ni = lookupNamedIntrinsic(argCall->gtCallMethHnd); if ((ni == NI_System_MemoryExtensions_AsSpan) || (ni == NI_System_String_op_Implicit)) { - // To make sure only single-arg methods are marked as [Intrinsic] - assert(argCall->gtCallArgs->GetNext() == nullptr); - if (argCall->gtCallArgs->GetNode()->OperIs(GT_CNS_STR)) { return argCall->gtCallArgs->GetNode()->AsStrCon(); diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs index 910a84bc02d79..482be2fbd983d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs @@ -89,7 +89,7 @@ public static Span AsSpan(this T[]? array, Range range) /// /// The target string. /// Returns default when is null. - [Intrinsic] + [Intrinsic] // When input is a string literal [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ReadOnlySpan AsSpan(this string? text) { diff --git a/src/libraries/System.Private.CoreLib/src/System/String.cs b/src/libraries/System.Private.CoreLib/src/System/String.cs index e3d96683650cc..d90fdad66f088 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.cs @@ -334,6 +334,7 @@ public static string Create(IFormatProvider? provider, [InterpolatedStringHandle public static string Create(IFormatProvider? provider, Span initialBuffer, [InterpolatedStringHandlerArgument("provider", "initialBuffer")] ref DefaultInterpolatedStringHandler handler) => handler.ToStringAndClear(); + [Intrinsic] // When input is a string literal [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator ReadOnlySpan(string? value) => value != null ? new ReadOnlySpan(ref value.GetRawStringData(), value.Length) : default; From 52c54a53fff0f49f1e8d22c6520e11d225749fc0 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Fri, 18 Feb 2022 13:34:07 +0300 Subject: [PATCH 16/29] fix AsSpan and op_Implicit intrinsics --- src/coreclr/jit/importer.cpp | 8 ++++++++ src/coreclr/jit/importer_vectorization.cpp | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index e347ec31486bb..e47bbb3186ff1 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -3885,6 +3885,14 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, break; } + case NI_System_MemoryExtensions_AsSpan: + case NI_System_String_op_Implicit: + { + assert(sig->numArgs == 1); + isSpecial = impStackTop().val->OperIs(GT_CNS_STR); + break; + } + case NI_System_String_get_Chars: { GenTree* op2 = impPopStack().val; diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index db8484b6cabe1..d52410ac455f3 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -441,11 +441,12 @@ GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) argCall = span->AsCall(); } - if ((argCall != nullptr) && (argCall->callSig != nullptr) && (argCall->callSig->numArgs == 1)) + if ((argCall != nullptr) && ((argCall->gtCallMoreFlags & GTF_CALL_M_SPECIAL_INTRINSIC) != 0)) { - NamedIntrinsic ni = lookupNamedIntrinsic(argCall->gtCallMethHnd); + const NamedIntrinsic ni = lookupNamedIntrinsic(argCall->gtCallMethHnd); if ((ni == NI_System_MemoryExtensions_AsSpan) || (ni == NI_System_String_op_Implicit)) { + assert(argCall->gtCallArgs->GetNext() == nullptr); if (argCall->gtCallArgs->GetNode()->OperIs(GT_CNS_STR)) { return argCall->gtCallArgs->GetNode()->AsStrCon(); From de2faa9388c0ce97917bab9ea189edc3a64157bd Mon Sep 17 00:00:00 2001 From: EgorBo Date: Fri, 18 Feb 2022 16:00:03 +0300 Subject: [PATCH 17/29] Fix r2r assert --- src/coreclr/jit/importer_vectorization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index d52410ac455f3..349f0db081f7c 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -715,7 +715,7 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* if (unrolled != nullptr) { // We succeeded, fill the placeholders: - impAssignTempGen(spanObjRef, impGetStructAddr(spanObj, spanCls, (unsigned)CHECK_SPILL_ALL, true)); + impAssignTempGen(spanObjRef, impGetStructAddr(spanObj, spanCls, (unsigned)CHECK_SPILL_NONE, true)); impAssignTempGen(spanDataTmp, spanData); if (unrolled->OperIs(GT_QMARK)) { From 625277510c9448eb5c7ce2f8086d187d9e607d96 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sun, 20 Feb 2022 14:32:35 +0300 Subject: [PATCH 18/29] minor clean up --- src/coreclr/jit/importer_vectorization.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 349f0db081f7c..3fc1aa2112d40 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -157,7 +157,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* zero = gtNewSimdHWIntrinsicNode(simdType, niZero, baseType, simdSize); GenTree* offset1 = gtNewIconNode(dataOffset, TYP_I_IMPL); - GenTree* offset2 = gtNewIconNode(dataOffset + len * 2 - simdSize, TYP_I_IMPL); + GenTree* offset2 = gtNewIconNode(dataOffset + len * sizeof(USHORT) - simdSize, TYP_I_IMPL); GenTree* dataPtr1 = gtNewOperNode(GT_ADD, TYP_BYREF, data, offset1); GenTree* dataPtr2 = gtNewOperNode(GT_ADD, TYP_BYREF, gtClone(data), offset2); @@ -168,13 +168,13 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l // // vmovdqu xmm0, xmmword ptr [rcx+12] // vpxor xmm0, xmm0, xmmword ptr[reloc @RWD00] - // vmovdqu xmm1, xmmword ptr [rcx + 20] + // vmovdqu xmm1, xmmword ptr [rcx+20] // vpxor xmm1, xmm1, xmmword ptr[reloc @RWD16] // // While we should re-order them to be: // // vmovdqu xmm0, xmmword ptr [rcx+12] - // vmovdqu xmm1, xmmword ptr [rcx + 20] + // vmovdqu xmm1, xmmword ptr [rcx+20] // vpxor xmm0, xmm0, xmmword ptr[reloc @RWD00] // vpxor xmm1, xmm1, xmmword ptr[reloc @RWD16] // From a45c7054488c7b7869f5ae7e5080aedf3e20aa19 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Tue, 22 Feb 2022 04:49:16 +0300 Subject: [PATCH 19/29] Fix bug with s.StartsWith("", Ordinal) - it should be optimized to COMMA(NULLCHECK(s), true) instead of just true. Add codegened tests to run on CI (they helped to find that bug) --- src/coreclr/jit/importer_vectorization.cpp | 22 +- .../JIT/opt/Vectorization/UnrollTests.cs | 138 + .../JIT/opt/Vectorization/UnrollTests.csproj | 15 + .../JIT/opt/Vectorization/UnrollTestsData.cs | 5010 +++++++++++++++++ 4 files changed, 5176 insertions(+), 9 deletions(-) create mode 100644 src/tests/JIT/opt/Vectorization/UnrollTests.cs create mode 100644 src/tests/JIT/opt/Vectorization/UnrollTests.csproj create mode 100644 src/tests/JIT/opt/Vectorization/UnrollTestsData.cs diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 3fc1aa2112d40..5a305f724f43b 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -164,7 +164,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l GenTree* vec1 = gtNewIndir(simdType, dataPtr1); GenTree* vec2 = gtNewIndir(simdType, dataPtr2); - // TODO-CQ: Spill vec1 and vec2 for better pipelining, currently we end up emitting: + // TODO-Unroll-CQ: Spill vec1 and vec2 for better pipelining, currently we end up emitting: // // vmovdqu xmm0, xmmword ptr [rcx+12] // vpxor xmm0, xmm0, xmmword ptr[reloc @RWD00] @@ -279,7 +279,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l GenTree* firstIndir = impCreateCompareInd(this, data, TYP_INT, dataOffset, value1); GenTree* secondIndir = impCreateCompareInd(this, gtClone(data), TYP_INT, dataOffset + 2, value2); - // TODO: Consider merging two indirs via XOR instead of QMARK + // TODO-Unroll-CQ: Consider merging two indirs via XOR instead of QMARK // e.g. gtNewOperNode(GT_XOR, TYP_INT, firstIndir, secondIndir); // but it currently has CQ issues (redundant movs) GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtNewFalse()); @@ -309,7 +309,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l ssize_t offset = dataOffset + len * sizeof(WCHAR) - sizeof(UINT64); GenTree* secondIndir = impCreateCompareInd(this, gtClone(data), TYP_LONG, offset, value2); - // TODO: Consider merging two indirs via XOR instead of QMARK + // TODO-Unroll-CQ: Consider merging two indirs via XOR instead of QMARK GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtNewFalse()); return gtNewQmarkNode(TYP_INT, firstIndir, doubleIndirColon); #else // TARGET_64BIT @@ -352,7 +352,7 @@ GenTree* Compiler::impExpandHalfConstEquals( if (fgBBcount > 20) { // We don't want to unroll too much and in big methods - // TODO: come up with some better heuristic/budget + // TODO-Unroll-CQ: come up with some better heuristic/budget JITDUMP("impExpandHalfConstEquals: method has too many BBs (>20) - not profitable to expand.\n"); return nullptr; } @@ -363,8 +363,12 @@ GenTree* Compiler::impExpandHalfConstEquals( { if (startsWith) { - // Any string starts with "" - return gtNewTrue(); + // Any string starts with "" - return true + // But we need to preserve a possible nullcheck + // We may use gtNewNullcheck here, but we'll have to propagate BBF_HAS_NULLCHECK + // through QMARKs (not supported currently), so let's just leave an access + // to Length + return gtNewOperNode(GT_COMMA, TYP_INT, lengthFld, gtNewTrue()); } // For zero length we don't need to compare content, the following expression is enough: @@ -493,7 +497,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO { if (!impStackTop(0).val->IsIntegralConst(4)) // StringComparison.Ordinal { - // TODO: Unroll & vectorize OrdinalIgnoreCase + // TODO-Unroll-CQ: Unroll & vectorize OrdinalIgnoreCase return nullptr; } op1 = impStackTop(2).val; @@ -565,7 +569,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO GenTree* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); // Create a tree representing string's Length: - // TODO: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN + // TODO-Unroll-CQ: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN int strLenOffset = OFFSETOF__CORINFO_String__stringLen; GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); @@ -624,7 +628,7 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* { if (!impStackTop(0).val->IsIntegralConst(4)) // StringComparison.Ordinal { - // TODO: Unroll & vectorize OrdinalIgnoreCase + // TODO-Unroll-CQ: Unroll & vectorize OrdinalIgnoreCase return nullptr; } op1 = impStackTop(2).val; diff --git a/src/tests/JIT/opt/Vectorization/UnrollTests.cs b/src/tests/JIT/opt/Vectorization/UnrollTests.cs new file mode 100644 index 0000000000000..691e63c84a7f3 --- /dev/null +++ b/src/tests/JIT/opt/Vectorization/UnrollTests.cs @@ -0,0 +1,138 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; + +public class UnrollTests +{ + public static int Main() + { + var testTypes = typeof(UnrollTests).Assembly + .GetTypes() + .Where(t => t.Name.StartsWith("Tests_len")) + .ToArray(); + + int testCount = 0; + foreach (var testType in testTypes) + testCount += RunTests(testType); + + Console.WriteLine(testCount); + return testCount == 312048 ? 100 : 0; + } + + public static int RunTests(Type type) + { + // List of "reference" (unoptimized) tests + var refImpl = type + .GetMethods(BindingFlags.NonPublic | BindingFlags.Static) + .Where(m => m.Name.StartsWith("Test_ref_")) + .ToArray(); + + // List of actual tests + var tstImpl = type + .GetMethods(BindingFlags.NonPublic | BindingFlags.Static) + .Where(m => m.Name.StartsWith("Test_tst_")) + .ToArray(); + + string[] testData = + { + "", + string.Empty, + "a", + "A", + "\0", + "a-", + "aa", + "aAa", + "aaA", + "a-aa", + "aaaa", + "aaaaa", + "aaaaa", + "aaaaaa", + "aaaaaa", + "aaaaaaa", + "aaaaaaa", + "aaAAaaaa", + "aaaaa-aa", + "aaaaaaaaa", + "aaaaaaaaa", + "aaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaaaaaaa", + "aaaAAaaaaaa", + "aaaaaa-aaaaa", + "aaaaaaaaaaaa", + "aaaaaaaaaaaaa", + "aaaaaaaaaжжaaa", + "aaaaaaaaaaaaaaa", + "aaaAAAaaaaaazzz", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaжaaaa", + "aaaaaaAAAAaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaggggggggggaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + "aaaaaaAAAAaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa\0", + "aaaччччччччччaaaaжжaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "gggggggggggaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaa\\aaaaaaaaaaaNNNNNNaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa-aaaa", + "aaaaaaaaaaaaaa\0aaaaaaaaaaaaaaaaa", + "aaaaaZZZZZZZaaaaaaaaaaaaaaaaaaaaa\0", + }; + + var testDataList = testData.ToList(); + foreach (var td in testData) + { + // Add more test input - uppercase, lowercase, replace some chars + testDataList.Add(td.ToUpper()); + testDataList.Add(td.Replace('a', 'b')); + testDataList.Add(td.ToLower()); + } + + // Add null and check how various APIs react to it + testDataList.Add(null); + + int testCasesCount = 0; + foreach (var testStr in testDataList) + { + for (int i = 0; i < refImpl.Length; i++) + { + // Compare states for ref and tst (e.g. both should return the same value and the same exception if any) + if (!GetInvokeResult(refImpl[i], testStr).Equals(GetInvokeResult(tstImpl[i], testStr))) + throw new InvalidOperationException($"Different states, type={type}, str={testStr}, mi={tstImpl[i]}"); + testCasesCount++; + } + } + return testCasesCount; + } + + // Invoke method and return its return value and exception if happened + public static(bool, Type) GetInvokeResult(MethodInfo mi, string str) + { + bool eq = false; + Type excType = null; + try + { + eq = (bool)mi.Invoke(null, new object[] { str }); + } + catch (TargetInvocationException e) + { + excType = e.InnerException.GetType(); + } + catch (Exception e) + { + excType = e.GetType(); + } + return (eq, excType); + } +} \ No newline at end of file diff --git a/src/tests/JIT/opt/Vectorization/UnrollTests.csproj b/src/tests/JIT/opt/Vectorization/UnrollTests.csproj new file mode 100644 index 0000000000000..e18ea5e34277a --- /dev/null +++ b/src/tests/JIT/opt/Vectorization/UnrollTests.csproj @@ -0,0 +1,15 @@ + + + Exe + True + + + + true + true + + + + + + diff --git a/src/tests/JIT/opt/Vectorization/UnrollTestsData.cs b/src/tests/JIT/opt/Vectorization/UnrollTestsData.cs new file mode 100644 index 0000000000000..f5affddd3eb3b --- /dev/null +++ b/src/tests/JIT/opt/Vectorization/UnrollTestsData.cs @@ -0,0 +1,5010 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; + +public class Common +{ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Const(T t) => t; + + [MethodImpl(MethodImplOptions.NoInlining)] + public static T Var(T t) => t; + + public const MethodImplOptions Opt = MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization; + public const MethodImplOptions NoOpt = MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization; +} + +public static class Tests_len0_0 +{ + const string cns = ""; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len1_1 +{ + const string cns = "a"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len1_2 +{ + const string cns = "A"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len1_3 +{ + const string cns = ""; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len2_4 +{ + const string cns = "a-"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len2_5 +{ + const string cns = "aa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len3_6 +{ + const string cns = "aAa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len3_7 +{ + const string cns = "aaA"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len4_8 +{ + const string cns = "a-aa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len4_9 +{ + const string cns = "aaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len5_10 +{ + const string cns = "aaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len5_11 +{ + const string cns = "aaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len6_12 +{ + const string cns = "aaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len6_13 +{ + const string cns = "aaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len7_14 +{ + const string cns = "aaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len7_15 +{ + const string cns = "aaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len8_16 +{ + const string cns = "aaAAaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len8_17 +{ + const string cns = "aaaaa-aa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len9_18 +{ + const string cns = "aaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len9_19 +{ + const string cns = "aaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len10_20 +{ + const string cns = "aaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len10_21 +{ + const string cns = "aaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len11_22 +{ + const string cns = "aaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len11_23 +{ + const string cns = "aaaAAaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len12_24 +{ + const string cns = "aaaaaa-aaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len12_25 +{ + const string cns = "aaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len13_26 +{ + const string cns = "aaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len14_27 +{ + const string cns = "aaaaaaaaaжжaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len15_28 +{ + const string cns = "aaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len15_29 +{ + const string cns = "aaaAAAaaaaaazzz"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len16_30 +{ + const string cns = "aaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len17_31 +{ + const string cns = "aaaaaaaaaaaaжaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len17_32 +{ + const string cns = "aaaaaaAAAAaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len18_33 +{ + const string cns = "aaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len19_34 +{ + const string cns = "aaaaaaaggggggggggaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len20_35 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len21_36 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len22_37 +{ + const string cns = "aaaaaaAAAAaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len23_38 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len24_39 +{ + const string cns = "aaaччччччччччaaaaжжaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len25_40 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len26_41 +{ + const string cns = "gggggggggggaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len27_42 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len29_43 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len29_44 +{ + const string cns = "aaaaa\aaaaaaaaaaaNNNNNNaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len31_45 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaa-aaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len32_46 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + +public static class Tests_len34_47 +{ + const string cns = "aaaaaZZZZZZZaaaaaaaaaaaaaaaaaaaaa"; + [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; + [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; + + [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); + [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); + [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); + [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); + [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); + [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); + + [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); + [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); + +} + From 40550e9b79dfd9bb2de27f02007357dd30c1f419 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Tue, 22 Feb 2022 12:26:58 +0300 Subject: [PATCH 20/29] Clean up --- src/coreclr/jit/importer_vectorization.cpp | 18 +- .../{StringEquals => }/StringEquals.cs | 0 .../{StringEquals => }/StringEquals.csproj | 0 ...rollTests.cs => UnrollEqualsStartsWIth.cs} | 29 +- .../UnrollEqualsStartsWIth.csproj | 10 + .../UnrollEqualsStartsWIth_Tests.cs | 999 ++++ .../JIT/opt/Vectorization/UnrollTests.csproj | 15 - .../JIT/opt/Vectorization/UnrollTestsData.cs | 5010 ----------------- 8 files changed, 1033 insertions(+), 5048 deletions(-) rename src/tests/JIT/opt/Vectorization/{StringEquals => }/StringEquals.cs (100%) rename src/tests/JIT/opt/Vectorization/{StringEquals => }/StringEquals.csproj (100%) rename src/tests/JIT/opt/Vectorization/{UnrollTests.cs => UnrollEqualsStartsWIth.cs} (83%) create mode 100644 src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.csproj create mode 100644 src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth_Tests.cs delete mode 100644 src/tests/JIT/opt/Vectorization/UnrollTests.csproj delete mode 100644 src/tests/JIT/opt/Vectorization/UnrollTestsData.cs diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 5a305f724f43b..ce44a616d3d12 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -357,25 +357,17 @@ GenTree* Compiler::impExpandHalfConstEquals( return nullptr; } + const genTreeOps cmpOp = startsWith ? GT_GE : GT_EQ; + GenTree* elementsCount = gtNewIconNode(len); GenTree* lenCheckNode; if (len == 0) { - if (startsWith) - { - // Any string starts with "" - return true - // But we need to preserve a possible nullcheck - // We may use gtNewNullcheck here, but we'll have to propagate BBF_HAS_NULLCHECK - // through QMARKs (not supported currently), so let's just leave an access - // to Length - return gtNewOperNode(GT_COMMA, TYP_INT, lengthFld, gtNewTrue()); - } - // For zero length we don't need to compare content, the following expression is enough: // // varData != null && lengthFld == 0 // - lenCheckNode = gtNewOperNode(GT_EQ, TYP_INT, lengthFld, elementsCount); + lenCheckNode = gtNewOperNode(cmpOp, TYP_INT, lengthFld, elementsCount); } else { @@ -400,9 +392,7 @@ GenTree* Compiler::impExpandHalfConstEquals( GenTreeColon* lenCheckColon = gtNewColonNode(TYP_INT, indirCmp, gtNewFalse()); // For StartsWith we use GT_GE, e.g.: `x.Length >= 10` - lenCheckNode = - gtNewQmarkNode(TYP_INT, gtNewOperNode(startsWith ? GT_GE : GT_EQ, TYP_INT, lengthFld, elementsCount), - lenCheckColon); + lenCheckNode = gtNewQmarkNode(TYP_INT, gtNewOperNode(cmpOp, TYP_INT, lengthFld, elementsCount), lenCheckColon); } GenTree* rootQmark; diff --git a/src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.cs b/src/tests/JIT/opt/Vectorization/StringEquals.cs similarity index 100% rename from src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.cs rename to src/tests/JIT/opt/Vectorization/StringEquals.cs diff --git a/src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.csproj b/src/tests/JIT/opt/Vectorization/StringEquals.csproj similarity index 100% rename from src/tests/JIT/opt/Vectorization/StringEquals/StringEquals.csproj rename to src/tests/JIT/opt/Vectorization/StringEquals.csproj diff --git a/src/tests/JIT/opt/Vectorization/UnrollTests.cs b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs similarity index 83% rename from src/tests/JIT/opt/Vectorization/UnrollTests.cs rename to src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs index 691e63c84a7f3..b58eae0235893 100644 --- a/src/tests/JIT/opt/Vectorization/UnrollTests.cs +++ b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs @@ -6,11 +6,11 @@ using System.Reflection; using System.Runtime.CompilerServices; -public class UnrollTests +public class UnrollEqualsStartsWIth { public static int Main() { - var testTypes = typeof(UnrollTests).Assembly + var testTypes = typeof(UnrollEqualsStartsWIth).Assembly .GetTypes() .Where(t => t.Name.StartsWith("Tests_len")) .ToArray(); @@ -18,22 +18,20 @@ public static int Main() int testCount = 0; foreach (var testType in testTypes) testCount += RunTests(testType); - - Console.WriteLine(testCount); - return testCount == 312048 ? 100 : 0; + return testCount == 91014 ? 100 : 0; } public static int RunTests(Type type) { // List of "reference" (unoptimized) tests var refImpl = type - .GetMethods(BindingFlags.NonPublic | BindingFlags.Static) + .GetMethods() .Where(m => m.Name.StartsWith("Test_ref_")) .ToArray(); // List of actual tests var tstImpl = type - .GetMethods(BindingFlags.NonPublic | BindingFlags.Static) + .GetMethods() .Where(m => m.Name.StartsWith("Test_tst_")) .ToArray(); @@ -96,6 +94,7 @@ public static int RunTests(Type type) // Add more test input - uppercase, lowercase, replace some chars testDataList.Add(td.ToUpper()); testDataList.Add(td.Replace('a', 'b')); + testDataList.Add(td.Replace('a', 'Ф')); testDataList.Add(td.ToLower()); } @@ -117,7 +116,7 @@ public static int RunTests(Type type) } // Invoke method and return its return value and exception if happened - public static(bool, Type) GetInvokeResult(MethodInfo mi, string str) + public static (bool, Type) GetInvokeResult(MethodInfo mi, string str) { bool eq = false; Type excType = null; @@ -135,4 +134,16 @@ public static(bool, Type) GetInvokeResult(MethodInfo mi, string str) } return (eq, excType); } -} \ No newline at end of file +} + +public class Utils +{ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Const(T t) => t; + + [MethodImpl(MethodImplOptions.NoInlining)] + public static T Var(T t) => t; + + public const MethodImplOptions Opt = MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization; + public const MethodImplOptions NoOpt = MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization; +} diff --git a/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.csproj b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.csproj new file mode 100644 index 0000000000000..8d47a4514590e --- /dev/null +++ b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.csproj @@ -0,0 +1,10 @@ + + + Exe + True + + + + + + diff --git a/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth_Tests.cs b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth_Tests.cs new file mode 100644 index 0000000000000..8f4b3bfc14a65 --- /dev/null +++ b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth_Tests.cs @@ -0,0 +1,999 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; + +public static class Tests_len0_0 +{ + const string cns = ""; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len1_1 +{ + const string cns = "a"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len1_2 +{ + const string cns = "A"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len1_3 +{ + const string cns = " "; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len2_4 +{ + const string cns = "a-"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len2_5 +{ + const string cns = "aa"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len3_6 +{ + const string cns = "a-a"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len4_7 +{ + const string cns = "aaaa"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len5_8 +{ + const string cns = "aaaaa"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len14_9 +{ + const string cns = "aaaaaaaaaжжaaa"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len15_10 +{ + const string cns = "aaaaaaaqqqqqqqq"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len31_11 +{ + const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaa-aaaa"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len31_12 +{ + const string cns = "aaaaaaaaaaaaaa aaaaaaaaaaa"; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} + +public static class Tests_len34_13 +{ + const string cns = "aaaaaZZZZZZZaaaaaaaaaaaaaaaaaaaaa "; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_0(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_0(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_1(string s) => Utils.Var(cns) == s; + [MethodImpl(Utils.Opt)] public static bool Test_tst_1(string s) => cns == s; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_2(string s) => string.Equals(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_2(string s) => string.Equals(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_3(string s) => string.Equals(null, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_3(string s) => string.Equals(null, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_4(string s) => string.Equals((object)s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_4(string s) => string.Equals((object)s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_5(string s) => string.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_5(string s) => string.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_6(string s) => string.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_6(string s) => string.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_7(string s) => string.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_7(string s) => string.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_8(string s) => (s as object).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_8(string s) => (s as object).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_9(string s) => s.Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_9(string s) => s.Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_10(string s) => ((string)null).Equals(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_10(string s) => ((string)null).Equals(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_11(string s) => s.Equals(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_11(string s) => s.Equals(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_12(string s) => s.Equals(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_12(string s) => s.Equals(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_13(string s) => s.Equals(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_13(string s) => s.Equals(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_14(string s) => s == Utils.Var(cns); + [MethodImpl(Utils.Opt)] public static bool Test_tst_14(string s) => s == cns; + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_15(string s) => s.StartsWith(Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_15(string s) => s.StartsWith(cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_16(string s) => s.StartsWith(Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_16(string s) => s.StartsWith(cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_17(string s) => s.StartsWith(Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_17(string s) => s.StartsWith(cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_18(string s) => s.StartsWith(Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_18(string s) => s.StartsWith(cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_19(string s) => s.StartsWith(Utils.Var(cns), true, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_19(string s) => s.StartsWith(cns, true, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_20(string s) => s.StartsWith(Utils.Var(cns), false, null); + [MethodImpl(Utils.Opt)] public static bool Test_tst_20(string s) => s.StartsWith(cns, false, null); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Utils.Var(cns), s); + [MethodImpl(Utils.Opt)] public static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual(cns, s); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.InvariantCulture); + [MethodImpl(Utils.Opt)] public static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.InvariantCulture); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.Ordinal); + [MethodImpl(Utils.Opt)] public static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.Ordinal); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Utils.Var(cns), StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.Opt)] public static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, cns, StringComparison.OrdinalIgnoreCase); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), cns); + [MethodImpl(Utils.NoOpt)]public static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Utils.Var(cns)); + [MethodImpl(Utils.Opt)] public static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, cns); +} diff --git a/src/tests/JIT/opt/Vectorization/UnrollTests.csproj b/src/tests/JIT/opt/Vectorization/UnrollTests.csproj deleted file mode 100644 index e18ea5e34277a..0000000000000 --- a/src/tests/JIT/opt/Vectorization/UnrollTests.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - Exe - True - - - - true - true - - - - - - diff --git a/src/tests/JIT/opt/Vectorization/UnrollTestsData.cs b/src/tests/JIT/opt/Vectorization/UnrollTestsData.cs deleted file mode 100644 index f5affddd3eb3b..0000000000000 --- a/src/tests/JIT/opt/Vectorization/UnrollTestsData.cs +++ /dev/null @@ -1,5010 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; - -public class Common -{ - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Const(T t) => t; - - [MethodImpl(MethodImplOptions.NoInlining)] - public static T Var(T t) => t; - - public const MethodImplOptions Opt = MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization; - public const MethodImplOptions NoOpt = MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization; -} - -public static class Tests_len0_0 -{ - const string cns = ""; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len1_1 -{ - const string cns = "a"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len1_2 -{ - const string cns = "A"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len1_3 -{ - const string cns = ""; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len2_4 -{ - const string cns = "a-"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len2_5 -{ - const string cns = "aa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len3_6 -{ - const string cns = "aAa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len3_7 -{ - const string cns = "aaA"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len4_8 -{ - const string cns = "a-aa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len4_9 -{ - const string cns = "aaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len5_10 -{ - const string cns = "aaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len5_11 -{ - const string cns = "aaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len6_12 -{ - const string cns = "aaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len6_13 -{ - const string cns = "aaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len7_14 -{ - const string cns = "aaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len7_15 -{ - const string cns = "aaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len8_16 -{ - const string cns = "aaAAaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len8_17 -{ - const string cns = "aaaaa-aa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len9_18 -{ - const string cns = "aaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len9_19 -{ - const string cns = "aaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len10_20 -{ - const string cns = "aaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len10_21 -{ - const string cns = "aaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len11_22 -{ - const string cns = "aaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len11_23 -{ - const string cns = "aaaAAaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len12_24 -{ - const string cns = "aaaaaa-aaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len12_25 -{ - const string cns = "aaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len13_26 -{ - const string cns = "aaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len14_27 -{ - const string cns = "aaaaaaaaaжжaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len15_28 -{ - const string cns = "aaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len15_29 -{ - const string cns = "aaaAAAaaaaaazzz"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len16_30 -{ - const string cns = "aaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len17_31 -{ - const string cns = "aaaaaaaaaaaaжaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len17_32 -{ - const string cns = "aaaaaaAAAAaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len18_33 -{ - const string cns = "aaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len19_34 -{ - const string cns = "aaaaaaaggggggggggaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len20_35 -{ - const string cns = "aaaaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len21_36 -{ - const string cns = "aaaaaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len22_37 -{ - const string cns = "aaaaaaAAAAaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len23_38 -{ - const string cns = "aaaaaaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len24_39 -{ - const string cns = "aaaччччччччччaaaaжжaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len25_40 -{ - const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len26_41 -{ - const string cns = "gggggggggggaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len27_42 -{ - const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len29_43 -{ - const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len29_44 -{ - const string cns = "aaaaa\aaaaaaaaaaaNNNNNNaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len31_45 -{ - const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaa-aaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len32_46 -{ - const string cns = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - -public static class Tests_len34_47 -{ - const string cns = "aaaaaZZZZZZZaaaaaaaaaaaaaaaaaaaaa"; - [MethodImpl(Common.NoOpt)]static bool Test_ref_0(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_0(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_1(string s) => Common.Var(cns) == s; - [MethodImpl(Common.Opt)]static bool Test_tst_1(string s) => (cns) == s; - - [MethodImpl(Common.NoOpt)]static bool Test_ref_2(string s) => string.Equals(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_2(string s) => string.Equals(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_3(string s) => string.Equals(null, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_3(string s) => string.Equals(null, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_4(string s) => string.Equals((object)s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_4(string s) => string.Equals((object)s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_5(string s) => string.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_5(string s) => string.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_6(string s) => string.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_6(string s) => string.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_7(string s) => string.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_7(string s) => string.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_8(string s) => (s as object).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_8(string s) => (s as object).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_9(string s) => s.Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_9(string s) => s.Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_10(string s) => ((string)null).Equals(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_10(string s) => ((string)null).Equals((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_11(string s) => s.Equals(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_11(string s) => s.Equals((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_12(string s) => s.Equals(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_12(string s) => s.Equals((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_13(string s) => s.Equals(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_13(string s) => s.Equals((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_14(string s) => s == Common.Var(cns); - [MethodImpl(Common.Opt)]static bool Test_tst_14(string s) => s == (cns); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_15(string s) => s.StartsWith(Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_15(string s) => s.StartsWith((cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_16(string s) => s.StartsWith(Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_16(string s) => s.StartsWith((cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_17(string s) => s.StartsWith(Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_17(string s) => s.StartsWith((cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_18(string s) => s.StartsWith(Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_18(string s) => s.StartsWith((cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_19(string s) => s.StartsWith(Common.Var(cns), true, null); - [MethodImpl(Common.Opt)]static bool Test_tst_19(string s) => s.StartsWith((cns), true, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_20(string s) => s.StartsWith(Common.Var(cns), false, null); - [MethodImpl(Common.Opt)]static bool Test_tst_20(string s) => s.StartsWith((cns), false, null); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_21(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_21(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_22(string s) => MemoryExtensions.SequenceEqual(Common.Var(cns), s); - [MethodImpl(Common.Opt)]static bool Test_tst_22(string s) => MemoryExtensions.SequenceEqual((cns), s); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_23(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_23(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_24(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_24(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_25(string s) => MemoryExtensions.Equals(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_25(string s) => MemoryExtensions.Equals(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_26(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.InvariantCulture); - [MethodImpl(Common.Opt)]static bool Test_tst_26(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.InvariantCulture); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_27(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.Ordinal); - [MethodImpl(Common.Opt)]static bool Test_tst_27(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.Ordinal); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_28(string s) => MemoryExtensions.StartsWith(s, Common.Var(cns), StringComparison.OrdinalIgnoreCase); - [MethodImpl(Common.Opt)]static bool Test_tst_28(string s) => MemoryExtensions.StartsWith(s, (cns), StringComparison.OrdinalIgnoreCase); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_29(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_30(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(1), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_31(string s) => MemoryExtensions.SequenceEqual(s.AsSpan(0, 2), (cns)); - - [MethodImpl(Common.NoOpt)]static bool Test_ref_32(string s) => MemoryExtensions.SequenceEqual(s, Common.Var(cns)); - [MethodImpl(Common.Opt)]static bool Test_tst_32(string s) => MemoryExtensions.SequenceEqual(s, (cns)); - -} - From a52453004cc980838c0b4089b51bacd4a2df6ae2 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Tue, 22 Feb 2022 14:35:07 +0300 Subject: [PATCH 21/29] Update UnrollEqualsStartsWIth.cs --- src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs index b58eae0235893..d50deb26defcf 100644 --- a/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs +++ b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs @@ -18,7 +18,7 @@ public static int Main() int testCount = 0; foreach (var testType in testTypes) testCount += RunTests(testType); - return testCount == 91014 ? 100 : 0; + return testCount == 113652 ? 100 : 0; } public static int RunTests(Type type) From 411af861b3ac1d826c71852cd3a76f7c9acbe9b3 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Sat, 26 Feb 2022 16:04:47 +0300 Subject: [PATCH 22/29] Update src/coreclr/jit/importer_vectorization.cpp Co-authored-by: Andy Ayers --- src/coreclr/jit/importer_vectorization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index ce44a616d3d12..36e624dbaacc3 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -124,7 +124,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l #endif if (len <= 16) { - // Handle [8..16] inputs via two Vector256 + // Handle [8..16] inputs via two Vector128 assert(len >= 8 && len <= 16); simdSize = 16; From aa4880171573f9f80135b3961156e7ee14ee5a45 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sat, 26 Feb 2022 16:53:08 +0300 Subject: [PATCH 23/29] Address feedback --- src/coreclr/jit/compiler.h | 13 ++-- src/coreclr/jit/importer_vectorization.cpp | 82 +++++++++++++--------- 2 files changed, 59 insertions(+), 36 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 42ceb53be201c..954d8738b7f42 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -4413,10 +4413,15 @@ class Compiler GenTree* impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); GenTree* impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* sig, unsigned methodFlags); - GenTree* impExpandHalfConstEquals( - GenTree* data, GenTree* lengthFld, bool checkForNull, bool startsWith, WCHAR* cnsData, int len, int dataOffset); - GenTree* impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset); - GenTree* impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset); + GenTree* impExpandHalfConstEquals(GenTreeLclVar* data, + GenTree* lengthFld, + bool checkForNull, + bool startsWith, + WCHAR* cnsData, + int len, + int dataOffset); + GenTree* impExpandHalfConstEqualsSWAR(GenTreeLclVar* data, WCHAR* cns, int len, int dataOffset); + GenTree* impExpandHalfConstEqualsSIMD(GenTreeLclVar* data, WCHAR* cns, int len, int dataOffset); GenTreeStrCon* impGetStrConFromSpan(GenTree* span); GenTree* impIntrinsic(GenTree* newobjThis, diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 36e624dbaacc3..38cc4cc14c9f5 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -64,7 +64,7 @@ // This function doesn't check obj for null or its Length, it's just an internal helper // for impExpandHalfConstEquals // -GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int len, int dataOffset) +GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTreeLclVar* data, WCHAR* cns, int len, int dataOffset) { assert(len >= 8 && len <= 32); @@ -209,16 +209,15 @@ GenTree* Compiler::impExpandHalfConstEqualsSIMD(GenTree* data, WCHAR* cns, int l // Return Value: // A tree with indirect load and comparison // -static GenTree* impCreateCompareInd(Compiler* comp, GenTree* obj, var_types type, ssize_t offset, ssize_t value) +static GenTree* impCreateCompareInd(Compiler* comp, GenTreeLclVar* obj, var_types type, ssize_t offset, ssize_t value) { GenTree* offsetTree = comp->gtNewIconNode(offset, TYP_I_IMPL); GenTree* addOffsetTree = comp->gtNewOperNode(GT_ADD, TYP_BYREF, obj, offsetTree); GenTree* indirTree = comp->gtNewIndir(type, addOffsetTree); - GenTree* valueTree = comp->gtNewIconNode(value, type); - if (varTypeIsSmall(indirTree)) + GenTree* valueTree = comp->gtNewIconNode(value, genActualType(type)); + if (varTypeIsSmall(type)) { indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, TYP_UINT); - valueTree->ChangeType(TYP_INT); } return comp->gtNewOperNode(GT_EQ, TYP_INT, indirTree, valueTree); } @@ -242,7 +241,7 @@ static GenTree* impCreateCompareInd(Compiler* comp, GenTree* obj, var_types type // This function doesn't check obj for null or its Length, it's just an internal helper // for impExpandHalfConstEquals // -GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int len, int dataOffset) +GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTreeLclVar* data, WCHAR* cns, int len, int dataOffset) { assert(len >= 1 && len <= 8); @@ -274,10 +273,13 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l // [ value1 ] // [ value2 ] // - UINT32 value1 = MAKEINT32(cns[0], cns[1]); - UINT32 value2 = MAKEINT32(cns[1], cns[2]); - GenTree* firstIndir = impCreateCompareInd(this, data, TYP_INT, dataOffset, value1); - GenTree* secondIndir = impCreateCompareInd(this, gtClone(data), TYP_INT, dataOffset + 2, value2); + // where offset for value2 is 2 bytes (1 char) + // + UINT32 value1 = MAKEINT32(cns[0], cns[1]); + UINT32 value2 = MAKEINT32(cns[1], cns[2]); + GenTree* firstIndir = impCreateCompareInd(this, data, TYP_USHORT, dataOffset, value1); + GenTree* secondIndir = + impCreateCompareInd(this, (GenTreeLclVar*)gtClone(data), TYP_INT, dataOffset + sizeof(USHORT), value2); // TODO-Unroll-CQ: Consider merging two indirs via XOR instead of QMARK // e.g. gtNewOperNode(GT_XOR, TYP_INT, firstIndir, secondIndir); @@ -307,7 +309,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l GenTree* firstIndir = impCreateCompareInd(this, data, TYP_LONG, dataOffset, value1); ssize_t offset = dataOffset + len * sizeof(WCHAR) - sizeof(UINT64); - GenTree* secondIndir = impCreateCompareInd(this, gtClone(data), TYP_LONG, offset, value2); + GenTree* secondIndir = impCreateCompareInd(this, (GenTreeLclVar*)gtClone(data), TYP_LONG, offset, value2); // TODO-Unroll-CQ: Consider merging two indirs via XOR instead of QMARK GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtNewFalse()); @@ -325,8 +327,8 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l // bool equals = obj != null && obj.Length == len && (SWAR or SIMD) // // Arguments: -// data - Pointer to a data to vectorize -// lengthFld - Pointer to Length field +// data - Pointer (LCL_VAR) to a data to vectorize +// lengthFld - Pointer (LCL_VAR or GT_FIELD) to Length field // checkForNull - Check data for null // startsWith - Is it StartsWith or Equals? // cns - Constant data (array of 2-byte chars) @@ -337,11 +339,19 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTree* data, WCHAR* cns, int l // A pointer to the newly created SIMD node or nullptr if unrolling is not // possible or not profitable // -GenTree* Compiler::impExpandHalfConstEquals( - GenTree* data, GenTree* lengthFld, bool checkForNull, bool startsWith, WCHAR* cnsData, int len, int dataOffset) +GenTree* Compiler::impExpandHalfConstEquals(GenTreeLclVar* data, + GenTree* lengthFld, + bool checkForNull, + bool startsWith, + WCHAR* cnsData, + int len, + int dataOffset) { assert(len >= 0); + // lengthFld must be cheap to clone + assert(lengthFld->OperIs(GT_FIELD, GT_LCL_VAR)); + if (compCurBB->isRunRarely()) { // Not profitable to expand @@ -349,7 +359,7 @@ GenTree* Compiler::impExpandHalfConstEquals( return nullptr; } - if (fgBBcount > 20) + if ((compIsForInlining() ? (fgBBcount + impInlineRoot()->fgBBcount) : (fgBBcount)) > 20) { // We don't want to unroll too much and in big methods // TODO-Unroll-CQ: come up with some better heuristic/budget @@ -357,10 +367,9 @@ GenTree* Compiler::impExpandHalfConstEquals( return nullptr; } - const genTreeOps cmpOp = startsWith ? GT_GE : GT_EQ; - - GenTree* elementsCount = gtNewIconNode(len); - GenTree* lenCheckNode; + const genTreeOps cmpOp = startsWith ? GT_GE : GT_EQ; + GenTree* elementsCount = gtNewIconNode(len); + GenTree* lenCheckNode; if (len == 0) { // For zero length we don't need to compare content, the following expression is enough: @@ -376,11 +385,11 @@ GenTree* Compiler::impExpandHalfConstEquals( GenTree* indirCmp = nullptr; if (len < 8) // SWAR impl supports len == 8 but we'd better give it to SIMD { - indirCmp = impExpandHalfConstEqualsSWAR(gtClone(data), cnsData, len, dataOffset); + indirCmp = impExpandHalfConstEqualsSWAR((GenTreeLclVar*)gtClone(data), cnsData, len, dataOffset); } else if (len <= 32) { - indirCmp = impExpandHalfConstEqualsSIMD(gtClone(data), cnsData, len, dataOffset); + indirCmp = impExpandHalfConstEqualsSIMD((GenTreeLclVar*)gtClone(data), cnsData, len, dataOffset); } if (indirCmp == nullptr) @@ -428,7 +437,12 @@ GenTreeStrCon* Compiler::impGetStrConFromSpan(GenTree* span) GenTreeCall* argCall = nullptr; if (span->OperIs(GT_RET_EXPR)) { - argCall = span->AsRetExpr()->gtInlineCandidate->AsCall(); + // NOTE: we don't support chains of RET_EXPR here + GenTree* inlineCandidate = span->AsRetExpr()->gtInlineCandidate; + if (inlineCandidate->OperIs(GT_CALL)) + { + argCall = inlineCandidate->AsCall(); + } } else if (span->OperIs(GT_CALL)) { @@ -544,7 +558,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO else { str = info.compCompHnd->getStringLiteral(cnsStr->gtScpHnd, cnsStr->gtSconCPX, &cnsLength); - if (cnsLength < 0 || str == nullptr) + if ((cnsLength < 0) || (str == nullptr)) { // We were unable to get the literal (e.g. dynamic context) return nullptr; @@ -556,7 +570,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO // We're not appending it as a statement until we figure out unrolling is profitable (and possible) unsigned varStrTmp = lvaGrabTemp(true DEBUGARG("spilling varStr")); lvaTable[varStrTmp].lvType = varStr->TypeGet(); - GenTree* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); + GenTreeLclVar* varStrLcl = gtNewLclvNode(varStrTmp, varStr->TypeGet()); // Create a tree representing string's Length: // TODO-Unroll-CQ: Consider using ARR_LENGTH here, but we'll have to modify QMARK to propagate BBF_HAS_IDX_LEN @@ -564,8 +578,8 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); - GenTree* unrolled = impExpandHalfConstEquals(gtClone(varStrLcl), lenNode, needsNullcheck, startsWith, (WCHAR*)str, - cnsLength, strLenOffset + sizeof(int)); + GenTree* unrolled = impExpandHalfConstEquals((GenTreeLclVar*)gtClone(varStrLcl), lenNode, needsNullcheck, + startsWith, (WCHAR*)str, cnsLength, strLenOffset + sizeof(int)); if (unrolled != nullptr) { impAssignTempGen(varStrTmp, varStr); @@ -700,9 +714,9 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* GenTree* spanData = gtNewFieldRef(TYP_BYREF, pointerHnd, spanObjRefLcl); // Additionally spill spanData to a local which we might need to clone then: - unsigned spanDataTmp = lvaGrabTemp(true DEBUGARG("spanData tmp")); - lvaTable[spanDataTmp].lvType = TYP_BYREF; - GenTree* spanDataTmpLcl = gtNewLclvNode(spanDataTmp, spanData->TypeGet()); + unsigned spanDataTmp = lvaGrabTemp(true DEBUGARG("spanData tmp")); + lvaTable[spanDataTmp].lvType = TYP_BYREF; + GenTreeLclVar* spanDataTmpLcl = gtNewLclvNode(spanDataTmp, spanData->TypeGet()); GenTree* unrolled = impExpandHalfConstEquals(spanDataTmpLcl, spanLength, false, startsWith, (WCHAR*)str, cnsLength, 0); @@ -730,11 +744,15 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* // We have to clean up GT_RET_EXPR for String.op_Implicit or MemoryExtensions.AsSpans if ((spanObj != op1) && op1->OperIs(GT_RET_EXPR)) { - op1->AsRetExpr()->gtInlineCandidate->ReplaceWith(gtNewNothingNode(), this); + GenTree* inlineCandidate = op1->AsRetExpr()->gtInlineCandidate; + assert(inlineCandidate->IsCall()); + inlineCandidate->gtBashToNOP(); } else if ((spanObj != op2) && op2->OperIs(GT_RET_EXPR)) { - op2->AsRetExpr()->gtInlineCandidate->ReplaceWith(gtNewNothingNode(), this); + GenTree* inlineCandidate = op2->AsRetExpr()->gtInlineCandidate; + assert(inlineCandidate->IsCall()); + inlineCandidate->gtBashToNOP(); } } return unrolled; From abaf73aeade27e702b80388f236f5dc5d4bc5423 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sat, 26 Feb 2022 17:18:53 +0300 Subject: [PATCH 24/29] Address feedback --- src/coreclr/jit/importer_vectorization.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 38cc4cc14c9f5..f54de9adc9d0f 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -277,7 +277,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTreeLclVar* data, WCHAR* cns, // UINT32 value1 = MAKEINT32(cns[0], cns[1]); UINT32 value2 = MAKEINT32(cns[1], cns[2]); - GenTree* firstIndir = impCreateCompareInd(this, data, TYP_USHORT, dataOffset, value1); + GenTree* firstIndir = impCreateCompareInd(this, data, TYP_INT, dataOffset, value1); GenTree* secondIndir = impCreateCompareInd(this, (GenTreeLclVar*)gtClone(data), TYP_INT, dataOffset + sizeof(USHORT), value2); @@ -349,9 +349,6 @@ GenTree* Compiler::impExpandHalfConstEquals(GenTreeLclVar* data, { assert(len >= 0); - // lengthFld must be cheap to clone - assert(lengthFld->OperIs(GT_FIELD, GT_LCL_VAR)); - if (compCurBB->isRunRarely()) { // Not profitable to expand @@ -577,9 +574,10 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO int strLenOffset = OFFSETOF__CORINFO_String__stringLen; GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); + varStrLcl = (GenTreeLclVar*)gtClone(varStrLcl); - GenTree* unrolled = impExpandHalfConstEquals((GenTreeLclVar*)gtClone(varStrLcl), lenNode, needsNullcheck, - startsWith, (WCHAR*)str, cnsLength, strLenOffset + sizeof(int)); + GenTree* unrolled = impExpandHalfConstEquals(varStrLcl, lenNode, needsNullcheck, startsWith, (WCHAR*)str, + cnsLength, strLenOffset + sizeof(int)); if (unrolled != nullptr) { impAssignTempGen(varStrTmp, varStr); From f42ae58eb6fc8c1d6d1d52961ab228f69f843a56 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sat, 26 Feb 2022 17:29:54 +0300 Subject: [PATCH 25/29] Address feedback --- src/coreclr/jit/compiler.h | 2 +- src/coreclr/jit/compiler.hpp | 4 ++-- src/coreclr/jit/importer_vectorization.cpp | 21 ++++++++++----------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 954d8738b7f42..0b97a6dbe11f7 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -3369,7 +3369,7 @@ class Compiler GenTreeLclFld* gtNewLclFldNode(unsigned lnum, var_types type, unsigned offset); GenTree* gtNewInlineCandidateReturnExpr(GenTree* inlineCandidate, var_types type, BasicBlockFlags bbFlags); - GenTree* gtNewFieldRef(var_types type, CORINFO_FIELD_HANDLE fldHnd, GenTree* obj = nullptr, DWORD offset = 0); + GenTreeField* gtNewFieldRef(var_types type, CORINFO_FIELD_HANDLE fldHnd, GenTree* obj = nullptr, DWORD offset = 0); GenTree* gtNewIndexRef(var_types typ, GenTree* arrayOp, GenTree* indexOp); diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 5fef8c6ffe0f3..53f2781996760 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -1093,7 +1093,7 @@ inline GenTree* Compiler::gtNewRuntimeLookup(CORINFO_GENERIC_HANDLE hnd, CorInfo // Return Value: // The created node. // -inline GenTree* Compiler::gtNewFieldRef(var_types type, CORINFO_FIELD_HANDLE fldHnd, GenTree* obj, DWORD offset) +inline GenTreeField* Compiler::gtNewFieldRef(var_types type, CORINFO_FIELD_HANDLE fldHnd, GenTree* obj, DWORD offset) { // GT_FIELD nodes are transformed into GT_IND nodes. assert(GenTree::s_gtNodeSizes[GT_IND] <= GenTree::s_gtNodeSizes[GT_FIELD]); @@ -1105,7 +1105,7 @@ inline GenTree* Compiler::gtNewFieldRef(var_types type, CORINFO_FIELD_HANDLE fld type = impNormStructType(structHnd); } - GenTree* fieldNode = new (this, GT_FIELD) GenTreeField(type, obj, fldHnd, offset); + GenTreeField* fieldNode = new (this, GT_FIELD) GenTreeField(type, obj, fldHnd, offset); // If "obj" is the address of a local, note that a field of that struct local has been accessed. if ((obj != nullptr) && obj->OperIs(GT_ADDR) && varTypeIsStruct(obj->AsUnOp()->gtOp1) && diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index f54de9adc9d0f..4250b86188112 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -576,8 +576,8 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); varStrLcl = (GenTreeLclVar*)gtClone(varStrLcl); - GenTree* unrolled = impExpandHalfConstEquals(varStrLcl, lenNode, needsNullcheck, startsWith, (WCHAR*)str, - cnsLength, strLenOffset + sizeof(int)); + GenTree* unrolled = impExpandHalfConstEquals(varStrLcl, lenNode, needsNullcheck, startsWith, (WCHAR*)str, cnsLength, + strLenOffset + sizeof(int)); if (unrolled != nullptr) { impAssignTempGen(varStrTmp, varStr); @@ -704,17 +704,16 @@ GenTree* Compiler::impSpanEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO* // Create a placeholder for Span object - we're not going to Append it to statements // in advance to avoid redundant spills in case if we fail to vectorize - unsigned spanObjRef = lvaGrabTemp(true DEBUGARG("spanObjRef")); - lvaTable[spanObjRef].lvType = TYP_BYREF; + unsigned spanObjRef = lvaGrabTemp(true DEBUGARG("spanObj tmp")); + unsigned spanDataTmp = lvaGrabTemp(true DEBUGARG("spanData tmp")); + lvaTable[spanObjRef].lvType = TYP_BYREF; + lvaTable[spanDataTmp].lvType = TYP_BYREF; - GenTree* spanObjRefLcl = gtNewLclvNode(spanObjRef, TYP_BYREF); - GenTree* spanLength = gtNewFieldRef(TYP_INT, lengthHnd, gtClone(spanObjRefLcl), lengthOffset); - GenTree* spanData = gtNewFieldRef(TYP_BYREF, pointerHnd, spanObjRefLcl); + GenTreeLclVar* spanObjRefLcl = gtNewLclvNode(spanObjRef, TYP_BYREF); + GenTreeLclVar* spanDataTmpLcl = gtNewLclvNode(spanDataTmp, TYP_BYREF); - // Additionally spill spanData to a local which we might need to clone then: - unsigned spanDataTmp = lvaGrabTemp(true DEBUGARG("spanData tmp")); - lvaTable[spanDataTmp].lvType = TYP_BYREF; - GenTreeLclVar* spanDataTmpLcl = gtNewLclvNode(spanDataTmp, spanData->TypeGet()); + GenTreeField* spanLength = gtNewFieldRef(TYP_INT, lengthHnd, gtClone(spanObjRefLcl), lengthOffset); + GenTreeField* spanData = gtNewFieldRef(TYP_BYREF, pointerHnd, spanObjRefLcl); GenTree* unrolled = impExpandHalfConstEquals(spanDataTmpLcl, spanLength, false, startsWith, (WCHAR*)str, cnsLength, 0); From 9c641329fc5a31c8b7457341df0c9d3c4335b555 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Sat, 26 Feb 2022 17:33:25 +0300 Subject: [PATCH 26/29] Apply suggestions from code review Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> --- src/coreclr/jit/importer_vectorization.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 4250b86188112..8562b7c8a3c79 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -279,7 +279,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTreeLclVar* data, WCHAR* cns, UINT32 value2 = MAKEINT32(cns[1], cns[2]); GenTree* firstIndir = impCreateCompareInd(this, data, TYP_INT, dataOffset, value1); GenTree* secondIndir = - impCreateCompareInd(this, (GenTreeLclVar*)gtClone(data), TYP_INT, dataOffset + sizeof(USHORT), value2); + impCreateCompareInd(this, gtClone(data)->AsLclVar(), TYP_INT, dataOffset + sizeof(USHORT), value2); // TODO-Unroll-CQ: Consider merging two indirs via XOR instead of QMARK // e.g. gtNewOperNode(GT_XOR, TYP_INT, firstIndir, secondIndir); @@ -309,7 +309,7 @@ GenTree* Compiler::impExpandHalfConstEqualsSWAR(GenTreeLclVar* data, WCHAR* cns, GenTree* firstIndir = impCreateCompareInd(this, data, TYP_LONG, dataOffset, value1); ssize_t offset = dataOffset + len * sizeof(WCHAR) - sizeof(UINT64); - GenTree* secondIndir = impCreateCompareInd(this, (GenTreeLclVar*)gtClone(data), TYP_LONG, offset, value2); + GenTree* secondIndir = impCreateCompareInd(this, gtClone(data)->AsLclVar(), TYP_LONG, offset, value2); // TODO-Unroll-CQ: Consider merging two indirs via XOR instead of QMARK GenTreeColon* doubleIndirColon = gtNewColonNode(TYP_INT, secondIndir, gtNewFalse()); @@ -382,11 +382,11 @@ GenTree* Compiler::impExpandHalfConstEquals(GenTreeLclVar* data, GenTree* indirCmp = nullptr; if (len < 8) // SWAR impl supports len == 8 but we'd better give it to SIMD { - indirCmp = impExpandHalfConstEqualsSWAR((GenTreeLclVar*)gtClone(data), cnsData, len, dataOffset); + indirCmp = impExpandHalfConstEqualsSWAR(gtClone(data)->AsLclVar(), cnsData, len, dataOffset); } else if (len <= 32) { - indirCmp = impExpandHalfConstEqualsSIMD((GenTreeLclVar*)gtClone(data), cnsData, len, dataOffset); + indirCmp = impExpandHalfConstEqualsSIMD(gtClone(data)->AsLclVar(), cnsData, len, dataOffset); } if (indirCmp == nullptr) From afb814dcfa8da98eaf83ff991a54b23e439acc0c Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Sat, 26 Feb 2022 17:33:49 +0300 Subject: [PATCH 27/29] Update src/coreclr/jit/importer_vectorization.cpp Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> --- src/coreclr/jit/importer_vectorization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 8562b7c8a3c79..8f9391d7e726e 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -574,7 +574,7 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO int strLenOffset = OFFSETOF__CORINFO_String__stringLen; GenTree* lenOffset = gtNewIconNode(strLenOffset, TYP_I_IMPL); GenTree* lenNode = gtNewIndir(TYP_INT, gtNewOperNode(GT_ADD, TYP_BYREF, varStrLcl, lenOffset)); - varStrLcl = (GenTreeLclVar*)gtClone(varStrLcl); + varStrLcl = gtClone(varStrLcl)->AsLclVar(); GenTree* unrolled = impExpandHalfConstEquals(varStrLcl, lenNode, needsNullcheck, startsWith, (WCHAR*)str, cnsLength, strLenOffset + sizeof(int)); From 345246cd567bdbd1adb5b04fa8b82aba257aadf2 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sat, 26 Feb 2022 17:38:12 +0300 Subject: [PATCH 28/29] fix cast type --- src/coreclr/jit/importer_vectorization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 8f9391d7e726e..0a8801a2aa653 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -217,7 +217,7 @@ static GenTree* impCreateCompareInd(Compiler* comp, GenTreeLclVar* obj, var_type GenTree* valueTree = comp->gtNewIconNode(value, genActualType(type)); if (varTypeIsSmall(type)) { - indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, TYP_UINT); + indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, type); } return comp->gtNewOperNode(GT_EQ, TYP_INT, indirTree, valueTree); } From d42a006533bb7c38964aac7e9f3c50584a88d11e Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 2 Mar 2022 01:33:22 +0300 Subject: [PATCH 29/29] Remove redundant cast --- src/coreclr/jit/importer_vectorization.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/coreclr/jit/importer_vectorization.cpp b/src/coreclr/jit/importer_vectorization.cpp index 0a8801a2aa653..00a5389a8939e 100644 --- a/src/coreclr/jit/importer_vectorization.cpp +++ b/src/coreclr/jit/importer_vectorization.cpp @@ -215,10 +215,6 @@ static GenTree* impCreateCompareInd(Compiler* comp, GenTreeLclVar* obj, var_type GenTree* addOffsetTree = comp->gtNewOperNode(GT_ADD, TYP_BYREF, obj, offsetTree); GenTree* indirTree = comp->gtNewIndir(type, addOffsetTree); GenTree* valueTree = comp->gtNewIconNode(value, genActualType(type)); - if (varTypeIsSmall(type)) - { - indirTree = comp->gtNewCastNode(TYP_INT, indirTree, true, type); - } return comp->gtNewOperNode(GT_EQ, TYP_INT, indirTree, valueTree); }